/* ZylloPag Zap — design system do app.zyllopag.online
   Protótipo estático. Marca herdada da ZylloPag: azul #0097c9, tinta #0b1b33, Inter.
   Tokens em :root; tema escuro por [data-theme=dark] ou pela preferência do sistema. */

:root {
  --brand-50:#e8f6fb; --brand-100:#c8eaf5; --brand-200:#93d4ea; --brand-300:#57bcdd; --brand-400:#22a6d1;
  --brand-500:#0097c9; --brand-600:#007aa8; --brand-700:#036287; --brand-800:#0a4f6d; --brand-900:#0d3f57;

  --bg:#f6f8fb;          /* fundo da página */
  --surface:#ffffff;     /* cartões, colunas */
  --surface-2:#f1f4f8;   /* áreas secundárias, hover */
  --surface-3:#e7ecf2;
  --border:#e3e8ef;
  --border-strong:#cbd5e1;
  --text:#0b1b33;
  --text-2:#334155;
  --muted:#64748b;
  --faint:#94a3b8;
  --accent:var(--brand-500);
  --accent-strong:var(--brand-600);
  --accent-soft:var(--brand-50);
  --accent-text:#036287;     /* texto de marca com contraste AA no claro */
  --on-accent:#ffffff;

  --ok:#15803d;  --ok-soft:#e8f7ee;
  --warn:#b45309; --warn-soft:#fff6e5;
  --bad:#b91c1c; --bad-soft:#fdecec;
  --info:#1d4ed8; --info-soft:#eaf0ff;

  --bubble-in:#ffffff; --bubble-out:#dff3fa; --bubble-note:#fff8db; --chat-bg:#eef2f6;

  --r-sm:6px; --r:10px; --r-lg:14px; --r-xl:20px;
  --shadow-1:0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --shadow-2:0 12px 32px -12px rgba(15,23,42,.22);
  --ring:0 0 0 3px rgba(0,151,201,.28);
  --font:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w:232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0a0f1a; --surface:#0f1624; --surface-2:#151e2f; --surface-3:#1c2740;
    --border:#1f2a3d; --border-strong:#2d3b55;
    --text:#e6edf7; --text-2:#c3cfdf; --muted:#8a9bb4; --faint:#5d6e89;
    --accent:#22a6d1; --accent-strong:#57bcdd; --accent-soft:rgba(34,166,209,.12); --accent-text:#7fd0ea; --on-accent:#04131c;
    --ok:#4ade80; --ok-soft:rgba(74,222,128,.12); --warn:#fbbf24; --warn-soft:rgba(251,191,36,.12);
    --bad:#f87171; --bad-soft:rgba(248,113,113,.12); --info:#93b4ff; --info-soft:rgba(147,180,255,.12);
    --bubble-in:#151e2f; --bubble-out:#0d3f57; --bubble-note:#3a3115; --chat-bg:#0b111d;
    --shadow-1:0 1px 2px rgba(0,0,0,.4); --shadow-2:0 16px 40px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#0a0f1a; --surface:#0f1624; --surface-2:#151e2f; --surface-3:#1c2740;
  --border:#1f2a3d; --border-strong:#2d3b55;
  --text:#e6edf7; --text-2:#c3cfdf; --muted:#8a9bb4; --faint:#5d6e89;
  --accent:#22a6d1; --accent-strong:#57bcdd; --accent-soft:rgba(34,166,209,.12); --accent-text:#7fd0ea; --on-accent:#04131c;
  --ok:#4ade80; --ok-soft:rgba(74,222,128,.12); --warn:#fbbf24; --warn-soft:rgba(251,191,36,.12);
  --bad:#f87171; --bad-soft:rgba(248,113,113,.12); --info:#93b4ff; --info-soft:rgba(147,180,255,.12);
  --bubble-in:#151e2f; --bubble-out:#0d3f57; --bubble-note:#3a3115; --chat-bg:#0b111d;
  --shadow-1:0 1px 2px rgba(0,0,0,.4); --shadow-2:0 16px 40px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

*,*::before,*::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family:var(--font); 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:-.01em; }
h1 { font-size:22px; font-weight:700; } h2 { font-size:17px; font-weight:650; } h3 { font-size:15px; font-weight:600; } h4 { font-size:13px; font-weight:600; }
p { margin:0; }
a { color:var(--accent-text); text-decoration:none; } a:hover { text-decoration:underline; }
:focus-visible { outline:none; box-shadow:var(--ring); border-radius:var(--r-sm); }
img { max-width:100%; display:block; }
.tabular { font-variant-numeric:tabular-nums; }
.mono { font-family:var(--mono); font-size:12.5px; }
.muted { color:var(--muted); } .faint { color:var(--faint); } .small { font-size:12.5px; } .xs { font-size:11.5px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.row { display:flex; align-items:center; gap:8px; } .row-wrap { flex-wrap:wrap; } .between { justify-content:space-between; } .grow { flex:1; min-width:0; }
.stack { display:flex; flex-direction:column; gap:12px; } .stack-sm { display:flex; flex-direction:column; gap:6px; } .stack-lg { display:flex; flex-direction:column; gap:20px; }
.grid { display:grid; gap:16px; } .grid > * { min-width:0; } .g2 { grid-template-columns:repeat(2,minmax(0,1fr)); } .g3 { grid-template-columns:repeat(3,minmax(0,1fr)); } .g4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:900px){ .g3,.g4 { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px){ .g2,.g3,.g4 { grid-template-columns:1fr; } }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hide-sm { } @media (max-width:760px){ .hide-sm { display:none !important; } }
.show-sm { display:none !important; } @media (max-width:760px){ .show-sm { display:inline-flex !important; } }

/* ---------- Ícones (SVG inline, traço 1.75, estilo Lucide ISC) ---------- */
.i { width:18px; height:18px; flex:none; stroke:currentColor; fill:none; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle; }
.i-sm { width:15px; height:15px; } .i-lg { width:22px; height:22px; }

/* ---------- Botões ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:36px; padding:0 14px; border-radius:var(--r); border:1px solid transparent; font:inherit; font-weight:600; font-size:13.5px; cursor:pointer; white-space:nowrap; transition:background-color .12s, border-color .12s, color .12s; text-decoration:none !important; }
.btn-primary { background:var(--accent); color:var(--on-accent); box-shadow:0 6px 16px -10px rgba(0,151,201,.9); }
.btn-primary:hover { background:var(--accent-strong); }
.btn-secondary { background:var(--surface); color:var(--text); border-color:var(--border-strong); }
.btn-secondary:hover { background:var(--surface-2); }
.btn-ghost { background:transparent; color:var(--text-2); } .btn-ghost:hover { background:var(--surface-2); color:var(--text); }
.btn-danger { background:var(--bad); color:#fff; } .btn-danger-soft { background:var(--bad-soft); color:var(--bad); }
.btn-sm { height:30px; padding:0 10px; font-size:12.5px; border-radius:8px; }
.btn-lg { height:44px; padding:0 18px; font-size:15px; }
.btn-icon { width:36px; padding:0; } .btn-sm.btn-icon { width:30px; }
.btn-block { width:100%; }
.btn[disabled], .btn.is-disabled { opacity:.5; cursor:not-allowed; }

/* ---------- Formulários ---------- */
.field { display:flex; flex-direction:column; gap:6px; }
.label { font-size:13px; font-weight:600; color:var(--text-2); }
.help { font-size:12.5px; color:var(--muted); }
.error { font-size:12.5px; color:var(--bad); font-weight:500; }
.input, .select, .textarea { width:100%; height:38px; padding:0 12px; border-radius:var(--r); border:1px solid var(--border-strong); background:var(--surface); color:var(--text); font:inherit; font-size:14px; transition:border-color .12s, box-shadow .12s; }
.textarea { height:auto; min-height:92px; padding:10px 12px; resize:vertical; line-height:1.5; }
.input::placeholder, .textarea::placeholder { color:var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline:none; border-color:var(--accent); box-shadow:var(--ring); }
.input[aria-invalid="true"] { border-color:var(--bad); }
.input-lg { height:44px; font-size:15px; }
.input-group { position:relative; } .input-group .i { position:absolute; left:11px; top:50%; transform:translateY(-50%); color:var(--faint); } .input-group .input { padding-left:36px; }
.check { display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-size:13.5px; }
.check input { width:16px; height:16px; accent-color:var(--accent); margin:0; }
.switch { position:relative; width:36px; height:20px; flex:none; display:inline-block; }
.switch input { position:absolute; opacity:0; inset:0; margin:0; cursor:pointer; }
.switch span { position:absolute; inset:0; background:var(--surface-3); border:1px solid var(--border-strong); border-radius:99px; transition:.15s; pointer-events:none; }
.switch span::after { content:""; position:absolute; left:2px; top:2px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:.15s; }
.switch input:checked + span { background:var(--accent); border-color:var(--accent); }
.switch input:checked + span::after { transform:translateX(16px); }
.switch input:focus-visible + span { box-shadow:var(--ring); }
input[type=range] { accent-color:var(--accent); width:100%; }

/* ---------- Superfícies ---------- */
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--shadow-1); }
.card-pad { padding:18px; } .card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border); }
.card-foot { display:flex; justify-content:flex-end; gap:8px; padding:12px 18px; border-top:1px solid var(--border); background:var(--surface-2); border-radius:0 0 var(--r-lg) var(--r-lg); }
.divider { height:1px; background:var(--border); border:0; margin:0; }
.kpi { padding:16px 18px; } .kpi .v { font-size:24px; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; } .kpi .l { font-size:12.5px; color:var(--muted); font-weight:500; }
.kpi .d { font-size:12px; font-weight:600; } .up { color:var(--ok); } .down { color:var(--bad); }

