/* ============================================================
   Lima Cini — Estilos
   Identidade do design system Lima Cini: marfim e dourado sobre três versões escuras
   (Preto, Azul-marinho, Vinho — escolhida pelo administrador, <html data-brand>), mais um
   tema claro derivado (mesmas fontes, dourado e cantos retos) escolhido por usuário
   (<html data-theme="claro|escuro">). Contraste AA conferido em todas as combinações.
   ============================================================ */
@font-face { font-family: "Cormorant Garamond"; src: url("/static/fonts/CormorantGaramond-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/static/fonts/CormorantGaramond-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/Manrope-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/Manrope-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/Manrope-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --font-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-sans: Manrope, "Helvetica Neue", Arial, sans-serif;
  --radius: 0;          /* cartões, painéis, faixas: cantos retos */
  --radius-sm: 2px;     /* botões e campos */
  --shadow: none;       /* sem sombras: separação por contraste de superfície e filetes */
  --shadow-lg: 0 0 0 1px var(--input-border);

  /* Cor da versão (barra lateral, topo das telas de acesso, portal) */
  --brand: #13233f;
  --brand-deep: #0a1426;
  --gold: #c2a36b;      /* dourado da marca (arco do monograma, filetes sobre a cor da versão) */
  --gold-strong: #d6bc88;
  --ivory: #efe8dc;
  --ivory-muted: #b5ada0;

  /* Tema claro derivado (padrão) — papel marfim, tinta escura, dourado "positivo" */
  color-scheme: light;
  --bg: #f3eee5;
  --surface: #fbf8f3;
  --surface-2: #f1eadf;
  --border: #ddd3c3;
  --text: #1d1a16;
  --text-2: #3e382f;
  --muted: #625a4e;
  --primary: #7a5c2a;
  --primary-2: #5f4720;
  --primary-soft: #efe3c8;
  --btn-primary-bg: #8a6a34;
  --btn-primary-hover: #6f5428;
  --on-accent: #ffffff;
  --focus: #8a6a34;
  --danger: #b3261e;
  --ok: #2e6b3a;
  --warn: #8a5300;
  --input-border: #8f8473;
  --tab-count: #3e382f;
  --b-gray-fg: #4f4a42; --b-blue-fg: #1d4f7a; --b-green-fg: #2e6b3a; --b-amber-fg: #7a5200;
  --b-orange-fg: #8f3d12; --b-red-fg: #9b1f1a; --b-violet-fg: #5b3a87;
  --mix: 13%;
}
:root[data-brand="preto"] { --brand: #141416; --brand-deep: #09090a; }
:root[data-brand="vinho"] { --brand: #4a1422; --brand-deep: #1f090e; }

/* Tema escuro: o design system à risca (ground, surface, surface-raised, line, ink…) */
[data-theme="escuro"] {
  color-scheme: dark;
  --bg: #0a1426;
  --surface: #101d36;
  --surface-2: #182948;
  --border: #2b3e62;
  --input-border: #6a80a8;
  --text: #efe8dc;
  --text-2: #ddd5c8;
  --muted: #b5ada0;
  --primary: #c2a36b;
  --primary-2: #d6bc88;
  --primary-soft: color-mix(in srgb, #c2a36b 16%, var(--surface));
  --btn-primary-bg: #c2a36b;
  --btn-primary-hover: #d6bc88;
  --on-accent: #17130c;
  --focus: #d6bc88;
  --danger: #ef9a8a;
  --ok: #9fd3a6;
  --warn: #e8c27a;
  --tab-count: #ddd5c8;
  --b-gray-fg: #d2cabd; --b-blue-fg: #a9c7ec; --b-green-fg: #9fd3a6; --b-amber-fg: #e8c27a;
  --b-orange-fg: #f0b48a; --b-red-fg: #ef9a8a; --b-violet-fg: #cbb4ef;
  --mix: 20%;
}
[data-theme="escuro"][data-brand="preto"] {
  --bg: #09090a; --surface: #121214; --surface-2: #1b1b1e; --border: #2e2e33; --input-border: #6b6b72;
}
[data-theme="escuro"][data-brand="vinho"] {
  --bg: #1f090e; --surface: #2b0e15; --surface-2: #3a141e; --border: #5c2532; --input-border: #9a5c6a;
}

/* Derivados (mesma regra nos dois temas) */
:root, [data-theme="escuro"] {
  --sidebar-bg: var(--brand);
  --sidebar-text: var(--ivory-muted);
  --sidebar-muted: #9d9588;
  --danger-soft: color-mix(in srgb, var(--danger) var(--mix), var(--surface));
  --ok-soft: color-mix(in srgb, var(--ok) var(--mix), var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) var(--mix), var(--surface));
  --b-gray-bg: color-mix(in srgb, var(--b-gray-fg) var(--mix), var(--surface));
  --b-blue-bg: color-mix(in srgb, var(--b-blue-fg) var(--mix), var(--surface));
  --b-green-bg: color-mix(in srgb, var(--b-green-fg) var(--mix), var(--surface));
  --b-amber-bg: color-mix(in srgb, var(--b-amber-fg) var(--mix), var(--surface));
  --b-orange-bg: color-mix(in srgb, var(--b-orange-fg) var(--mix), var(--surface));
  --b-red-bg: color-mix(in srgb, var(--b-red-fg) var(--mix), var(--surface));
  --b-violet-bg: color-mix(in srgb, var(--b-violet-fg) var(--mix), var(--surface));
  --cal-weekend: var(--surface-2);
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: var(--font-sans);
  background: var(--bg); color: var(--text); line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-feature-settings: "lnum" 1;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Links dentro de texto corrido são sublinhados (não dependem só da cor) */
p a:not(.btn):not(.badge), .notice a:not(.btn), .breadcrumb a, .muted a:not(.btn), .form-hint a, .empty a, li.kv a.row-link { text-decoration: underline; text-underline-offset: 2px; }
.i { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }
h1 { font-family: var(--font-display); font-size: 2rem; line-height: 1.15; font-weight: 600; letter-spacing: 0; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
small { font-size: .8rem; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: var(--radius-sm); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--btn-primary-bg); color: var(--on-accent);
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 10px; text-decoration: none; }
[hidden] { display: none !important; }
/* Com JS ativo: esconde botões de fallback e mostra "Salvar" só quando algo mudar */
.js .js-hide { display: none !important; }
.js .dirty-only { display: none; }
.js .is-dirty .dirty-only { display: inline-flex; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 24px 34px 40px; max-width: 1320px; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.topbar, .hamburger, .sidebar-overlay { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; margin-bottom: 6px; border-bottom: 1px solid rgba(194, 163, 107, .22); }
/* Logo Lima Cini (partials/brand-logo): monograma em arco + nome em capitulares */
.lc-logo { display: inline-flex; align-items: center; gap: 12px; line-height: 0; }
.lc-logo img { display: block; width: auto; }
.lc-logo-row .lc-logo-mono { height: 40px; }
.lc-logo-row .lc-logo-word { height: 12px; }
.lc-logo-stack { flex-direction: column; gap: 16px; }
.lc-logo-stack .lc-logo-mono { height: 92px; }
.lc-logo-stack .lc-logo-word { height: 15px; }
.topbar .lc-logo-mono { height: 30px; }
.topbar .lc-logo-word { height: 10px; }
/* Sobretítulo (eyebrow): caixa alta espaçada, dourado */
.eyebrow { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); }
.brand-mark {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--surface-2); color: var(--primary); border: 1px solid var(--border); font-size: 1.2rem;
}
.brand-mark .i { width: 22px; height: 22px; }
/* Logotipo do escritório (Configurações): fundo claro para ficar legível na barra escura */
.brand-logo { height: 36px; max-width: 120px; object-fit: contain; background: #fff; border-radius: var(--radius-sm); padding: 3px; flex: none; }
.brand-logo-sm { height: 28px; max-width: 90px; }
.logo-preview { display: inline-block; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; margin-bottom: 12px; }
.logo-preview img { display: block; max-height: 96px; max-width: 320px; object-fit: contain; }
.brand-mark.lg { width: 52px; height: 52px; font-size: 1.6rem; margin: 0 auto 10px; }
.brand-text { line-height: 1.15; }
.brand-text strong { color: var(--ivory); display: block; font-size: 1rem; }
.brand-text span { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sidebar-text); }
.nav { flex: 1; padding: 0 10px 8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.nav-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--sidebar-muted); padding: 10px 10px 4px;
}
.nav-toggle {
  display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0;
  font: inherit; font-size: .68rem; cursor: pointer; border-radius: var(--radius-sm); min-height: 28px;
}
.nav-toggle:hover { color: var(--ivory); }
.nav-chev { width: 14px; height: 14px; transition: transform .15s ease; }
.nav-toggle[aria-expanded="false"] .nav-chev { transform: rotate(-90deg); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: var(--radius-sm); min-height: 32px;
  color: var(--sidebar-text); font-size: .9rem; margin-bottom: 1px;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--ivory); text-decoration: none; }
.nav a.active { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--ivory); font-weight: 600; box-shadow: inset 2px 0 0 var(--gold); }
.nav .ico { width: 18px; height: 18px; opacity: .9; }
.nav .nav-count {
  margin-left: auto; background: rgba(255, 255, 255, .14); color: #fff; font-size: .7rem;
  font-weight: 700; padding: 0 7px; border-radius: var(--radius-sm); line-height: 18px;
}
.sidebar-footer { padding: 10px 12px 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px; border-radius: var(--radius-sm); color: var(--sidebar-text); }
.user-chip:hover, .user-chip.active { background: rgba(255, 255, 255, .07); text-decoration: none; }
.user-meta { line-height: 1.25; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.user-meta strong { color: var(--ivory); font-size: .88rem; display: block; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-link { font-size: .74rem; color: #c7d2fe; text-decoration: underline; text-underline-offset: 2px; }
.sidebar .btn-ghost { color: #dbe2f3; border-color: rgba(255, 255, 255, .22); }
.sidebar .btn-ghost:hover { background: rgba(255, 255, 255, .08); }

/* ---------- Barra de ações (appbar) ---------- */
.appbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.appbar-search { flex: 1; max-width: 560px; display: flex; position: relative; }
.appbar-search input {
  width: 100%; padding: 9px 44px 9px 14px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--input-border);
}
.appbar-search-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; border-radius: 50%; font-size: 1.15rem; line-height: 1; display: grid; place-items: center;
}
.appbar-search-btn:hover { color: var(--primary); background: var(--primary-soft); }
.appbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: inline-grid; place-items: center;
  cursor: pointer; font-size: 1.1rem; text-decoration: none;
}
.icon-btn:hover { border-color: var(--primary); text-decoration: none; }
.badge-count {
  position: absolute; top: -6px; right: -6px; background: #c81e1e; color: #fff;
  font-size: .64rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: var(--radius-sm);
  display: grid; place-items: center; padding: 0 4px;
}
.kbd-wrap { position: relative; }
.kbd-hint { font: inherit; font-size: .78rem; color: var(--text-2); background: var(--surface); border: 1px solid var(--input-border); border-radius: var(--radius-sm); min-width: 28px; min-height: 28px; cursor: pointer; }
.kbd-hint:hover { border-color: var(--primary); color: var(--primary); }
.kbd-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 46; width: 280px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 8px; font-size: .86rem;
}
kbd { font-family: Consolas, "Cascadia Mono", monospace; font-size: .8em; border: 1px solid var(--input-border); border-bottom-width: 2px; border-radius: var(--radius-sm); padding: 0 5px; background: var(--surface-2); }
/* Menu "+ Novo": botão com aria-expanded que mostra uma lista de links */
.quick-add { position: relative; }
.quick-add > .btn { gap: 4px; height: 38px; }
.quick-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; min-width: 250px; padding: 6px;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.quick-menu a { padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); font-size: .88rem; }
.quick-menu a:hover, .quick-menu a:focus-visible { background: var(--primary-soft); text-decoration: none; }

