/* Omni Audit Console — design system (SPEC-SAAS-FRONTEND §2.1).
   Premium operator console: Geist (UI) + Geist Mono (data). Crisp cool-neutral surfaces,
   hairline borders + a whisper of depth, deep-emerald accent used with restraint. Self-hosted. */

@font-face { font-family: 'Geist'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/console/static/fonts/geist-400.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/console/static/fonts/geist-500.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/console/static/fonts/geist-600.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/console/static/fonts/geistmono-400.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/console/static/fonts/geistmono-500.woff2') format('woff2'); }

:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f7f8fa; --surface-3: #eef0f3;
  --border: #e6e8ec; --border-2: #dcdfe4; --border-strong: #cfd3da;
  --text: #0d1117; --text-2: #3f4754; --text-3: #667085; --muted: #98a0ac;
  --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: #eef4ff; --accent-line: #c3d9fe;
  --accent-ink: #1e40af;
  --danger: #b42318; --danger-soft: #fef3f2; --danger-line: #fda29b;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89;
  --info: #175cd3; --info-soft: #eff8ff;
  --term-bg: #0b0e0c; --term-fg: #cdd3cc; --term-green: #34e39b;
  --font: 'Geist', -apple-system, ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
  --r: 6px; --r-sm: 4px;
  --sh-sm: 0 1px 2px rgba(16,24,40,.05);
  --sh: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
  --sh-md: 0 2px 4px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.05);
  --sh-btn: 0 1px 2px rgba(30,64,175,.24), inset 0 1px 0 rgba(255,255,255,.08);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 36px;
}

:root[data-theme="dark"] {
  --bg: #0c0f12; --surface: #14181d; --surface-2: #191e24; --surface-3: #222831;
  --border: #262c34; --border-2: #2f3742; --border-strong: #3a434f;
  --text: #e8ebef; --text-2: #aab2bd; --text-3: #7b8593; --muted: #5c6673;
  --accent: #5c9bff; --accent-2: #78adff; --accent-soft: #0f1e33; --accent-line: #23406b;
  --accent-ink: #a9caff;
  --danger: #f97066; --danger-soft: #2a1512; --danger-line: #5c2a24;
  --warn: #fdb022; --warn-soft: #2a2010; --warn-line: #5a4418;
  --info: #53b1fd; --info-soft: #10233a;
  --term-bg: #05070a; --term-fg: #c9d1d9; --term-green: #34e39b;
  --sh-sm: 0 1px 2px rgba(0,0,0,.3);
  --sh: 0 1px 2px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.3);
  --sh-md: 0 2px 4px rgba(0,0,0,.4), 0 6px 16px rgba(0,0,0,.35);
  --sh-btn: 0 1px 2px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
}
:root[data-theme="dark"] .brand .mark svg { color: #06231a; }
:root[data-theme="dark"] .btn:not(.subtle):not(.ghost):not(.danger) { color: #06101f; }
:root[data-theme="dark"] .msg.ai .av { color: #06101f; }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--border-strong); border-color: var(--bg); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: 'cv01' 1, 'cv03' 1, 'ss01' 1;
}
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border: 3px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

h1, h2, h3, h4 { margin: 0 0 var(--sp-3); color: var(--text); font-weight: 600; letter-spacing: -0.014em; }
h1 { font-size: 20px; line-height: 1.25; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { color: var(--accent-2); }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

.label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500; letter-spacing: -0.006em; line-height: 1;
  padding: 0 15px; height: 36px; border: 1px solid var(--accent-ink); border-radius: var(--r);
  background: var(--accent); color: #fff; box-shadow: var(--sh-btn); white-space: nowrap;
  transition: background 140ms ease, box-shadow 140ms ease, border-color 140ms ease, transform 60ms ease;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: transparent; color: var(--accent); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.subtle { background: var(--surface); color: var(--text-2); border-color: var(--border-2); box-shadow: var(--sh-sm); }
.btn.subtle:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); box-shadow: var(--sh-sm); }
.btn.danger:hover { background: var(--danger-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; }
.btn.sm { height: 30px; font-size: 12.5px; padding: 0 11px; }

/* ── Forms ───────────────────────────────────────────── */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  width: 100%; height: 38px; padding: 0 12px; font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r);
  box-shadow: var(--sh-sm); transition: border-color 130ms ease, box-shadow 130ms ease;
}
textarea { height: auto; padding: 10px 12px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
input::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft);
}
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

