:root {
  /* Paleta da Dra. Laís: azul escuro e dourado.
     O azul definitivo é escolha dela — trocar só esta linha muda a marca
     inteira, porque nenhuma cor aparece solta no resto do arquivo. */
  --ink: #16243d;

  --paper: #f5f1e8;

  /* Dourado em dois tons, e não um só.
     `--accent` é a cor da marca, usada em superfície (botão, avatar, barra),
     onde o contraste é do fundo contra o texto escuro por cima.
     `--accent-texto` é a versão que serve como TEXTO sobre o creme: o dourado
     de marca dava 3:1 nas etiquetas de área, abaixo do mínimo de 4,5:1 — e a
     etiqueta é o que classifica o processo, não é enfeite. */
  --accent: #b98245;
  --accent-texto: #8a5a26;

  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --muted: color-mix(in srgb, var(--ink) 65%, transparent);
  --atencao: #9a3412;

  /* Raio pequeno e único. Canto reto em tudo lia como wireframe; raio grande
     lia como aplicativo de consumo. 3px tira a aspereza sem virar bolha. */
  --raio: 3px;
}

/* ---- Ícones ----------------------------------------------------------
   Um só lugar define tamanho, traço e alinhamento. Como o traço é
   `currentColor`, o ícone acompanha a cor do texto ao lado — não existe
   ícone com cor própria brigando com o rótulo. */
.ico { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico-seta { width: 17px; height: 17px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 Aptos, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; background: var(--ink); color: var(--paper); display: flex; flex-direction: column; z-index: 3; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font: 700 18px/1.15 "Aptos Display", Aptos, sans-serif; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: var(--raio); color: var(--accent); }
.brand-mark .ico { width: 22px; height: 22px; stroke-width: 1.4; }
.main-nav { display: grid; gap: 6px; margin-top: 48px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-left: 2px solid transparent; border-radius: 0 var(--raio) var(--raio) 0; color: color-mix(in srgb, var(--paper) 78%, transparent); text-decoration: none; font-weight: 600; transition: background-color .15s ease, color .15s ease; }
.nav-link .ico { color: var(--accent); opacity: .85; }
.nav-link.active .ico, .nav-link:hover .ico { opacity: 1; }
.nav-link:hover, .nav-link.active { background: color-mix(in srgb, var(--paper) 8%, transparent); border-color: var(--accent); color: var(--paper); }
.sidebar-note { margin-top: auto; padding: 16px 12px; border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); }
.sidebar-note p { margin: 7px 0 0; color: color-mix(in srgb, var(--paper) 68%, transparent); font-size: 14px; }
.profile { margin-top: 16px; padding: 12px; border: 0; background: transparent; color: var(--paper); display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--ink); font-weight: 800; }
.profile strong, .profile small { display: block; }
.profile small { color: color-mix(in srgb, var(--paper) 60%, transparent); font-size: 14px; }
.main-content { min-width: 0; padding: 0 36px 48px; }
.topbar { height: 74px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.menu-button { display: none; place-items: center; padding: 8px; border: 0; border-radius: var(--raio); background: transparent; cursor: pointer; }
.global-search { width: min(430px, 45vw); display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--raio); background: color-mix(in srgb, var(--paper) 84%, white); transition: border-color .15s ease; }
.global-search .ico { color: var(--muted); width: 18px; height: 18px; }
.global-search:focus-within { border-color: var(--accent-texto); }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; }
.primary-action, .secondary-action { border: 0; border-radius: var(--raio); background: var(--accent); color: var(--ink); padding: 11px 17px; font-weight: 800; cursor: pointer; transition: filter .15s ease; }
.primary-action:hover, .secondary-action:hover { filter: brightness(1.06); }
.primary-action .rotulo::before { content: "+"; margin-right: 7px; font-weight: 700; }
.primary-action { margin-left: auto; }
.welcome { padding: 32px 0 24px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.eyebrow { display: block; color: var(--accent-texto); font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-style: normal; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font: 750 clamp(32px, 4vw, 48px)/1 "Aptos Display", Aptos, sans-serif; letter-spacing: -.035em; }
.welcome > div > p { margin-bottom: 0; color: var(--muted); }
.review-flag { display: flex; align-items: center; gap: 11px; max-width: 320px; padding: 11px 14px; border: 1px solid var(--accent); border-radius: var(--raio); }
.review-flag .ico { color: var(--accent-texto); }

.review-flag p, .review-flag strong { margin: 0; display: block; font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
/* Os cartões viraram links: numa demonstração, o avaliador clica no número que
   chamou a atenção dele, e um cartão que não leva a lugar nenhum parece defeito. */
.metric-card { min-height: 125px; padding: 19px; border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 80%, white); display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: border-color .15s ease; }
.metric-card:hover { border-color: var(--accent-texto); }
.metric-card.featured { border-top: 4px solid var(--accent); padding-top: 16px; }
.metric-card > span, .metric-card small { color: var(--muted); }
.metric-card strong { margin: auto 0 -2px; font: 750 36px/1 "Aptos Display", Aptos, sans-serif; }
.metric-card small { font-size: 14px; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .75fr); gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--raio); background: color-mix(in srgb, var(--paper) 82%, white); overflow: hidden; }
.panel-heading { min-height: 78px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 2px 0 0; font: 750 22px/1.1 "Aptos Display", Aptos, sans-serif; }
.text-action { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--accent-texto); font-weight: 800; cursor: pointer; }
.text-action .ico { transition: transform .15s ease; }
.text-action:hover .ico { transform: translateX(3px); }
.deadline-list { list-style: none; padding: 0; margin: 0; }
.deadline-list li { min-height: 86px; padding: 14px 20px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.deadline-list li:last-child { border-bottom: 0; }
.deadline-list time { text-align: center; color: var(--muted); font-size: 14px; }
.deadline-list time strong { display: block; color: var(--ink); font-size: 25px; line-height: 1; }
.deadline-list h3 { margin: 2px 0; font-size: 16px; }
.deadline-list p { margin: 0; color: var(--muted); font-size: 14px; }
.tag { color: var(--accent-texto); font-size: 14px; font-weight: 800; }
.status { padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--raio); font-size: 14px; font-weight: 700; white-space: nowrap; }
/* Urgência não pode depender só da cor da borda: quem não distingue os dois
   dourados vê duas etiquetas iguais. O peso do traço reforça o sinal. */
