/* Hermes · sistema visual base.
   Cores de marca vem de /brand.php (sobrepoe os tokens de :root pela configuracao
   da instalacao). Modulo usa SEMPRE var(--token), nunca hex solto.
   Semantica fixa: laranja = a vez e da equipe (e o botao principal do portal);
   violeta = tudo que a IA fez ou sugeriu; verde = pronto; cinza = parado/inativo;
   vermelho = so erro de verdade ou prazo estourado. */

@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/nunito-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* marca (sobrescrita por /brand.php) */
  --brand: #0B396D;
  --brand-2: #092E57;
  --deep: #08082E;
  --steel: #3C618A;
  --accent: #FF5C00;
  --bg: #EFF3F7;
  --line: #CED7E2;

  /* derivados fixos */
  --accent-ink: #08082E;          /* texto sobre laranja (branco nao passa AA) */
  --on-brand: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --ink: #0E1A30;
  --ink-2: #3E4D66;
  --ink-3: #66758C;
  --line-2: #E3E9F1;
  --focus: #2E7CF6;

  --ok: #17754A;      --ok-bg: #E2F3EA;
  --err: #B42318;     --err-bg: #FDECEA;
  --ai: #5A3FCF;      --ai-bg: #F0ECFF;   --ai-line: #D6CCFF;
  --idle: #7C8899;    --idle-bg: #EDF0F4;
  --note-bg: #FFF7EE; --note-line: #F3C9A4;  /* nota interna: papel, nao alarme */

  --turn-team: var(--accent);
  --turn-client: var(--steel);
  --turn-third: var(--idle);

  --f-brand: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --sh-1: 0 1px 2px rgba(8, 8, 46, .06), 0 1px 1px rgba(8, 8, 46, .03);
  --sh-2: 0 6px 16px rgba(8, 8, 46, .08);
  --sh-pop: 0 18px 44px rgba(8, 8, 46, .22);

  --t-xs: 12px;
  --t-s: 13px;
  --t-m: 14px;
  --t-l: 16px;
  --t-xl: 20px;
  --t-2xl: 26px;
  --t-3xl: 34px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--t-m)/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--f-brand); color: var(--ink); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.2; }
h2 { font-size: var(--t-xl); font-weight: 800; line-height: 1.25; }
h3 { font-size: var(--t-l); font-weight: 700; line-height: 1.3; }
h4 { font-size: var(--t-m); font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
small, .muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-2); }
code, kbd, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
kbd { background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-2); }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }

/* ---------- icones (sprite /assets/img/icons.svg) ---------- */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-s { width: 15px; height: 15px; }
.i-l { width: 22px; height: 22px; }

/* ---------- botoes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid transparent;
  font: 600 var(--t-m)/1 var(--f-ui); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--brand); color: var(--on-brand);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--brand-2); color: var(--on-brand); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 88%, black); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--steel); background: var(--surface-2); color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--idle-bg); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, white); }
.btn.danger:hover { background: var(--err-bg); color: var(--err); }
.btn.ai { background: var(--ai); color: #fff; }
.btn.ai:hover { background: color-mix(in srgb, var(--ai) 85%, black); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--t-s); gap: 6px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: var(--t-xs); gap: 4px; border-radius: 5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font: 600 var(--t-s)/1.3 var(--f-ui); color: var(--ink-2); }
.field .hint { font-size: var(--t-xs); color: var(--ink-3); }
.field .err { font-size: var(--t-xs); color: var(--err); }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 8px 10px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 400 var(--t-m)/1.4 var(--f-ui);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:hover, .select:hover, .textarea:hover { border-color: #b3c0d1; }
.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[aria-invalid="true"] { border-color: var(--err); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--t-m); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 20px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .15s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ---------- superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); box-shadow: var(--sh-1); }
.card.pad { padding: 16px 18px; }
.card > header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.card > header h3 { font-size: var(--t-m); }
.card > .body { padding: 14px 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-title h2, .section-title h3 { margin: 0; }

/* ---------- selos ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 600 var(--t-xs)/1 var(--f-ui); white-space: nowrap; border: 1px solid transparent;
  background: var(--idle-bg); color: var(--ink-2);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.st-novo { background: #E6EEF8; color: var(--brand); border-color: #C7D6EA; }
.pill.st-em_atendimento { background: var(--brand); color: var(--on-brand); }
.pill.st-aguardando_cliente { background: #E4ECF5; color: var(--steel); border-color: #C5D4E5; }
.pill.st-aguardando_terceiro { background: var(--idle-bg); color: var(--ink-2); border-color: var(--line); }
.pill.st-resolvido { background: var(--ok-bg); color: var(--ok); }
.pill.st-fechado { background: var(--idle-bg); color: var(--ink-3); }
.pill.st-cancelado { background: var(--idle-bg); color: var(--ink-3); text-decoration: line-through; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.ai { background: var(--ai-bg); color: var(--ai); border-color: var(--ai-line); }
.pill.brand { background: var(--brand); color: var(--on-brand); }
.pill.outline { background: transparent; border-color: var(--line); color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); font-size: var(--t-xs); }

/* prioridade: barras, nao cor */
.prio { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; vertical-align: -2px; }
.prio i { display: block; width: 3px; border-radius: 1px; background: var(--line); }
.prio i:nth-child(1) { height: 5px; } .prio i:nth-child(2) { height: 8px; } .prio i:nth-child(3) { height: 11px; } .prio i:nth-child(4) { height: 14px; }
.prio.p1 i:nth-child(-n+1), .prio.p2 i:nth-child(-n+2), .prio.p3 i:nth-child(-n+3) { background: var(--ink-2); }
.prio.p4 i { background: var(--accent); }

