/* Comercial Pro — tokens e componentes (base: prototipo/style.css + brand.css do Netto).
   Cada pacote tem o seu CSS (clientes.css, metas-reunioes.css, whatsapp.css); este arquivo é do P0 (ajustes cruzados: P4). */

@font-face { font-family: Raleway; src: url('../assets/Raleway.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --pro-purple: #5019AF; --pro-black: #191923; --pro-charcoal: #282832; --pro-blue: #465FF0; --pro-magenta: #DC1478; --pro-silver: #D2DCDC;
  --navy: #191923; --teal: #5019AF; --lime: #EDE5FB; --ink: #282832; --muted: #71717F; --line: #E1E1E8; --bg: #F0F0F0;
  --red: #A33333; --amber: #8B5D16;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px Raleway, Arial, sans-serif; font-variant-numeric: lining-nums tabular-nums; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--pro-black); color: var(--pro-silver); padding: 0 20px 24px; display: flex; flex-direction: column; border-right: 1px solid #30303C; overflow-y: auto; z-index: 5; }
.brand-pro { display: flex; align-items: center; gap: 12px; padding: 30px 6px 24px; border-bottom: 1px solid #353540; }
.brand-pro img { width: 38px; height: 38px; }
.brand-pro span { font-size: 22px; font-weight: 800; letter-spacing: .5px; color: #F0F0F0; }
.brand-pro small { display: block; font-size: 10px; letter-spacing: 1.6px; margin-top: 4px; color: #AFAFBE; font-weight: 500; }
.nav-caption { font-size: 11px; letter-spacing: 1.8px; color: #A7A7B7; margin: 22px 12px 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.nav a, .nav button { padding: 11px 13px; border-radius: 7px; font-size: 14px; display: flex; gap: 12px; align-items: center; font-weight: 500; color: var(--pro-silver); background: none; border: 0; text-align: left; width: 100%; }
.nav a:hover, .nav button:hover { background: #2B2538; color: #fff; }
.nav a.active { background: var(--pro-purple); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--pro-magenta); }
.nav .ico { font-size: 16px; width: 22px; text-align: center; font-family: Arial, sans-serif; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #353540; padding: 20px 10px 0; font-size: 13px; color: #E1E1E8; display: flex; align-items: center; gap: 8px; }
.sidebar-bottom .muted { color: #AFAFBE; }
.avatar { width: 33px; height: 33px; display: inline-grid; place-items: center; border-radius: 50%; background: #3B245C; color: #E3D7F5; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.shell { margin-left: 236px; min-height: 100vh; }
.topbar { position: relative; height: 78px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 38px; font-size: 14px; gap: 12px; }
.topbar:before { content: ''; height: 3px; position: absolute; inset: 0 0 auto; background: linear-gradient(90deg, var(--pro-magenta), var(--pro-purple) 55%, var(--pro-blue)); }
.crumb { color: var(--muted); }
.crumb strong { color: var(--ink); font-weight: 600; }
.topright { display: flex; align-items: center; gap: 14px; }
main { max-width: 1620px; margin: auto; padding: 32px 38px 45px; }

/* tela de entrada (sem shell) */
.entrar-pagina { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(115deg, #282832 0%, #351568 70%, #5019AF 100%); }
.entrar-cartao { width: min(420px, 100%); background: #fff; border-radius: 12px; padding: 32px 28px; box-shadow: 0 20px 80px #19192340; }
.entrar-cartao .brand-pro { border: 0; padding: 0 0 22px; }
.entrar-cartao .brand-pro span { color: var(--pro-black); }
.entrar-cartao .brand-pro small { color: var(--muted); }

/* ---------- tipografia ---------- */
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 27px; flex-wrap: wrap; }
h1 { font: 800 29px Raleway, Arial, sans-serif; letter-spacing: -.8px; margin: 0 0 7px; }
h2 { font: 700 18px Raleway, Arial, sans-serif; margin: 0; }
h3 { font: 700 16px Raleway, Arial, sans-serif; margin: 0 0 10px; }
p { line-height: 1.65; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 11px; letter-spacing: 1.7px; color: var(--muted); font-weight: 700; margin-bottom: 10px; text-transform: uppercase; }
.error, .erro { color: var(--red); font-size: 14px; line-height: 1.5; }

/* ---------- botões ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #DADAE4; padding: 10px 15px; border-radius: 7px; background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); }
.button:not(.primary):hover { background: #F2EDFA; border-color: #D0BEE9; }
.button.primary, .primary { background: var(--pro-purple); color: #fff; border-color: var(--pro-purple); }
.button.primary:hover { background: #40128C; border-color: #40128C; }
.button.perigo { color: var(--red); }
.button.pequeno { padding: 6px 10px; font-size: 13px; }
.link { border: 0; background: none; color: var(--pro-purple); font-size: 14px; font-weight: 600; padding: 4px; cursor: pointer; }
.link:hover { color: #371075; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- painéis e cartões ---------- */
.card, .panel { background: #fff; border: 1px solid #E2E0E9; border-radius: 11px; box-shadow: 0 2px 3px #19192303; }
.card { padding: 22px; }
.panel-head { padding: 23px 23px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.panel-body { padding: 0 23px 23px; }
.panel-foot { padding: 15px 23px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 0 23px 18px; flex-wrap: wrap; }
.notice { padding: 14px 18px; background: #F3EFF9; border: 1px solid #E4DCF1; border-radius: 7px; font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.notice.warning { background: #fff6e8; border-color: #f2e5cd; }
.empty, .em-construcao { padding: 50px 20px; text-align: center; color: var(--muted); }
.section-gap { margin-top: 24px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 23px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.client-banner { background: linear-gradient(115deg, #282832 0%, #351568 70%, #5019AF 100%); border: 1px solid #4E2B77; padding: 25px; border-radius: 11px; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.client-banner p { color: var(--pro-silver); font-size: 14px; }
.company-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #EEE8F7; color: var(--pro-purple); font: 800 15px Raleway, Arial, sans-serif; }
.client-cell { display: flex; gap: 11px; align-items: center; }
.client-cell b { font-weight: 600; }
.client-cell small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.footer-note { margin-top: 25px; font-size: 12px; color: #787582; display: flex; justify-content: space-between; gap: 12px; }

/* ---------- abas ---------- */
.segmented { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 24px; overflow-x: auto; }
.segmented button, .segmented a { border: 0; background: transparent; color: var(--muted); padding: 13px 14px; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; }
.segmented .active { color: var(--pro-purple); border-bottom-color: var(--pro-purple); font-weight: 700; }
.abas-cliente { background: #fff; border: 1px solid #E2E0E9; border-radius: 11px 11px 0 0; padding: 0 12px; }
.aba-conteudo { background: #fff; border: 1px solid #E2E0E9; border-top: 0; border-radius: 0 0 11px 11px; padding: 23px; min-height: 200px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 5px; padding: 5px 8px; font-size: 12px; font-weight: 600; background: #F0F0F5; color: #636372; }
.badge.green, .green { background: #EAF5ED; color: #28683E; }
.badge.yellow, .yellow { background: #FFF3DF; color: #8B5D16; }
.badge.red, .red { background: #FBE9E9; color: #A33333; }
.badge.blue, .blue { background: #EBEDFF; color: #3547BB; }
.badge.purple { background: #F0EBFA; color: var(--pro-purple); }
.badge-dot:before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; background: #FAFAFC; color: #737382; padding: 14px 20px; border-block: 1px solid var(--line); }
td { font-size: 14px; padding: 16px 20px; border-bottom: 1px solid #EBEBF0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAF9FD; }
.wrap-cell { white-space: normal; min-width: 200px; }

/* ---------- formulários ---------- */
.control, input, select, textarea { border: 1px solid #DADAE4; border-radius: 6px; padding: 10px 12px; background: #fff; color: var(--ink); font-size: 14px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pro-purple); outline-offset: 2px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--pro-blue); outline-offset: 4px; }
input[type=checkbox] { accent-color: var(--pro-purple); }
input[type=date] { min-height: 42px; }
.search { width: 260px; background: #FAFAFC; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 14px; min-width: 0; }
.field > span { font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; }
.field.full { grid-column: 1 / -1; }
.field small { color: var(--muted); font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 15px; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; }
.check small { display: block; color: var(--muted); margin-top: 5px; line-height: 1.5; }
details summary { cursor: pointer; }

/* ---------- modal e toast ---------- */
dialog { border: 0; border-radius: 12px; width: min(600px, 92vw); max-height: 90vh; overflow: auto; padding: 28px; box-shadow: 0 20px 100px #19192340; color: var(--ink); }
dialog::backdrop { background: #19192388; }
dialog h2 { font-size: 22px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: var(--pro-black); border-left: 4px solid var(--pro-purple); color: #fff; box-shadow: 0 10px 40px #193c3330; border-radius: 8px; padding: 15px 24px; z-index: 50; font-size: 14px; max-width: calc(100vw - 32px); }
#toast.erro { border-left-color: var(--pro-magenta); }

/* ---------- responsivo (1200 / 760) ---------- */
@media (max-width: 1200px) {
  .sidebar { width: 210px; padding-inline: 13px; }
  .shell { margin-left: 210px; }
  main { padding: 28px 24px; }
  .topbar { padding-inline: 24px; }
}
@media (max-width: 760px) {
  .sidebar { position: relative; width: 100%; padding: 0 16px 12px; overflow: visible; }
  .brand-pro { padding: 16px 0 12px; }
  .sidebar .nav-caption, .sidebar-bottom { display: none; }
  .nav { flex-direction: row; overflow-x: auto; margin-top: 12px; }
  .nav a, .nav button { white-space: nowrap; padding: 10px; width: auto; }
  .nav .ico { display: none; }
  .shell { margin: 0; }
  .topbar { height: 60px; padding: 0 16px; }
  .topright .muted { display: none; }
  main { padding: 20px 16px; }
  .heading { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 26px; }
  .two, .three, .form-grid { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search { width: 100%; }
  .client-banner { align-items: flex-start; flex-direction: column; }
  .footer-note { display: block; }
  .aba-conteudo { padding: 16px; }
  /* P4: abas quebram linha em vez de esconder "Tarefas"/"WhatsApp" e "Resultados em atenção" atrás de rolagem lateral */
  .segmented { flex-wrap: wrap; padding: 0 8px; gap: 0; }
  .segmented button, .segmented a { padding: 11px 10px; }
  /* P4: tabelas viram cartões empilhados (rótulo da coluna à esquerda), sem rolagem lateral escondendo status e prazo */
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap table { white-space: normal; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap tr { padding: 12px 4px; border-bottom: 1px solid #EBEBF0; }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .table-wrap td[data-rotulo]::before { content: attr(data-rotulo); flex: 0 0 118px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; font-weight: 600; color: #737382; }
  .table-wrap td[data-rotulo=""]::before { content: none; }
  .table-wrap td > * { min-width: 0; }
  .table-wrap td.empty { display: block; }
  .wrap-cell { min-width: 0; }
}