/* ── Cards ───────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--sp-5); box-shadow: var(--sh); }
.card + .card { margin-top: var(--sp-4); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }

/* ── Auth ────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5);
  background:
    radial-gradient(1200px 420px at 50% -12%, rgba(37,99,235,.06), transparent 70%),
    var(--bg); }
.auth-card { width: 100%; max-width: 384px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 34px 32px; box-shadow: var(--sh-md); }
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-3); font-size: 13.5px; margin-bottom: var(--sp-5); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  display: grid; place-items: center; box-shadow: var(--sh-btn); }
.brand .mark svg { width: 15px; height: 15px; color: #fff; }
.brand b { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.auth-card .brand { margin-bottom: var(--sp-5); }
.auth-alt { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-3); text-align: center; }

/* ── App shell ───────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 8px 4px; margin-bottom: var(--sp-5); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 2px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: color 120ms ease, background 120ms ease; }
.nav a svg { width: 17px; height: 17px; color: var(--muted); transition: color 120ms ease; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:hover svg { color: var(--text-3); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.active svg { color: var(--accent); }
.nav .group { padding: var(--sp-5) 10px 6px; }
.sidebar .foot { margin-top: auto; padding: var(--sp-3) 10px 0; border-top: 1px solid var(--border); }
.sidebar .foot .who { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: block; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 26px 40px; width: 100%; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--sp-5); }
.topbar h1 { margin: 0; }
.pagelede { color: var(--text-3); margin: 6px 0 var(--sp-5); max-width: 62ch; font-size: 13.5px; }

/* ── Metric tiles ────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); }
.tile .k { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 12px; }
.tile .k svg { width: 15px; height: 15px; color: var(--muted); }
.tile .n { font-size: 27px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-feature-settings: 'tnum' 1; }
.tile .n.accent { color: var(--accent); }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ── Steps ───────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); position: relative; }
.step .i { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.step .i svg { width: 15px; height: 15px; }
.step .n { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.08em; position: absolute; top: 18px; right: 18px; }
.step h3 { margin: 0 0 6px; }
.step p { font-size: 12.5px; color: var(--text-3); margin: 0; line-height: 1.5; }

/* ── Badges ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.02em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--border-2); color: var(--text-2); background: var(--surface-2); }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.crit, .badge.exploited { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.badge.high { color: #c4320a; border-color: #f9b98a; background: #fff4ed; }
.badge.med, .badge.pending { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.badge.low { color: var(--text-3); }
.badge.escalating { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.filtered { color: var(--muted); }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; letter-spacing: 0.02em; color: var(--text-3); font-weight: 500; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 110ms ease; }
tbody tr:hover { background: var(--surface-2); }
td a { color: var(--text); font-weight: 500; }
td a:hover { color: var(--accent); }
.empty { padding: 44px 24px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ── Chat (Gemini-like) ──────────────────────────────── */
.chat-wrap { display: flex; gap: 14px; height: calc(100vh - 190px); min-height: 460px; }
.chat-history { width: 250px; flex: none; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 12px; overflow: hidden; }
.chat-history .newchat { width: 100%; justify-content: center; gap: 7px; margin-bottom: 4px; }
.chat-history .newchat svg { width: 15px; height: 15px; }
.chat-history .convos-label { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 8px 2px; }
.chat-history .convos { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.chat-history .convo { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-size: 13px; text-decoration: none; transition: background .15s ease, color .15s ease; }
.chat-history .convo svg { width: 15px; height: 15px; flex: none; opacity: .7; }
.chat-history .convo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-history .convo:hover { background: var(--surface-2); color: var(--text); }
.chat-history .convo.active { background: var(--accent-soft); color: var(--accent-ink); }
.chat-history .convo.active svg { opacity: 1; }
.chat-history .convo-empty { color: var(--muted); font-size: 12.5px; padding: 8px 10px; }
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; background: var(--surface); }
.chat-log { flex: 1; overflow-y: auto; padding: 26px 26px 8px; scroll-behavior: smooth; }
.chat-log:empty::before { content: 'Converse com o assistente — escope um alvo, destrinche uma metodologia, ou raciocine sobre um achado.'; color: var(--muted); font-size: 13.5px; }
.msg { margin-bottom: 18px; display: flex; gap: 11px; align-items: flex-start; }
.msg .av { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; font-weight: 500; margin-top: 2px; }
.msg.me .av { background: var(--surface-3); color: var(--text-2); }
.msg.ai .av { background: var(--accent); color: #fff; }
.msg .bubble { min-width: 0; }
.msg.me .bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 13px; }
.msg .who { font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.msg .body { color: var(--text); white-space: pre-wrap; line-height: 1.62; font-size: 13.6px; word-wrap: break-word; }
.msg-in { animation: msg-in .26s cubic-bezier(.22,.61,.36,1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.msg .dots { display: inline-flex; gap: 5px; align-items: center; height: 20px; }
.msg .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; animation: dot-bounce 1.25s infinite ease-in-out; }
.msg .dots i:nth-child(2) { animation-delay: .16s; }
.msg .dots i:nth-child(3) { animation-delay: .32s; }
@keyframes dot-bounce { 0%, 70%, 100% { opacity: .3; transform: translateY(0) scale(.85); } 35% { opacity: 1; transform: translateY(-5px) scale(1); } }
.msg.typing .who { color: var(--accent-ink); }
.chat-input { padding: 14px 18px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input .pill { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 6px 6px 6px 16px; transition: border-color .15s ease, box-shadow .15s ease; }
.chat-input .pill:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-input .pill input { flex: 1; border: none; background: transparent; box-shadow: none; padding: 8px 0; font-size: 14px; color: var(--text); }
.chat-input .pill input:focus { outline: none; }
.chat-input .send { flex: none; width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; background: var(--accent); color: #fff; display: grid; place-items: center; transition: transform .12s ease, opacity .15s ease, background .15s ease; }
.chat-input .send svg { width: 17px; height: 17px; }
.chat-input .send:hover { background: var(--accent-2); transform: translateY(-1px); }
.chat-input .send:disabled { opacity: .5; cursor: default; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .msg-in { animation: none; }
  .msg .dots i { animation: none; opacity: .6; }
  .chat-log, .chat-history .convo, .chat-input .pill, .chat-input .send { transition: none; scroll-behavior: auto; }
}
.terminal { background: var(--term-bg); color: var(--term-fg); font-family: var(--font-mono); font-size: 12.5px;
  line-height: 1.65; padding: 16px; height: 300px; overflow-y: auto; border-radius: var(--r); }
.terminal .green { color: var(--term-green); }

/* ── Flash ───────────────────────────────────────────── */
.flash { padding: 11px 14px; border: 1px solid var(--border-2); border-radius: var(--r); margin-bottom: var(--sp-4); font-size: 13.5px; box-shadow: var(--sh-sm); }
.flash.err { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.flash.ok { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); }
.flash .label { display: block; margin-bottom: 3px; }

/* ── Utilities ───────────────────────────────────────── */
.row { display: flex; gap: var(--sp-3); align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.mt { margin-top: var(--sp-4); } .mb { margin-bottom: var(--sp-4); }
.rule { height: 1px; background: var(--border); border: none; margin: var(--sp-5) 0; }
form.inline { margin: 0; display: inline; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  padding: 4px 9px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.chip .d { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .v { font-family: var(--font-mono); font-size: 13px; }

/* ── Responsive ──────────────────────────────────────── */
/* Mobile shell/drawer/chat rules live in the consolidated block at end of file. */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.htmx-indicator { opacity: 0; transition: opacity 180ms ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }


/* theme toggle */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); color: var(--text-3);
  box-shadow: var(--sh-sm); transition: color 130ms ease, background 130ms ease, border-color 130ms ease; }
.theme-toggle:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ═══ Enriquecimento visual (catadão Mosaic/shadcn-admin/next-saas) ═══ */

/* App header (sticky, dentro do main) */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--sp-4);
  height: 60px; padding: 0 32px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--border); margin: -26px -40px 24px; }
.appbar .title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.appbar .crumb { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.appbar .actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Search (⌘K) */
.search { position: relative; width: 260px; max-width: 32vw; }
.search input { height: 34px; padding: 0 34px 0 32px; font-size: 13px; background: var(--surface-2);
  border-color: var(--border); box-shadow: none; }
.search input:focus { background: var(--surface); }
.search .si { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono);
  font-size: 10px; color: var(--muted); border: 1px solid var(--border-2); border-radius: 4px; padding: 1px 5px; background: var(--surface); }

/* Icon button (notificações etc.) */
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); color: var(--text-3);
  box-shadow: var(--sh-sm); transition: color 130ms, background 130ms, border-color 130ms; }
