:root {
  color-scheme: dark;
  --bg-canvas: #060A12;
  --bg-panel: #0D1526;
  --bg-panel-elevated: #131F38;
  --border-hud: rgba(34, 211, 238, .20);
  --border-hud-focus: rgba(34, 211, 238, .60);
  --color-primary: #22D3EE;
  --color-ok: #10B981;
  --color-warn: #F59E0B;
  --color-critical: #F43F5E;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg-canvas); color: var(--text-primary); }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.shell { max-width: 1280px; margin: auto; padding: 20px; }
.skip { position: fixed; z-index: 2; transform: translateY(-200%); top: 10px; left: 10px; color: var(--bg-canvas); background: var(--color-primary); padding: 8px; }
.skip:focus { transform: none; }
.top {
  min-height: 60px; display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 8px 15px; border: 1px solid var(--border-hud); border-radius: 8px;
  background: var(--bg-panel);
}
.trim {
  background-image: linear-gradient(var(--color-primary),var(--color-primary)),linear-gradient(var(--color-primary),var(--color-primary)),
    linear-gradient(var(--color-primary),var(--color-primary)),linear-gradient(var(--color-primary),var(--color-primary)),
    linear-gradient(var(--color-primary),var(--color-primary)),linear-gradient(var(--color-primary),var(--color-primary)),
    linear-gradient(var(--color-primary),var(--color-primary)),linear-gradient(var(--color-primary),var(--color-primary));
  background-size: 6px 1px,1px 6px,6px 1px,1px 6px,6px 1px,1px 6px,6px 1px,1px 6px;
  background-position: left top,left top,right top,right top,left bottom,left bottom,right bottom,right bottom;
  background-repeat: no-repeat;
}
.identity, .sync, .alerts { display: flex; gap: 10px; align-items: center; }
.identity { flex-shrink: 0; }
.radar-mark { color: var(--color-primary); flex: 0 0 auto; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 18px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
.sync { min-width: max-content; }
.sync time { display: block; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.sync span { display: block; color: var(--text-secondary); font-size: 11px; }
.alerts { justify-content: center; min-width: 0; flex-wrap: wrap; }
.alerts button { max-width: 225px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.badge, .tab-count {
  display: inline-block; width: fit-content; border: 1px solid #30415b; border-radius: 4px; padding: 3px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary);
  background: #101b2d; line-height: 1.25;
}
.tab-count { font: 600 11px/1.2 var(--mono); margin-left: 3px; }
.state-ok { color: #6ee7b7; border-color: #205c53; background: #0c272c; }
.state-warn { color: #fcd27a; border-color: #725321; background: #271f19; }
.state-critical { color: #fda4af; border-color: #80354c; background: #321d2c; }
.state-info { color: #8be7f5; border-color: #285262; background: #102635; }
.text-critical { color: #fda4af; }
.text-warn { color: #fcd27a; }
.text-info { color: var(--color-primary); }
.text-secondary, .meta { color: var(--text-secondary); }
.meta { font-size: 12px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nav { display: flex; gap: 22px; border-bottom: 1px solid var(--border-hud); margin: 10px 0 25px; overflow: auto; scrollbar-width: thin; }
.nav button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-secondary); min-height: 48px; padding: 8px 2px; font-weight: 600; white-space: nowrap; }
.nav button:hover, .nav button[aria-selected="true"] { color: var(--text-primary); }
.nav button[aria-selected="true"] { border-color: var(--color-primary); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h2 { letter-spacing: -.025em; font-size: 24px; line-height: 1.2; }
.page-head p { color: var(--text-secondary); margin-top: 4px; }
.filters, .actions, .tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters { padding: 10px 0 16px; justify-content: space-between; }
.button, .filter {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  padding: 6px 12px; border: 1px solid #2d4057; border-radius: 6px; color: var(--text-primary); background: #101a2b;
}
.button:hover, .filter:hover { background: var(--bg-panel-elevated); border-color: var(--border-hud-focus); }
.button.compact { min-height: 32px; font-size: 12px; }
.filter { border-radius: 20px; color: var(--text-secondary); }
.filter[aria-pressed="true"] { color: #a4eef8; background: #112735; border-color: var(--border-hud-focus); }
.primary { color: #06212a; background: var(--color-primary); border-color: var(--color-primary); font-weight: 700; }
.primary:hover { color: var(--bg-canvas); background: #81eaf7; }
.approve { color: #80efc6; background: #10342e; border-color: #278367; font-weight: 650; }
.respond { color: #9eefef; border-color: #2b6678; }
.defer { color: #f6cd77; border-color: #725321; }
.grid, .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel, .card { background-color: var(--bg-panel); border: 1px solid var(--border-hud); border-radius: 8px; padding: 16px 20px; min-width: 0; }
.card { display: flex; flex-direction: column; gap: 10px; min-height: 174px; }
.card:focus-within { border-color: var(--border-hud-focus); }
.card.saved { border-color: var(--color-ok); transition: border-color 1.5s; }
.tags { row-gap: 4px; color: var(--text-secondary); font-size: 12px; }
.tag-divider::before { content: '·'; padding-right: 8px; }
.card h3 { overflow-wrap: anywhere; }
.card .actions { margin-top: auto; }
.card-info { white-space: pre-line; overflow-wrap: anywhere; color: var(--text-secondary); }
.clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.text-button { background: none; padding: 0; border: 0; text-align: left; color: var(--color-primary); width: fit-content; }
.empty { padding: 14px; border: 1px dashed rgba(34, 211, 238, .25); background: var(--bg-panel); color: var(--text-secondary); border-radius: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.panel > .meta { margin-bottom: 10px; }
.full-width { grid-column: 1/-1; }
svg.chart { width: 100%; height: auto; overflow: visible; display: block; }
.chart text { fill: var(--text-secondary); font-family: var(--mono); font-size: 11px; }
.chart text.metric { fill: var(--text-primary); font-size: 12px; }
.chart text.funnel-number { fill: var(--color-primary); font-size: 23px; font-weight: 650; }
.chart .track { fill: #1e293b; }
.chart .gmail { fill: var(--color-primary); }
.chart .whatsapp { fill: var(--color-ok); }
.chart .pending { fill: var(--color-warn); }
.chart .stage-box { fill: #101b2d; stroke: #33536b; }
.chart .connector { stroke: #67c9db; fill: none; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-secondary); margin: 9px 0; }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--swatch); }
.legend .legend-gmail { --swatch: var(--color-primary); }
.legend .legend-whatsapp { --swatch: var(--color-ok); }
.legend .legend-pending { --swatch: var(--color-warn); }
.progress-list { display: grid; gap: 15px; }
.progress-row { display: grid; grid-template-columns: minmax(105px,170px) minmax(75px, 1fr) minmax(70px, auto); gap: 12px; align-items: center; }
.progress-row svg { min-width: 0; width: 100%; display: block; }
.progress-row .mono { text-align: right; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { padding: 9px 0; border-bottom: 1px solid #22324a; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.row:last-child { border-bottom: 0; }
.row .meta { margin-top: 2px; }
.row time, .row .badge { flex-shrink: 0; }
.rank { color: var(--color-primary); font-size: 12px; margin-right: 7px; }
.metric-large { font: 600 38px/1.15 var(--mono); color: var(--color-primary); }
.metric-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.project { padding: 8px; border-radius: 6px; border: 1px solid #273b52; background: #101b2d; overflow-wrap: anywhere; }
.project .badge { margin: 4px 0; }
.note-form { display: grid; gap: 9px; }
textarea { padding: 9px; min-height: 100px; width: 100%; border: 1px solid #355571; border-radius: 8px; background: var(--bg-canvas); color: var(--text-primary); resize: vertical; }
dialog { width: min(580px,calc(100vw - 28px)); max-height: min(620px,calc(100vh - 28px)); color: var(--text-primary); background: var(--bg-panel); border: 1px solid var(--border-hud-focus); border-radius: 8px; padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.68); }
.notice { position: fixed; right: 24px; bottom: 20px; z-index: 3; padding: 11px 16px; background: #12312e; border: 1px solid #2f8c74; color: #b7f2db; border-radius: 8px; }
.notice.failure { background: #321d2c; color: #fda4af; border-color: #80354c; }
@media (max-width: 899px) {
  .grid, .cards { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; }
  .alerts { order: 3; flex-basis: 100%; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .shell { padding: 12px; }
  .top, .panel, .card { padding: 12px; }
  .nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; overflow: visible; }
  .nav button { min-width: 0; white-space: normal; text-align: left; line-height: 1.25; }
  .panel-head { flex-wrap: wrap; }
  .card .button { min-height: 40px; }
  .top .sync { flex: 1 1 240px; justify-content: space-between; }
  .sync time { text-align: left; }
  .alerts { width: 100%; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .progress-row { grid-template-columns: 95px minmax(30px, 1fr) auto; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}


.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-panel { width: min(100%, 420px); display: grid; gap: 16px; padding: 22px; }
.login-panel h2 { font-size: 22px; }
.login-form { display: grid; gap: 8px; }
.login-form label { font-weight: 600; }
.login-form input { color: var(--text-primary); background: var(--bg-canvas); padding: 10px 12px; border: 1px solid #355571; border-radius: 6px; min-height: 44px; min-width: 0; font: inherit; }
.login-form input:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.login-form .button { min-height: 44px; }