/* ---------- Avatar / papéis ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  font-size: .8rem; font-weight: 650; flex-shrink: 0;
}
.avatar.sm { width: 30px; height: 30px; font-size: .7rem; }
.role-tag {
  display: inline-block; font-size: .68rem; font-weight: 650; padding: 2px 8px;
  border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: .05em;
}
.role-admin { background: var(--b-violet-bg); color: var(--b-violet-fg); }
.role-gestor { background: var(--b-blue-bg); color: var(--b-blue-fg); }
.role-advogado { background: var(--b-green-bg); color: var(--b-green-fg); }
.role-assistente { background: var(--b-amber-bg); color: var(--b-amber-fg); }

/* ---------- Página ---------- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head p.muted { margin-top: 2px; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 2px; }
.panel {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; overflow-x: auto;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.sub-title { margin: 16px 0 8px; font-size: .9rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.plain-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.collapsible { border-left: 3px solid var(--primary); }
/* Formulário de cadastro recolhível dentro do painel da lista ("+ Novo …") */
.create-box {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 18px;
}
.create-box .create-title { grid-column: 1 / -1; font-size: .95rem; margin: 0; }
.disclaimer { font-size: .8rem; margin-top: 4px; }

/* ---------- Indicadores (KPIs) ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  display: flex; align-items: center; gap: 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
a.kpi:hover { border-color: var(--primary); text-decoration: none; }
.kpi-alert { border-color: var(--danger); }
.kpi-ico { width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.kpi strong { display: block; font-size: 1.35rem; line-height: 1.15; }
.kpi span { font-size: .8rem; color: var(--muted); }
.kpi small { display: block; font-size: .74rem; }
.kpi-blue { background: var(--b-blue-bg); color: var(--b-blue-fg); }
.kpi-green { background: var(--b-green-bg); color: var(--b-green-fg); }
.kpi-amber { background: var(--b-amber-bg); color: var(--b-amber-fg); }
.kpi-red { background: var(--b-red-bg); color: var(--b-red-fg); }
.kpi-violet { background: var(--b-violet-bg); color: var(--b-violet-fg); }
.text-danger { color: var(--danger); font-weight: 600; }
/* Painel inicial: 5 indicadores empilhados (ícone acima do número) cabem numa linha só */
.kpi-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-row-5 .kpi { flex-direction: column; align-items: flex-start; gap: 10px; }
.kpi-row-5 .kpi-ico { width: 34px; height: 34px; border-radius: var(--radius-sm); font-size: .82rem; }
.kpi strong { font-variant-numeric: tabular-nums; }