.iconbtn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn .dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); border: 1.5px solid var(--surface); }

/* Avatar (iniciais) */
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em; box-shadow: var(--sh-sm); cursor: default; }
:root[data-theme="dark"] .avatar { color: #06101f; }

/* Sidebar workspace (topo) */
.workspace { display: flex; align-items: center; gap: 10px; padding: 8px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.workspace .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; box-shadow: var(--sh-btn); flex: none; }
.workspace .mark svg { width: 17px; height: 17px; color: #fff; }
:root[data-theme="dark"] .workspace .mark svg { color: #06101f; }
.workspace .meta { min-width: 0; }
.workspace .org { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace .plan { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Sidebar user profile (rodapé) */
.profile { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: var(--r-sm); }
.profile .avatar { width: 30px; height: 30px; font-size: 11px; }
.profile .pmeta { min-width: 0; flex: 1; }
.profile .pname { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile .pmail { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile form { margin: 0; }
.profile .logout { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); cursor: pointer; transition: color 130ms, background 130ms; }
.profile .logout:hover { color: var(--danger); background: var(--danger-soft); }
.profile .logout svg { width: 15px; height: 15px; }

/* Trend chip (stat cards) */
.trend { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.trend.up { color: var(--accent); } .trend.down { color: var(--danger); }
.trend svg { width: 12px; height: 12px; }
.tile .k .ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.tile .k .ico svg { width: 15px; height: 15px; }
.tile .krow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tile.rich .n { font-size: 26px; margin-bottom: 4px; }

/* Welcome banner */
.welcome { margin-bottom: var(--sp-5); }
.welcome h2 { font-size: 18px; margin: 0 0 3px; letter-spacing: -0.02em; }
.welcome p { color: var(--text-3); margin: 0; font-size: 13.5px; }

/* Panel + activity + quick */
.cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--sp-4); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.panel .ph { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel .ph h3 { margin: 0; }
.panel .pb { padding: 6px 6px; }
.act { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); }
.act:hover { background: var(--surface-2); }
.act .aico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none; background: var(--surface-2); color: var(--text-3); }
.act .aico svg { width: 15px; height: 15px; }
.act .amain { flex: 1; min-width: 0; }
.act .at { font-size: 13px; font-weight: 500; }
.act .as { font-size: 11.5px; color: var(--muted); }
.act .awhen { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.quick a { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: var(--r-sm); color: var(--text); transition: background 130ms; }
.quick a:hover { background: var(--surface-2); text-decoration: none; }
.quick a .qico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex: none; }
.quick a .qico svg { width: 16px; height: 16px; }
.quick a .qt { font-size: 13px; font-weight: 500; }
.quick a .qs { font-size: 11.5px; color: var(--muted); }
.quick a .arr { margin-left: auto; color: var(--muted); }

@media (max-width: 980px) { .cols { grid-template-columns: 1fr; } }

/* ═══ Landing (marketing / tela comercial antes do login) ═══ */
.mkt { min-height: 100vh; }
.mkt-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px;
  height: 62px; padding: 0 32px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.mkt-nav .brand b { font-size: 15px; }
.mkt-nav .links { margin-left: 20px; display: flex; gap: 4px; }
.mkt-nav .links a { padding: 7px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.mkt-nav .links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mkt-nav .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mkt-wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.hero { text-align: center; padding: 92px 0 64px;
  background: radial-gradient(900px 380px at 50% -8%, var(--accent-soft), transparent 68%); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 20px; padding: 5px 12px; margin-bottom: 22px; }
.hero .eyebrow .d { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: 46px; line-height: 1.05; letter-spacing: -0.03em; max-width: 16ch; margin: 0 auto 18px; }
.hero p { font-size: 17px; color: var(--text-2); max-width: 56ch; margin: 0 auto 30px; line-height: 1.55; }
.hero .cta { display: flex; gap: 12px; justify-content: center; }
.hero .btn { height: 42px; padding: 0 20px; font-size: 14px; }
@media (max-width: 700px) { .hero h1 { font-size: 32px; } .hero { padding: 60px 0 44px; } }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); padding: 8px 0 40px; }
.feat { padding: 22px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--sh); }
.feat .fi { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.feat .fi svg { width: 20px; height: 20px; }
.feat h3 { font-size: 14.5px; margin: 0 0 6px; }
.feat p { font-size: 13px; color: var(--text-3); margin: 0; line-height: 1.55; }
.ctaband { text-align: center; margin: 24px 0 56px; padding: 44px; border: 1px solid var(--border); border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-soft), var(--surface)); box-shadow: var(--sh); }
.ctaband h2 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 8px; }
.ctaband p { color: var(--text-2); margin: 0 0 20px; }
.mkt-foot { border-top: 1px solid var(--border); padding: 26px 32px; text-align: center; color: var(--muted); font-size: 12.5px; }
.mkt-foot .brand { display: inline-flex; margin-bottom: 8px; }


/* Sidebar: grupos de produto (Vexnary multi-produto) */
.nav .prod { display: flex; align-items: center; gap: 8px; padding: 14px 10px 6px; }
.nav .prod .pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.nav .prod .pname { font-size: 12px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.nav .prod .soon { margin-left: auto; font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border-2); border-radius: 10px; padding: 1px 6px; }
.sidebar .brand-top { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.sidebar .brand-top .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; box-shadow: var(--sh-btn); flex: none; }
.sidebar .brand-top .mark svg { width: 16px; height: 16px; color: #fff; }
:root[data-theme="dark"] .sidebar .brand-top .mark svg { color: #06101f; }
.sidebar .brand-top b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sidebar .brand-top .tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; }
.nav { overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-5); }
.settings-nav a { display: block; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.settings-nav a.active, .settings-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
@media (max-width: 760px) { .settings-grid { grid-template-columns: 1fr; } }

/* Product-soon splash */
.soon-hero { text-align: center; padding: 60px 24px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface); }
.soon-hero .badge { margin-bottom: 16px; }
.soon-hero h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 8px; }
.soon-hero p { color: var(--text-3); max-width: 52ch; margin: 0 auto 22px; }