/* A MARCA DO PRODUTO: de quem e a vez */
.turn { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--t-xs)/1 var(--f-ui); white-space: nowrap; }
.turn::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--turn-client); }
.turn.equipe { color: color-mix(in srgb, var(--accent) 70%, black); }
.turn.equipe::before { background: var(--turn-team); }
.turn.cliente { color: var(--steel); }
.turn.terceiro, .turn.ninguem { color: var(--ink-3); }
.turn.terceiro::before, .turn.ninguem::before { background: var(--turn-third); }

/* relogio de SLA */
.sla { display: inline-flex; align-items: center; gap: 5px; font: 600 var(--t-xs)/1 var(--f-ui); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sla.warn { color: color-mix(in srgb, var(--accent) 75%, black); }
.sla.late { color: var(--err); }
.sla.paused { color: var(--ink-3); }
.sla.met { color: var(--ok); }

/* avatar */
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--steel); color: #fff; font: 700 11px/1 var(--f-brand); letter-spacing: .02em; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.avatar.lg { width: 36px; height: 36px; font-size: 14px; }
.avatar.bot { background: var(--ai); }
.avatar.sys { background: var(--idle); }

/* ---------- lista densa (filas) ---------- */
.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); }
.list th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font: 600 var(--t-xs)/1.2 var(--f-ui); color: var(--ink-3); padding: 9px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.list td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: var(--t-s); }
.list tr.clickable { cursor: pointer; }
.list tr.clickable:hover td { background: #F5F8FC; }
.list tr.sel td { background: #EAF1FA; }
.list tr td:first-child { border-left: 3px solid transparent; }
.list tr.w-equipe td:first-child { border-left-color: var(--turn-team); }
.list tr.w-cliente td:first-child { border-left-color: var(--turn-client); }
.list tr.w-terceiro td:first-child, .list tr.w-ninguem td:first-child { border-left-color: var(--line); }
.list .key { font: 600 var(--t-xs)/1 var(--f-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.list .subj { font-weight: 600; color: var(--ink); }

/* ---------- vazio, carregando, erro ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty h3 { margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; color: var(--ink-3); }
.skel { background: linear-gradient(90deg, var(--line-2), #f3f6fa, var(--line-2)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 6px; min-height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-s); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); font-size: var(--t-s); }
.notice.err { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 25%, white); color: var(--err); }
.notice.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 25%, white); color: var(--ok); }
.notice.ai { background: var(--ai-bg); border-color: var(--ai-line); color: #3d2a9a; }

/* ---------- bloco da IA ---------- */
.ai-box { border: 1px solid var(--ai-line); background: var(--ai-bg); border-radius: var(--r-m); padding: 12px 14px; }
.ai-box > .ai-head { display: flex; align-items: center; gap: 8px; font: 700 var(--t-s)/1 var(--f-ui); color: var(--ai); margin-bottom: 8px; }
.ai-box .src { font-size: var(--t-xs); color: #5f52a0; }

/* ---------- abas ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button, .tabs a { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; font: 600 var(--t-s)/1 var(--f-ui); color: var(--ink-3); cursor: pointer; text-decoration: none; white-space: nowrap; }
.tabs button[aria-selected="true"], .tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button:hover, .tabs a:hover { color: var(--ink); }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--deep); color: #fff; padding: 10px 14px; border-radius: var(--r-s); box-shadow: var(--sh-pop); font-size: var(--t-s); display: flex; gap: 10px; align-items: center; animation: toastin .18s ease-out; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- modal (dialog nativo) ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-l); box-shadow: var(--sh-pop); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--ink); background: var(--surface); }
dialog.modal.wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(8, 8, 46, .45); }
dialog.modal > header { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; }
dialog.modal > header h2 { font-size: var(--t-l); }
dialog.modal > .body { padding: 6px 20px 16px; overflow: auto; max-height: calc(100vh - 200px); }
dialog.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line-2); }

/* menu suspenso */
.menu { position: absolute; z-index: 50; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-pop); padding: 6px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font: 500 var(--t-s)/1.2 var(--f-ui); color: var(--ink); cursor: pointer; text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--idle-bg); }

/* ============ SHELL DO ATENDENTE (/app/) ============ */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--deep); color: #C9D3E3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 14px 10px; gap: 2px; }
.rail .brandmark { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; min-height: 44px; }
.rail .brandmark img { max-height: 28px; max-width: 150px; object-fit: contain; }
.rail .brandmark .wm { font: 800 17px/1 var(--f-brand); color: #fff; letter-spacing: -.01em; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #C9D3E3; text-decoration: none; font: 600 var(--t-s)/1.2 var(--f-ui); position: relative; }
.rail a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.rail a[aria-current="page"] { background: rgba(255, 255, 255, .11); color: #fff; }
.rail a[aria-current="page"]::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail a .count { margin-left: auto; font: 700 11px/1 var(--f-ui); background: var(--accent); color: var(--accent-ink); padding: 3px 6px; border-radius: 999px; }
.rail a .count.ai { background: var(--ai); color: #fff; }
.rail .group { font: 600 11px/1 var(--f-ui); color: #7F8BA6; padding: 14px 10px 6px; }
.rail .foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 10px; }
.rail .me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #fff; font-size: var(--t-s); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line-2); min-height: 56px; }
.topbar h1 { font-size: var(--t-xl); }
.topbar .search { position: relative; width: min(380px, 40vw); }
.topbar .search .input { padding-left: 34px; background: var(--surface); }
.topbar .search .i { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.page { padding: 20px; flex: 1; min-width: 0; }
.page.flush { padding: 0; }

.bell { position: relative; }
.bell .badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 10px/16px var(--f-ui); text-align: center; padding: 0 4px; }

.mobile-bar { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .rail.open { transform: none; box-shadow: var(--sh-pop); }
  .mobile-bar { display: inline-flex; }
  .topbar .search { width: auto; flex: 1; }
  .page { padding: 14px; }
}
/* celular: titulo e icones na 1a linha; busca e acoes da tela embaixo (dividem a linha se couber, senao as acoes descem e rolam de lado) */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding: 8px 12px; }
  .topbar > .grow { display: none; }
  .topbar h1 { order: 1; flex: 1 1 0; min-width: 0; font-size: var(--t-l); }
  .topbar .bell { order: 2; }
  .topbar .me-btn { order: 3; }
  .topbar .search { order: 4; flex: 1 1 calc(100% - 120px); }
  .topbar .top-actions { order: 5; flex: 0 1 auto; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .topbar .top-actions:empty { display: none; }
  .topbar .top-actions > * { flex: 0 0 auto; }
}

/* ============ LOGIN ============ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.auth-side { background: var(--deep); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h1 { color: #fff; font-size: var(--t-3xl); max-width: 16ch; }
.auth-side p { color: #BFC9DC; max-width: 40ch; font-size: var(--t-l); }
.auth-side .turns { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.auth-side .turns div { display: flex; align-items: center; gap: 10px; color: #DCE3EF; font-size: var(--t-m); }
.auth-side .turns span { width: 10px; height: 10px; border-radius: 3px; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-form form { width: min(360px, 100%); }
.auth-form h2 { margin-bottom: 4px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 28px 20px; } .auth-side h1 { font-size: var(--t-2xl); } }
.boot-skel { width: 40%; height: 18px; margin: 40px auto; }

/* entrada */
.auth-logo { max-height: 40px; max-width: 220px; object-fit: contain; }
.auth-wm { font: 800 24px/1 var(--f-brand); color: #fff; }
.auth-foot { color: #8C97B0; }
.sw-team { background: var(--turn-team); }
.sw-client { background: var(--turn-client); }
.sw-ai { background: #9B87F5; }
.secret-box { display: block; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); font-size: var(--t-l); letter-spacing: .06em; word-break: break-all; }

/* avisos */
.aviso { display: flex; gap: 10px; align-items: baseline; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: var(--t-s); }
.aviso:hover { background: var(--surface-2); color: var(--ink); }
.aviso.unread { color: var(--ink); font-weight: 600; }
.aviso.unread::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; align-self: center; }

/* texto rico (mensagens e artigos) */
.rich { line-height: 1.6; overflow-wrap: anywhere; }
.rich p { margin: 0 0 .6em; }
.rich p:last-child { margin-bottom: 0; }
.rich ul, .rich ol { margin: 0 0 .6em; padding-left: 1.3em; }
.rich h3, .rich h4 { margin: .8em 0 .4em; }
.rich code { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; }