.status.urgent { border-color: var(--accent-texto); border-width: 2px; padding: 4px 7px; color: var(--accent-texto); }
.daily { display: flex; flex-direction: column; }
.progress-wrap { padding: 18px 20px 10px; }
.progress-copy { display: flex; justify-content: space-between; font-size: 14px; }
.progress { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress span { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--accent); transition: width .25s ease; }
.task-list { list-style: none; margin: 0; padding: 8px 20px 16px; display: grid; gap: 13px; }
.task-list li { display: flex; align-items: center; gap: 10px; }
.check { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius: var(--raio); background: transparent; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.check .ico { width: 16px; height: 16px; stroke-width: 2.4; opacity: 0; }
.check.done { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.check.done .ico { opacity: 1; }
.check.done { background: var(--ink); color: var(--paper); }
.task-list li:has(.done) span { text-decoration: line-through; color: var(--muted); }
.secondary-action { margin: auto 20px 20px; background: var(--ink); color: var(--paper); }
.cases { margin-top: 16px; }
.cases-heading { flex-wrap: wrap; }
.filters { display: flex; gap: 4px; }
.filter { padding: 7px 12px; border: 1px solid transparent; border-radius: var(--raio); background: transparent; cursor: pointer; font-weight: 700; }
.filter.active { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 20px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 14px; }
td strong, td small { display: block; }
td small { color: var(--muted); font-size: 14px; }
.case-state { font-weight: 800; }
.case-state::before { content: ""; width: 7px; height: 7px; margin-right: 7px; display: inline-block; border-radius: 50%; background: var(--accent); }
/* "Atenção" é a única situação que pede ação: ganha cor própria, não só o
   mesmo ponto dourado das outras três. */
.case-state.atencao { color: var(--atencao); }
.case-state.atencao::before { background: var(--atencao); }
.empty-state { padding: 38px 20px; text-align: center; }
.empty-state p { margin-bottom: 0; color: var(--muted); }

/* ---- Clientes e Documentos: as duas seções que o menu prometia e não tinha */
.work-grid.secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.people-list, .doc-list { list-style: none; margin: 0; padding: 0; }
.people-list li, .doc-list li { min-height: 72px; padding: 13px 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.people-list li:last-child, .doc-list li:last-child { border-bottom: 0; }
.people-list strong, .doc-list strong { display: block; }
.people-list small, .doc-list small { display: block; color: var(--muted); font-size: 14px; }
.avatar.small { width: 34px; height: 34px; font-size: 14px; }
.doc-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--raio); color: var(--accent-texto); }
.panel-note { margin: 0; padding: 14px 20px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---- Foco visível: navegação por teclado precisa mostrar onde está */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 20; padding: 12px 18px; background: var(--ink); color: var(--paper); font-weight: 700; }
.skip-link:focus { left: 12px; top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:where(a, button, input, [tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sidebar :where(a, button):focus-visible { outline-color: var(--accent); }
:where(section, .panel):focus { outline: none; }
.config-error { position: fixed; inset: 20px 20px auto; z-index: 10; padding: 18px; background: var(--ink); color: var(--paper); border: 2px solid var(--accent); text-align: center; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid, .work-grid.secondary { grid-template-columns: 1fr; }
}
/* Quem prefere menos movimento não recebe a rolagem suave nem as transições. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 12px 0 40px var(--line); }
  .main-content { padding: 0 18px 36px; }
  .menu-button { display: grid; }
  .topbar { gap: 9px; }
  .global-search { width: auto; flex: 1; }
  .primary-action { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; }
  .primary-action .rotulo { font-size: 0; }
  .primary-action .rotulo::before { margin: 0; font-size: 22px; }
  .welcome { align-items: start; flex-direction: column; }
}
@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-card strong { font-size: 30px; }
  .deadline-list li { grid-template-columns: 42px 1fr; padding-inline: 14px; }
  .deadline-list .status { grid-column: 2; justify-self: start; }
  .panel-heading { padding-inline: 14px; }
}


/* ---- Funil do CRM ----------------------------------------------------- */
.funil-panel { margin-top: 16px; }
.funil-acoes { display: flex; align-items: center; gap: 14px; }
.funil-estado { color: var(--accent-texto); font-size: 14px; font-weight: 700; }
.funil-colunas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(212px, 1fr); gap: 1px; background: var(--line); overflow-x: auto; }
.funil-vazio { margin: 0; padding: 30px 20px; color: var(--muted); }
.coluna { min-height: 190px; padding: 14px; background: color-mix(in srgb, var(--paper) 82%, white); display: flex; flex-direction: column; gap: 10px; }
.coluna-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coluna-topo h3 { margin: 0; font-size: 15px; }
.coluna-conta { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: 14px; font-weight: 800; text-align: center; }
.coluna-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.coluna-vazia { color: var(--muted); font-size: 14px; }
.cartao { padding: 11px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--raio); background: var(--paper); display: grid; gap: 5px; }
.cartao-atrasado { border-left-color: var(--atencao); }
.cartao-assunto { margin: 0; color: var(--muted); font-size: 14px; }
.cartao-marcas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.marca-urgencia { padding: 1px 7px; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; }
.cartao-rodape { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 14px; }
.cartao-passo { color: var(--ink); }
.cartao-atraso { color: var(--atencao); font-weight: 800; }
/* O recém-criado se anuncia sem piscar: quem acabou de salvar precisa achá-lo. */
.cartao-novo { border-color: var(--accent-texto); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---- Formulário de novo atendimento ----------------------------------- */
.dialogo { width: min(760px, 94vw); max-height: 90vh; padding: 0; border: 1px solid var(--line); border-radius: var(--raio); background: var(--paper); color: var(--ink); }
.dialogo::backdrop { background: color-mix(in srgb, var(--ink) 55%, transparent); }
.dialogo form { display: flex; flex-direction: column; max-height: 90vh; }
.dialogo-topo { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.dialogo-topo h2 { margin: 2px 0 0; font: 750 22px/1.1 "Aptos Display", Aptos, sans-serif; }
.dialogo-fechar { padding: 6px; border: 0; border-radius: var(--raio); background: transparent; color: var(--muted); cursor: pointer; }
.dialogo-fechar:hover { color: var(--ink); }
.dialogo-corpo { padding: 8px 22px 18px; overflow-y: auto; }
.dialogo fieldset { margin: 14px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.dialogo legend { margin-bottom: 4px; padding: 0; color: var(--accent-texto); font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.campo { display: grid; gap: 4px; }
.campo-largo { grid-column: 1 / -1; }
.campo > span { font-size: 14px; font-weight: 700; }
.campo > span b { color: var(--atencao); }
.campo input, .campo select, .campo textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--raio); background: color-mix(in srgb, var(--paper) 84%, white); color: var(--ink); font: inherit; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.campo input[aria-invalid], .campo textarea[aria-invalid] { border-color: var(--atencao); }
.campo input:disabled { opacity: .55; }
.campo textarea { resize: vertical; }
.campo .erro { color: var(--atencao); font-size: 14px; font-weight: 700; }
.campo .dica, .consentimento .dica { color: var(--muted); font-size: 14px; }
.consentimento .dica { grid-column: 1 / -1; }
.campo-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; font-size: 15px; }
.campo-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.aviso-erro { margin: 14px 0 0; padding: 11px 13px; border: 1px solid var(--atencao); border-radius: var(--raio); color: var(--atencao); font-weight: 700; }
.dialogo-rodape { padding: 14px 22px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 90%, white); }
.dialogo-status { margin-right: auto; color: var(--muted); font-size: 14px; }
.dialogo-rodape .primary-action { margin-left: 0; }
.dialogo-rodape .primary-action:disabled { opacity: .6; cursor: progress; }
.dialogo-rodape .secondary-action { margin: 0; }

@media (max-width: 620px) {
  .dialogo fieldset { grid-template-columns: 1fr; }
  .dialogo-corpo { padding-inline: 16px; }
  .dialogo-topo, .dialogo-rodape { padding-inline: 16px; }
}

/* ---- Tela de entrar ---------------------------------------------------- */
.pagina-entrada { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.entrada { width: min(410px, 100%); display: grid; gap: 18px; }
.entrada-marca { display: flex; align-items: center; gap: 12px; color: var(--paper); font: 700 19px/1.15 "Aptos Display", Aptos, sans-serif; }
.entrada-marca .brand-mark { border-color: var(--accent); color: var(--accent); }
.entrada form { padding: 26px 24px 22px; border: 1px solid var(--line); border-radius: var(--raio); background: var(--paper); display: grid; gap: 15px; }
.entrada h1 { margin: 0; font: 750 27px/1.1 "Aptos Display", Aptos, sans-serif; letter-spacing: -.02em; }
.entrada-sub { margin: -9px 0 0; color: var(--muted); font-size: 15px; }
.entrada .aviso-erro { margin: 0; }
.entrada-botao { margin-top: 4px; width: 100%; justify-self: stretch; }
/* O "+" do botão principal não faz sentido em "Entrar". */
.entrada-botao .rotulo-entrar::before { content: none; }
.entrada-rodape { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