/* Landing: seções produtos + planos + empresa */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head .label { display: block; margin-bottom: 10px; }
.section-head h2 { font-size: 30px; letter-spacing: -0.025em; margin: 0 0 8px; }
.section-head p { color: var(--text-2); max-width: 52ch; margin: 0 auto; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4); }
.prod-card { padding: 26px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--sh); display: flex; flex-direction: column; }
.prod-card .fi { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 16px; }
.prod-card .fi svg { width: 22px; height: 22px; }
.prod-card .st { align-self: flex-start; margin-bottom: 12px; }
.prod-card h3 { font-size: 17px; letter-spacing: -0.01em; margin: 0 0 6px; }
.prod-card p { color: var(--text-3); font-size: 13.5px; margin: 0 0 18px; line-height: 1.55; flex: 1; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-4); }
.plan { padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--sh); }
.plan.feature { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--sh-md); position: relative; }
.plan.feature::before { content: 'Popular'; position: absolute; top: -10px; left: 28px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 20px; padding: 3px 10px; }
.plan .pn { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.plan .price { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; }
.plan .price small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan .pd { color: var(--text-3); font-size: 13px; margin: 4px 0 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; }
.plan li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); padding: 6px 0; }
.plan li svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 1px; }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.about h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 14px; }
.about p { color: var(--text-2); line-height: 1.6; margin: 0 0 14px; }
.about .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about .stat { padding: 18px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.about .stat .sn { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--accent); }
.about .stat .sl { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; gap: 24px; } .section-head h2 { font-size: 24px; } }

