/* Primus UI - shared look for Primus Identity, Ronda Hub and the future super app.
   Themes: light / dark / system (prefers-color-scheme), set on <html data-theme>.
   Accents: <html data-accent="blue|teal|violet|amber">. No external fonts or libraries. */

:root {
  --accent: #1a73e8; --accent-ink: #ffffff; --accent-soft: #e8f0fe; --accent-hover: #1765cc;
  --bg: #f4f6fb; --bg-2: #eef1f7; --surface: #ffffff; --surface-2: #f8f9fc;
  --ink: #1f2430; --ink-2: #4b5363; --muted: #6b7385; --line: #e3e7ef; --line-strong: #cfd6e3;
  --red: #d93025; --red-soft: #fdecea; --green: #188038; --green-soft: #e6f4ea;
  --amber: #b06000; --amber-soft: #fef4e0; --blue-soft: #e8f0fe;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .14);
  --radius: 14px; --radius-sm: 9px;
  --sidebar: 248px;
  color-scheme: light;
}
:root[data-accent="teal"]   { --accent: #00897b; --accent-hover: #00796b; --accent-soft: #e0f2f1; }
:root[data-accent="violet"] { --accent: #6d4aff; --accent-hover: #5b3be6; --accent-soft: #efebff; }
:root[data-accent="amber"]  { --accent: #e37400; --accent-hover: #c86600; --accent-soft: #fff1e0; }

/* dark: explicit choice, or the device setting when no choice was made */
:root[data-theme="dark"] {
  --bg: #0f1218; --bg-2: #141923; --surface: #171c26; --surface-2: #1d2330;
  --ink: #e7eaf0; --ink-2: #c3c9d6; --muted: #8b93a5; --line: #262d3b; --line-strong: #343c4d;
  --red-soft: #3a1c1b; --green-soft: #15301f; --amber-soft: #3a2a12; --blue-soft: #18243d; --accent-soft: #1b2740;
  --red: #f28b82; --green: #81c995; --amber: #fdd663;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 18px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --bg-2: #141923; --surface: #171c26; --surface-2: #1d2330;
    --ink: #e7eaf0; --ink-2: #c3c9d6; --muted: #8b93a5; --line: #262d3b; --line-strong: #343c4d;
    --red-soft: #3a1c1b; --green-soft: #15301f; --amber-soft: #3a2a12; --blue-soft: #18243d; --accent-soft: #1b2740;
    --red: #f28b82; --green: #81c995; --amber: #fdd663;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 18px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 44px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 28px 0 12px; }
h2.first { margin-top: 0; }
.muted { color: var(--muted); }
.sub { font-weight: 400; }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.mono { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; letter-spacing: .4px; }
.err { color: var(--red); min-height: 1.3em; margin: 0; font-size: 14px; }
.ok-msg { color: var(--green); min-height: 1.3em; margin: 0; font-size: 14px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- controls ---- */
button { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-sm);
  padding: 9px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  transition: background .15s, box-shadow .15s, transform .05s; }
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: progress; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
button.ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); }
button.ghost:hover { background: var(--surface-2); color: var(--ink); }
button.danger { background: var(--red); color: #fff; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 600; }
button.link:hover { text-decoration: underline; background: none; }
button.icon { background: none; color: var(--ink-2); padding: 8px; border-radius: 10px; }
button.icon:hover { background: var(--surface-2); color: var(--ink); }
input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 100%;
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* ---- app frame ---- */
.top { position: sticky; top: 0; z-index: 5; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4285f4 0%, #34a853 35%, #fbbc05 65%, #ea4335 100%); box-shadow: var(--shadow); }
.logo svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--accent-soft); color: var(--accent); }
#menuBtn { display: none; }

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: calc(100vh - 60px); }
.shell.bare { grid-template-columns: 1fr; }
.side { border-right: 1px solid var(--line); background: var(--surface); padding: 16px 12px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; }
.shell.bare .side { display: none; }
.side .group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 10px 6px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.side a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side a.on { background: var(--accent-soft); color: var(--accent); }
.side a .tag { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
main { padding: 28px 32px 64px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card h2 { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .i { color: var(--accent); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.stack { display: grid; gap: 14px; margin-top: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input, .row select { width: auto; flex: 1; min-width: 150px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.banner { display: flex; gap: 12px; align-items: flex-start; background: var(--amber-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; }
.banner .i { color: var(--amber); margin-top: 2px; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat .v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }

/* ---- tables ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.when { white-space: nowrap; color: var(--muted); font-size: 13px; }
td.detail { overflow-wrap: anywhere; }
td select { width: auto; padding: 6px 10px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 30px; height: 30px; font-size: 12px; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.crit { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--blue-soft); color: var(--accent); }
.badge.role { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); text-transform: capitalize; }

/* ---- sign-in pages ---- */
.auth { min-height: calc(100vh - 60px); display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .art { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end;
  background: radial-gradient(1200px 600px at 10% 10%, #4285f4 0%, transparent 55%),
              radial-gradient(900px 500px at 90% 30%, #34a853 0%, transparent 55%),
              radial-gradient(800px 600px at 40% 100%, #ea4335 0%, transparent 55%),
              radial-gradient(700px 400px at 100% 100%, #fbbc05 0%, transparent 60%), #1b2a4a; }
.auth .art h2 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; max-width: 460px; }
.auth .art p { font-size: 16px; opacity: .92; max-width: 440px; margin: 0; }
.auth .art .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.auth .art .chip { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; backdrop-filter: blur(4px); }
.auth .pane { display: grid; place-items: center; padding: 32px 20px; }
.auth .box { width: 100%; max-width: 400px; }
.auth .box h1 { font-size: 28px; }
.auth form { display: grid; gap: 14px; margin-top: 22px; }
.auth form button[type=submit] { padding: 12px; font-size: 15px; }
.narrow { max-width: 440px; margin: 48px auto; }
.narrow form { display: grid; gap: 14px; margin-top: 16px; }

/* ---- 2-step ---- */
.qr { background: #fff; display: inline-block; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.qr svg { width: 200px; height: 200px; display: block; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 28px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 16px; margin: 12px 0; }
ol.steps { padding-left: 18px; color: var(--ink-2); }

/* ---- theme menu ---- */
.menu { position: relative; }
.menu .pop { position: absolute; right: 0; top: 44px; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 10px; display: none; z-index: 10; }
.menu.open .pop { display: block; }
.pop .lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 6px 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 4px; }
.seg button { background: none; color: var(--ink-2); padding: 7px 4px; font-size: 13px; border-radius: 8px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.swatches { display: flex; gap: 10px; padding: 4px 6px 6px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid transparent; }
.swatch.on { border-color: var(--ink); }
.swatch.blue { background: #1a73e8; } .swatch.teal { background: #00897b; } .swatch.violet { background: #6d4aff; } .swatch.amber { background: #e37400; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 60px; width: 270px; z-index: 6; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.menu-open .side { transform: none; }
  #menuBtn { display: inline-flex; }
  main { padding: 20px 16px 56px; }
  .who .name { display: none; }
}
@media print { .top, .side { display: none !important; } .shell { display: block; } body { background: #fff; } }
main.full { padding: 0; max-width: none; }
.org-card { display: grid; gap: 10px; }
.org-card .top-line { display: flex; align-items: center; gap: 12px; }
.org-card .code { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.org-card .acts { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.section { margin-top: 22px; }
.section > .card-head h2 { margin: 0; }
[hidden] { display: none !important; }
body:not(.signed-in) #menuBtn { display: none !important; }

/* ---- Error Hub additions ---- */
.logo.warm { background: linear-gradient(135deg, #ea4335 0%, #fbbc05 100%); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters label { min-width: 150px; }
.filters .grow { flex: 1; min-width: 220px; }
.issue-title { font-weight: 600; color: var(--ink); display: block; overflow-wrap: anywhere; }
.issue-title:hover { color: var(--accent); }
.frame { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num { text-align: right; }
tr.click { cursor: pointer; }
pre.stack { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; overflow: auto;
  max-height: 520px; font: 12.5px/1.5 Consolas, "Cascadia Mono", "Courier New", monospace; color: var(--ink); white-space: pre; margin: 8px 0 0; }
pre.stack.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; background: var(--red-soft); color: var(--ink); border-radius: var(--radius-sm); padding: 10px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }
textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 100%; min-height: 110px;
  background: var(--surface); color: var(--ink); resize: vertical; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.site-card { display: grid; gap: 8px; }
.site-card .top-line { display: flex; align-items: center; gap: 12px; }
.site-card .code { min-width: 46px; height: 42px; padding: 0 8px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.site-card .nums { display: flex; gap: 18px; }
.site-card .nums b { font-size: 20px; display: block; line-height: 1.1; }
.pager { display: flex; justify-content: center; margin-top: 14px; }
.badge.level-severe, .badge.level-error { background: var(--red-soft); color: var(--red); }
.badge.level-warning { background: var(--amber-soft); color: var(--amber); }
.badge.status-open { background: var(--blue-soft); color: var(--accent); }
.badge.status-resolved { background: var(--green-soft); color: var(--green); }
.badge.status-ignored { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
details.report { border-bottom: 1px solid var(--line); padding: 10px 14px; }
details.report:last-child { border-bottom: 0; }
details.report summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
details.report summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
a.card { color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.badge.role { text-transform: none; }

/* ---- brand: hub mark + wordmark ---- */
.logo.warm { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #ff5a4e 0%, #ea4335 45%, #fbbc05 100%);
  box-shadow: 0 2px 8px rgba(234, 67, 53, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.logo.warm svg { width: 26px; height: 26px; stroke: none; fill: none; }
.logo.warm .spokes path { stroke: rgba(255, 255, 255, .7); stroke-width: 1.8; stroke-linecap: round; }
.logo.warm .node { fill: #fff; }
.logo.warm .hub { fill: #fff; }
.logo.warm .bang { stroke: #d93025; stroke-width: 2.4; stroke-linecap: round; }
.logo.warm .dot { fill: #d93025; }
.wordmark { display: grid; line-height: 1.1; gap: 1px; }
.wordmark b { font-size: 16px; letter-spacing: -.01em; }
.wordmark small { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--muted); }

/* ---- admin ---- */
dialog.dlg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px 24px;
  width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog.dlg::backdrop { background: rgba(10, 14, 22, .55); backdrop-filter: blur(2px); }
dialog.dlg h2 { margin: 0; }
dialog.dlg label span { font-weight: 400; }
.secret { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.secret code { flex: 1; font-size: 15px; overflow-wrap: anywhere; user-select: all; }
.acts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
td .acts { justify-content: flex-start; }
tr.dim td { opacity: .55; }
button.danger:hover { background: #b3261e; }
.banner button { margin-left: 8px; }

/* ---- Ronda Hub ---- */
.logo.cool { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #1a73e8 0%, #12a1a1 55%, #34a853 100%);
  box-shadow: 0 2px 8px rgba(26, 115, 232, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.logo.cool svg { width: 26px; height: 26px; fill: none; stroke: none; }
.logo.cool .ring1 { stroke: rgba(255, 255, 255, .45); stroke-width: 1.6; }
.logo.cool .ring2 { stroke: rgba(255, 255, 255, .75); stroke-width: 1.6; }
.logo.cool .sweep { stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.logo.cool .core { fill: #fff; }
.logo.cool .blip { fill: #fbbc05; }
.auth .art.cool { background: radial-gradient(1100px 600px at 10% 10%, #1a73e8 0%, transparent 55%), radial-gradient(900px 500px at 90% 40%, #12a1a1 0%, transparent 55%),
  radial-gradient(800px 600px at 40% 100%, #34a853 0%, transparent 55%), #0f2a3a; }
.badge.new, .badge.off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.side .tag.lvl-crit { color: var(--red); font-weight: 700; }
.side .tag.lvl-warn { color: var(--amber); font-weight: 700; }
.side .tag.lvl-ok { color: var(--green); }
.site-card { border-left: 4px solid var(--line); }
.site-card.st-crit { border-left-color: var(--red); }
.site-card.st-warn { border-left-color: var(--amber); }
.site-card.st-ok { border-left-color: var(--green); }
.agents { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.agent { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.agent.silent .pulse-dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; overflow-x: auto; }
nav.tabs a { padding: 10px 14px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs a:hover { color: var(--ink); text-decoration: none; }
nav.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.chart { padding: 16px 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.chart .now { font-size: 20px; font-weight: 700; color: var(--accent); }
.chart svg { width: 100%; height: 150px; display: block; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .lbl { fill: var(--muted); font-size: 10px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi { padding: 14px 16px; box-shadow: none; }
.kpi .v { font-size: 22px; font-weight: 700; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.card.report h2 { margin-top: 22px; }
.card.report h2:first-child { margin-top: 0; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
@media print { .filters, nav.tabs, .agents { display: none !important; } .card { box-shadow: none; } }
.row label input { width: 110px; }
.pre { white-space: pre-wrap; }
/* ---- Sign in with Primus ---- */
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px; border-radius: var(--radius-sm); margin-top: 18px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; }
.sso-btn:hover { border-color: var(--accent); text-decoration: none; background: var(--surface-2); }
.sso-btn .logo-mini { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, #4285f4 0%, #34a853 35%, #fbbc05 65%, #ea4335 100%); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 16px 0 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- selects: our own chevron + themed options (the open list itself is drawn by the OS) ---- */
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7385' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px; }
select:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a73e8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
select option { background: var(--surface); color: var(--ink); }
select option:checked { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
td select { padding-right: 32px; background-position: right 8px center; }

/* ---- every native widget follows the theme ---- */
html { accent-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { opacity: .5; }
input[type=date], input[type=month], input[type=time], input[type=datetime-local] { min-height: 42px; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
:root[data-theme="dark"] input::-webkit-calendar-picker-indicator { filter: invert(.85); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input::-webkit-calendar-picker-indicator { filter: invert(.85); } }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
details > summary { color: var(--ink); }
dialog { color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.seg.seg2 { grid-template-columns: repeat(2, 1fr); }

/* =====================================================================
   v2 shell (Lulus style): no top header. Signed in = sidebar with the brand
   on top and you / theme / language at the bottom. Signed out = the brand
   inside the page and a small corner switch (language + theme).
   ===================================================================== */
.top { display: none !important; }
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.shell.bare { grid-template-columns: 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface);
  border-right: 1px solid var(--line); padding: 18px 12px 12px; z-index: 6; }
.shell.bare .sidebar { display: none; }
.sidebar > .brand { padding: 4px 10px 18px; }
.side { position: static; height: auto; border: 0; background: none; padding: 0; flex: 1; overflow: auto; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.side-foot .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.side-foot .who .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); font-size: 14px; }
.side-foot .who .name { display: block !important; }
.side-foot .menu .pop { top: auto; bottom: 46px; right: auto; left: -150px; }
main { padding: 32px 36px 64px; max-width: 1240px; }
main.full { padding: 0; max-width: none; }

/* corner switch (signed out): language pill + theme */
.corner { position: fixed; top: 18px; right: 22px; z-index: 20; display: flex; gap: 8px; align-items: center; }
body.signed-in .corner { display: none; }
.lang-pill { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-pill button { background: none; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.lang-pill button:hover { background: none; color: var(--ink); }
.lang-pill button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.corner .menu > button.icon { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }

/* sign-in page (Lulus layout) */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center;
  max-width: 1120px; margin: 0 auto; padding: 72px 32px 40px; background: none; }
.auth .art { position: static; background: none !important; color: var(--ink); padding: 0; display: block; overflow: visible; }
.auth .art .brand { margin-bottom: 26px; font-size: 22px; }
.auth .art .brand .logo { width: 46px; height: 46px; border-radius: 13px; }
.auth .art .brand .logo svg { width: 30px; height: 30px; }
.auth .art .brand .wordmark b { font-size: 22px; }
.auth .art h2 { font-size: 42px; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 16px; max-width: 520px; font-weight: 800; color: var(--ink); }
.auth .art p.lead { font-size: 17px; color: var(--ink-2); max-width: 470px; margin: 0 0 22px; opacity: 1; }
.feats { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.feats li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink); font-size: 15px; }
.feats li .fi { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.feats li .fi svg { width: 17px; height: 17px; }
.feats li:nth-child(1) .fi { background: var(--amber-soft); color: var(--amber); }
.feats li:nth-child(2) .fi { background: var(--blue-soft); color: var(--accent); }
.feats li:nth-child(3) .fi { background: var(--red-soft); color: var(--red); }
.feats li:nth-child(4) .fi { background: var(--green-soft); color: var(--green); }
.auth .chips { display: none; }
.auth .pane { display: block; padding: 0; }
.auth .box { max-width: 440px; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 30px 28px; }
.auth .box h1 { font-size: 26px; }
.auth-foot { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* mobile */
#menuBtn { display: none; position: fixed; top: 12px; left: 12px; z-index: 30; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.menu-open .sidebar { transform: none; }
  body.signed-in #menuBtn { display: inline-flex; }
  main { padding: 64px 16px 56px; }
  main.full { padding: 0; }
  .auth { grid-template-columns: 1fr; gap: 26px; padding: 70px 16px 28px; }
  .auth .art h2 { font-size: 30px; }
  .auth .art p.lead, .feats { display: none; }
  .auth .box { margin: 0 auto; padding: 24px 20px; }
}
