:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --line: #e3e8ef;
  --line-strong: #d3dae4;
  --text: #0e1726;
  --text-2: #475467;
  --muted: #8a94a6;
  --brand: #1b3a6b;
  --brand-hover: #15305a;
  --brand-soft: #eaf0fa;
  --brand-ink: #1b3a6b;
  --gold: #c39a3e;
  --gold-soft: #faf3e3;
  --sidebar: #0d1b33;
  --sidebar-2: #13264a;
  --sidebar-text: #a9b6cc;
  --ok: #157f3c;
  --ok-soft: #e7f6ec;
  --warn: #a15c07;
  --warn-soft: #fdf3e2;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 6px 16px -6px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.22);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b1220; --surface: #121a2b; --surface-2: #0f1727; --surface-3: #18233a; --line: #222e45; --line-strong: #2d3b57;
    --text: #e8edf6; --text-2: #b3bdd0; --muted: #7d89a0; --brand: #5b8def; --brand-hover: #74a0f5; --brand-soft: #172743; --brand-ink: #9dbcf7;
    --gold: #d8b25a; --gold-soft: #2a2414; --sidebar: #070d19; --sidebar-2: #111c33; --ok: #4cc27a; --ok-soft: #12291c;
    --warn: #e5a23a; --warn-soft: #2d2210; --danger: #f07167; --danger-soft: #2f1615;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4); --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6); color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b1220; --surface: #121a2b; --surface-2: #0f1727; --surface-3: #18233a; --line: #222e45; --line-strong: #2d3b57;
  --text: #e8edf6; --text-2: #b3bdd0; --muted: #7d89a0; --brand: #5b8def; --brand-hover: #74a0f5; --brand-soft: #172743; --brand-ink: #9dbcf7;
  --gold: #d8b25a; --gold-soft: #2a2414; --sidebar: #070d19; --sidebar-2: #111c33; --ok: #4cc27a; --ok-soft: #12291c;
  --warn: #e5a23a; --warn-soft: #2d2210; --danger: #f07167; --danger-soft: #2f1615;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4); --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.icon { flex-shrink: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #1a1305;
  background: linear-gradient(135deg, #e6c779, var(--gold)); box-shadow: 0 6px 16px -6px rgba(195, 154, 62, 0.7);
}
.brand strong { display: block; font-size: 15px; letter-spacing: -0.01em; }
.brand small { color: var(--sidebar-text); font-size: 11.5px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: #6e7d98; padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8.5px 10px; border-radius: 9px; color: var(--sidebar-text);
  font-weight: 500; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-item .badge-count { margin-left: auto; background: var(--gold); color: #1a1305; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; gap: 10px; }

/* Compact menu (Atendimentos): icons only, the full menu opens over the page while the mouse is on it */
@media (min-width: 861px) {
  .shell.compact { grid-template-columns: 68px 1fr; }
  .shell.compact .sidebar { width: 68px; padding: 20px 10px; z-index: 60; overflow-x: hidden; transition: width 0.18s ease, box-shadow 0.18s; }
  .shell.compact .sidebar:hover { width: 252px; padding: 20px 14px; box-shadow: 12px 0 32px -12px rgba(0, 0, 0, 0.45); }
  .shell.compact .brand, .shell.compact .nav-item, .shell.compact .sidebar-foot { white-space: nowrap; }
  .shell.compact .brand { padding-left: 5px; }
  .shell.compact .nav-item { position: relative; padding-left: 14px; }
  .shell.compact .sidebar:not(:hover) .nav-group { visibility: hidden; height: 10px; padding: 0; }
  .shell.compact .sidebar:not(:hover) .nav-item { font-size: 0; }
  .shell.compact .sidebar:not(:hover) .brand > div, .shell.compact .sidebar:not(:hover) .sidebar-foot > :not(.avatar) { display: none; }
  .shell.compact .sidebar:not(:hover) .badge-count { position: absolute; top: 2px; left: 30px; font-size: 10px; padding: 0 5px; }
  .shell.compact .sidebar-foot { padding-left: 4px; }
  /* Only the chats: no client search bar on top, and the WhatsApp screen takes the whole height */
  .shell.compact .topbar { display: none; }
  .shell.compact .content { padding: 14px 16px; max-width: none; }
  .shell.compact .wa { height: calc(100vh - 28px); }
}
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot strong { color: #fff; display: block; font-size: 13px; }
.sidebar-foot small { font-size: 11.5px; }
.sidebar-foot .icon-btn { color: var(--sidebar-text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px);
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { padding-left: 38px; background: var(--surface-2); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 40;
}
.search-results a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text); }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.content { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header p { margin: 4px 0 0; color: var(--text-2); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-weight: 550; font-size: 13px; }
.stat .stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.stat .stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .stat-foot { font-size: 12.5px; color: var(--muted); }
.stat.gold .stat-icon { background: var(--gold-soft); color: var(--gold); }

/* Bars (single series: one hue, direct labels) */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 36px; align-items: center; gap: 12px; font-size: 13px; }
.bar-row .label { color: var(--text-2); }
.bar-track { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); min-width: 4px; transition: width 0.4s; }
.bar-row:hover .bar-fill { background: var(--brand-hover); }
.bar-row .value { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type='checkbox'] { width: auto; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-all { grid-column: 1 / -1; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); grid-column: 1 / -1; margin-top: 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--line); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn.gold { background: linear-gradient(135deg, #e2c068, var(--gold)); color: #1d1503; }
.btn.gold:hover:not(:disabled) { filter: brightness(1.05); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.icon-btn { background: transparent; border: 0; padding: 7px; border-radius: 8px; color: var(--text-2); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; display: inline-block; }
.spinner.lg { width: 28px; height: 28px; border-width: 3px; color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.blue { background: #e8f0fe; color: #1d4ed8; }
.badge.violet { background: #f1ebfe; color: #6d28d9; }
.badge.amber { background: #fdf3e2; color: #a15c07; }
.badge.orange { background: #fdeee4; color: #c2410c; }
.badge.sky { background: #e3f4fb; color: #0369a1; }
.badge.teal { background: #e0f5f1; color: #0f766e; }
.badge.pink { background: #fce8f3; color: #be185d; }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.gold { background: var(--gold-soft); color: #8a6a1f; }
:root[data-theme='dark'] .badge:not(.neutral), .dark-badges .badge { filter: saturate(0.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .badge.blue { background: #172a4d; color: #93b4f8; }
  :root:not([data-theme='light']) .badge.violet { background: #251a42; color: #c4a8fb; }
  :root:not([data-theme='light']) .badge.amber, :root:not([data-theme='light']) .badge.gold { background: #2d2210; color: #f0bf6a; }
  :root:not([data-theme='light']) .badge.orange { background: #2f1c10; color: #f6a26e; }
  :root:not([data-theme='light']) .badge.sky { background: #0f2735; color: #7cc8ef; }
  :root:not([data-theme='light']) .badge.teal { background: #0f2a27; color: #6fd6c6; }
  :root:not([data-theme='light']) .badge.pink { background: #2f1424; color: #f39ac9; }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person strong { display: block; font-weight: 600; }
.person small { color: var(--muted); }
.avatar { border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; flex-shrink: 0; background: hsl(var(--h) 55% 92%); color: hsl(var(--h) 45% 32%); position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .avatar { background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 60% 80%); } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 600; color: var(--text-2); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabs .count { background: var(--surface-3); color: var(--text-2); border-radius: 99px; font-size: 11px; padding: 0 7px; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--surface-3); border-radius: var(--radius); padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 9px; transition: background 0.15s, box-shadow 0.15s; }
.column.drop { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px; font-weight: 650; font-size: 13px; }
.column-head .count { color: var(--muted); font-weight: 600; }
.column-head small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s; display: flex; flex-direction: column; gap: 8px; }
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard.dragging { opacity: 0.5; }
.kcard strong { font-weight: 650; }
.kcard .meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }

/* ---------- Modal & drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 18, 34, 0.45); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop 0.18s; }
.modal.wide { width: min(880px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
.modal header, .drawer header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal h3, .drawer h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { background: var(--surface); width: min(640px, 100vw); height: 100vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide 0.2s; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer header p { margin: 2px 0 0; }
.drawer-body { padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); margin-bottom: 8px; }
.empty p { margin: 0; color: var(--muted); max-width: 380px; }
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 550; max-width: 420px; animation: pop 0.2s; }
.toast.error { background: var(--danger); color: #fff; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-item .tdot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); margin-top: 3px; }
.timeline-item.ia .tdot { border-color: var(--gold); }
.timeline-item p { margin: 0; }
.timeline-item small { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist .item { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.checklist .tick { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.checklist .item.ok .tick { background: var(--ok-soft); color: var(--ok); }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--brand-soft); color: var(--text); }
.callout.gold { background: var(--gold-soft); }
.callout .icon { color: var(--brand-ink); margin-top: 2px; }
.callout.gold .icon { color: var(--gold); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 14px; padding: 22px; text-align: center; color: var(--text-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.doc { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 11px; background: var(--surface); }
.doc-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex-shrink: 0; overflow: hidden; }
.doc-icon img { width: 100%; height: 100%; object-fit: cover; }
.doc .doc-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.doc .doc-body select { padding: 4px 8px; font-size: 12px; }
.doc .doc-actions { display: flex; gap: 2px; }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; height: calc(100vh - 64px - 56px - 70px); min-height: 520px; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-item { display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--brand-soft); }
.chat-item .top { display: flex; justify-content: space-between; gap: 8px; }
.chat-item strong { font-weight: 650; }
.chat-item .last { color: var(--muted); font-size: 13px; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.bubble { max-width: 74%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow-sm); font-size: 13.5px; }
.bubble.incoming { align-self: flex-start; background: var(--surface); border-top-left-radius: 4px; }
.bubble.outgoing { align-self: flex-end; background: #dbeafe; color: #0b1f44; border-top-right-radius: 4px; }
.bubble.bot { background: var(--gold-soft); color: var(--text); }
.bubble.private { align-self: flex-end; background: transparent; border: 1px dashed var(--line-strong); box-shadow: none; color: var(--text-2); font-size: 12.5px; }
.bubble.activity { align-self: center; background: transparent; box-shadow: none; color: var(--muted); font-size: 12px; padding: 2px; }
.bubble .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.bubble img { max-width: 220px; border-radius: 8px; display: block; margin-top: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .bubble.outgoing { background: #1b3561; color: #e6eefc; } }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.opt { border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand-ink); border-radius: 99px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; }
.chat-compose { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { min-height: 42px; max-height: 140px; }
.chat-side { border-left: 1px solid var(--line); padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

/* Document editor */
.editor-toolbar { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 64px; z-index: 5; }
.paper { background: #fff; color: #111; max-width: 820px; margin: 24px auto; padding: 64px 72px; box-shadow: var(--shadow); border-radius: 4px; font-family: 'Times New Roman', Georgia, serif; font-size: 15px; line-height: 1.6; min-height: 900px; }
.paper:focus { outline: none; }
.paper h1, .paper h2, .paper h3 { font-family: inherit; text-align: center; margin: 0.6em 0; }
.paper h1 { font-size: 19px; } .paper h2 { font-size: 16px; } .paper h3 { font-size: 15px; }
.paper p { text-align: justify; margin: 0 0 0.8em; }
.paper table { border-collapse: collapse; width: 100%; } .paper td, .paper th { border: 1px solid #999; padding: 4px 8px; }
.ai-glow { background: linear-gradient(135deg, var(--brand), #3b5ea8 60%, var(--gold)); color: #fff; border-radius: var(--radius); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; box-shadow: var(--shadow); }
.ai-glow h2 { font-size: 19px; }
.ai-glow p { margin: 4px 0 0; opacity: 0.88; max-width: 640px; }
.opp { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.opp h4 { font-size: 15px; font-weight: 650; }
.opp p { margin: 0; color: var(--text-2); font-size: 13.5px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(circle at 20% 20%, #23467f 0, transparent 50%), linear-gradient(160deg, var(--sidebar), #183160); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(216, 178, 90, 0.35); box-shadow: 0 0 0 60px rgba(216, 178, 90, 0.05), 0 0 0 120px rgba(216, 178, 90, 0.03); }
.login-art h2 { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; max-width: 460px; line-height: 1.15; }
.login-art h2 em { font-style: normal; color: #e6c779; }
.login-art p { color: #b6c3da; max-width: 420px; font-size: 15px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login-form h1 { font-size: 26px; font-weight: 700; }
.error-text { color: var(--danger); font-weight: 550; font-size: 13px; }

@media print {
  .sidebar, .topbar, .editor-toolbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; } .content { padding: 0; } body { background: #fff; }
  .paper { box-shadow: none; margin: 0; padding: 0; max-width: none; min-height: 0; }
}

@media (max-width: 1100px) {
  .grid.split, .grid.cols-3 { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .chat-side { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 90; transform: translateX(-100%); transition: transform 0.2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { padding: 0 16px; } .topbar .menu-btn { display: inline-grid; }
  .content { padding: 18px 16px; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat .stat-value { font-size: 21px; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .messages { min-height: 380px; }
  .paper { padding: 32px 22px; }
  .bar-row { grid-template-columns: 110px 1fr 30px; }
  .field.span-2 { grid-column: auto; }
}
.checklist .item.skipped .tick { background: var(--warn-soft); color: var(--warn); }
.checklist .item.skipped { color: var(--warn); }
.checklist .item.none { color: var(--muted); }

/* Idealização: outline of topics — one card per main topic, sub-topics as a tree */
.ideas-page { max-width: 960px; margin: 0 auto; }
.ideas-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.ideas-toolbar .search { flex: 1; min-width: 220px; max-width: 380px; background: var(--surface); }
.ideas-summary { font-size: 13px; }
.ideas-toolbar .btn { margin-left: auto; }
.ideas-list { display: flex; flex-direction: column; gap: 14px; }
.idea-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.idea-card-head { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px; border-left: 3px solid var(--gold); }
.idea-card-head:hover { background: var(--surface-2); }
.idea-card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 26px; margin: 0; overflow-wrap: anywhere; }
.idea-text { flex: 1; min-width: 0; }
.idea-body { margin: 3px 0 0; white-space: pre-wrap; color: var(--text-2); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.idea-badge { display: inline-block; margin-left: 10px; vertical-align: 3px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; color: var(--brand-ink); background: var(--brand-soft); border-radius: 99px; padding: 1px 9px; line-height: 19px; }
.idea-tree { border-top: 1px solid var(--line); padding: 10px 16px 14px 22px; display: flex; flex-direction: column; }

/* Chevron (has sub-topics) or dot (leaf), both 24px so titles line up */
.idea-chevron { appearance: none; flex: none; width: 24px; height: 24px; min-height: 0; padding: 0; margin: 1px 0 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; transition: background .12s, transform .15s; }
.idea-card-head .idea-chevron { margin-top: 1px; }
.idea-chevron:hover { background: var(--surface-3); color: var(--text); }
.idea-chevron svg { transition: transform .15s; }
.idea-chevron.open svg { transform: rotate(90deg); }
.idea-chevron.placeholder { cursor: default; background: none; }
.idea-dot { flex: none; width: 24px; height: 24px; display: grid; place-items: center; }
.idea-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: .55; }
.level-2 > .idea-row .idea-dot::before { background: var(--gold); opacity: .8; }
.level-3 > .idea-row .idea-dot::before { width: 6px; height: 6px; background: var(--muted); }

.idea-node { position: relative; }
.idea-row { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; margin: 1px 0; border-radius: 9px; }
.idea-row:hover { background: var(--surface-2); }
.idea-title { font-weight: 600; font-size: 14.5px; line-height: 24px; overflow-wrap: anywhere; }
.level-1 > .idea-row .idea-title { font-size: 15px; }
.level-3 > .idea-row .idea-title { font-weight: 500; }
.idea-count { display: inline-block; margin-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 0 7px; line-height: 18px; vertical-align: 2px; }
.idea-children { margin-left: 19px; padding-left: 13px; border-left: 1.5px solid var(--line); }
mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Floating toolbar: appears on hover, takes no room in the layout */
.idea-tools { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .12s; }
.idea-card-head .idea-tools { right: 14px; }
.idea-row:hover > .idea-tools, .idea-card-head:hover > .idea-tools, .idea-tools:focus-within { opacity: 1; pointer-events: auto; }
.idea-tool { appearance: none; min-height: 0; height: 28px; min-width: 28px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.idea-tool:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.idea-tool:disabled { opacity: .35; cursor: default; }
.idea-tool.add { color: var(--brand-ink); }
.idea-tool.add:hover { background: var(--brand-soft); }
.idea-tool.danger:hover { background: var(--danger-soft); color: var(--danger); }

.idea-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin: 6px 0; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.idea-form.main { margin: 0; border: 0; border-left: 3px solid var(--gold); border-radius: 0; box-shadow: none; padding: 18px 20px; }
.idea-form-title { font-weight: 600; }
.idea-form.main .idea-form-title { font-size: 16px; }
.idea-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.ideas-empty { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ideas-empty p { max-width: 460px; margin: 0; line-height: 1.55; }
.ideas-empty-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }

@media (max-width: 720px) {
  .ideas-toolbar .search { max-width: none; }
  .idea-card-head { padding: 14px; flex-wrap: wrap; }
  .idea-tree { padding: 8px 8px 12px 10px; }
  .idea-children { margin-left: 11px; padding-left: 9px; }
  /* No hover on phones: the toolbar sits under the text */
  .idea-tools { position: static; transform: none; opacity: 1; pointer-events: auto; box-shadow: none; border: 0; padding: 0; flex-basis: 100%; justify-content: flex-start; margin-left: 30px; }
  .idea-row { flex-wrap: wrap; }
}

/* Relatório: situation colors (always shown with a label or legend), thin bars, columns by month */
:root { --st-concedido: var(--ok); --st-indeferido: var(--danger); --st-analise: #0369a1; --st-pendente: #b7791f; --bar: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --st-analise: #4aa8d8; --st-pendente: #e5a23a; --bar: #5b8def; } }
:root[data-theme='dark'] { --st-analise: #4aa8d8; --st-pendente: #e5a23a; --bar: #5b8def; }
.report-stat.hero .stat-value { color: var(--brand-ink); }
.report-stat.concedido .stat-value { color: var(--st-concedido); }
.report-stat.indeferido .stat-value { color: var(--st-indeferido); }
.seg-bar { display: flex; gap: 2px; height: 10px; min-width: 120px; }
.seg-bar .seg { display: block; min-width: 3px; border-radius: 2px; }
.seg-bar .seg:first-child { border-radius: 4px 2px 2px 4px; }
.seg-bar .seg:last-child { border-radius: 2px 4px 4px 2px; }
.seg.concedido, .swatch.concedido { background: var(--st-concedido); }
.seg.indeferido, .swatch.indeferido { background: var(--st-indeferido); }
.seg.analise, .swatch.analise { background: var(--st-analise); }
.seg.pendente, .swatch.pendente { background: var(--st-pendente); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.insight { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.insight p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.insight-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.insight.good .insight-icon { background: var(--ok-soft); color: var(--ok); }
.insight.bad .insight-icon { background: var(--danger-soft); color: var(--danger); }
.insight.warn .insight-icon { background: var(--warn-soft); color: var(--warn); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.hbar-label { color: var(--text-2); }
.hbar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.hbar-value { min-width: 36px; text-align: right; font-weight: 600; }
.cols-wrap { position: relative; }
.cols { display: flex; align-items: flex-end; gap: 4px; height: 240px; padding-top: 22px; overflow-x: auto; }
.col { flex: 1 0 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; cursor: default; outline: none; border-radius: 6px; }
.col-bar { width: 72%; max-width: 32px; min-height: 2px; background: var(--bar); border-radius: 4px 4px 0 0; transition: opacity .15s; }
.cols-wrap:hover .col:not(.active) .col-bar { opacity: .45; }
.col:focus-visible { box-shadow: 0 0 0 2px var(--brand-soft); }
.col-value { font-size: 11.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.col.active .col-value { color: var(--text); }
.col-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.col-tip { position: absolute; top: 0; width: 230px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; pointer-events: none; z-index: 5; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.col-tip.right { transform: translateX(26px); }
.col-tip.left { transform: translateX(calc(-100% - 26px)); }
.col-tip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.col-tip-head span { font-weight: 700; }
.col-tip-row { display: flex; align-items: center; gap: 8px; }
.col-tip-row .num { font-weight: 600; min-width: 28px; text-align: right; }
.col-tip-row small { min-width: 34px; text-align: right; }
.col-tip-foot { padding-top: 7px; border-top: 1px solid var(--line); color: var(--text-2); }
.callout.clickable, .hbar.clickable { cursor: pointer; }
.hbar.clickable:hover .hbar-label { color: var(--text); text-decoration: underline; }

/* Guia: simulator + map of the WhatsApp flow */
.flow-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .flow-layout { grid-template-columns: 1fr; } }
.flow-sim { position: sticky; top: 16px; display: flex; flex-direction: column; }
.flow-sim .messages { flex: none; height: 640px; border-radius: 0 0 var(--radius) var(--radius); }
.flow-sim .bubble { max-width: 88%; }
.flow-tag { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
button.opt { cursor: pointer; }
button.opt:hover { background: var(--brand-soft); }
.opt.static { display: inline-block; cursor: default; }
.flow-outcome, .flow-typed { align-self: stretch; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); }
.flow-typed { border-style: dashed; align-self: flex-end; max-width: 88%; }
.flow-outcome p, .flow-typed p { margin: 0; color: var(--text-2); white-space: pre-wrap; }
.flow-outcome.green { border-left: 4px solid var(--ok); }
.flow-outcome.red { border-left: 4px solid var(--danger); }
.flow-outcome.gold { border-left: 4px solid var(--gold); }
.flow-outcome.violet, .flow-outcome.blue { border-left: 4px solid var(--brand); }
.flow-steps { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.flow-step { display: flex; gap: 10px; }
.flow-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.flow-docs { margin: 0; padding-left: 18px; color: var(--text-2); columns: 2; column-gap: 24px; }
.flow-docs li { break-inside: avoid; margin-bottom: 3px; }
.flow-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); padding: 2px 8px; border-radius: 99px; background: var(--surface-3); }
.flow-kind.green { background: var(--ok-soft); color: var(--ok); }
.flow-kind.red { background: var(--danger-soft); color: var(--danger); }
.flow-kind.gold { background: var(--gold-soft); color: #8a6a1f; }
.flow-kind.violet { background: #f1ebfe; color: #6d28d9; }
.flow-kind.blue { background: var(--brand-soft); color: var(--brand-ink); }
.flow-tree { font-size: 13.5px; overflow-x: auto; }
.flow-node { display: flex; flex-direction: column; gap: 6px; }
.flow-node > ul { list-style: none; margin: 0 0 0 10px; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.flow-node > ul > li { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flow-node > ul > li::before { content: ''; position: absolute; left: -16px; top: 13px; width: 12px; border-top: 2px solid var(--line); }
.flow-node > ul > li > .flow-node, .flow-node > ul > li > .flow-ref { flex-basis: 100%; margin-top: 4px; }
.flow-node-head { align-self: flex-start; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 9px; padding: 5px 11px; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; box-shadow: var(--shadow-sm); }
.flow-node-head:hover, .flow-node-head.active { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.flow-ref { align-self: flex-start; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.flow-ref:hover { color: var(--brand-ink); text-decoration: underline; }
.flow-root { display: flex; flex-direction: column; gap: 10px; }
.flow-root + .flow-root { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Atendimentos: people waiting for the team come first */
.chat-item.requested { box-shadow: inset 3px 0 0 var(--danger); }
.request-banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--danger-soft); color: var(--text); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.request-banner > svg { color: var(--danger); flex: none; }
.request-banner div div { color: var(--text-2); }
.team-requests.waiting { border-color: var(--danger); }
.nav-item .badge-count { background: var(--danger); color: #fff; }

/* Atendimentos: attachments, voice notes and media in the thread */
.bubble audio { display: block; width: 240px; max-width: 100%; margin-top: 4px; }
.bubble video { display: block; max-width: 260px; border-radius: 8px; margin-top: 4px; }
.attach-preview { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.attach-preview img, .attach-preview video { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.attach-preview audio { width: 220px; }
.attach-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.attach-preview.recording { background: var(--danger-soft); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.chat-compose .icon-btn.active { color: var(--danger); }

/* Menus without a visible scroll bar: the tabs and the sidebar still scroll (touch, wheel, trackpad) when they do not fit */
.tabs { overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; }
.sidebar { scrollbar-width: none; -ms-overflow-style: none; }
.sidebar::-webkit-scrollbar { display: none; }

/* Ficha do cliente: the case's lines in the spreadsheet, one per month */
.sheet-row { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.sheet-row > summary { cursor: pointer; padding: 9px 12px; font-size: 13.5px; list-style-position: inside; }
.sheet-row[open] > summary { border-bottom: 1px solid var(--line); }
.sheet-cols { padding: 10px 12px; grid-template-columns: minmax(150px, max-content) 1fr; font-size: 13px; }
.sheet-view { position: relative; }
.sheet-view > .btn { position: absolute; top: 8px; right: 10px; }
.sheet-edit { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.sheet-edit textarea { width: 100%; }

/* Guia: one image per benefit */
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.benefit-diagram { overflow-x: auto; }
.benefit-diagram svg { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; box-shadow: var(--shadow-sm); }

/* ---------- Atendimentos: WhatsApp Web look ---------- */
:root {
  --wa-panel: #ffffff; --wa-head: #f0f2f5; --wa-wall: #efeae2; --wa-dots: rgba(0, 0, 0, 0.045);
  --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-bot: #e7f3ff; --wa-note: #fff6c7; --wa-text: #111b21; --wa-sub: #667781;
  --wa-green: #00a884; --wa-unread: #25d366; --wa-hover: #f5f6f6; --wa-active: #f0f2f5; --wa-line: #e9edef;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --wa-panel: #111b21; --wa-head: #202c33; --wa-wall: #0b141a; --wa-dots: rgba(255, 255, 255, 0.03);
    --wa-in: #202c33; --wa-out: #005c4b; --wa-bot: #1d3a52; --wa-note: #3b3416; --wa-text: #e9edef; --wa-sub: #8696a0;
    --wa-hover: #202c33; --wa-active: #2a3942; --wa-line: #222d34;
  }
}
:root[data-theme='dark'] {
  --wa-panel: #111b21; --wa-head: #202c33; --wa-wall: #0b141a; --wa-dots: rgba(255, 255, 255, 0.03);
  --wa-in: #202c33; --wa-out: #005c4b; --wa-bot: #1d3a52; --wa-note: #3b3416; --wa-text: #e9edef; --wa-sub: #8696a0;
  --wa-hover: #202c33; --wa-active: #2a3942; --wa-line: #222d34;
}
.wa {
  display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 64px - 56px); min-height: 520px;
  background: var(--wa-panel); color: var(--wa-text); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative;
}
.wa.with-info { grid-template-columns: 360px minmax(0, 1fr) 320px; }
.wa .muted, .wa small.muted { color: var(--wa-sub); }
.wa .icon-btn { color: var(--wa-sub); }
.wa .icon-btn.on { background: var(--wa-active); color: var(--wa-green); }

.wa-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--wa-line); }
.wa-list-head { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 9px; border-bottom: 1px solid var(--wa-line); }
.wa-channel { width: auto; max-width: 170px; padding: 5px 8px; font-size: 12.5px; border-radius: 8px; background: var(--wa-head); border-color: transparent; color: var(--wa-text); }
.wa-search { display: flex; align-items: center; gap: 8px; background: var(--wa-head); border-radius: 9px; padding: 0 6px 0 12px; color: var(--wa-sub); }
.wa-search input { border: 0; background: transparent; padding: 8px 0; box-shadow: none; color: var(--wa-text); }
.wa-search input:focus { outline: none; box-shadow: none; }
.wa-chips { display: flex; gap: 5px; flex-wrap: nowrap; padding-top: 6px; margin: 0 -6px; }
.wa-chip { border: 1.5px solid color-mix(in srgb, var(--wa-sub) 45%, transparent); background: var(--wa-panel); color: var(--wa-text); border-radius: 99px; padding: 6px 12px 6px 7px; font-size: 12px; font-weight: 600; position: relative; cursor: pointer; transition: background .15s, border-color .15s;
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.wa-chip svg { flex-shrink: 0; }
.wa-chip-label { overflow: hidden; text-overflow: ellipsis; }
.wa-chip-count { position: absolute; top: -8px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--wa-sub); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--wa-panel); }
.wa-chip.on .wa-chip-count { background: #00513f; }
.wa-chip.alert .wa-chip-count { background: var(--danger); }
.wa-chip:hover { border-color: var(--wa-green); }
.wa-chip.on { background: #008069; border-color: #008069; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.wa-items { flex: 1; overflow-y: auto; }
.wa-item { display: flex; gap: 12px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--wa-line); }
.wa-item:hover { background: var(--wa-hover); }
.wa-item.active { background: var(--wa-active); }
.wa-item.requested { box-shadow: inset 3px 0 0 var(--danger); }
.wa-item-top, .wa-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-item-top strong { font-weight: 600; font-size: 14.5px; }
.wa-item-top small { color: var(--wa-sub); font-size: 11.5px; flex: none; }
.wa-item-top small.unread { color: var(--wa-unread); font-weight: 600; }
.wa-item-bottom { color: var(--wa-sub); font-size: 13px; }
.wa-unread { flex: none; background: var(--wa-unread); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; }
.wa-item-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.wa-item-tags .badge { font-size: 10.5px; padding: 1px 7px; }

.wa-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--wa-wall); }
.wa-empty { margin: auto; text-align: center; color: var(--wa-sub); max-width: 360px; padding: 24px; }
.wa-empty h3 { color: var(--wa-text); margin: 14px 0 6px; font-weight: 500; font-size: 22px; }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--wa-head); border-bottom: 1px solid var(--wa-line); }
.wa-back { display: none; }
.wa-who { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; cursor: pointer; }
.wa-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.wa-req { display: block; color: var(--danger); font-weight: 600; font-size: 11.5px; }
.wa-find { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--wa-panel); border-bottom: 1px solid var(--wa-line); color: var(--wa-sub); }
.wa-find input { border: 0; background: transparent; padding: 5px 0; box-shadow: none; color: var(--wa-text); }
.wa-find input:focus { outline: none; box-shadow: none; }
.wa-messages {
  flex: 1; overflow-y: auto; padding: 14px 7%; display: flex; flex-direction: column; gap: 3px;
  background-color: var(--wa-wall); background-image: radial-gradient(var(--wa-dots) 1.2px, transparent 1.2px); background-size: 16px 16px;
}
.wa-day { align-self: center; margin: 10px 0 6px; }
.wa-day span { background: var(--wa-in); color: var(--wa-sub); font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); text-transform: uppercase; letter-spacing: 0.02em; }
.wa-activity { align-self: center; font-size: 12px; color: var(--wa-sub); background: var(--wa-in); padding: 3px 10px; border-radius: 8px; margin: 4px 0; opacity: 0.85; }
.wa-msg {
  position: relative; max-width: 65%; padding: 6px 9px 18px; border-radius: 8px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); color: var(--wa-text); margin-top: 4px; min-width: 90px;
}
.wa-msg.in { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 0; }
.wa-msg.out { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 0; }
.wa-msg.out.bot { background: var(--wa-bot); }
.wa-msg.note { align-self: flex-end; background: var(--wa-note); border: 1px dashed color-mix(in srgb, var(--wa-sub) 50%, transparent); font-size: 13px; }
.wa-sender { font-size: 12px; font-weight: 600; color: var(--wa-green); margin-bottom: 2px; }
.wa-msg.note .wa-sender { color: var(--warn); }
.wa-text { white-space: pre-wrap; word-wrap: break-word; }
.wa-text mark { background: #ffd54f; color: #111b21; border-radius: 3px; padding: 0 1px; }
.wa-time { position: absolute; right: 8px; bottom: 3px; font-size: 11px; color: var(--wa-sub); }
.wa-msg img { max-width: 280px; width: 100%; border-radius: 6px; display: block; margin-bottom: 4px; }
.wa-msg video { max-width: 280px; width: 100%; border-radius: 6px; display: block; margin-bottom: 4px; }
.wa-msg audio { display: block; width: 260px; max-width: 100%; margin-bottom: 2px; }
.wa-transcribe { border: 0; background: transparent; color: var(--wa-green); font-size: 12.5px; font-weight: 600; padding: 2px 0 4px; cursor: pointer; }
.wa-transcribe:disabled { color: var(--wa-sub); cursor: default; }
.wa-transcript { font-size: 13px; font-style: italic; color: var(--wa-text); opacity: 0.85; border-left: 2px solid var(--wa-green); padding-left: 8px; margin: 2px 0 4px; white-space: pre-wrap; }
.wa-file { display: flex; align-items: center; gap: 9px; padding: 9px 10px; background: color-mix(in srgb, var(--wa-sub) 12%, transparent); border-radius: 6px; color: var(--wa-text); margin-bottom: 4px; max-width: 260px; }
.wa-down {
  position: absolute; right: 22px; bottom: 82px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--wa-in); color: var(--wa-sub); box-shadow: 0 2px 6px rgba(11, 20, 26, 0.2); display: grid; place-items: center; z-index: 3;
}
.wa-down svg { transform: rotate(90deg); }
.wa-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; padding: 10px 12px; background: var(--wa-head); border-top: 1px solid var(--wa-line); max-height: 170px; overflow-y: auto; }
.wa-emojis button { border: 0; background: transparent; font-size: 22px; padding: 4px; border-radius: 8px; cursor: pointer; }
.wa-emojis button:hover { background: var(--wa-active); }
.wa-compose { display: flex; align-items: flex-end; gap: 6px; padding: 8px 12px; background: var(--wa-head); }
.wa-compose.note { background: var(--wa-note); }
.wa-compose textarea {
  flex: 1; min-height: 42px; max-height: 140px; resize: none; border: 0; border-radius: 9px; padding: 10px 13px; background: var(--wa-panel); color: var(--wa-text); box-shadow: none;
}
.wa-compose textarea:focus { outline: none; box-shadow: none; }
.wa-compose .icon-btn { padding: 9px; }
.wa-note-toggle { border: 0; background: transparent; color: var(--wa-sub); font-size: 12px; font-weight: 600; padding: 9px 6px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.wa-note-toggle.on { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.wa-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--wa-green); color: #fff; display: grid; place-items: center; cursor: pointer; }
.wa-send:disabled { opacity: 0.6; cursor: default; }
.wa-send.rec { background: var(--danger); }
.wa-thread .attach-preview { background: var(--wa-head); border-top: 1px solid var(--wa-line); }
.wa-thread .request-banner { padding: 7px 14px; font-size: 13px; }
.wa-info { border-left: 1px solid var(--wa-line); padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: var(--wa-panel); }

@media (max-width: 1100px) {
  .wa { grid-template-columns: 360px minmax(0, 1fr); }
  .wa.with-info { grid-template-columns: 360px minmax(0, 1fr); }
  .wa-info { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; z-index: 5; box-shadow: var(--shadow-lg); }
  .wa-messages { padding: 12px 4%; }
  .wa-msg { max-width: 80%; }
}
@media (max-width: 860px) {
  .wa, .wa.with-info { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 64px - 36px); border-radius: 0; }
  .wa-actions .wa-label { display: none; }
  .wa-actions { flex-wrap: nowrap; gap: 2px; }
  .wa-head { padding: 6px 8px; gap: 6px; }
  .wa-thread .request-banner { flex-wrap: wrap; }
  .wa-msg { max-width: 88%; }
  .wa.has-chat .wa-list { display: none; }
  .wa:not(.has-chat) .wa-thread { display: none; }
  .wa-back { display: inline-grid; }
  .wa-info { width: 100%; }
  .wa-actions .btn { padding: 6px 8px; }
}

/* Registration form (client-form.js) */
.client-form .field.span-2 { grid-column: span 2; }
.client-toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.client-toggle { align-items: flex-start; flex: 1; min-width: 240px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.client-toggle input { margin-top: 3px; }
/* On the phone: two columns, long fields (names, address) across */
.client-form.compact { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.client-form.compact .form-section, .client-form.compact .client-toggles, .client-form.compact .field.span-2, .client-form.compact .field.span-all { grid-column: 1 / -1; }
.client-form.compact .field { min-width: 0; }
.client-form.compact .field-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-form.compact .form-section { margin-top: 10px; }
@media (max-width: 720px) { .client-form .field.span-2 { grid-column: 1 / -1; } }
.client-form .client-toggles { grid-column: 1 / -1; }

/* Novo cliente: the sections on top, green when most of each is filled */
.client-nav { grid-column: 1 / -1; position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-body .client-nav { top: -22px; margin-top: -10px; }
.client-nav button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.client-nav button:hover { border-color: var(--brand); color: var(--brand); }
.client-nav button small { font-size: 11px; font-weight: 500; opacity: 0.75; }
.client-nav button.most { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.client-nav button.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.client-form .form-section[data-sec] { scroll-margin-top: 64px; }

/* Serviço advocatício: the areas */
.area-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.area-tabs button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); }
.area-tabs button:hover { border-color: var(--brand); color: var(--brand); }
.area-tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.area-tabs .count { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.area-tabs button.active .count { background: rgba(255, 255, 255, 0.2); color: #fff; }
@media (max-width: 1100px) { .area-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .area-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Novo processo: areas and types as tiles, causes as chips */
.pf-section { display: flex; align-items: center; gap: 6px; }
.pf-tiles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pf-tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pf-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.pf-tile:hover { border-color: var(--brand); }
.pf-tile strong { display: block; font-size: 14px; }
.pf-tile small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.pf-tile-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.pf-tile.active { border-color: var(--brand); background: var(--brand-soft); }
.pf-tile.active .pf-tile-icon { background: var(--brand); color: #fff; }
.pf-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.pf-chip:hover { border-color: var(--brand); color: var(--brand); }
.pf-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.process-form .client-toggles, .process-form small.span-all { grid-column: 1 / -1; }
.process-form .field.span-2 { grid-column: span 2; }
@media (max-width: 720px) { .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .process-form .field.span-2 { grid-column: 1 / -1; } }

/* Novo processo (page): the form and, beside it, what was chosen */
.np-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.np-side { position: sticky; top: 84px; }
.np-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.np-steps li { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.np-steps li > div { min-width: 0; flex: 1; font-size: 13.5px; }
.np-steps small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.np-dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; margin-top: 4px; }
.np-steps li.ok .np-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (max-width: 1100px) { .np-layout { grid-template-columns: 1fr; } .np-side { position: static; } }

/* Pickers (cliente, causa) */
.pk-search { width: 100%; margin-bottom: 12px; }
.pk-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.pk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pk-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.pk-row.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink, var(--brand)); }
.pk-row strong { display: block; font-size: 14px; }
.pk-row small { display: block; font-size: 12.5px; }
.pk-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
.pk-other { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.pk-field { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.pk-field:hover { border-color: var(--brand); }
.pk-field.filled { border-style: solid; border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.pk-field.filled .pk-icon { background: var(--brand); color: #fff; }
.pk-change { font-size: 13px; font-weight: 600; color: var(--brand); }
.pk-field.locked { cursor: default; }
.pk-field.span-all { grid-column: 1 / -1; }

/* Processos › Serviço advocatício: the areas under the menu button */
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 30px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.12); }
.nav-sub a { padding: 6px 10px; border-radius: 8px; font-size: 13.5px; color: #aab6cc; }
.nav-sub a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.nav-sub a.active { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 600; }
.shell.compact .sidebar:not(:hover) .nav-sub { display: none; }

/* Serviço advocatício: the areas as big buttons */
.nav-sub { display: none; }
.area-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.area-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.area-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.area-card-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.area-card strong { font-size: 18px; }
.area-card small { color: var(--muted); font-size: 13px; }
.area-card-stats { display: flex; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); width: 100%; font-size: 12px; color: var(--muted); }
.area-card-stats b { display: block; font-size: 18px; color: var(--text); }
.area-card-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--brand); }
@media (max-width: 1100px) { .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .area-grid { grid-template-columns: 1fr; } }

/* Serviço advocatício: filters */
.flt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.flt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink, var(--brand)); font-size: 13px; font-weight: 600; }
.flt-chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.flt-chip button:hover { background: rgba(0, 0, 0, 0.08); }
.flt-clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; padding: 9px 6px; border: 0; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.active { background: var(--brand); color: #fff; font-weight: 600; }

/* Processos › Específicos: the benefits */
.benefit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.benefit-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); }
.benefit-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.benefit-item:hover .pk-icon { background: var(--brand); color: #fff; }
@media (max-width: 800px) { .benefit-list { grid-template-columns: 1fr; } }

/* Específicos › Salário-maternidade: Gestante / Nasceu */
.mat-groups { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.mat-group { display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; min-width: 210px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); }
.mat-group strong { display: block; font-size: 16px; }
.mat-group small { display: block; color: var(--muted); font-size: 12px; }
.mat-group:hover { border-color: var(--brand); }
.mat-group.active { border-color: var(--brand); background: var(--brand-soft); }
.mat-group.active .pf-tile-icon { background: var(--brand); color: #fff; }
.mat-note { display: block; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* Novo cliente: documents chosen; Ficha › pasta no Drive */
.doc-picked { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 6px 6px 6px 10px; border-radius: 99px; background: var(--surface-3); font-size: 13px; }
.doc-chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.drive-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.drive-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }

/* Ficha › Documentos: survey */
.survey { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.survey-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.survey-item:last-child { border-bottom: 0; }
@media (max-width: 800px) { .survey { grid-template-columns: 1fr; } }

/* Separar PDF por página */
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-ink); font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.pdf-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pdf-page { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.pdf-page.done { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.pdf-page.ignored { opacity: 0.55; }
.pdf-page select { width: 100%; font-size: 13px; }
.pdf-page-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.pdf-thumb { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; background: #fff; }
.pdf-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pdf-group { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); }
.pdf-group.pending { background: var(--gold-soft); color: var(--text); }
.pdf-zoom { position: fixed; inset: 0; z-index: 200; background: rgba(10, 14, 24, 0.82); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; overflow-y: auto; }
.pdf-zoom-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; background: var(--surface); color: var(--text); border-radius: 12px; padding: 8px 12px; }
.pdf-zoom .pdf-thumb { cursor: default; }

/* Atendimentos: painel lateral */
.wa-summary { font-size: 13px; line-height: 1.5; white-space: pre-wrap; background: var(--surface); border: 1px solid var(--wa-line); border-radius: 10px; padding: 10px 12px; }
.wa-docs { display: flex; flex-direction: column; gap: 6px; }
.wa-doc { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--wa-line); }
.wa-doc a.grow { min-width: 0; color: inherit; }
.wa-doc small { display: block; color: var(--muted); font-size: 11.5px; }
.wa-msg.in .wa-sender { color: var(--brand-ink); }

/* Leads em lista */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.view-toggle button.on { background: var(--brand-soft); color: var(--brand-ink); }
.lead-progress { width: 80px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; flex-shrink: 0; }
.lead-progress span { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.ok-text { color: var(--ok); font-weight: 600; }

/* Documentos do processo: marcar qual documento é cada arquivo */
.doc-picked-list { display: flex; flex-direction: column; gap: 10px; }
.doc-picked-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.doc-marks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.doc-mark { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 12.5px; cursor: pointer; background: var(--surface-2); }
.doc-mark input { margin: 0; }
.doc-mark.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

/* Documentos do SysproJud (model-docs.js) */
.md-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; }
.md-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.md-title { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; color: var(--muted); }
.md-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.md-item .btn { justify-content: flex-start; width: 100%; text-align: left; white-space: normal; }
.md-item.off .btn { opacity: .55; }
.md-item small { font-size: 11.5px; line-height: 1.3; padding-left: 4px; }
.md-missing { color: var(--warn); }
.md-gender { align-items: center; margin: 0 0 14px; gap: 10px; flex-wrap: wrap; }

/* Sistema financeiro (case-finance.js, finance.js) */
.cf-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cf-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.cf-stat > small:first-child { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.cf-stat strong { font-size: 17px; }
.cf-stat strong.warn { color: var(--warn); }
.cf-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cf-head small { font-size: 12px; }
.cf-table td, .cf-table th { font-size: 13px; }
.cf-date { width: 150px; padding: 4px 6px; font-size: 13px; }
.cf-empty { margin: 4px 0 8px; font-size: 13px; }
.cf-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.cf-add .field { min-width: 140px; flex: 1 1 140px; margin: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

/* Financeiro › Visão geral (finance.js) */
.fin-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
a.card.fin-group, a.card.stat { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.card.fin-group:hover, a.card.stat:hover { border-color: var(--line-strong, var(--line)); box-shadow: 0 4px 14px rgba(15, 23, 42, .07); }
.fin-kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13.5px; }
.fin-kv span { color: var(--muted); }
.fin-list { display: flex; flex-direction: column; }
.fin-line { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.fin-line:last-child { border-bottom: 0; }
.fin-line:hover { background: var(--surface-2); }
.fin-line strong { font-size: 13.5px; }
.fin-line small { font-size: 12px; }
.fin-date { font-size: 12.5px; color: var(--muted); width: 78px; flex: none; }
.fin-more { display: block; padding: 10px 4px 0; font-size: 13px; }

/* =====================================================================================================
   Identidade visual (2026-11): a mesa de trabalho de um escritório previdenciário.
   Tinta azul-marinho (marca do escritório), caneta azul nas ações (a caneta da assinatura da procuração),
   fundo cinza-papel de formulário, situações como carimbos e a página atual como a aba de uma pasta de processo.
   Public Sans na interface; Source Serif 4 nos títulos de página, como os documentos jurídicos.
   Esta camada vem por último: os mesmos seletores de cima, com os valores novos.
   ===================================================================================================== */
:root {
  --bg: #eceeea;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --surface-3: #e9ebe6;
  --line: #dde0d9;
  --line-strong: #c9cdc4;
  --text: #15213f;
  --text-2: #4a5468;
  --muted: #7b8496;
  --brand: #1d3fae;
  --brand-hover: #16328c;
  --brand-soft: #e8edfa;
  --brand-ink: #1d3fae;
  --gold: #b98a2e;
  --gold-soft: #f6efe0;
  --sidebar: #15213f;
  --sidebar-2: #15213f;
  --sidebar-text: #aab3c8;
  --ok: #1d6b45;
  --ok-soft: #e6f2ea;
  --warn: #8f5a07;
  --warn-soft: #f8efdd;
  --danger: #a5291f;
  --danger-soft: #f9e8e6;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(21, 33, 63, 0.06);
  --shadow-lg: 0 18px 40px -14px rgba(21, 33, 63, 0.35);
  --radius: 10px;
  --radius-sm: 7px;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #10141c; --surface: #171c27; --surface-2: #1b2130; --surface-3: #222938; --line: #2a3142; --line-strong: #364056;
    --text: #e6e9f0; --text-2: #b4bccc; --muted: #828ba0; --brand: #7d98f2; --brand-hover: #98aef6; --brand-soft: #1e2847; --brand-ink: #9fb3f6;
    --gold: #d2a64e; --gold-soft: #2b2416; --sidebar: #0b0f17; --sidebar-2: #0b0f17; --ok: #5cc28c; --ok-soft: #13271c;
    --warn: #e3a64a; --warn-soft: #2c2312; --danger: #ee7d72; --danger-soft: #2e1817;
  }
}
:root[data-theme='dark'] {
  --bg: #10141c; --surface: #171c27; --surface-2: #1b2130; --surface-3: #222938; --line: #2a3142; --line-strong: #364056;
  --text: #e6e9f0; --text-2: #b4bccc; --muted: #828ba0; --brand: #7d98f2; --brand-hover: #98aef6; --brand-soft: #1e2847; --brand-ink: #9fb3f6;
  --gold: #d2a64e; --gold-soft: #2b2416; --sidebar: #0b0f17; --sidebar-2: #0b0f17; --ok: #5cc28c; --ok-soft: #13271c;
  --warn: #e3a64a; --warn-soft: #2c2312; --danger: #ee7d72; --danger-soft: #2e1817;
}

body { font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.5; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Menu: tinta lisa; a página atual é a aba de uma pasta encaixada no conteúdo ---------- */
.sidebar { background: var(--sidebar); padding: 20px 0 16px 12px; }
.brand { padding: 4px 18px 20px 8px; }
.brand-mark { background: var(--gold); color: #1c1405; box-shadow: none; border-radius: 9px; }
.brand strong { font-family: var(--serif); font-size: 16.5px; font-weight: 600; letter-spacing: 0; }
.nav-group { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: #7d88a3; padding: 16px 10px 5px; }
.nav-item { position: relative; margin-right: 12px; border-radius: 8px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); }
.nav-item.active {
  margin-right: 0; background: var(--bg); color: var(--text); font-weight: 650; box-shadow: none;
  border-radius: 9px 0 0 9px; padding-right: 22px;
}
.nav-item.active .icon { color: var(--gold); }
.nav-item.active::before, .nav-item.active::after { content: ''; position: absolute; right: 0; width: 12px; height: 12px; pointer-events: none; }
.nav-item.active::before { top: -12px; background: radial-gradient(circle at 0 0, transparent 11.5px, var(--bg) 12px); }
.nav-item.active::after { bottom: -12px; background: radial-gradient(circle at 0 100%, transparent 11.5px, var(--bg) 12px); }
.sidebar-foot { margin-right: 12px; }

/* ---------- Página ---------- */
.topbar { background: var(--bg); border-bottom-color: transparent; }
.page-header { margin-bottom: 20px; align-items: flex-end; }
.page-header h1 { font-family: var(--serif); font-size: 29px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.15; }
.page-header p { max-width: 72ch; margin-top: 6px; }

/* ---------- Superfícies: papel com borda fina; o raio diminui com o tamanho ---------- */
.card { border-color: var(--line); box-shadow: none; border-radius: var(--radius); }
.card-head h3 { font-size: 15px; font-weight: 650; }
.stats { gap: 12px; }
.stat { padding: 16px 18px; gap: 6px; }
.stat .stat-top { font-size: 13px; color: var(--text-2); font-weight: 550; }
.stat .stat-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); }
.stat.gold .stat-icon { background: var(--gold-soft); color: var(--gold); }
.stat .stat-value { font-size: 23px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
/* Valores grandes em cartões estreitos (Painel) não podem ser cortados */
.stats .stat { container-type: inline-size; }
@container (max-width: 190px) { .stat .stat-value { font-size: 19px; } }
.stat.gold { border-top: 3px solid var(--gold); }

/* Rótulos em letra normal, só mais escuros (sem caixa alta) */
.table th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }
.form-section { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 650; color: var(--text); border-bottom: 1px solid var(--line); }
.field-label { color: var(--text-2); }
.md-title, .cf-stat > small:first-child, .np-steps small, .flow-tag { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text-2); }

/* ---------- Ações: a caneta azul ---------- */
.btn { border-radius: 7px; font-weight: 600; }
.btn.primary { background: var(--brand); box-shadow: none; }
.btn.gold { background: var(--gold); color: #1c1405; }
.btn.secondary { border-color: var(--line-strong); }
input, select, textarea { border-radius: 7px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.tabs button.active { color: var(--text); border-bottom-color: var(--brand); }
.tabs .count { border-radius: 4px; }
.search input { background: var(--surface); }

/* ---------- Situações como carimbo: borda na cor, fundo claro, canto pequeno ---------- */
.badge { border-radius: 4px; padding: 1px 8px; border: 1px solid currentColor; background: transparent; font-weight: 650; letter-spacing: 0.01em; }
.badge.green { color: var(--ok); background: var(--ok-soft); }
.badge.red { color: var(--danger); background: var(--danger-soft); }
.badge.amber { color: var(--warn); background: var(--warn-soft); }
.badge.gold { color: #7a5a17; background: var(--gold-soft); }
.badge.blue { color: var(--brand); background: var(--brand-soft); }
:root[data-theme='dark'] .badge.gold { color: var(--gold); }

/* ---------- Avisos, janelas, vazios ---------- */
.callout { border-radius: 8px; border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.callout.gold { border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.modal { border-radius: 12px; }
.empty-icon { border-radius: 10px; }
.column { border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Entrada: tinta lisa, título em serifa e um carimbo de "Deferido", o que todo cliente espera ver no processo */
.login-art { background: var(--sidebar); }
.login-art::after { display: none; }
.login-art .brand { padding: 0; }
.login-copy { position: relative; max-width: 500px; }
.login-art h2 { font-family: var(--serif); font-size: 40px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; max-width: 480px; }
.login-art p { color: #b3bccf; font-size: 15.5px; max-width: 440px; margin-top: 16px; }
.login-stamp {
  display: inline-block; margin-bottom: 28px; padding: 6px 16px 5px; transform: rotate(-6deg); transform-origin: left center;
  border: 3px double var(--gold); border-radius: 6px; color: var(--gold); font-weight: 700; font-size: 19px; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.92;
}
.login-form h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; }
@media (max-width: 860px) {
  .login-art h2 { font-size: 30px; }
  .login-stamp { font-size: 15px; margin-bottom: 18px; }
}

/* Financeiro: the options under each kind of process (Parcelas, Honorários e financeiro, Restituições / Retroativos) */
.fin-sub { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 4px 20px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.12); }
.fin-sub a { padding: 4px 10px; border-radius: 7px; font-size: 12.5px; color: #8f9cb5; }
.fin-sub a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.fin-sub a.active { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 600; }
.shell.compact .sidebar:not(:hover) .fin-sub { display: none; }

/* Serviço advocatício: the plain list of actions when a client is clicked */
.act-list { display: flex; flex-direction: column; }
.act-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 6px; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.act-item:last-child { border-bottom: 0; }
.act-item:hover { background: var(--surface-2); }
.act-item:disabled { opacity: .6; cursor: default; }
.act-item svg { color: var(--muted, #64748b); flex: none; }
.act-gender { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }


/* Editar processo: the tabs of the page on top */
.pe-tabs .tabs { margin-bottom: 0; }

/* Atendimentos: documents the client sent, waiting for the team to confirm what they are */
.wa-doc-pending { width: 100%; font: inherit; font-size: 13px; color: inherit; cursor: pointer; border: 1px solid var(--warn, #d97706); background: var(--surface); }
.wa-doc-pending:hover { background: var(--surface-2); }
.doc-review { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
.doc-review-view { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; min-height: 420px; display: flex; align-items: center; justify-content: center; overflow: auto; }
.doc-review-view img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.doc-review-view iframe { width: 100%; height: 70vh; border: 0; }
@media (max-width: 760px) { .doc-review { grid-template-columns: 1fr; } .doc-review-view { min-height: 260px; } }
.doc-review-view .pdf-pages { display: flex; flex-direction: column; gap: 10px; padding: 10px; align-self: flex-start; max-height: 70vh; overflow: auto; }
.doc-review-view .pdf-pages canvas { max-width: 100%; height: auto !important; box-shadow: 0 1px 4px rgba(0,0,0,.15); cursor: default; }
/* Analisar documento: what it is (the benefit's documents) and its data */
.doc-review-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dr-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dr-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); font: inherit; font-size: 13px; color: inherit; text-align: left; cursor: pointer; }
.dr-opt:last-child { border-bottom: 0; }
.dr-opt:hover { background: var(--surface-2); }
.dr-opt.on { background: var(--brand-soft, #e8eef8); font-weight: 600; }
.dr-box { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--line-strong, #94a3b8); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
.dr-opt.on .dr-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.dr-got { color: var(--success, #15803d); font-size: 11px; font-weight: 600; white-space: nowrap; }
.dr-other { margin-top: 6px; font-size: 13px; }
.dr-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.dr-fields .field:first-child { grid-column: 1 / -1; }
.doc-review { grid-template-columns: minmax(0, 1fr) 320px; }
/* Analisar documento: a PDF with several pages, each with what it is */
.doc-review-view.multi { display: block; align-items: stretch; max-height: 72vh; }
.pdf-marker { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 12px; }
.pdf-marker .pdf-page { display: flex; flex-direction: column; gap: 6px; }
.pdf-marker .pdf-page canvas { max-width: 100%; height: auto !important; cursor: zoom-in; }
.pdf-marker select { width: 100%; font-size: 13px; }

/* Full-screen modal (Analisar documento): the document on the left with zoom, what it is and its data on the right */
.overlay:has(.modal.full) { padding: 12px; }
.modal.full { width: 100%; height: calc(100vh - 24px); max-height: none; }
.modal.full .modal-body { flex: 1; min-height: 0; overflow: hidden; padding: 0; }
.modal.full .doc-review { height: 100%; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; }
.modal.full .dr-viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); border-right: 1px solid var(--line); }
.dr-zoom { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.dr-zoom .icon-btn { font-size: 18px; font-weight: 700; width: 32px; height: 32px; }
.dr-zoom-val { min-width: 58px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.dr-zoom small { margin-left: 8px; font-size: 12px; }
.modal.full .doc-review-view { flex: 1; min-height: 0; max-height: none; display: block; overflow: auto; border: 0; border-radius: 0; background: transparent; padding: 16px; text-align: center; }
.modal.full .doc-review-view img { max-width: none; max-height: none; height: auto; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.modal.full .doc-review-view .pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: none; overflow: visible; padding: 0; }
.modal.full .doc-review-view .pdf-pages canvas { max-width: none; }
.modal.full .pdf-marker { padding: 0; text-align: left; }
.modal.full .pdf-marker .pdf-page canvas { max-width: none; }
.modal.full .doc-review-side { overflow-y: auto; padding: 18px; gap: 8px; }
.modal.full .dr-fields { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) {
  .modal.full .doc-review { grid-template-columns: 1fr; grid-template-rows: 55% 45%; }
  .modal.full .dr-viewer { border-right: 0; border-bottom: 1px solid var(--line); }
}
/* Analisar documento, one page at a time */
.dr-zoom { gap: 14px; }
.dr-tool { display: flex; align-items: center; gap: 4px; padding-right: 14px; border-right: 1px solid var(--line); }
.dr-tool:last-child { border-right: 0; }
.dr-page { font-size: 13px; min-width: 104px; text-align: center; }
.modal.full .doc-review-view { display: flex; align-items: flex-start; }
.modal.full .doc-review-view > * { margin: auto; }
.doc-page-canvas { display: block; flex: none; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .2); }
.dr-pages { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-height: 220px; overflow-y: auto; }
.dr-pg { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12.5px; color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.dr-pg:last-child { border-bottom: 0; }
.dr-pg strong { width: 22px; flex: none; color: var(--text-2); }
.dr-pg.cur { background: var(--brand-soft, #e8eef8); box-shadow: inset 3px 0 0 var(--brand); }
.dr-pg.blank span { color: var(--warn, #b45309); }
.dr-pg.ign span { color: var(--muted); text-decoration: line-through; }
/* The right column scrolls as a whole: its blocks keep their height (the list was squeezed to nothing) */
.modal.full .doc-review-side > * { flex-shrink: 0; }
.modal.full .doc-review-side .dr-list { overflow: visible; }
.dr-fields .field-label { display: flex; align-items: center; gap: 6px; }
.dr-rm { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.dr-rm:hover { color: var(--danger); }
/* Analisar documento: page | what it is | its data. The page zooms with the wheel and moves by dragging */
.modal.full .doc-review.three { grid-template-columns: minmax(0, 1fr) 290px 360px; }
.modal.full .dr-stagebox { position: relative; overflow: hidden; display: block; padding: 0; cursor: grab; touch-action: none; user-select: none; }
.modal.full .dr-stagebox:active { cursor: grabbing; }
.dr-stage { position: absolute; left: 50%; top: 50%; will-change: transform; }
.dr-stage .doc-page-canvas { pointer-events: none; }
.modal.full .dr-kind { display: flex; flex-direction: column; gap: 8px; padding: 18px; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); }
.modal.full .dr-kind > * { flex-shrink: 0; }
.modal.full .dr-kind .dr-list { overflow: visible; }
.modal.full .doc-review-side { display: flex; flex-direction: column; }
.dr-nav { position: sticky; bottom: -18px; margin: 12px -18px -18px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border-top: 1px solid var(--line); }
.dr-nav strong { font-size: 13px; white-space: nowrap; }
.dr-nav .btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1100px) {
  .modal.full .doc-review.three { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto; }
  .modal.full .doc-review.three .dr-viewer { grid-row: span 2; }
}
@media (max-width: 860px) {
  .modal.full .doc-review.three { grid-template-columns: 1fr; grid-template-rows: 50vh auto auto; overflow-y: auto; }
  .modal.full .doc-review.three .dr-viewer { grid-row: auto; }
}

/* SysproJud client search (Atendimento) */
.sp-search { border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; background: var(--surface); margin-bottom: 10px; }
.sp-results { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.sp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.sp-item:hover { background: var(--surface-3); }
.sp-kv { grid-template-columns: 130px 1fr; }
.sp-form { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.sp-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; grid-column: 1 / -1; padding-top: 4px; }
.sp-check input { width: auto; }
.sp-procs { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.sp-proc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.sp-obs { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--gold-soft); border-left: 3px solid var(--gold); font-size: 13.5px; white-space: pre-wrap; display: flex; flex-direction: column; gap: 4px; }
/* "Criar cliente" side panel: chat on one side, form on the other */
.wa.with-side { grid-template-columns: 360px minmax(0, 1fr) minmax(420px, 32%); }
/* Narrower chat while the panel is open: header buttons show only their icons */
.wa.with-side .wa-actions .wa-label { display: none; }
.wa-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--wa-line); background: var(--wa-panel); }
.sp-side-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--wa-head); border-bottom: 1px solid var(--wa-line); min-height: 60px; }
.sp-side-body { flex: 1; overflow-y: auto; padding: 16px; }
.sp-side-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--wa-line); background: var(--wa-panel); }
.sp-create .sp-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.sp-create .sp-form .field.span-2 { grid-column: 1 / -1; }
@media (max-width: 1400px) {
  /* the conversations stay visible next to the form (narrower columns) */
  .wa.with-side { grid-template-columns: 290px minmax(0, 1fr) minmax(360px, 34%); }
}
@media (max-width: 860px) {
  .wa.with-side { grid-template-columns: minmax(0, 1fr); }
  .wa.with-side .wa-side { position: absolute; inset: 0; z-index: 6; }
}
/* Right-click menu on the conversation list */
.ctx-menu { position: fixed; z-index: 50; min-width: 210px; padding: 5px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ctx-menu button:hover:not(:disabled) { background: var(--surface-3); }
.ctx-menu button:disabled { color: var(--muted); cursor: default; }
.wa-item.menu-on { background: var(--wa-hover); }
.sp-cep { padding: 12px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--line); }
.sp-cep input { font-size: 15px; letter-spacing: .5px; }
.sp-cep-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-weight: 600; }
.sp-sep { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); }
.sp-sep.first { border-top: 0; padding-top: 0; }
/* Street suggestions (Criar cliente) */
.sp-street { position: relative; }
.sp-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 4px; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; }
.sp-suggest button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sp-suggest button:hover, .sp-suggest button.on { background: var(--surface-3); }
.sp-suggest-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.sp-street-row { display: flex; gap: 8px; align-items: center; position: relative; }
.sp-street-row select { width: 76px; flex-shrink: 0; }
.sp-street-row input { flex: 1; min-width: 0; }
.sp-street-spin { position: absolute; right: 10px; }
/* CPF or full name found in a message: magnifier to search the client */
.wa-hit { text-decoration: underline dotted; text-decoration-color: var(--wa-green); text-underline-offset: 3px; }
.wa-lupa { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 3px; vertical-align: -3px; border: 0; border-radius: 50%; background: var(--wa-green); color: #fff; cursor: pointer; padding: 0; }
.wa-lupa:hover { filter: brightness(1.1); transform: scale(1.08); }
/* Conexões: kind of a WhatsApp number (Parceiro / Escritório) */
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-pick button { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.kind-pick button span { display: flex; flex-direction: column; gap: 2px; }
.kind-pick button small { color: var(--muted); font-size: 12px; }
.kind-pick button.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.kind-pick button.on svg { color: var(--brand); }
.conn-chips .wa-chip { flex: 0 0 auto; }
.conn-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
@media (max-width: 560px) { .kind-pick { grid-template-columns: 1fr; } }
/* Categoria (Comercial / Justiça): transfer menu in the chat header */
.cat-wrap { position: relative; display: inline-flex; }
.cat-menu { position: absolute; top: calc(100% + 6px); right: 0; left: auto; }
/* Grupos: analysis cards and the general chat */
.grp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.grp-card.alert { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.grp-sec ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.grp-sec li.done { color: var(--text-2); }
.grp-sec .field-label { display: flex; align-items: center; gap: 5px; }
.grp-chat { display: flex; flex-direction: column; height: calc(100vh - 290px); min-height: 420px; }
.shell.compact .grp-chat { height: calc(100vh - 100px); }
.shell.compact .tabs { margin-bottom: 14px; }
.grp-msgs { flex: 1; overflow-y: auto; padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.grp-msg { max-width: 78%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; }
.grp-msg.out { align-self: flex-end; background: var(--brand-soft); }
.grp-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.grp-tag { border: 1.5px solid; border-radius: 99px; background: transparent; padding: 1px 8px; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.grp-text { white-space: pre-wrap; font-size: 14px; }
.grp-img { max-width: 240px; max-height: 240px; border-radius: 8px; display: block; }
@media (max-width: 560px) { .grp-grid { grid-template-columns: 1fr; } .grp-msg { max-width: 92%; } }
.wa-filters .wa-channel { flex: 1 1 0; max-width: none; min-width: 0; }
/* PDF in a chat: open, rename, split */
.wa-pdf { display: flex; flex-direction: column; gap: 4px; }
.wa-pdf-open { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--wa-green); color: var(--wa-green); background: transparent; border-radius: 99px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.wa-pdf-open:hover { background: color-mix(in srgb, var(--wa-green) 10%, transparent); }
.pdf-tool-bar { gap: 12px; margin-bottom: 12px; align-items: center; }
.pdf-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.pdf-seg button { border: 0; background: var(--surface); color: var(--text-2); padding: 7px 14px; font: inherit; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pdf-seg button.on { background: var(--brand); color: #fff; }
.pdf-view { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdf-view canvas { box-shadow: var(--shadow); border-radius: 4px; background: #fff; }
.pdf-split-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.pdf-split-pages { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center; }
.pdf-split-page { display: flex; align-items: center; }
.pdf-split-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; }
.pdf-split-thumb canvas { box-shadow: var(--shadow-sm); border: 1px solid var(--line); background: #fff; }
.pdf-split-num { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pdf-cut { width: 28px; height: 28px; border-radius: 50%; border: 1.5px dashed var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; }
.pdf-cut:hover { border-color: var(--danger); color: var(--danger); }
.pdf-cut.on { border-style: solid; border-color: var(--danger); background: var(--danger); color: #fff; }
.pdf-split-parts { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pdf-part { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 860px) { .pdf-split-wrap { grid-template-columns: 1fr; } }
.pdf-tool-bar { padding: 2px 6px 0; }
.pdf-split-thumb { cursor: grab; border-radius: 10px; border: 2px solid transparent; transition: border-color .12s, opacity .12s; }
.pdf-split-thumb.dragging { opacity: .4; }
.pdf-split-thumb.over-before { border-left-color: var(--brand); background: var(--brand-soft); }
.pdf-split-thumb.over-after { border-right-color: var(--brand); background: var(--brand-soft); }
.pdf-move { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.pdf-move button { width: 24px; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text-2); cursor: pointer; padding: 0; font-size: 12px; }
.pdf-move button:disabled { opacity: .35; cursor: default; }
/* PDF tool: fixed toolbar, the pages and the parts list scroll on their own */
.pdf-tool { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.pdf-tool .pdf-tool-bar { flex-shrink: 0; margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.pdf-scroll { overflow-y: auto; min-height: 0; }
.pdf-tool .pdf-view { flex: 1; padding: 18px; background: var(--surface-2); }
.pdf-tool .pdf-split-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; align-items: stretch; }
.pdf-tool .pdf-split-pages { padding: 16px 18px 40px; align-content: flex-start; background: var(--surface-2); }
.pdf-tool .pdf-split-parts { position: static; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 16px; background: var(--surface); }
@media (max-width: 860px) {
  .pdf-tool .pdf-split-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .pdf-tool .pdf-split-parts { border-left: 0; border-top: 1px solid var(--line); max-height: 40vh; }
}
/* Grupos: tabs with the client buttons beside them; "Criar cliente" as a side panel */
.grp-top { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.grp-top .tabs { flex: 1; border-bottom: 0; margin-bottom: 0 !important; }
.grp-top > .row { padding-bottom: 8px; }
.side-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 18, 34, 0.45); display: flex; justify-content: flex-end; animation: fade 0.15s; }
.side-overlay .sp-create { width: min(560px, 100%); height: 100%; box-shadow: var(--shadow-lg); }
@media (max-width: 720px) { .grp-top { flex-direction: column; align-items: stretch; } .grp-top > .row { padding: 0 0 8px; } }
/* Grupos › Chat: the WhatsApp screen below the tabs, "Chat geral" in the right pane */
.shell.compact .wa.in-groups { height: calc(100vh - 92px); }
.wa.in-groups { height: calc(100vh - 64px - 120px); }
.grp-chat.embedded { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--wa-panel); display: flex; flex-direction: column; }
.grp-chat.embedded .card-head { padding: 10px 16px; background: var(--wa-head); border-bottom: 1px solid var(--wa-line); min-height: 60px; }
.wa-general { align-items: center; }
.wa-general-icon { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--wa-green); color: #fff; flex-shrink: 0; }
.grp-chat.embedded .grp-msgs { background: var(--wa-wall); }
/* PDF beside the "Criar cliente" form: takes the chat pane instead of covering the screen */
.wa-thread { position: relative; }
.pdf-inline { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; background: var(--surface); color: var(--text); }
.pdf-inline-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--wa-head); border-bottom: 1px solid var(--wa-line); min-height: 60px; }
.pdf-inline-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pdf-inline-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.pdf-inline .pdf-split-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
.pdf-inline .pdf-split-parts { border-left: 0; border-top: 1px solid var(--line); max-height: 35%; }
/* PDF: zoom, rotate, crop */
.pdf-tool .pdf-view { display: block; overflow: auto; }
.pdf-page-wrap { margin: 0 auto 16px; max-width: none; }
.pdf-page-canvas { display: block; background: #fff; box-shadow: var(--shadow); border-radius: 3px; }
.pdf-page-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12.5px; color: var(--text-2); }
.pdf-page-tools span { flex: 1; font-weight: 600; }
.pdf-page-tools button, .pdft-zoom button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 7px; padding: 3px 9px; font: inherit; font-size: 13px; cursor: pointer; }
.pdf-page-tools button:hover, .pdft-zoom button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pdft-zoom { display: inline-flex; gap: 4px; align-items: center; }
.pdft-zoom button:disabled { opacity: .4; cursor: default; }
.pdft-zoom-val { min-width: 58px; font-weight: 700; }
.pdf-crop-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pdf-crop-area { position: relative; cursor: crosshair; touch-action: none; user-select: none; overflow: hidden; border-radius: 3px; }
.pdf-crop-box { position: absolute; border: 2px solid var(--brand); box-shadow: 0 0 0 9999px rgba(10, 18, 34, 0.5); pointer-events: none; }
/* Document + registration: the conversation list steps aside and both fill the screen */
.wa.with-side.with-pdf { grid-template-columns: minmax(0, 1fr) minmax(400px, 40%); }
.wa.with-side.with-pdf .wa-list { display: none; }
@media (max-width: 1100px) { .wa.with-side:not(.with-pdf) { grid-template-columns: 260px minmax(0, 1fr) 340px; } }
@media (max-width: 860px) { .wa.with-side.with-pdf { grid-template-columns: minmax(0, 1fr); } }
/* Drag the document with the mouse */
.pdf-pan { cursor: grab; }
.pdf-pan.panning { cursor: grabbing; user-select: none; }
.pdf-pan canvas { -webkit-user-drag: none; user-select: none; }
.pdf-tool, .pdf-tool .pdf-view, .pdf-inline-body, .pdf-inline { min-width: 0; } .pdf-tool .pdf-view { width: 100%; }
.modal.full, .modal.full .modal-body { min-width: 0; }
/* Separar documento › Editar a page (crop + rotate) */
.pdf-tool { position: relative; }
.pdf-edit-btn { border: 1px solid var(--brand); color: var(--brand); background: var(--surface); border-radius: 7px; padding: 2px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.pdf-edit-btn:hover { background: var(--brand-soft); }
.pdf-editor { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; background: var(--surface); }
.pdf-editor-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.pdf-ed-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pdf-ed-btn:hover { border-color: var(--brand); color: var(--brand); }
.pdf-editor-body { flex: 1; min-height: 0; overflow: auto; padding: 18px; background: var(--surface-2); display: flex; justify-content: center; align-items: flex-start; }
/* Grupos: client named in a message → button with the client's name and a magnifier */
.wa-clients { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.wa-client-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 99px; padding: 4px 11px; background: var(--wa-green); color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.wa-client-btn:hover { filter: brightness(1.08); }
/* Chat geral: select, reply, send */
.grp-row { display: flex; align-items: flex-start; gap: 8px; }
.grp-row.out { flex-direction: row-reverse; }
.grp-row.picked .grp-msg { box-shadow: 0 0 0 2px var(--wa-green); }
.grp-pick { padding-top: 10px; cursor: pointer; }
.grp-pick input { width: 16px; height: 16px; accent-color: var(--wa-green); }
.grp-reply { align-self: flex-start; border: 0; background: transparent; color: var(--wa-green); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 2px 0; }
.grp-quote { border-left: 3px solid var(--wa-green); background: color-mix(in srgb, var(--wa-green) 8%, transparent); border-radius: 6px; padding: 4px 8px; font-size: 12.5px; display: flex; flex-direction: column; min-width: 0; }
.grp-quote strong { color: var(--wa-green); font-size: 12px; }
.gc-chips { flex-wrap: nowrap; }
.gc-chips .wa-chip { flex: 0 0 auto; padding-right: 14px; }
.gc-composer { border-top: 1px solid var(--wa-line); background: var(--wa-head); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.gc-target { display: flex; align-items: center; gap: 8px; }
.gc-target select { width: auto; max-width: 320px; padding: 4px 8px; font-size: 12.5px; }
.gc-replying, .gc-file { display: flex; align-items: center; gap: 8px; background: var(--wa-panel); border-left: 3px solid var(--wa-green); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.gc-file audio { height: 32px; }
.gc-row { display: flex; align-items: flex-end; gap: 8px; }
.gc-row textarea { resize: none; border-radius: 10px; padding: 9px 12px; min-height: 40px; background: var(--wa-panel); }
.gc-rec { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gc-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
/* Audio transcription under the player */
.wa-transcript-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--wa-green); margin-bottom: 2px; }
.wa-transcribing { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--wa-sub); padding: 2px 0; }
.wa-transcribing .spinner { width: 12px; height: 12px; }
/* Grupos: only the chat, the whole screen height */
.shell.compact .wa.in-groups { height: calc(100vh - 28px); }
.shell.compact .wa-thread .grp-chat.embedded, .wa-thread .grp-chat.embedded { height: auto; flex: 1; min-height: 0; }
/* Conexões: category of an office number */
.conn-cat { display: flex; flex-direction: column; gap: 6px; }
.conn-cat .pdf-seg { align-self: flex-start; }
.conn-cat-select { width: auto; padding: 3px 8px; font-size: 12.5px; }
/* Chat geral: OK (resolve) / Desfazer on each message */
.grp-actions { display: flex; align-items: center; gap: 14px; }
.grp-ok { border: 1.5px solid var(--wa-green); color: var(--wa-green); background: transparent; border-radius: 99px; padding: 1px 10px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; margin-left: auto; }
.grp-ok:hover { background: var(--wa-green); color: #fff; }
.grp-undo { border: 1px solid var(--line-strong); color: var(--text-2); background: transparent; border-radius: 99px; padding: 1px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; margin-left: auto; }
.grp-undo:hover { border-color: var(--brand); color: var(--brand); }
/* Chat geral › Criar cliente: the panel sits beside the chat, which stays usable */
.side-overlay.soft { background: transparent; pointer-events: none; z-index: 90; }
.side-overlay.soft .sp-create { pointer-events: auto; border-left: 1px solid var(--line-strong); }