/* ---------- Cards de opções (início) ---------- */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.option-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); color: var(--text); display: block;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
a.option-card:hover { transform: translateY(-2px); text-decoration: none; box-shadow: var(--shadow-lg); border-color: var(--primary); }
.option-ico { width: 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 12px; }
.option-card h2 { margin-bottom: 4px; }
.option-card p { font-size: .86rem; color: var(--text-2); margin-bottom: 10px; }

/* ---------- Gráfico de barras (receitas) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--btn-primary-bg); }
.chart .bar-current { fill: #7c3aed; }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--text-2); font-size: 12px; font-family: inherit; }
.chart .val { font-weight: 600; fill: var(--text); }

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; }
label > span { font-weight: 550; color: var(--text-2); }
input, select, textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); width: 100%;
}
/* Erros de validação junto do campo */
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger); }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: .8rem; font-weight: 600; }
.field-error::before { content: "!"; display: inline-grid; place-items: center; flex-shrink: 0; width: 15px; height: 15px; margin-top: 1px; border-radius: 50%; background: var(--danger); color: var(--surface); font-size: .68rem; }
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--btn-primary-bg); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus);
}
input[readonly] { background: var(--bg); color: var(--muted); }
textarea.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .86rem; line-height: 1.55; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-hint { font-size: .8rem; color: var(--muted); }
.choice-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.choice-group legend { font-size: .84rem; font-weight: 600; color: var(--text-2); padding: 0 6px; }
.inline-choices { flex-direction: row; flex-wrap: wrap; gap: 18px; }
.chk { flex-direction: row; align-items: center; gap: 8px; font-size: .88rem; }
.chk input { flex-shrink: 0; }
/* Rótulo longo (texto + destaque + nota): um único bloco de texto ao lado da caixa, alinhado ao topo */
.chk.chk-top { align-items: flex-start; }
.chk.chk-top input { margin-top: 3px; }
.chk > .chk-text { font-weight: 400; color: var(--text); line-height: 1.45; }
.inline-field { flex-direction: row; align-items: center; gap: 8px; }
.inline-field input, .inline-field select { width: auto; }
.check-list {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  max-height: 168px; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px;
}
.check-list .chk { font-weight: 400; }
.kv { display: flex; justify-content: space-between; gap: 14px; font-size: .9rem; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.kv > span { color: var(--muted); flex-shrink: 0; }
.kv > strong { font-weight: 550; text-align: right; }
.kv.block { flex-direction: column; gap: 4px; }
.kv.block > strong, .kv .long { text-align: left; font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Botões ---------- */
.btn {
  font: inherit; font-size: .88rem; font-weight: 570; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; transition: background .12s, border-color .12s; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.btn-primary { background: var(--btn-primary-bg); color: var(--on-accent); }
.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }

/* ---------- Tabelas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 40%, transparent); }
.table tfoot th, .table tfoot td { border-top: 2px solid var(--border); border-bottom: none; padding-top: 10px; color: var(--text); font-size: .84rem; }
.row-link { color: var(--text); font-weight: 550; display: inline-block; min-height: 24px; padding: 2px 0; }
.row-link:hover { color: var(--primary); }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-inactive { opacity: .6; }
.subrow td, .edit-row td { background: var(--surface-2); }
.edit-row td { padding: 16px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.select-sm { padding: 4px 8px; font-size: .8rem; width: auto; }
.input-sm { padding: 4px 8px; font-size: .8rem; width: 110px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-sm); white-space: nowrap; background: var(--b-gray-bg); color: var(--b-gray-fg);
}
.st-pendente, .prio-baixa, .cst-inativo, .inv-cancelada, .urg-futuro, .dst-pendente, .dk-outro { background: var(--b-gray-bg); color: var(--b-gray-fg); }
.st-em_andamento, .prio-media, .acc-view, .dk-processual, .kind-hora { background: var(--b-blue-bg); color: var(--b-blue-fg); }
.st-em_revisao, .inv-pendente, .urg-proximo, .kind-despesa { background: var(--b-amber-bg); color: var(--b-amber-fg); }
.st-concluida, .cst-ativo, .acc-edit, .inv-paga, .urg-cumprido, .dst-cumprido, .dk-reuniao { background: var(--b-green-bg); color: var(--b-green-fg); }
.st-cancelada, .prio-urgente, .inv-vencida, .urg-vencido, .urg-perdido, .dst-perdido, .dk-fatal { background: var(--b-red-bg); color: var(--b-red-fg); }
.prio-alta, .urg-hoje { background: var(--b-orange-bg); color: var(--b-orange-fg); }
.cst-prospecto, .dk-audiencia, .st-generic { background: var(--b-violet-bg); color: var(--b-violet-fg); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
a.badge:hover { text-decoration: none; filter: brightness(.96); }
/* Situação dos processos */
.cs-ativo { background: var(--b-green-bg); color: var(--b-green-fg); }
.cs-cumprimento { background: var(--b-blue-bg); color: var(--b-blue-fg); }
.cs-em_analise, .cs-aguardando_decisao { background: var(--b-amber-bg); color: var(--b-amber-fg); }
.cs-suspenso { background: var(--b-orange-bg); color: var(--b-orange-fg); }
.cs-encerrado { background: var(--b-violet-bg); color: var(--b-violet-fg); }
.cs-arquivado { background: var(--b-gray-bg); color: var(--b-gray-fg); }
/* Funil de leads e situação "perdido" do cliente */
.stage-novo { background: var(--b-blue-bg); color: var(--b-blue-fg); }
.stage-negociacao { background: var(--b-amber-bg); color: var(--b-amber-fg); }
.stage-convertido { background: var(--b-green-bg); color: var(--b-green-fg); }
.stage-perdido, .cst-perdido { background: var(--b-red-bg); color: var(--b-red-fg); }
/* Canal do atendimento (ligação, WhatsApp, e-mail…) */
.ch-whatsapp { background: var(--b-green-bg); color: var(--b-green-fg); }
.ch-ligacao { background: var(--b-blue-bg); color: var(--b-blue-fg); }
.ch-email { background: var(--b-violet-bg); color: var(--b-violet-fg); }
.ch-reuniao, .ch-presencial { background: var(--b-amber-bg); color: var(--b-amber-fg); }
.ch-outro { background: var(--b-gray-bg); color: var(--b-gray-fg); }
/* Tipo da tarefa: um único estilo discreto (a cor fica para prioridade e situação) */
[class*=" tk-"], [class^="tk-"] { background: var(--primary-soft); color: var(--primary); }
/* Checklist de documentos */
.chk-recebido { background: var(--b-green-bg); color: var(--b-green-fg); }
.chk-pendente, .docs-pending { background: var(--b-orange-bg); color: var(--b-orange-fg); }

/* ---------- Abas ---------- */
.tabs-wrap { position: relative; margin-bottom: 20px; }
.tabs {
  display: flex; gap: 2px; border-bottom: 2px solid var(--border); overflow-x: auto; flex-wrap: nowrap;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
/* Esmaecimento nas bordas indica que há mais abas (a rolagem é por roda, toque ou teclado) */
.tabs-wrap::before, .tabs-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 2px; width: 40px; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .15s ease;
}
.tabs-wrap::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.tabs-wrap::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.tabs-wrap.more-left::before, .tabs-wrap.more-right::after { opacity: 1; }
.tabs a {
  padding: 10px 14px; color: var(--text-2); font-size: .9rem; font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs a:hover { color: var(--primary); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .tab-count { font-size: .72rem; color: var(--tab-count); margin-left: 3px; }

/* ---------- Mensagens ---------- */
.flash {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .9rem; font-weight: 530;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-erro { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--primary-soft); color: var(--primary); }
.flash-aviso { background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; }
.flash-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0 2px; opacity: .8; }
.flash-close:hover { opacity: 1; }
.empty { color: var(--muted); font-size: .9rem; padding: 18px 4px; text-align: center; }
.empty a { font-weight: 600; }
.notice { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .86rem; color: var(--text-2); margin-bottom: 14px; }
.notice-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; }

/* ---------- Busca / filtros ---------- */
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.searchbar.flush { margin: 0; }
.searchbar input[type="search"], .searchbar input[type="password"] { max-width: 340px; }
.searchbar select, .searchbar input, .searchbar .btn { font-size: .88rem; }
.searchbar select { width: auto; max-width: 100%; }

/* ---------- Linha do tempo ---------- */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 18px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-date { flex-shrink: 0; width: 92px; font-size: .82rem; font-weight: 600; color: var(--primary); padding-top: 2px; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-case { font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.timeline-body p { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.timeline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Comentários ---------- */
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.comment { display: flex; gap: 10px; }
.comment-body { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; flex: 1; min-width: 0; }
.comment-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px; font-size: .85rem; }
.comment-body p { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 10px; align-items: flex-end; }
.comment-form textarea { flex: 1; }

/* ---------- Atalhos dos tribunais ---------- */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.link-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; color: var(--text); display: block; transition: border-color .12s, transform .12s; }
.link-card:hover { border-color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.link-name { font-weight: 620; margin-bottom: 4px; }
.link-name .ext { color: var(--primary); font-size: .8rem; }
.link-card p { font-size: .82rem; margin-bottom: 6px; }
.link-url { color: var(--muted); font-size: .74rem; word-break: break-all; }

/* ---------- Estatísticas (gestão de tarefas) ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; color: var(--text); display: block; }
.stat-card:hover { border-color: var(--primary); text-decoration: none; }
.stat-card.active { border-color: var(--primary); background: var(--primary-soft); }
.stat-card strong { display: block; font-size: 1.4rem; }
.stat-card span { font-size: .78rem; color: var(--muted); }
.stat-card span small { display: block; font-size: .72rem; }
.stat-card .stat-money { font-size: 1.1rem; line-height: 1.6; white-space: nowrap; }
.stat-static { cursor: default; }
.stat-static:hover { border-color: var(--border); }
.stat-alert { border-color: var(--danger); }
.stats-row-flush { margin-bottom: 0; }
/* Funil de leads: etapas clicáveis lado a lado */
.funnel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.funnel .stat-card { border-top: 3px solid var(--border); }
.funnel .stage-card-novo { border-top-color: var(--b-blue-fg); }
.funnel .stage-card-negociacao { border-top-color: var(--b-amber-fg); }
.funnel .stage-card-convertido { border-top-color: var(--b-green-fg); }
.funnel .stage-card-perdido { border-top-color: var(--b-red-fg); }

/* ---------- Gráficos de barras horizontais (CSS puro, painel gerencial) ---------- */
.two-col.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.hbar { display: inline-block; flex: 1; min-width: 60px; height: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; vertical-align: middle; }
.hbar > span { display: block; height: 100%; background: var(--btn-primary-bg); border-radius: var(--radius-sm); }
.hbar .hbar-ok { background: var(--ok); }
.hbar .hbar-money { background: #7c3aed; }
.hbar .hbar-encerrado, .hbar .hbar-arquivado { background: var(--muted); }
.hbar .hbar-suspenso, .hbar .hbar-aguardando_decisao, .hbar .hbar-em_analise { background: #d97706; }
.bar-table .bar-cell { min-width: 150px; }
.bar-table td.bar-cell { white-space: nowrap; }
.bar-table td.bar-cell .hbar { width: calc(100% - 48px); }
.bar-table td.bar-cell strong { margin-left: 8px; font-variant-numeric: tabular-nums; }
.bar-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bar-list li { display: grid; grid-template-columns: minmax(130px, 210px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .86rem; }
.bar-list li strong { font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.bar-list-money li { grid-template-columns: 70px minmax(0, 1fr) minmax(170px, auto); }

/* ---------- Hierarquia ---------- */
.hierarchy { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.h-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.h-item p { font-size: .82rem; color: var(--text-2); margin-top: 8px; }

/* ---------- Autenticação ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px 20px; background: var(--bg); }
/* O arco da marca no topo do cartão (um arco por composição), com o logo vertical dentro */
.auth-card { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 220px; border-top-right-radius: 220px; padding: 64px 36px 32px; width: 100%; max-width: 440px; position: relative; }
.auth-card::before { content: ""; position: absolute; inset: 10px 10px auto; height: 200px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-bottom: 0; border-top-left-radius: 210px; border-top-right-radius: 210px; pointer-events: none; }
.auth-brand { text-align: center; margin-bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.auth-brand h1 { font-size: 1.65rem; line-height: 1.2; }
.auth-brand h1 span { color: var(--primary); }
.auth-brand p { font-size: .86rem; margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-hint { text-align: center; font-size: .8rem; margin-top: 18px; }
.auth-rules { font-size: .8rem; color: var(--muted); margin-top: -6px; }

/* ---------- Portal do Cliente ---------- */
.portal-body { background: var(--bg); }
.portal-header { background: var(--sidebar-bg); padding: 14px 0; color: var(--sidebar-text); }
.portal-header-inner { max-width: 1000px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.portal-badge { font-size: .76rem; color: var(--sidebar-text); border: 1px solid rgba(255, 255, 255, .22); padding: 4px 12px; border-radius: var(--radius-sm); }
.portal-main { max-width: 1000px; margin: 0 auto; padding: 30px 24px; }
.portal-main h1 { margin-bottom: 2px; }
.portal-main > .muted { margin-bottom: 22px; }
.portal-footer { text-align: center; font-size: .82rem; padding: 10px 0 30px; }
.portal-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 6px; }
.portal-new-link { border-left: 3px solid var(--ok); }
.copy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.copy-row input { flex: 1; min-width: 240px; font-size: .82rem; color: var(--text-2); }

/* ---------- Notificações ---------- */
.notif-list { list-style: none; display: flex; flex-direction: column; }
.notif-item { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); border-radius: var(--radius-sm); }
.notif-unread .notif-text span { font-weight: 600; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.notif-tarefa { background: #16a34a; } .notif-prazo { background: #d97706; }
.notif-comentario { background: #0284c7; } .notif-info { background: var(--muted); }
.notif-text { flex: 1; display: flex; justify-content: space-between; gap: 12px; color: var(--text); min-width: 0; }
.notif-text:hover { text-decoration: none; color: var(--primary); }

/* ---------- Calendário ---------- */
.cal-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.calendar { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; min-width: 620px; }
.calendar th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 4px 0; }
.calendar td { vertical-align: top; height: 88px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; background: var(--surface-2); }
.calendar td.cal-empty { background: transparent; border: none; }
.calendar td.cal-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-day { font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.cal-item { display: block; font-size: .7rem; padding: 2px 6px; border-radius: var(--radius-sm); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.cal-item:hover { text-decoration: none; filter: brightness(.95); }
.cal-more { font-size: .7rem; color: var(--muted); }
/* Dias sem expediente: fins de semana, feriados e recesso forense */
.calendar td.cal-weekend { background: var(--cal-weekend); }
.calendar td.cal-recesso { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, var(--b-violet-bg) 6px, var(--b-violet-bg) 8px); }
.calendar td.cal-holiday { background: var(--b-amber-bg); border-color: var(--b-amber-bg); }
.cal-tag {
  display: block; font-size: .64rem; font-weight: 600; color: var(--b-amber-fg); line-height: 1.2; margin: -2px 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-tag-recesso { color: var(--b-violet-fg); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .78rem; color: var(--muted); margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-swatch { display: inline-block; width: 14px; height: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.cal-swatch-holiday { background: var(--b-amber-bg); }
.cal-swatch-recesso { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 3px, var(--b-violet-bg) 3px, var(--b-violet-bg) 5px); }

/* ---------- Kanban ---------- */
/* 5 colunas de no mínimo 180px cabem numa tela de 1280px; abaixo disso o quadro rola na horizontal */
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.kanban-move select { min-width: 0; flex: 1; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; min-height: 140px; }
.kanban-col.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.kanban-col-head h2 { font-size: .9rem; margin: 0; }
.kanban-count { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 40px; }
.kanban-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: grab; }
.kanban-card.dragging { opacity: .5; }
.kanban-card-title { display: block; font-weight: 600; color: var(--text); font-size: .88rem; margin-bottom: 6px; }
.kanban-card-title:hover { color: var(--primary); text-decoration: none; }
.kanban-card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; margin-bottom: 4px; }
.kanban-card-client { font-size: .76rem; }
.kanban-move { display: flex; gap: 6px; margin-top: 8px; }
.kanban-move select { padding: 3px 6px; font-size: .76rem; }

/* ---------- Pagamentos / anexos ---------- */
.pay-block { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pay-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--b-green-bg); color: var(--b-green-fg); font-size: .76rem; padding: 3px 4px 3px 10px; border-radius: var(--radius-sm); }
.pay-x { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 1.05rem; line-height: 1; min-width: 26px; min-height: 26px; border-radius: 50%; }
.pay-x:hover { background: var(--danger-soft); }
.pay-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pay-form input { width: auto; padding: 5px 8px; font-size: .8rem; }
.pay-form input[type="number"] { max-width: 120px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.attach-chip { font-size: .76rem; background: var(--primary-soft); color: var(--primary); padding: 3px 10px; border-radius: var(--radius-sm); }
.attach-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.attach-form input[type="file"] { font-size: .78rem; width: auto; max-width: 100%; }
.cnj-info { font-size: .74rem; }

/* ---------- Paginação ---------- */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pagination-links { display: flex; align-items: center; gap: 10px; }

/* ---------- Calculadora de prazos ---------- */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.result-card { border-left: 4px solid var(--btn-primary-bg); }
.result-due { display: flex; flex-direction: column; margin-bottom: 14px; }
.result-due span { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.result-due strong { font-size: 2rem; line-height: 1.1; color: var(--primary); }
.result-due small { color: var(--text-2); font-size: .9rem; }
.skip-list, .holiday-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }
.skip-list li, .holiday-list li { display: flex; gap: 12px; }
.skip-date, .holiday-list li span { flex-shrink: 0; min-width: 96px; font-weight: 600; color: var(--text-2); }
.holiday-list { margin-top: 10px; }
.how-list { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--text-2); }
details summary { cursor: pointer; }

/* ---------- Horas & despesas ---------- */
.timer { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; box-shadow: var(--shadow); }
.timer-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.timer-display { font-variant-numeric: tabular-nums; font-size: 1.1rem; min-width: 76px; }
.timer.running .timer-display { color: var(--danger); }

/* ---------- Modelos de documentos ---------- */
.var-list { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; }
.var-list li { display: flex; flex-direction: column; gap: 1px; }
.var-chip { align-self: flex-start; font-family: Consolas, "Cascadia Mono", monospace; font-size: .76rem; background: var(--primary-soft); color: var(--primary); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 2px 8px; cursor: pointer; }
.var-chip:hover { border-color: var(--primary); }
.doc-editor { font-family: Georgia, "Times New Roman", serif; font-size: .98rem; line-height: 1.65; min-height: 420px; }
.print-area { display: none; }

/* ---------- Relatórios imprimíveis ---------- */
.print-body { background: #fff; color: #111; }
.print-page { max-width: 960px; margin: 0 auto; padding: 30px 24px; }
.print-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #ddd; padding-bottom: 14px; margin-bottom: 16px; }
.print-title { text-align: right; }
.print-totals { display: flex; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.print-totals div { display: flex; flex-direction: column; }
.print-totals span { font-size: .76rem; color: #555; }
.print-totals strong { font-size: 1.2rem; }
.print-totals .pos { color: #157f3b; } .print-totals .neg { color: #b91c1c; }
.print-footer { margin-top: 20px; font-size: .8rem; }
.print-actions { margin-top: 20px; display: flex; gap: 10px; }

/* ---------- Impressão ---------- */
@media print {
  .sidebar, .topbar, .sidebar-overlay, .appbar, .skip-link, .no-print, .flash, form, .btn, .tabs-wrap,
  .hamburger, .kanban-move, .pagination, .searchbar { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body, .panel, .kpi { background: #fff !important; color: #111 !important; box-shadow: none !important; }
  .panel { border: 1px solid #ccc; break-inside: avoid; overflow: visible; }
  .table tr { break-inside: avoid; }
  a { color: #111; text-decoration: none; }
  .print-area { display: block !important; white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; font-size: 12pt; line-height: 1.6; color: #000; }
  body.printing-doc > *:not(.print-root) { display: none !important; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .calc-layout { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-row-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .two-col, .two-col.even { grid-template-columns: 1fr; }
  .main { padding: 20px 22px 36px; }
}
@media (max-width: 860px) {
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
    background: var(--sidebar-bg); color: var(--sidebar-text); padding: 8px 16px; width: 100%;
  }
  .hamburger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 42px; height: 42px; border: none; background: transparent; cursor: pointer; padding: 9px;
  }
  .hamburger span { display: block; height: 2px; background: #fff; border-radius: var(--radius-sm); transition: .2s; }
  .shell.nav-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .shell.nav-open .hamburger span:nth-child(2) { opacity: 0; }
  .shell.nav-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 272px; z-index: 60;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .3);
  }
  .shell.nav-open .sidebar { transform: translateX(0); visibility: visible; transition: transform .22s ease; }
  /* O overlay só existe com o menu aberto (antes cobria a tela inteira) */
  .shell.nav-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; }
  .main { padding: 16px 16px 32px; width: 100%; }
  .page-head h1 { font-size: 1.3rem; }
  .appbar { margin-bottom: 16px; }
}
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-row > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-row-5 .kpi { gap: 6px; }
  .kpi-row-5 .kpi-ico { width: 28px; height: 28px; border-radius: var(--radius-sm); font-size: .72rem; }
  .kpi-ico { width: 36px; height: 36px; }
  .kpi strong { font-size: 1.1rem; }
  .comment-form { flex-direction: column; align-items: stretch; }
  .timeline-item { flex-direction: column; gap: 4px; }
  .timeline-date { width: auto; }
  .timer { width: 100%; justify-content: space-between; }
}
@media (max-width: 620px) {
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-list li { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) auto; }
  .appbar-search { max-width: none; }
  .kbd-hint { display: none; }
  .quick-add .qa-label { display: none; }
  .quick-add > .btn { width: 38px; justify-content: center; padding: 0; font-size: 1.2rem; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .option-card { padding: 14px; }
  .option-card p { display: none; }
  /* No celular o calendário vira um mapa compacto; os detalhes ficam na lista abaixo */
  .calendar { min-width: 0; border-spacing: 2px; }
  .calendar td { height: 46px; padding: 3px; }
  .cal-item, .cal-more, .cal-tag { display: none; }
  .calendar td.has-items .cal-day::after { content: " •"; color: var(--danger); }
  .table { font-size: .84rem; }
  .table td, .table th { padding: 8px 6px; }
}


/* ============================================================
   Componentes de interface (widgets.js)
   ============================================================ */
/* ---------- Campo de busca com sugestões (combobox) ---------- */
.field { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; position: relative; min-width: 0; }
.field > label > span, .field > .field-label { font-weight: 550; color: var(--text-2); }
.combo { position: relative; }
.combo-input-wrap { position: relative; }
.combo-input-wrap input { padding-right: 34px; }
.combo-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.combo-clear:hover { color: var(--danger); background: var(--danger-soft); }
.combo-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px;
}
.combo-pop [role="listbox"] { list-style: none; }
.combo-pop [role="option"] { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; display: flex; flex-direction: column; gap: 1px; font-size: .88rem; color: var(--text); }
.combo-pop [role="option"] small { color: var(--muted); font-size: .76rem; }
.combo-pop [role="option"][aria-selected="true"], .combo-pop [role="option"]:hover { background: var(--primary-soft); }
.combo-pop .combo-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 2px; font-weight: 700; }
.combo-pop .combo-empty { padding: 10px; color: var(--muted); font-size: .86rem; }
.search-pop { min-width: 320px; }
.searchbar .combo { min-width: 220px; }

/* ---------- Diálogo (edição em janela) ---------- */
dialog.dlg {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; width: min(720px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); max-height: calc(100dvh - 24px);
}
dialog.dlg::backdrop { background: rgba(10, 15, 26, .55); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h2 { font-size: 1rem; }
.dlg-body { padding: 16px 18px 18px; }
.dlg-close { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.dlg-close:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Menu "⋯" de ações por linha ---------- */
.menu-wrap { position: relative; display: inline-flex; }
.menu-btn { min-width: 32px; min-height: 30px; padding: 4px 8px; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.menu-pop > a, .menu-pop > button, .menu-pop form > button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none;
  font: inherit; font-size: .86rem; color: var(--text); text-align: left; cursor: pointer; min-height: 32px;
}
.menu-pop > a:hover, .menu-pop > button:hover, .menu-pop form > button:hover,
.menu-pop > a:focus-visible, .menu-pop > button:focus-visible, .menu-pop form > button:focus-visible { background: var(--primary-soft); text-decoration: none; }
.menu-pop .menu-danger { color: var(--danger); }
.menu-pop.menu-up { top: auto; bottom: calc(100% + 4px); } /* sem espaço abaixo (widgets.js) */
.menu-pop form { display: block; }

/* ---------- Abas com menu "Mais" ---------- */
.tabs-bar { display: flex; align-items: flex-end; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tabs-bar .tabs { border-bottom: 0; flex: 1; min-width: 0; overflow: hidden; }
.tabs-bar .tabs a { flex-shrink: 0; }
.tabs-bar.is-measured .tabs a.tab-overflow { display: none; }
.tabs-more { position: relative; flex-shrink: 0; margin-bottom: -2px; }
.tabs-more > button {
  font: inherit; font-size: .9rem; font-weight: 550; color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.tabs-more > button:hover { color: var(--primary); }
.tabs-more.has-active > button { color: var(--primary); border-bottom-color: var(--primary); }
.tabs-more .menu-pop a { justify-content: space-between; }
.tabs-more .menu-pop a[aria-current] { font-weight: 650; color: var(--primary); }

/* ---------- Barra de progresso (faturas parcialmente pagas) ---------- */
.progress { display: block; height: 6px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 4px; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--ok); }
.inv-parcial { background: var(--b-blue-bg); color: var(--b-blue-fg); }

/* ---------- Página de erro dentro do painel ---------- */
.error-panel { max-width: 640px; margin: 24px auto; text-align: center; padding: 34px 28px; }
.error-panel h1 { margin-bottom: 6px; }
.error-ico { width: 56px; height: 56px; border-radius: var(--radius-sm); display: grid; place-items: center; margin: 0 auto 14px; background: var(--b-amber-bg); color: var(--b-amber-fg); }
.error-ico-lock { background: var(--b-red-bg); color: var(--b-red-fg); }
.error-ico .i { width: 28px; height: 28px; }
.error-help { text-align: left; margin: 18px 0 4px; }
.error-help ul { margin-top: 6px; }
.error-actions { justify-content: center; margin-top: 18px; }

/* ---------- Região rolável com tabela (foco pelo teclado) ---------- */
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  a.option-card:hover, .link-card:hover { transform: none; }
}

/* ---------- Tabelas viram cartões no celular (rótulos em data-label) ---------- */
@media (max-width: 640px) {
  .table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td, .table.cards tfoot, .table.cards tfoot th { display: block; width: 100%; }
  .table.cards tbody tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 10px; background: var(--surface); }
  .table.cards tbody tr.edit-row, .table.cards tbody tr.subrow { margin-top: -10px; border-top: 0; border-radius: 0 0 10px 10px; }
  .table.cards td { border-bottom: 1px dashed var(--border); padding: 7px 0 7px 36%; position: relative; text-align: left; min-height: 32px; overflow-wrap: anywhere; }
  .table.cards td:last-child { border-bottom: 0; }
  .table.cards td::before { content: attr(data-label); position: absolute; left: 0; top: 8px; width: calc(36% - 10px); font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); line-height: 1.3; }
  .table.cards td[data-label=""]::before, .table.cards td:not([data-label])::before { content: none; }
  .table.cards td[data-label=""], .table.cards td:not([data-label]), .table.cards td[colspan] { padding-left: 0; }
  .table.cards td.num { text-align: left; }
  .table.cards .nowrap { white-space: normal; }
  .table.cards tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; }
  .table.cards tfoot th, .table.cards tfoot td { width: auto; border: 0; padding: 0; }
  .table.cards tfoot td:empty, .table.cards tfoot th:empty { display: none; }
  .table.cards tbody tr:hover { background: var(--surface); }
  .table.cards .row-actions { justify-content: flex-start; }
}
/* Campo com sugestões dentro de uma barra de filtros: rótulo ao lado */
.searchbar .inline-combo { flex-direction: row; align-items: center; gap: 8px; min-width: 260px; }
.searchbar .inline-combo .combo-input-wrap { flex: 1; min-width: 180px; }
.searchbar .inline-combo .combo-pop { left: auto; right: 0; min-width: 100%; }
.searchbar .inline-combo .field-label { white-space: nowrap; }
.timer-task { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--primary); }
.tfoot-total strong { font-variant-numeric: tabular-nums; }
.table tfoot th { text-transform: none; letter-spacing: 0; font-size: .84rem; }

/* ============================================================
   Verificação em duas etapas, fila de e-mails (recursos profissionais)
   ============================================================ */
.twofa-setup { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.twofa-qr { background: #fff; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border, #ddd); line-height: 0; }
.twofa-qr svg { width: 220px; height: 220px; max-width: 100%; }
.twofa-setup .how-list { flex: 1 1 280px; }
.twofa-secret, .twofa-uri { word-break: break-all; user-select: all; }
.recovery-codes { columns: 2; column-gap: 32px; padding-left: 24px; margin: 12px 0 16px; font-size: 1.05rem; }
.recovery-codes li { margin-bottom: 6px; }
.recovery-codes code { letter-spacing: .08em; }
.outbox-falhou { color: var(--danger, #b91c1c); }
.outbox-enviado { color: var(--success, #157f3b); }
@media (max-width: 640px) { .recovery-codes { columns: 1; } }
/* ============ fim: recursos profissionais ============ */
/* Interruptor (ex.: documento visível no portal) */
.switch { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 2px; cursor: pointer; font: inherit; font-size: .82rem; color: var(--text-2); min-height: 28px; }
.switch-track { position: relative; width: 36px; height: 20px; border-radius: 12px; background: var(--b-gray-bg); border: 1px solid var(--input-border); transition: background .15s; flex-shrink: 0; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch[aria-checked="true"] .switch-track { background: var(--ok); border-color: var(--ok); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(16px); background: #fff; }
.switch[aria-checked="true"] .switch-text { color: var(--ok); font-weight: 600; }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
/* Estorno de pagamento: botão com texto (antes um "×" pequeno) */
.pay-chip { padding: 3px 4px 3px 10px; gap: 8px; }
.pay-undo { display: inline-flex; align-items: center; gap: 4px; border: 1px solid currentColor; border-radius: var(--radius-sm); background: var(--surface); color: var(--danger); font: inherit; font-size: .74rem; font-weight: 600; padding: 2px 8px; min-height: 24px; cursor: pointer; }
.pay-undo:hover { background: var(--danger-soft); }
/* Qualificação do cliente */
.form-grid.nested { grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid.nested-city { grid-template-columns: 1fr 80px; }
.qual-group > .form-grid { margin-top: 6px; }
.badge .i, .btn .i { width: 1em; height: 1em; }
.attach-chip { display: inline-flex; align-items: center; gap: 4px; }
/* ---------- Página do processo ---------- */
.case-title { font-variant-numeric: tabular-nums; }
.badges-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 20px; margin-bottom: 16px; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.facts dd { font-size: .92rem; font-weight: 550; margin-top: 2px; overflow-wrap: anywhere; }
.fact-alert dd { color: var(--danger); }
.notes-row { gap: 14px; margin-bottom: 6px; }
.note-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.note-box h3 { font-size: .82rem; margin-bottom: 4px; color: var(--text-2); }
.note-box p { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .88rem; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li > a { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; }
.mini-list li > span { display: inline-flex; align-items: center; gap: 6px; }
ol.timeline { list-style: none; }
.chk.chk-end { align-self: end; padding-bottom: 10px; }
.badge-dj { background: var(--b-blue-bg); color: var(--b-blue-fg); }
.badge-warn { background: var(--b-amber-bg); color: var(--b-amber-fg); }
.dj-actions { margin-top: 6px; }
.fact-datajud { grid-column: span 2; }
.pay-receipt { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; color: var(--b-green-fg); text-decoration: underline; min-height: 24px; }
@media (max-width: 640px) { .fact-datajud { grid-column: auto; } }
/* Lista de processos: colunas secundárias somem abaixo de 1440 px (a informação vai para a 1ª coluna) */
.hide-wide { display: none; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 42ch; }
@media (max-width: 1439px) {
  .table .col-sec { display: none; }
  .table .hide-wide { display: block; }
}
/* Painel gerencial e início: indicadores se ajustam à largura; gráfico com altura limitada */
.chart { max-height: 280px; }
.cards-grid .option-card .row-actions { margin-top: auto; }
.cards-grid .option-card { display: flex; flex-direction: column; }
.cards-grid .option-card p { flex: 1; }
/* Alternância lista/quadro */
.seg { display: inline-flex; border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: .86rem; font-weight: 570; color: var(--text-2); min-height: 36px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--input-border); }
.seg-btn:hover { background: var(--primary-soft); text-decoration: none; }
.seg-btn[aria-current] { background: var(--primary-soft); color: var(--primary); }
/* Quadro de leads */
.lead-board { grid-auto-columns: minmax(220px, 1fr); }
.lead-board .kanban-col { border-top: 3px solid var(--border); }
.lead-board .stage-col-novo { border-top-color: var(--b-blue-fg); }
.lead-board .stage-col-negociacao { border-top-color: var(--b-amber-fg); }
.lead-board .stage-col-convertido { border-top-color: var(--b-green-fg); }
.lead-board .stage-col-perdido { border-top-color: var(--b-red-fg); }
.lead-board .kanban-col-head h3 { font-size: .9rem; }
/* Próximos passos após converter */
.next-steps { border-left: 3px solid var(--ok); }
.next-steps h2 { margin-bottom: 8px; }
.next-list { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.next-list a { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; }
.row-actions.nowrap { flex-wrap: nowrap; }
.qual-details summary { font-weight: 600; font-size: .88rem; color: var(--text-2); padding: 6px 0; }
.qual-details[open] summary { margin-bottom: 8px; }
/* Quadro de tarefas: vencimento em destaque, ações rápidas e etiquetas sem estourar o cartão */
.kanban-card { min-width: 0; }
.kanban-card-meta .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card-title { overflow-wrap: anywhere; }
.kanban-due { display: inline-flex; align-items: center; gap: 4px; }
.card-late { border-left: 4px solid var(--danger); }
.card-today { border-left: 4px solid var(--warn); }
.due-today { color: var(--warn); font-weight: 650; }
.kanban-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.kanban-quick .btn { padding: 3px 8px; font-size: .76rem; min-height: 26px; }
.empty-board p { margin-bottom: 10px; }
/* Relatórios: botões dos cartões alinhados na base */
.option-card > .btn, .option-card > .row-actions { margin-top: auto; align-self: flex-start; }
@media (max-width: 640px) {
  .print-header { flex-direction: column; }
  .print-title { text-align: left; }
  .print-page { padding: 16px; }
}
/* Alvos de toque/clique com pelo menos 24 px (WCAG 2.5.8) */
.table td a:not(.btn):not(.badge):not(.row-link) { display: inline-block; min-height: 24px; padding: 3px 0; }
a.badge { display: inline-flex; align-items: center; min-height: 24px; }
.stat-card.active span { color: var(--text-2); }

.cell-proc > small { display: block; }
.pay-chip { flex-wrap: wrap; border-radius: var(--radius-sm); }
.pay-undo, .pay-receipt { white-space: nowrap; }

/* ---------- Identidade visual (Configurações › versão de cor) ---------- */
.brand-picker fieldset { border: 0; }
.brand-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 6px 0 16px; }
.brand-option { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.brand-option input { position: absolute; opacity: 0; pointer-events: none; }
.brand-swatch { display: grid; place-items: center; height: 120px; border: 1px solid var(--border); outline: 2px solid transparent; outline-offset: 3px; }
.brand-swatch img { height: 72px; }
.brand-option[data-brand-swatch="preto"] .brand-swatch { background: #141416; }
.brand-option[data-brand-swatch="marinho"] .brand-swatch { background: #13233f; }
.brand-option[data-brand-swatch="vinho"] .brand-swatch { background: #4a1422; }
.brand-option input:checked + .brand-swatch { outline-color: var(--primary); }
.brand-option input:focus-visible + .brand-swatch { outline-color: var(--focus); outline-style: dashed; }
.brand-option-label { font-weight: 600; }