/* Findings: segment bar + attacker narrative */
.segbar { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: var(--sp-4); }
.segbar a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--text-2); }
.segbar a:hover { color: var(--text); text-decoration: none; }
.segbar a.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.segbar a span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--surface-3); border-radius: 10px; padding: 0 6px; }
.segbar a.active span { background: var(--accent-soft); color: var(--accent); }
.attacker { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 4px 0 18px; }
.attacker .label { color: var(--accent); }
.attacker p { font-size: 15px; margin: 6px 0 0; line-height: 1.55; }

/* Live terminal lines (SPEC-SAAS-STREAM) */
.tline { padding: 1px 0; white-space: pre-wrap; word-break: break-word; }
.tline.lvl-ok { color: var(--term-green); }
.tline.lvl-warn { color: #fdb022; }
.tline.lvl-err { color: #f97066; }
.tline::before { content: '›  '; color: #4b5563; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first overrides (drawer nav + phone layout).
   Desktop (>960px) is untouched. Breakpoints: 960px (tablet+drawer), 640px (phone).
   ═════════════════════════════════════════════════════════════════════════ */

/* Mobile-only controls are hidden on desktop; media queries below reveal them. */
.nav-toggle, .nav-scrim, .chat-convos-toggle, .chat-scrim { display: none; }

/* ── Tablet & mobile: off-canvas sidebar drawer (≤960px) ─────────────────── */
@media (max-width: 960px) {
  /* Shell collapses to one column; main takes the full width. */
  .shell { grid-template-columns: 1fr; }

  /* Sidebar → off-canvas drawer, hidden by default. */
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 60;
    width: 280px; max-width: 86vw; height: 100dvh;
    border-right: 1px solid var(--border); box-shadow: var(--sh-md);
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.22,.61,.36,1);
    overflow-y: auto;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar .foot { display: block; }

  /* Scrim behind the open drawer. */
  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(6, 9, 12, .5);
    opacity: 0; visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
  }
  body.nav-open .nav-scrim { opacity: 1; visibility: visible; }

  /* Hamburger button in the appbar. */
  .nav-toggle {
    display: inline-grid; place-items: center; flex: none;
    width: 40px; height: 40px; margin-left: -4px; cursor: pointer;
    background: transparent; border: 1px solid transparent; border-radius: var(--r);
    color: var(--text-2); transition: color 130ms, background 130ms;
  }
  .nav-toggle:hover { background: var(--surface-2); color: var(--text); }
  .nav-toggle svg { width: 20px; height: 20px; }

  /* Appbar bleeds to the padding edges and tightens. */
  .appbar { margin: -20px -20px 20px; padding: 0 16px; gap: 10px; }
  .appbar .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 20px; }

  /* Search shrinks (becomes an icon-sized field); hidden entirely on phones. */
  .search { width: 150px; max-width: 40vw; }

  /* Prevent horizontal overflow without breaking the sticky appbar. */
  body { overflow-x: clip; }

  /* Chat: the conversation list becomes its own off-canvas drawer. */
  .chat-convos-toggle { display: inline-flex; margin-bottom: 12px; }
  .chat-wrap { height: calc(100dvh - 168px); min-height: 300px; gap: 0; }
  .chat { width: 100%; }
  .chat-history {
    position: fixed; top: 0; left: 0; z-index: 70;
    width: 300px; max-width: 86vw; height: 100dvh;
    border-radius: 0; box-shadow: var(--sh-md);
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.22,.61,.36,1);
  }
  body.chat-convos-open .chat-history { transform: translateX(0); }
  .chat-scrim {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(6, 9, 12, .5);
    opacity: 0; visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
  }
  body.chat-convos-open .chat-scrim { opacity: 1; visibility: visible; }

  /* Landing: drop the anchor links, keep brand + auth CTAs. */
  .mkt-nav { padding: 0 20px; gap: 12px; }
  .mkt-wrap { padding: 0 20px; }
}