/* ---------- Badges, chips, avatar ---------- */
.badge { display:inline-flex; align-items:center; gap:4px; height:22px; padding:0 8px; border-radius:99px; font-size:11.5px; font-weight:600; background:var(--surface-2); color:var(--text-2); border:1px solid var(--border); white-space:nowrap; }
.badge-ok { background:var(--ok-soft); color:var(--ok); border-color:transparent; }
.badge-warn { background:var(--warn-soft); color:var(--warn); border-color:transparent; }
.badge-bad { background:var(--bad-soft); color:var(--bad); border-color:transparent; }
.badge-info { background:var(--info-soft); color:var(--info); border-color:transparent; }
.badge-brand { background:var(--accent-soft); color:var(--accent-text); border-color:transparent; }
.dot { width:8px; height:8px; border-radius:50%; background:var(--faint); flex:none; display:inline-block; }
.dot-ok { background:#22c55e; } .dot-warn { background:#f59e0b; } .dot-bad { background:#ef4444; }
.tag { display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 8px; border-radius:6px; font-size:11.5px; font-weight:600; color:var(--text-2); background:var(--surface-2); }
.tag::before { content:""; width:7px; height:7px; border-radius:2px; background:var(--c,#94a3b8); }
.chip { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 12px; border-radius:99px; border:1px solid var(--border-strong); background:var(--surface); font-size:12.5px; font-weight:600; color:var(--text-2); cursor:pointer; }
.chip[aria-pressed="true"], .chip.on { background:var(--accent-soft); border-color:var(--accent); color:var(--accent-text); }
.avatar { width:36px; height:36px; border-radius:50%; flex:none; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; color:#fff; background:var(--c,#64748b); position:relative; }
.avatar-sm { width:28px; height:28px; font-size:11px; } .avatar-lg { width:56px; height:56px; font-size:19px; }
.avatar.group { border-radius:10px; }
.avatar .st { position:absolute; right:-1px; bottom:-1px; width:10px; height:10px; border-radius:50%; border:2px solid var(--surface); background:#22c55e; }
.kbd { font-family:var(--mono); font-size:11px; padding:1px 5px; border-radius:4px; border:1px solid var(--border-strong); background:var(--surface-2); color:var(--muted); }

/* ---------- Abas e segmentos ---------- */
.tabs { display:flex; gap:2px; border-bottom:1px solid var(--border); overflow-x:auto; scrollbar-width:none; }
.tabs a, .tabs button { flex:none; display:inline-flex; align-items:center; gap:6px; padding:10px 12px; font:inherit; font-weight:600; font-size:13.5px; color:var(--muted); background:none; border:0; border-bottom:2px solid transparent; margin-bottom:-1px; cursor:pointer; text-decoration:none; }
.tabs [aria-selected="true"], .tabs .on { color:var(--text); border-bottom-color:var(--accent); }
.tabs .count { font-size:11px; padding:0 6px; border-radius:99px; background:var(--surface-2); color:var(--muted); }
.seg { display:inline-flex; padding:3px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--r); gap:2px; }
.seg button { height:28px; padding:0 10px; border:0; background:none; font:inherit; font-size:12.5px; font-weight:600; color:var(--muted); border-radius:7px; cursor:pointer; }
.seg button[aria-pressed="true"] { background:var(--surface); color:var(--text); box-shadow:var(--shadow-1); }

/* ---------- Tabela (vira cartões no celular) ---------- */
.table-wrap { overflow-x:auto; }
table.t { width:100%; border-collapse:collapse; font-size:13.5px; }
table.t.stack { display:table; gap:0; }   /* .stack (utilitário flex) não pode virar a tabela em flex no computador */
.t th { text-align:left; font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); padding:10px 14px; border-bottom:1px solid var(--border); background:var(--surface-2); white-space:nowrap; }
.t td { padding:11px 14px; border-bottom:1px solid var(--border); vertical-align:middle; }
.t tr:last-child td { border-bottom:0; }
.t tbody tr:hover td { background:var(--surface-2); }
@media (max-width:640px){
  table.t.stack, .t.stack tbody { display:block; }
  .t.stack thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .t.stack tr { display:block; margin:10px; padding:6px 12px; border:1px solid var(--border); border-radius:var(--r); background:var(--surface); }
  .t.stack td { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border:0; text-align:right; }
  .t.stack td + td { border-top:1px dashed var(--border); }
  .t.stack td[data-l]::before { content:attr(data-l); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); text-align:left; }
}

/* ---------- Alertas ---------- */
.alert { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:var(--r); font-size:13.5px; border:1px solid transparent; }
.alert .i { margin-top:1px; }
.alert-info { background:var(--info-soft); color:var(--text); } .alert-info .i { color:var(--info); }
.alert-warn { background:var(--warn-soft); color:var(--text); } .alert-warn .i { color:var(--warn); }
.alert-bad { background:var(--bad-soft); color:var(--text); } .alert-bad .i { color:var(--bad); }
.alert-ok { background:var(--ok-soft); color:var(--text); } .alert-ok .i { color:var(--ok); }

/* ---------- Medidor de risco ---------- */
.meter { height:8px; border-radius:99px; background:var(--surface-3); overflow:hidden; }
.meter > span { display:block; height:100%; border-radius:99px; background:var(--accent); }
.meter.ok > span { background:#22c55e; } .meter.warn > span { background:#f59e0b; } .meter.bad > span { background:#ef4444; }
.risk { display:grid; grid-template-columns:repeat(3,1fr); gap:3px; height:8px; }
.risk span { border-radius:99px; background:var(--surface-3); }
.risk.l1 span:nth-child(1) { background:#22c55e; }
.risk.l2 span:nth-child(-n+2) { background:#f59e0b; }
.risk.l3 span { background:#ef4444; }

/* ---------- Shell do app ---------- */
.app { display:flex; min-height:100vh; }
.side { width:var(--side-w); flex:none; background:var(--surface); border-right:1px solid var(--border); display:flex; flex-direction:column; position:sticky; top:0; height:100vh; }
.side .brand { display:flex; align-items:center; gap:10px; padding:16px 16px 12px; font-weight:750; font-size:15px; letter-spacing:-.01em; color:var(--text); text-decoration:none; }
.logo { width:28px; height:28px; border-radius:8px; background:linear-gradient(135deg,#22a6d1,#036287); display:inline-flex; align-items:center; justify-content:center; color:#fff; flex:none; }
.logo .i { width:16px; height:16px; stroke-width:2.2; }
.side .acct { margin:0 10px 8px; padding:8px 10px; border:1px solid var(--border); border-radius:var(--r); display:flex; align-items:center; gap:8px; font-size:12.5px; }
.nav { flex:1; overflow-y:auto; padding:4px 10px 10px; }
.nav h5 { margin:14px 8px 4px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--faint); }
.nav a { display:flex; align-items:center; gap:10px; height:34px; padding:0 10px; border-radius:8px; color:var(--text-2); font-weight:550; font-size:13.5px; text-decoration:none; }
.nav a:hover { background:var(--surface-2); color:var(--text); }
.nav a[aria-current="page"] { background:var(--accent-soft); color:var(--accent-text); }
.nav a .n { margin-left:auto; font-size:11px; font-weight:700; min-width:20px; height:18px; padding:0 6px; border-radius:99px; background:var(--accent); color:var(--on-accent); display:inline-flex; align-items:center; justify-content:center; }
.side .foot { padding:10px; border-top:1px solid var(--border); }
.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.top { height:56px; flex:none; display:flex; align-items:center; gap:12px; padding:0 20px; border-bottom:1px solid var(--border); background:color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter:blur(8px); position:sticky; top:0; z-index:20; }
.top h1 { font-size:16px; font-weight:650; }
.page { padding:24px; max-width:1240px; width:100%; margin:0 auto; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.page-head p { color:var(--muted); margin-top:4px; }
.banner { display:flex; align-items:center; gap:10px; padding:8px 20px; font-size:13px; font-weight:500; }
.banner-warn { background:var(--warn-soft); color:var(--text); border-bottom:1px solid var(--border); }
.banner-bad { background:var(--bad); color:#fff; }
.demo-flag { position:fixed; right:12px; bottom:12px; z-index:90; font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:5px 10px; border-radius:99px; background:#7c3aed; color:#fff; box-shadow:var(--shadow-2); pointer-events:none; }
.bottom-nav { display:none; }
@media (max-width:760px){
  .side { display:none; }
  .top { padding:0 12px; }
  /* a barra fixa tem 64px + a área segura do aparelho (iPhone); o fim do conteúdo sempre fica acima dela */
  .page { padding:16px 16px calc(88px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:40; height:calc(64px + env(safe-area-inset-bottom, 0px)); padding-bottom:env(safe-area-inset-bottom, 0px); background:var(--surface); border-top:1px solid var(--border); }
  .bottom-nav a { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-size:10.5px; font-weight:600; color:var(--muted); text-decoration:none; position:relative; }
  .bottom-nav a[aria-current="page"] { color:var(--accent-text); }
  .bottom-nav a .n { position:absolute; top:8px; left:calc(50% + 6px); font-size:10px; min-width:16px; height:16px; border-radius:99px; background:var(--accent); color:var(--on-accent); display:flex; align-items:center; justify-content:center; padding:0 4px; }
  .demo-flag { bottom:auto; top:62px; right:8px; font-size:10px; padding:3px 8px; opacity:.92; }
}
/* gaveta do menu no celular */
.drawer-bg { position:fixed; inset:0; background:rgba(2,6,23,.45); z-index:60; display:none; }
.drawer-bg.open { display:block; }
.drawer-bg .side { display:flex; position:absolute; left:0; top:0; bottom:0; box-shadow:var(--shadow-2); }

/* ---------- Modal / sheet ---------- */
.modal-bg { position:fixed; inset:0; background:rgba(2,6,23,.5); z-index:70; display:flex; align-items:center; justify-content:center; padding:16px; }
.modal { width:100%; max-width:520px; background:var(--surface); border-radius:var(--r-xl); box-shadow:var(--shadow-2); border:1px solid var(--border); }
@media (max-width:600px){ .modal-bg { align-items:flex-end; padding:0; } .modal { border-radius:var(--r-xl) var(--r-xl) 0 0; } }
.hidden { display:none !important; }

/* ---------- Estado vazio ---------- */
.empty { text-align:center; padding:40px 20px; color:var(--muted); }
.empty .ico { width:48px; height:48px; border-radius:14px; background:var(--surface-2); display:inline-flex; align-items:center; justify-content:center; margin-bottom:12px; color:var(--muted); }

/* ---------- Telas de autenticação ---------- */
.auth { min-height:100vh; display:grid; grid-template-columns:1fr 1fr; }
.auth-side { background:radial-gradient(1200px 600px at 0% 0%, #0a4f6d 0%, #082a3b 55%, #05131c 100%); color:#e6f4fa; padding:48px; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden; }
.auth-side::after { content:""; position:absolute; right:-120px; bottom:-120px; width:420px; height:420px; border-radius:50%; background:radial-gradient(circle, rgba(34,166,209,.35), transparent 65%); }
.auth-main { display:flex; align-items:center; justify-content:center; padding:32px 20px; background:var(--surface); }
.auth-box { width:100%; max-width:400px; }
@media (max-width:900px){ .auth { grid-template-columns:1fr; } .auth-side { display:none; } .auth-main { align-items:flex-start; padding-top:40px; } }

/* ---------- Inbox 3 colunas ---------- */
.inbox { display:grid; grid-template-columns:320px minmax(0,1fr) 280px; height:calc(100vh - 56px); }
.inbox.with-banner { height:calc(100vh - 56px - 37px); }
.col { min-width:0; min-height:0; display:flex; flex-direction:column; background:var(--surface); }
.col + .col { border-left:1px solid var(--border); }
.list { flex:1; overflow-y:auto; }
.conv { display:flex; gap:10px; padding:12px 14px; border-bottom:1px solid var(--border); cursor:pointer; text-decoration:none !important; color:inherit; position:relative; }
.conv:hover { background:var(--surface-2); }
.conv[aria-current="true"] { background:var(--accent-soft); }
.conv[aria-current="true"]::before { content:""; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:0 3px 3px 0; background:var(--accent); }
.conv .nm { font-weight:650; font-size:13.5px; color:var(--text); }
.conv .pv { font-size:12.5px; color:var(--muted); }
.conv .tm { font-size:11px; color:var(--faint); white-space:nowrap; }
.conv .unread { min-width:18px; height:18px; padding:0 5px; border-radius:99px; background:var(--accent); color:var(--on-accent); font-size:10.5px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.chat { background:var(--chat-bg); }
.chat-head { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--surface); border-bottom:1px solid var(--border); min-height:60px; }
.msgs { flex:1; overflow-y:auto; padding:18px 18px 8px; display:flex; flex-direction:column; gap:6px; }
.day { align-self:center; font-size:11.5px; font-weight:600; color:var(--muted); background:var(--surface); border:1px solid var(--border); padding:2px 10px; border-radius:99px; margin:8px 0; }
.sys { align-self:center; font-size:12px; color:var(--muted); display:block; text-align:center; max-width:90%; margin:4px 0; } .sys .i { margin-right:4px; vertical-align:-3px; }
.bubble { max-width:min(72%, 520px); padding:8px 11px 6px; border-radius:12px; background:var(--bubble-in); box-shadow:var(--shadow-1); font-size:14px; line-height:1.45; position:relative; word-wrap:break-word; }
.bubble.in { align-self:flex-start; border-top-left-radius:4px; }
.bubble.out { align-self:flex-end; background:var(--bubble-out); border-top-right-radius:4px; }
.bubble.note { align-self:stretch; max-width:none; background:var(--bubble-note); border:1px dashed color-mix(in srgb, var(--warn) 45%, transparent); box-shadow:none; }
.bubble .meta { display:flex; justify-content:flex-end; align-items:center; gap:4px; font-size:10.5px; color:var(--muted); margin-top:2px; }
.bubble .author { font-size:12px; font-weight:700; color:var(--c,var(--accent-text)); margin-bottom:2px; }
.media { display:flex; align-items:center; gap:10px; padding:10px; border-radius:10px; background:var(--surface-2); border:1px solid var(--border); margin:2px 0 4px; min-width:240px; }
.bubble.out .media { background:color-mix(in srgb, var(--surface) 55%, transparent); }
.media .mi { width:40px; height:40px; border-radius:9px; background:var(--surface-3); display:flex; align-items:center; justify-content:center; color:var(--text-2); flex:none; }
.media .mt { font-weight:600; font-size:13px; } .media .ms { font-size:11.5px; color:var(--muted); }
.media.expired { opacity:.85; border-style:dashed; }
.thumb { border-radius:9px; overflow:hidden; margin:2px 0 4px; background:linear-gradient(135deg,#93d4ea,#036287); aspect-ratio:4/3; width:260px; max-width:100%; display:flex; align-items:flex-end; color:#fff; font-size:11.5px; padding:8px; font-weight:600; }
.wave { display:flex; align-items:center; gap:2px; height:28px; flex:1; }
.wave i { display:block; width:3px; border-radius:2px; background:var(--muted); opacity:.55; }
.composer { background:var(--surface); border-top:1px solid var(--border); padding:10px 12px; }
.composer .box { display:flex; align-items:flex-end; gap:6px; border:1px solid var(--border-strong); border-radius:var(--r-lg); padding:6px; background:var(--surface); }
.composer .box:focus-within { border-color:var(--accent); box-shadow:var(--ring); }
.composer textarea { flex:1; border:0; outline:0; resize:none; font:inherit; font-size:14px; min-height:36px; max-height:140px; padding:8px 6px; background:transparent; color:var(--text); }
.qr-pop { border:1px solid var(--border); border-radius:var(--r); background:var(--surface); box-shadow:var(--shadow-2); margin-bottom:8px; overflow:hidden; }
.qr-pop .it { display:flex; gap:10px; padding:8px 12px; font-size:13px; } .qr-pop .it.on { background:var(--accent-soft); }
.profile { overflow-y:auto; }
.profile section { padding:16px; border-bottom:1px solid var(--border); }
.profile dl { display:grid; grid-template-columns:auto 1fr; gap:6px 12px; margin:0; font-size:13px; } .profile dt { color:var(--muted); } .profile dd { margin:0; text-align:right; }
@media (max-width:1180px){ .inbox { grid-template-columns:300px minmax(0,1fr); } .inbox .profile-col { display:none; } }
@media (max-width:760px){
  .inbox { grid-template-columns:minmax(0,1fr); height:auto; min-height:calc(100vh - 56px - 64px - env(safe-area-inset-bottom, 0px)); }
  .inbox .list-col { display:none; } .inbox.mobile-list .list-col { display:flex; } .inbox.mobile-list .chat { display:none; }
  .msgs { padding:12px 10px; } .bubble { max-width:86%; }
  .chat { min-height:calc(100vh - 56px - 64px - env(safe-area-inset-bottom, 0px)); }
  main#conteudo:not(.page):not(.wf-main) { padding-bottom:calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Calendário ---------- */
.cal { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); border-top:1px solid var(--border); border-left:1px solid var(--border); }
.cal > div { border-right:1px solid var(--border); border-bottom:1px solid var(--border); min-height:104px; padding:6px; background:var(--surface); }
.cal .dh { min-height:auto; padding:8px; font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); background:var(--surface-2); }
.cal .dn { font-size:12px; font-weight:600; color:var(--muted); margin-bottom:4px; }
.cal .today .dn { color:var(--on-accent); background:var(--accent); border-radius:99px; width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; }
.cal .out { background:var(--surface-2); } .cal .out .dn { color:var(--faint); }
.ev { display:flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; padding:2px 6px; border-radius:5px; margin-bottom:3px; background:var(--accent-soft); color:var(--accent-text); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.ev.st { background:var(--info-soft); color:var(--info); } .ev.pa { background:var(--surface-2); color:var(--muted); text-decoration:line-through; }
@media (max-width:760px){ .cal > div { min-height:64px; padding:4px; } .ev { font-size:0; padding:0; width:7px; height:7px; border-radius:50%; display:inline-block; margin-right:2px; background:var(--accent); } .ev.st { background:var(--info); } }

/* ---------- Timeline / histórico ---------- */
.tl { position:relative; padding-left:22px; } .tl::before { content:""; position:absolute; left:7px; top:4px; bottom:4px; width:2px; background:var(--border); }
.tl .it { position:relative; padding:0 0 14px; } .tl .it::before { content:""; position:absolute; left:-19px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--surface); border:2px solid var(--c,var(--accent)); }

/* ---------- Diversos ---------- */
.steps { display:flex; gap:8px; } .steps span { flex:1; height:4px; border-radius:99px; background:var(--surface-3); } .steps span.on { background:var(--accent); }
.qr { width:220px; height:220px; border-radius:12px; padding:12px; background:#fff; border:1px solid var(--border); }
.dropzone { border:1.5px dashed var(--border-strong); border-radius:var(--r-lg); padding:20px; text-align:center; color:var(--muted); background:var(--surface-2); }
.bar-chart { display:flex; align-items:flex-end; gap:6px; height:160px; padding-top:8px; }
.bar-chart div { flex:1; background:var(--accent); border-radius:4px 4px 0 0; opacity:.9; min-height:2px; position:relative; }
.bar-chart div.alt { background:var(--brand-200); }
.bar-x { display:flex; gap:6px; } .bar-x span { flex:1; text-align:center; font-size:11px; color:var(--muted); }
.pill-list { display:flex; flex-wrap:wrap; gap:6px; }
.sticky-foot { position:sticky; bottom:0; z-index:5; background:color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter:blur(8px); border-top:1px solid var(--border); padding:12px 16px; display:flex; gap:8px; justify-content:flex-end; align-items:center; }
@media (max-width:760px){ .sticky-foot { bottom:64px; } }
.hub a.card { display:block; padding:16px; color:inherit; text-decoration:none; transition:border-color .12s, transform .12s; }
.hub a.card:hover { border-color:var(--accent); transform:translateY(-1px); }
@media (prefers-reduced-motion: reduce) { * { animation:none !important; transition:none !important; } }