/* ── Phone tightening + touch targets (≤640px) ───────────────────────────── */
@media (max-width: 640px) {
  .main { padding: 16px; }
  .appbar { margin: -16px -16px 16px; padding: 0 12px; height: 56px; gap: 8px; }
  .appbar .actions { gap: 8px; }
  .search { display: none; }
  .iconbtn { display: none; }
  h1 { font-size: 18px; }

  /* Grids / tiles collapse to a single column. */
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .steps { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: var(--sp-4); }

  /* Wide tables scroll inside their wrapper — never the whole page. */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; }
  .segbar { width: 100%; overflow-x: auto; }

  /* Touch targets ≥44px; 16px inputs to avoid iOS focus-zoom. */
  .btn { height: 44px; }
  .btn.sm { height: 38px; }
  input, select { height: 44px; }
  input, select, textarea { font-size: 16px; }
  .nav a { padding: 11px 10px; }
  .chat-input .send { width: 44px; height: 44px; }

  /* Auth cards fit narrow screens. */
  .auth-wrap { padding: 16px; }
  .auth-card { padding: 26px 20px; }

  /* Landing: stack CTAs, tighten sections. */
  .mkt-nav { padding: 0 14px; }
  .mkt-nav .links { display: none; }
  .mkt-wrap { padding: 0 16px; }
  .section { padding: 40px 0; }
  .hero .cta { flex-direction: column; align-items: stretch; }
  .hero .cta .btn { width: 100%; }
  .section-head h2 { font-size: 22px; }
  .prod-card, .plan, .feat { padding: 20px; }
  .ctaband { padding: 28px 20px; margin: 16px 0 40px; }
}
