/* GoSkeleton admin console — design tokens */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f8;
  --border: #e3e7f0;
  --border-strong: #cfd6e6;
  --text: #121a2e;
  --text-soft: #46506a;
  --muted: #7b849c;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef2ff;
  --violet: #7c3aed;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #2563eb;
  --info-soft: #eff6ff;
  /* Sidebar palette — "ember" matches the admin sign-in hero (dark red).
     Other palettes are selected with html[data-sidebar-theme]. */
  --sidebar-from: #450a0a;
  --sidebar-mid: #7f1d1d;
  --sidebar-to: #991b1b;
  --sidebar-text: #f0cfcf;
  --sidebar-text-strong: #fff6f6;
  --sidebar-muted: #d9a3a6;
  --sidebar-label: #bd8287;
  --sidebar-accent: #fca5a5;
  --sidebar-border: rgba(254, 202, 202, 0.16);
  --sidebar-hover: rgba(255, 236, 236, 0.09);
  --sidebar-active-from: rgba(248, 113, 113, 0.32);
  --sidebar-active-to: rgba(248, 113, 113, 0.1);
  --sidebar-art-line: rgba(254, 202, 202, 0.1);
  --sidebar-art-line-strong: rgba(255, 228, 228, 0.15);
  --sidebar-art-dot: rgba(254, 202, 202, 0.1);
  --sidebar-art-node: #fecaca;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 10px 30px -18px rgba(19, 31, 61, 0.35);
  --on-primary: #ffffff;
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --row-hover: #fafbff;
  --pager-disabled: #c3c9d8;
  --marker-bg: #ffffff;
  --violet-soft: #f3efff;
  --badge-dark-bg: #1e293b;
  --badge-dark-text: #f1f5f9;
  --icon-violet-bg: #f3efff;
  --icon-violet-fg: #7c3aed;
  --icon-blue-bg: #eaf1ff;
  --icon-blue-fg: #2563eb;
  --icon-green-bg: #e9fbf3;
  --icon-green-fg: #059669;
  --icon-amber-bg: #fff5e6;
  --icon-amber-fg: #b45309;
  --alert-success-border: #bbf0dc;
  --alert-success-text: #065f46;
  --alert-error-border: #f8caca;
  --alert-error-text: #991b1b;
  --alert-info-border: #c7dcff;
  --alert-info-text: #1e40af;
  --profile-banner-from: #ffffff;
  --profile-banner-to: #f5f3ff;
  --auth-glow-1: #e0e7ff;
  --auth-glow-2: #f3e8ff;
  --auth-base: #f4f6fb;
  --input-group-hover: #e3e8f3;
  --danger-border: #f3c9c9;
  --timeline-grad-1: #e0e7ff;
  --timeline-grad-2: #ede9fe;
  --pre-bg: #0f152a;
  --pre-text: #d7dcf0;
  color-scheme: light;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1c;
  --surface: #111827;
  --surface-2: #151e31;
  --surface-3: #1c2740;
  --border: #1f2a44;
  --border-strong: #2c3a58;
  --text: #e8ecf7;
  --text-soft: #c3cbe0;
  --muted: #8a96b2;
  --primary: #8b93f8;
  --primary-600: #7379f0;
  --primary-soft: #1e2450;
  --violet: #b39dfb;
  --success: #34d399;
  --success-soft: #0f2a22;
  --warning: #fbbf24;
  --warning-soft: #2a2313;
  --danger: #f87171;
  --danger-soft: #2c1519;
  --info: #7ab3ff;
  --info-soft: #12203a;
  /* The sidebar keeps its own (already dark) palette in dark mode. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  --on-primary: #0a0f1c;
  --topbar-bg: rgba(17, 24, 39, 0.86);
  --row-hover: #172139;
  --pager-disabled: #46536f;
  --marker-bg: #111827;
  --violet-soft: #241c45;
  --badge-dark-bg: #26324d;
  --badge-dark-text: #e2e8f5;
  --icon-violet-bg: #241c45;
  --icon-violet-fg: #b39dfb;
  --icon-blue-bg: #12203a;
  --icon-blue-fg: #7ab3ff;
  --icon-green-bg: #0f2a22;
  --icon-green-fg: #34d399;
  --icon-amber-bg: #2a2313;
  --icon-amber-fg: #fbbf24;
  --alert-success-border: #1d4a3a;
  --alert-success-text: #8ee7c3;
  --alert-error-border: #4d2228;
  --alert-error-text: #fca5a5;
  --alert-info-border: #1f3a63;
  --alert-info-text: #a8c8ff;
  --profile-banner-from: #111827;
  --profile-banner-to: #191a3a;
  --auth-glow-1: #1e2450;
  --auth-glow-2: #2a1c48;
  --auth-base: #0a0f1c;
  --input-group-hover: #253149;
  --danger-border: #5a2a30;
  --timeline-grad-1: #1e2450;
  --timeline-grad-2: #2a1c48;
  --pre-bg: #05080f;
  --pre-text: #d7dcf0;
}

/* Sidebar background palettes (selected from the sidebar theme picker). */
html[data-sidebar-theme="wine"] {
  --sidebar-from: #2e0a16;
  --sidebar-mid: #5b1230;
  --sidebar-to: #8c1d43;
  --sidebar-text: #f0cfdb;
  --sidebar-text-strong: #fff4f8;
  --sidebar-muted: #d3a0b4;
  --sidebar-label: #bb7f96;
  --sidebar-accent: #f9a8d4;
  --sidebar-border: rgba(249, 168, 212, 0.18);
  --sidebar-hover: rgba(255, 236, 245, 0.09);
  --sidebar-active-from: rgba(244, 114, 182, 0.3);
  --sidebar-active-to: rgba(244, 114, 182, 0.1);
  --sidebar-art-line: rgba(249, 168, 212, 0.12);
  --sidebar-art-line-strong: rgba(252, 231, 243, 0.2);
  --sidebar-art-dot: rgba(249, 168, 212, 0.1);
  --sidebar-art-node: #fbcfe8;
}
html[data-sidebar-theme="graphite"] {
  --sidebar-from: #0b1120;
  --sidebar-mid: #131c31;
  --sidebar-to: #1b2540;
  --sidebar-text: #9aa5c0;
  --sidebar-text-strong: #eef1fa;
  --sidebar-muted: #7f8bab;
  --sidebar-label: #5d6787;
  --sidebar-accent: #818cf8;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active-from: rgba(99, 102, 241, 0.24);
  --sidebar-active-to: rgba(99, 102, 241, 0.08);
  --sidebar-art-line: rgba(165, 180, 252, 0.12);
  --sidebar-art-line-strong: rgba(199, 210, 254, 0.2);
  --sidebar-art-dot: rgba(165, 180, 252, 0.1);
  --sidebar-art-node: #c7d2fe;
}
html[data-sidebar-theme="midnight"] {
  --sidebar-from: #0a1024;
  --sidebar-mid: #1a1a46;
  --sidebar-to: #2a235c;
  --sidebar-text: #b7bce0;
  --sidebar-text-strong: #f1f2ff;
  --sidebar-muted: #9399c6;
  --sidebar-label: #777ea8;
  --sidebar-accent: #a5b4fc;
  --sidebar-border: rgba(165, 180, 252, 0.16);
  --sidebar-hover: rgba(199, 210, 254, 0.09);
  --sidebar-active-from: rgba(129, 140, 248, 0.3);
  --sidebar-active-to: rgba(129, 140, 248, 0.1);
  --sidebar-art-line: rgba(165, 180, 252, 0.12);
  --sidebar-art-line-strong: rgba(199, 210, 254, 0.2);
  --sidebar-art-dot: rgba(165, 180, 252, 0.1);
  --sidebar-art-node: #c7d2fe;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; color: var(--text); }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; color: var(--text-soft); }
pre { margin: 8px 0 0; padding: 10px 12px; background: var(--pre-bg); color: var(--pre-text); border-radius: 10px; font-family: var(--mono); font-size: 12px; overflow-x: auto; }

.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.ellipsis { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ta-right { text-align: right; }
.inline-form { display: inline-flex; margin: 0; }

/* App shell */
.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 16px 16px;
  /* Same gradient as the admin sign-in hero; swapped by the theme picker. */
  background: linear-gradient(165deg, var(--sidebar-from) 0%, var(--sidebar-mid) 55%, var(--sidebar-to) 100%);
  color: var(--sidebar-text);
  overflow-y: auto;
}

/* Decorative vector background; sits behind the sidebar content. */
.sidebar__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.sidebar__art svg { display: block; width: 100%; height: 100%; stroke-width: 1.3; }
.sidebar > :not(.sidebar__art) { position: relative; z-index: 1; }

/* Only the groups belonging to the selected pattern are painted. */
.sidebar__art svg > [class^="sidebar-art__"] { display: none; }
html[data-sidebar-pattern="mesh"] .sidebar-art__dots,
html[data-sidebar-pattern="mesh"] .sidebar-art__flow,
html[data-sidebar-pattern="mesh"] .sidebar-art__nodes,
html[data-sidebar-pattern="mesh"] .sidebar-art__signal,
html[data-sidebar-pattern="mesh"] .sidebar-art__shield,
html:not([data-sidebar-pattern]) .sidebar-art__dots,
html:not([data-sidebar-pattern]) .sidebar-art__flow,
html:not([data-sidebar-pattern]) .sidebar-art__nodes,
html:not([data-sidebar-pattern]) .sidebar-art__signal,
html:not([data-sidebar-pattern]) .sidebar-art__shield { display: block; }
html[data-sidebar-pattern="grid"] .sidebar-art__grid,
html[data-sidebar-pattern="grid"] .sidebar-art__rings { display: block; }
html[data-sidebar-pattern="waves"] .sidebar-art__waves,
html[data-sidebar-pattern="waves"] .sidebar-art__signal { display: block; }
html[data-sidebar-pattern="orbit"] .sidebar-art__rings,
html[data-sidebar-pattern="orbit"] .sidebar-art__nodes,
html[data-sidebar-pattern="orbit"] .sidebar-art__shield { display: block; }

.sidebar-art__dots { fill: url(#sidebarArtDots); stroke: none; }
.sidebar-art__dot { fill: var(--sidebar-art-dot); stroke: none; }
.sidebar-art__grid { fill: url(#sidebarArtGrid); stroke: none; }
.sidebar-art__grid-line { fill: none; stroke: var(--sidebar-art-line); stroke-width: 1; }
.sidebar-art__waves path {
  fill: none;
  stroke: var(--sidebar-art-line-strong);
  stroke-dasharray: 3 11;
  animation: artFlow 18s linear infinite;
}
.sidebar-art__waves path:nth-child(2n) { animation-duration: 24s; animation-direction: reverse; }
.sidebar-art__waves path:nth-child(3n) { animation-duration: 30s; }
.sidebar-art__rings circle {
  fill: none;
  stroke: var(--sidebar-art-line);
  stroke-dasharray: 3 9;
  animation: artSpin 60s linear infinite;
  transform-box: view-box;
  transform-origin: 228px 112px;
}
.sidebar-art__rings circle:nth-child(2) { animation-duration: 44s; animation-direction: reverse; }
.sidebar-art__rings circle:nth-child(3) { animation-duration: 30s; }
.sidebar-art__beam {
  fill: none;
  stroke: var(--sidebar-art-line-strong);
  stroke-dasharray: 8 14;
  animation: artFlow 9s linear infinite;
}
.sidebar-art__beam--slow { animation-duration: 14s; animation-direction: reverse; }
.sidebar-art__nodes circle {
  fill: var(--sidebar-art-node);
  stroke: none;
  opacity: 0.5;
  animation: artPulse 4.2s ease-in-out infinite;
}
.sidebar-art__nodes circle:nth-child(2n) { animation-delay: 1.4s; }
.sidebar-art__nodes circle:nth-child(3n) { animation-delay: 2.6s; }
.sidebar-art__signal path { fill: none; stroke: var(--sidebar-art-line-strong); }
.sidebar-art__signal circle { fill: var(--sidebar-art-node); stroke: none; animation: artPulse 3.4s ease-in-out infinite; }
.sidebar-art__shield path { fill: none; stroke: var(--sidebar-art-line-strong); }
.sidebar-art__shield path:first-child { stroke: var(--sidebar-art-line); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
  color: #fff;
}
.brand:hover { text-decoration: none; }
.brand__logo {
  display: block;
  width: auto;
  height: 38px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.16));
}
.brand__logo--sm { height: 30px; }
.brand__logo--lg { height: 76px; align-self: flex-start; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 15px; letter-spacing: 0.01em; }
.brand__text small { color: var(--sidebar-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav__label {
  margin: 18px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sidebar-label);
}
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav__link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); text-decoration: none; }
.nav__link svg { width: 17px; height: 17px; opacity: 0.85; }
.nav__link.is-active {
  background: linear-gradient(90deg, var(--sidebar-active-from), var(--sidebar-active-to));
  color: var(--sidebar-text-strong);
}
.nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-accent);
}

.sidebar__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11.5px;
  color: var(--sidebar-muted);
}
.sidebar__footer a { margin-left: auto; color: var(--sidebar-text); }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot--live { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  /* Above the mobile sidebar backdrop (50) so the toggle stays clickable. */
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 30px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__title { display: flex; flex-direction: column; }
.topbar__eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.topbar__title h1 { font-size: 16px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--ghost { border-color: transparent; background: transparent; }
.icon-btn--ghost:hover { background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-launcher__fill { fill: currentColor; stroke: none; }
.auth-theme { position: fixed; top: 18px; right: 18px; z-index: 10; }
.auth-theme .icon-btn { background: var(--surface); box-shadow: var(--shadow-sm); }
#sidebar + .main .icon-btn[data-sidebar-toggle] { display: none; }

/* Theme dialog: color mode and sidebar palette behind one launcher icon. */
.theme-dialog {
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 70px -30px rgba(10, 15, 30, 0.55);
}
.theme-dialog::backdrop { background: rgba(9, 13, 26, 0.55); }
.theme-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
}
.theme-dialog__head h2 { font-size: 17px; }
.theme-dialog__close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.theme-dialog__close:hover { background: var(--surface-2); color: var(--text); }
.theme-dialog__section { padding: 16px 20px 0; }
.theme-dialog__section:last-of-type { padding-bottom: 20px; }
.theme-dialog__label {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.theme-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.theme-choice:hover { background: var(--surface-2); color: var(--text); }
.theme-choice.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.theme-choice__icon { width: 18px; height: 18px; flex: none; }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: linear-gradient(150deg, var(--swatch-from), var(--swatch-to));
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.theme-swatch:hover { transform: translateY(-1px) scale(1.05); }
.theme-swatch.is-active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}
.theme-patterns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theme-pattern {
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-pattern:hover { border-color: var(--border-strong); color: var(--text-soft); }
.theme-pattern.is-active { border-color: var(--primary); color: var(--primary); }
.theme-pattern__canvas {
  display: block;
  height: 42px;
  border-radius: 7px;
  background-color: var(--sidebar-mid);
  background-image: linear-gradient(160deg, var(--sidebar-from), var(--sidebar-to));
  overflow: hidden;
}
.theme-pattern__canvas--mesh {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.5) 1px, transparent 1.4px),
    linear-gradient(160deg, var(--sidebar-from), var(--sidebar-to));
  background-size: 9px 9px, cover;
}
.theme-pattern__canvas--grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.26) 1px, transparent 1px),
    linear-gradient(160deg, var(--sidebar-from), var(--sidebar-to));
  background-size: 10px 10px, 10px 10px, cover;
}
.theme-pattern__canvas--waves {
  background-image:
    repeating-radial-gradient(circle at 50% 130%, transparent 0 8px, rgba(255, 255, 255, 0.3) 8px 9px),
    linear-gradient(160deg, var(--sidebar-from), var(--sidebar-to));
}
.theme-pattern__canvas--orbit {
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0 7px, rgba(255, 255, 255, 0.34) 7px 8px, transparent 8px),
    radial-gradient(circle at 50% 50%, transparent 0 14px, rgba(255, 255, 255, 0.24) 14px 15px, transparent 15px),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.65) 1.5px, transparent 2px),
    linear-gradient(160deg, var(--sidebar-from), var(--sidebar-to));
}
.theme-pattern__name { line-height: 1.1; text-align: center; }
.theme-swatch:focus-visible,
.theme-choice:focus-visible,
.theme-pattern:focus-visible,
.theme-dialog__close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-dialog__hint { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
}
.user-chip:hover { text-decoration: none; background: var(--surface-2); }
.user-chip__meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip__meta strong { font-size: 12.5px; font-weight: 600; }
.user-chip__meta small { font-size: 10.5px; color: var(--muted); }

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex: none;
}
.avatar--sm { width: 28px; height: 28px; font-size: 10px; }
.avatar--xl { width: 64px; height: 64px; font-size: 20px; }

.content { flex: 1; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1420px; margin: 0 auto; padding: 28px 30px; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 30px 24px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* Page head */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-head__sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head__brand { display: flex; align-items: center; gap: 14px; }
.page-head__logo { height: 50px; width: auto; flex: none; }
.page-head__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--muted { background: var(--surface-2); }
.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card__head--stack { flex-direction: column; gap: 2px; margin-bottom: 16px; }
.card__head--padded { padding: 20px; margin-bottom: 0; }
.card__sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.mini-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; }

/* Grids */
/* Panels hug their content instead of stretching, which keeps the top and
   bottom gutter of every card identical. */
.grid { display: grid; gap: 20px; align-items: start; }
.grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--two-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid--three-tight { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* Opt-in equal row heights: the panel content grows to fill, so the inner
   gutter stays 20px on every side instead of leaving an empty strip. */
.grid--stretch { align-items: stretch; }
.grid--stretch > .card { display: flex; flex-direction: column; }
.grid--stretch .chart { flex: 1 1 auto; min-height: 200px; }

.grid--form { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.grid--sidebar { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-tight { display: flex; flex-direction: column; gap: 2px; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-card__label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-card__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; }
.stat-card__icon svg { width: 17px; height: 17px; }
.stat-card__icon--violet { background: var(--icon-violet-bg); color: var(--icon-violet-fg); }
.stat-card__icon--blue { background: var(--icon-blue-bg); color: var(--icon-blue-fg); }
.stat-card__icon--green { background: var(--icon-green-bg); color: var(--icon-green-fg); }
.stat-card__icon--amber { background: var(--icon-amber-bg); color: var(--icon-amber-fg); }
.stat-card__value { margin-top: 12px; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.stat-card__unit { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat-card__hint { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Chart */
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 8px; height: 8px; border-radius: 3px; }
.legend__dot--total { background: #6366f1; }
.legend__dot--errors { background: #f87171; }

.chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; height: 200px; padding-top: 8px; }
.chart__col { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart__plot { display: flex; align-items: flex-end; justify-content: center; gap: 3px; flex: 1; width: 100%; }
.chart__bar {
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  transition: height 0.35s ease;
}
.chart__bar--total { width: 60%; max-width: 26px; background: linear-gradient(180deg, #818cf8, #4f46e5); }
.chart__bar--errors { width: 22%; max-width: 10px; background: linear-gradient(180deg, #fca5a5, #ef4444); }
.chart__label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart__value { font-size: 11px; font-weight: 600; color: var(--text-soft); }

/* Vertical tab layout (Mikrotik API remote console) */
.vtabs { display: grid; grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 20px; align-items: start; }
.vtabs__nav {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px; box-shadow: var(--shadow-sm);
}
.vtabs__link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-soft); font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid transparent;
}
.vtabs__link svg { width: 17px; height: 17px; flex: none; }
.vtabs__link:hover, .vtabs__link:focus, .vtabs__link:active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.vtabs__link.is-active { background: var(--primary-soft); color: var(--primary); border-color: var(--border); }
.vtabs__count {
  margin-left: auto; min-width: 22px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; text-align: center;
}
.vtabs__meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.vtabs__meta .meta-list > div { padding: 5px 2px; }
.vtabs__meta .meta-list dt, .vtabs__meta .meta-list dd { font-size: 11.5px; }
.vtabs__panel { min-width: 0; }
/* A router session row stacks username, the NIK/NIP it was created from, and
   the personnel name, so the operator can tell who is online. */
.session-user__ids { white-space: nowrap; }
.session-user__name { font-size: 12.5px; color: var(--text-soft); }
.vtabs__panel .card { margin: 0; }
.stat-card__value--text { font-size: 20px; letter-spacing: -0.01em; }
.meta-list__title { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

@media (max-width: 900px) {
  .vtabs { grid-template-columns: minmax(0, 1fr); }
  .vtabs__nav { flex-direction: row; flex-wrap: wrap; }
  .vtabs__meta { display: none; }
}

/* Access log statistics */
.range-picker { display: flex; align-items: center; gap: 8px; }
.split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 1px; }
.split__seg { height: 100%; min-width: 3px; }
.split__seg--desktop { background: linear-gradient(90deg, #818cf8, #6366f1); }
.split__seg--mobile { background: linear-gradient(90deg, #34d399, #059669); }
.split__seg--bot { background: linear-gradient(90deg, #fca5a5, #ef4444); }
.split__seg--other { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.split-legend {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px;
}
.split-legend__item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-soft); }
.split-legend__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.split-legend__dot--desktop { background: #6366f1; }
.split-legend__dot--mobile { background: #059669; }
.split-legend__dot--bot { background: #ef4444; }
.split-legend__dot--other { background: #94a3b8; }
.split-legend__value { margin-left: auto; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.role-list__count--wide { width: 62px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Health + roles */
.health-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.health-list__item { display: flex; align-items: center; gap: 12px; }
.health-list__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.health-list__body small { color: var(--muted); font-size: 11.5px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-dot--ok { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.status-dot--warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }

.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.role-list__item { display: flex; align-items: center; gap: 12px; }
.role-list__item .badge { width: 92px; justify-content: center; }
.role-list--wide .badge { width: 152px; justify-content: flex-start; }
.role-list__count { font-weight: 600; font-size: 12px; width: 24px; text-align: right; }
.progress { flex: 1; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #818cf8, #6366f1); }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity__item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.activity__item:last-child { border-bottom: 0; padding-bottom: 0; }
.activity__body { flex: 1; min-width: 0; }
.activity__body p { font-size: 13px; }
.activity__body small { color: var(--muted); font-size: 11.5px; }
.activity__time { font-size: 11px; color: var(--muted); white-space: nowrap; }

.release-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.release-list__item { display: flex; gap: 14px; align-items: flex-start; }
.release-list__version { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.release-list__body small { color: var(--muted); font-size: 11.5px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--row-hover); }
.table--wide { min-width: 900px; }
.table td.cell-nowrap { white-space: nowrap; }
.table--compact td { padding: 9px 20px; font-size: 12.5px; }
.table--compact th { padding: 9px 20px; }

/* Flush panels ending in a table need the same breathing room underneath. */
.card--flush > .table-wrap:last-child { padding-bottom: 20px; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-footer__info { font-size: 12px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager__link {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
  border: 1px solid transparent;
}
.pager__link:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.pager__link.is-active { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.pager__link.is-disabled { color: var(--pager-disabled); cursor: default; }
.pager__gap { color: var(--muted); padding: 0 2px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.6;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--violet { background: var(--violet-soft); color: var(--violet); }
.badge--muted { background: var(--surface-3); color: var(--muted); }
.badge--dark { background: var(--badge-dark-bg); color: var(--badge-dark-text); }
.badge--dark.mono { font-size: 10.5px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn--primary {
  background: linear-gradient(135deg, #5b5bf0, #4f46e5);
  border-color: #4f46e5;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.9);
}
.btn--primary:hover { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.btn--ghost { background: var(--surface); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.06); }
/* Dark mode uses the pale danger tone, so keep the label dark for contrast. */
:root[data-theme="dark"] .btn--danger { color: #450a0a; }
.btn--danger-ghost { color: var(--danger); border-color: var(--danger-border); background: var(--surface); }
.btn--danger-ghost:hover { background: var(--danger-soft); }
.btn--link { border-color: transparent; background: transparent; color: var(--primary); padding: 0 4px; }
.btn--link:hover { background: transparent; text-decoration: underline; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn--block { width: 100%; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-actions--center { justify-content: center; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field__hint { font-size: 11.5px; color: var(--muted); }
.field__error { font-size: 11.5px; color: var(--danger); font-weight: 500; }
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b849c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14); }
.input:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.input--sm { height: 30px; font-size: 12px; width: auto; }

.input-group { display: flex; align-items: stretch; position: relative; }
.input-group .input { padding-right: 62px; }
.input-group__btn {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.input-group__btn:hover { background: var(--input-group-hover); }

.fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0; }
.fieldset legend { padding: 0 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.checkbox { display: flex; align-items: flex-start; gap: 10px; padding-top: 26px; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--primary); }
.checkbox span { display: flex; flex-direction: column; }
.checkbox strong { font-size: 12.5px; }
.checkbox small { color: var(--muted); font-size: 11.5px; }
.checkbox--card { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.filter-bar__field { position: relative; display: flex; align-items: center; }
.filter-bar__field--grow { flex: 1; min-width: 220px; }
.filter-bar__field svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.filter-bar__field .input { padding-left: 36px; }
.filter-bar select.input { width: auto; min-width: 140px; }
.th-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort:hover { color: var(--primary); }
.th-sort.is-active { color: var(--primary); }
/* Two stacked filter rows: search + IP on the first, selects on the second. */
.filter-bar--stack { flex-direction: column; align-items: stretch; gap: 8px; }
.filter-bar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-bar__field--ip { flex: 0 1 260px; }

/* Alerts */
.content > .alert { margin-bottom: 0; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
}
.alert p { flex: 1; }
.alert__icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert__close { border: 0; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; padding: 2px; }
.alert__close:hover { opacity: 1; }
.alert__close svg { width: 14px; height: 14px; }
.alert--success { background: var(--success-soft); border-color: var(--alert-success-border); color: var(--alert-success-text); }
.alert--error { background: var(--danger-soft); border-color: var(--alert-error-border); color: var(--alert-error-text); }
.alert--info { background: var(--info-soft); border-color: var(--alert-info-border); color: var(--alert-info-text); }

/* Empty + errors */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 16px; color: var(--muted); font-size: 13px; }
.empty p { margin: 0; }

.error-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 60px 20px; }
.error-state__code { font-size: 72px; font-weight: 800; letter-spacing: -0.04em; background: linear-gradient(135deg, #6366f1, #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-state__message { color: var(--muted); max-width: 520px; }
.error-state__meta { color: var(--muted); font-size: 11px; margin-top: 8px; }

/* Details + metadata */
.details { margin-top: 6px; }
.details summary { cursor: pointer; font-size: 11px; color: var(--primary); }
.details summary:hover { text-decoration: underline; }

.meta-list { display: flex; flex-direction: column; gap: 0; margin: 0; }
.meta-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--muted); font-size: 12px; }
.meta-list dd { margin: 0; text-align: right; font-size: 12.5px; font-weight: 500; word-break: break-all; }

.user-cell { display: flex; align-items: center; gap: 11px; }
.user-cell div { display: flex; flex-direction: column; min-width: 0; }
.user-cell small { color: var(--muted); font-size: 11.5px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }

.perm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.perm-list li p { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Version hero */
.version-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #1e1b4b, #312e81 45%, #4c1d95);
  color: #e0e7ff;
  box-shadow: 0 18px 40px -28px rgba(49, 46, 129, 0.9);
  flex-wrap: wrap;
}
.version-hero__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: #a5b4fc; }
.version-hero__value { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; color: #fff; line-height: 1.15; }
.version-hero__meta { font-size: 12px; color: #c7d2fe; }
.version-hero__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 0; align-content: center; }
.version-hero__facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: #a5b4fc; }
.version-hero__facts dd { margin: 2px 0 0; font-size: 12.5px; color: #eef2ff; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 6px 22px 6px 26px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 12px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(180deg, var(--timeline-grad-1), var(--timeline-grad-2)); }
.timeline__item { position: relative; padding: 10px 0 10px 18px; }
.timeline__marker { position: absolute; left: -19px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--marker-bg); border: 3px solid #818cf8; }
.timeline__body { border-bottom: 1px dashed var(--border); padding-bottom: 14px; }
.timeline__item:last-child .timeline__body { border-bottom: 0; }
.timeline__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; }
.timeline__action { margin-left: auto; }
.timeline__body h4 { margin: 8px 0 4px; font-size: 14.5px; }
.timeline__notes { color: var(--text-soft); font-size: 12.5px; margin-bottom: 6px; }

/* Release groups: only the newest version is expanded, older ones collapse. */
.release-group { border-top: 1px solid var(--border); }
.release-group:first-child { border-top: 0; }
.release-group__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  cursor: pointer;
  list-style: none;
  font-size: 11.5px;
  color: var(--muted);
}
.release-group__summary::-webkit-details-marker { display: none; }
.release-group__summary:hover { background: var(--surface-2); }
.release-group__summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.release-group__count { font-size: 11.5px; }
.release-group__chevron { width: 16px; height: 16px; margin-left: auto; transition: transform 0.15s ease; }
.release-group[open] .release-group__chevron { transform: rotate(180deg); }
.release-group .timeline { padding-top: 0; }

/* Counts */
.count-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.count { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.count span { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.count small { color: var(--muted); font-size: 11px; }

/* Profile */
.profile-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: linear-gradient(120deg, var(--profile-banner-from), var(--profile-banner-to) 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.profile-banner__body h3 { font-size: 18px; }
.profile-banner__body p { color: var(--text-soft); font-size: 13px; }

/* Auth */
.auth-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(1000px 500px at 10% -10%, var(--auth-glow-1) 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 100%, var(--auth-glow-2) 0%, transparent 55%),
    var(--auth-base);
  display: grid;
  place-items: center;
  padding: 28px 18px;
}
.auth-shell {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  width: min(1020px, 100%);
  min-height: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 40px 80px -50px rgba(30, 27, 75, 0.55);
}
.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 52px 48px;
  background: linear-gradient(160deg, #450a0a 0%, #7f1d1d 55%, #991b1b 100%);
  color: #fee2e2;
  overflow: hidden;
  --auth-art-line: rgba(254, 202, 202, 0.2);
  --auth-art-line-strong: rgba(255, 228, 228, 0.34);
  --auth-art-dot: rgba(254, 202, 202, 0.16);
  --auth-art-node: #fecaca;
}
.auth-hero > :not(.auth-hero__art):not(.auth-hero__version) { position: relative; z-index: 1; }

/* Animated vector backdrop: signal rings, a flowing data mesh and a shield. */
.auth-hero__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.auth-hero__art svg { display: block; width: 100%; height: 100%; stroke-width: 1.3; }
.auth-art__dots { fill: url(#authArtDots); stroke: none; }
.auth-art__dot { fill: var(--auth-art-dot); stroke: none; }
.auth-art__rings circle {
  fill: none;
  stroke: var(--auth-art-line);
  stroke-dasharray: 3 10;
  animation: artSpin 70s linear infinite;
  transform-box: view-box;
  transform-origin: 512px 132px;
}
.auth-art__rings circle:nth-child(2) { animation-duration: 50s; animation-direction: reverse; }
.auth-art__rings circle:nth-child(3) { animation-duration: 34s; }
.auth-art__wave path {
  fill: none;
  stroke: var(--auth-art-line-strong);
  animation: artPulse 5s ease-in-out infinite;
}
.auth-art__wave path:nth-child(2) { animation-delay: 0.6s; }
.auth-art__wave path:nth-child(3) { animation-delay: 1.2s; }
.auth-art__wave circle { fill: var(--auth-art-node); stroke: none; animation: artPulse 3.6s ease-in-out infinite; }
.auth-art__mesh path { fill: none; stroke: var(--auth-art-line); }
.auth-art__mesh .auth-art__flow {
  stroke: var(--auth-art-line-strong);
  stroke-dasharray: 10 12;
  animation: artFlow 8s linear infinite;
}
.auth-art__mesh .auth-art__flow--slow { animation-duration: 13s; animation-direction: reverse; }
.auth-art__mesh .auth-art__node {
  fill: var(--auth-art-node);
  stroke: rgba(69, 10, 10, 0.55);
  stroke-width: 2;
  opacity: 0.75;
  animation: artPulse 4s ease-in-out infinite;
}
.auth-art__mesh .auth-art__node:nth-of-type(2n) { animation-delay: 1.2s; }
.auth-art__mesh .auth-art__node:nth-of-type(3n) { animation-delay: 2.4s; }
.auth-art__shield path { fill: none; stroke: var(--auth-art-line-strong); }
.auth-art__shield path:first-child { stroke: var(--auth-art-line); }

@keyframes artFlow { to { stroke-dashoffset: -220; } }
@keyframes artSpin { to { transform: rotate(360deg); } }
@keyframes artPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 113, 113, 0.32), transparent 65%);
}
.auth-hero h1 { font-size: 34px; letter-spacing: -0.03em; color: #fff; }
.auth-hero p { color: #fecaca; font-size: 13.5px; max-width: 34ch; }
.auth-hero__list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: #fee2e2; }
.auth-hero__list li { position: relative; padding-left: 22px; }
.auth-hero__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fca5a5;
  box-shadow: 0 0 0 4px rgba(252, 165, 165, 0.2);
}
.auth-hero__version { position: absolute; z-index: 1; bottom: 22px; left: 48px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #f87171; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px 44px; }
.auth-panel__footer { margin-top: 28px; text-align: center; font-size: 11px; color: var(--muted); }
.auth-card__head { margin-bottom: 22px; }
.auth-card__head h2 { font-size: 24px; letter-spacing: -0.025em; }
.auth-card__head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.demo-box {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  font-size: 12px;
}
.demo-box__title { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.demo-box ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.demo-box li { display: flex; justify-content: space-between; gap: 10px; }
.demo-box li span { color: var(--muted); font-size: 11.5px; }
.demo-box__password { color: var(--muted); font-size: 11.5px; }
.auth-card__alt { margin-top: 14px; text-align: center; font-size: 12.5px; }
.auth-card__alt a { color: var(--primary); }

/* Responsive */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    z-index: 60;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 30, 0.45);
    z-index: 50;
  }
  #sidebar + .main .icon-btn[data-sidebar-toggle] { display: grid; }
  .grid--two, .grid--form, .grid--sidebar, .grid--two-tight, .grid--three, .grid--three-tight { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 20px; }
  .topbar { padding: 12px 20px; }
  .footer { padding: 14px 20px 20px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { padding: 36px 26px; }
  .user-chip__meta { display: none; }
  .user-chip { padding: 5px; }
  .search__trigger span,
  .search__trigger kbd { display: none; }
  .search__trigger { padding: 0 8px; }
  .topbar__title { min-width: 0; }
  .topbar__title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .filter-bar__field--grow { min-width: 100%; }
  .filter-bar select.input { flex: 1; }
  .page-head { flex-direction: column; align-items: stretch; }
  .chart { height: 170px; gap: 4px; }
  .chart__value { display: none; }
  .footer { flex-direction: column; }
  .version-hero__facts { grid-template-columns: 1fr; }
  /* Keep the topbar usable on very small phones: the avatar chip is dropped
     (the sidebar still links to the profile) and gaps tighten. */
  .topbar { gap: 10px; padding: 12px 14px; }
  .topbar__actions { gap: 6px; }
  .user-chip { display: none; }
}

/* ---- Notifications, search, impersonation, and bulk actions ---- */

.ta-center { text-align: center; }

.avatar img,
img.avatar { object-fit: cover; display: block; }
img.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); }
img.avatar--xl { width: 64px; height: 64px; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 340px; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}

.notif__badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.notif .icon-btn { position: relative; }
.notif__head,
.notif__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.notif__foot { border-bottom: none; border-top: 1px solid var(--border); }
.notif__list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.notif__item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px;
}
.notif__item.is-unread { background: var(--surface-2); }
.notif__item strong { display: block; font-size: 12.5px; }
.notif__item small { display: block; color: var(--muted); font-size: 11.5px; }
.notif__open { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 15px; }
.notif__empty { padding: 18px 14px; color: var(--muted); font-size: 12px; margin: 0; }
.notif__dot {
  width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto;
  background: var(--primary);
}
.notif__dot--success { background: var(--success); }
.notif__dot--warning { background: var(--warning); }
.notif__dot--error { background: var(--danger); }
.notif__dot--info { background: var(--primary); }

tr.is-unread td { background: var(--surface-2); }

.search__trigger {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
}
.search__trigger:hover { color: var(--text); border-color: var(--border-strong); }
.search__trigger svg { width: 15px; height: 15px; }
.search__trigger kbd {
  font-family: inherit; font-size: 10.5px; padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface);
}
.search__overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 18, .55);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
  backdrop-filter: blur(2px);
}
.search__overlay[hidden] { display: none; }
.search__dialog {
  width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.search__field {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search__field svg { width: 17px; height: 17px; color: var(--muted); }
.search__field input {
  flex: 1; border: none; background: transparent; color: var(--text); font: inherit; font-size: 14px;
  outline: none;
}
.search__results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.search__result {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: inherit;
}
.search__result:hover,
.search__result.is-active { background: var(--surface-2); }
.search__type {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; margin-top: 2px;
}
.search__body strong { display: block; font-size: 13px; }
.search__body small { color: var(--muted); font-size: 11.5px; }
.search__hint { margin: 0; padding: 16px; color: var(--muted); font-size: 12px; }

html.search-open { overflow: hidden; }

.impersonation {
  display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  background: var(--warning-soft, #fef3c7); color: #7c4a03; font-size: 12.5px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.impersonation p { margin: 0; flex: 1; }
.impersonation__dot {
  width: 9px; height: 9px; border-radius: 50%; background: #d97706; flex: 0 0 auto;
}
.impersonation .btn--light {
  background: rgba(255, 255, 255, .65); color: #7c4a03; border-color: rgba(0, 0, 0, .12);
}
:root[data-theme="dark"] .impersonation { background: #3b2a06; color: #fbd38d; }
:root[data-theme="dark"] .impersonation .btn--light {
  background: rgba(255, 255, 255, .08); color: #fbd38d; border-color: rgba(255, 255, 255, .15);
}

.bulk-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.bulk-bar__count { font-size: 12px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters__label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.filters--save { margin-top: -4px; }
.filters--save .input { max-width: 220px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px;
}
.chip a { color: inherit; text-decoration: none; }
.chip__remove {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0;
}
.chip__remove:hover { color: var(--danger); }

.code-block {
  margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px; overflow-x: auto;
}
.input--code { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; }
.small-wrap { word-break: break-all; font-size: 11.5px; }

.email-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.email-preview__subject {
  margin: 0; padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600;
}
.email-preview__body {
  margin: 0; padding: 16px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap;
  word-break: break-word; max-height: 340px; overflow-y: auto; font-family: inherit;
}

.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.recovery-codes__item {
  padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 8px;
  background: var(--surface-2); font-size: 12.5px; text-align: center;
}

.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* ---- Public landing page ---- */

.landing-body { background: var(--bg); color: var(--text); }
.landing-nav .brand__logo { height: 42px; }

.landing-nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.landing-nav__inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand--landing { text-decoration: none; color: inherit; }
.landing-nav__links { display: flex; align-items: center; gap: 18px; margin-left: 8px; flex: 1; }
.landing-nav__links a {
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500;
}
.landing-nav__links a:hover { color: var(--text); }
.landing-nav__actions { display: flex; align-items: center; gap: 8px; }
.landing-nav__links--preview { margin: 0; }

.landing { max-width: 1120px; margin: 0 auto; padding: 0 24px 64px; }

.hero { position: relative; padding: 72px 0 56px; text-align: center; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -30% 10% auto; height: 420px; z-index: -1;
  background: radial-gradient(closest-side, rgba(99, 102, 241, .28), transparent 75%);
  filter: blur(10px); pointer-events: none;
}
.hero__inner { max-width: 760px; margin: 0 auto; }
.hero__logo {
  display: block; margin: 0 auto 18px; height: 104px; width: auto;
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, .18));
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.hero__title {
  margin: 22px 0 14px; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.12;
  letter-spacing: -0.02em; font-weight: 700;
}
.hero__sub { margin: 0 auto; max-width: 640px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.hero__actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero__facts {
  list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin: 40px 0 0; padding: 0;
}
.hero__facts li {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; min-width: 130px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.hero__facts strong { font-size: 13px; }
.hero__facts span { color: var(--muted); font-size: 11.5px; }

.btn--lg { height: 44px; padding: 0 20px; font-size: 13.5px; border-radius: 11px; }

.landing-section { padding: 48px 0; }
.landing-section--alt { border-top: 1px solid var(--border); }
.landing-section__head { max-width: 620px; margin-bottom: 26px; }
.landing-section__head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.01em; }
.landing-section__head p { margin: 0; color: var(--muted); font-size: 13.5px; }

.panel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel {
  display: flex; flex-direction: column; gap: 10px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-sm); min-width: 0;
}
.panel h3 { margin: 0; font-size: 14.5px; }
.panel p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.panel__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}
.panel__icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.panel__link { color: var(--primary); font-size: 12.5px; font-weight: 600; text-decoration: none; margin-top: auto; }
.panel__link:hover { text-decoration: underline; }

.inside-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inside {
  display: flex; gap: 14px; padding: 18px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface);
}
.inside h3 { margin: 0 0 4px; font-size: 13.5px; }
.inside p { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.inside .panel__icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; }
.inside .panel__icon svg { width: 17px; height: 17px; }

.landing-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 8px; padding: 30px; border-radius: 18px;
  border: 1px solid var(--border); background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 16%, var(--surface)), var(--surface));
}
.landing-cta h2 { margin: 0 0 6px; font-size: 20px; }
.landing-cta p { margin: 0; color: var(--muted); font-size: 13px; }
.landing-cta__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.landing-footer { border-top: 1px solid var(--border); background: var(--surface); }
.landing-footer__inner {
  max-width: 1120px; margin: 0 auto; padding: 28px 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.landing-footer__brand { display: flex; gap: 12px; align-items: flex-start; max-width: 420px; }
.landing-footer__brand strong { font-size: 13.5px; }
.landing-footer__brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.landing-footer__links { display: flex; flex-direction: column; gap: 7px; }
.landing-footer__links a { color: var(--muted); text-decoration: none; font-size: 12.5px; }
.landing-footer__links a:hover { color: var(--text); }
.landing-footer__meta { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11.5px; text-align: right; }

@media (max-width: 980px) {
  .landing-nav__links { display: none; }
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inside-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 52px 0 40px; }
  .landing-footer__meta { text-align: left; align-items: flex-start; }
}

@media (max-width: 620px) {
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .hero__facts li { flex: 1 1 44%; }
  .landing-cta { padding: 22px; }
}

.ektp-upload { display: grid; gap: 10px; justify-items: start; }
.ektp-preview {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* EKTP quick editor (rotate & crop). */
html.ektp-editor-open { overflow: hidden; }
.ektp-upload__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ektp-preview { cursor: zoom-in; }
.ektp-preview[hidden] { display: none; }
.ektp-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 8, 18, .6);
  backdrop-filter: blur(4px);
}
.ektp-modal[hidden] { display: none; }
.ektp-modal__panel {
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.ektp-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.ektp-modal__head h3 { margin: 0 0 2px; }
.ektp-modal__stage {
  display: block;
  padding: 14px;
  overflow: auto;
  background: var(--surface-2);
}
.ektp-modal__stage canvas {
  display: block;
  margin: 0 auto;
  max-width: none;
  max-height: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: crosshair;
  touch-action: none;
}
.ektp-toolbar { justify-content: flex-start; }
.ektp-toolbar__sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
}
.ektp-icon-btn svg { width: 16px; height: 16px; }
.ektp-zoom {
  min-width: 46px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.ektp-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

/* ---------- Generic modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 8, 18, .6);
  backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal__panel {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal__head h3 { margin: 0 0 2px; font-size: 17px; }
.modal__head .card__sub { margin: 0; }
.modal__body { padding: 16px 18px; overflow: auto; }
.modal__body textarea.input { min-height: 120px; resize: vertical; }
.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
body.modal-open { overflow: hidden; }

/* ---------- Landing: tentang, statistik, bantuan ---------- */
.landing-about {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 36px;
}
.landing-about p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.landing-about__contact { font-size: 12.5px; color: var(--text); }
.landing-about__contact a { color: var(--accent, #6366f1); font-weight: 600; text-decoration: none; }
.landing-about__contact a:hover { text-decoration: underline; }

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  padding: 22px 16px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); text-align: center; display: flex; flex-direction: column; gap: 6px;
}
.stat-card strong { font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.4; }
.stat-card--total {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface));
}
.stat-card--total strong { color: var(--primary); }

.landing-cta__note { align-self: center; color: var(--muted); font-size: 12px; }

.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.help-card {
  padding: 20px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); display: flex; flex-direction: column; gap: 10px;
}
.help-card h3 { margin: 0; font-size: 14px; }
.help-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.help-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.help-list a { color: var(--primary); text-decoration: none; }
.help-list a:hover { text-decoration: underline; }
.help-card__contact { font-size: 12.5px; }

.video-frame {
  position: relative; padding-top: 56.25%; overflow: hidden;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface-3);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 980px) {
  .landing-about { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-grid { grid-template-columns: 1fr; }
}

/* Dashboard: download/upload traffic bars */
.chart__bar--down { width: 46%; max-width: 20px; background: linear-gradient(180deg, #818cf8, #4f46e5); }
.chart__bar--up { width: 22%; max-width: 10px; background: linear-gradient(180deg, #34d399, #059669); }
.legend__dot--down { background: #6366f1; }
.legend__dot--up { background: #10b981; }

/* ---- FreeRADIUS log console ---- */

.log-console { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.log-console__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.log-console__tools { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.log-console__search { min-width: 240px; }
.log-console__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field--inline { margin: 0; }
.input--sm { padding: 6px 10px; font-size: 12.5px; height: 34px; }
.log-console__body {
  margin: 0; padding: 14px 16px; max-height: 62vh; overflow: auto;
  background: #0b1020; color: #d7e0f4;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  scrollbar-color: #33405c #0b1020;
}
.log-console__body:empty { display: none; }
.log-console__empty { margin: 0; padding: 18px 16px; color: var(--muted); font-size: 13px; }
[data-log-follow][aria-pressed="true"],
[data-log-pause][aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }

/* ---- Topbar active-session badge ---- */

.topbar-sessions { position: relative; }
/* The badge hangs off the corner so the icon itself stays fully visible, and
   the ring matches the topbar so it reads as a cut-out like the bell badge. */
.topbar-badge {
  position: absolute; top: -6px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--topbar-bg);
}
.topbar-sessions.is-empty .topbar-badge { display: none; }

/* ---- Personnel self-registration (public landing pages) ---- */

.reg-shell { max-width: 900px; margin: 0 auto; display: grid; gap: 18px; }
.reg-head h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -0.02em; }
.reg-head p { margin: 0; color: var(--muted); max-width: 68ch; }
.reg-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--info-soft); color: var(--info);
}
.reg-badge--ok { background: var(--success-soft); color: var(--success); }
.reg-card { padding: 22px; }
.reg-card--narrow { max-width: 460px; }
.reg-card__section { display: grid; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.reg-card__section:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.reg-card__section h2 { margin: 0; font-size: 15px; }
.reg-hint { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.req { color: var(--danger); }
.field--check { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.field--check input { margin-top: 3px; }
.reg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.reg-resend { display: flex; align-items: center; gap: 10px; }
.reg-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.reg-foot { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.input--code { letter-spacing: 0.5em; font-size: 20px; text-align: center; }

/* ---- Employee portal theme (elegant blue) ---- */

.app.is-personnel {
  --sidebar-from: #1d4e82;
  --sidebar-mid: #0a2540;
  --sidebar-to: #061a2e;
  --sidebar-text: #c3d8ee;
  --sidebar-text-strong: #eaf3ff;
  --sidebar-muted: #8fb0d2;
  --sidebar-label: #6f93b8;
  --sidebar-accent: #7eb2ff;
  --sidebar-border: rgba(126, 178, 255, 0.18);
  --sidebar-hover: rgba(126, 178, 255, 0.12);
  --sidebar-active-from: rgba(126, 178, 255, 0.28);
  --sidebar-active-to: rgba(126, 178, 255, 0.12);
  --sidebar-art-line: rgba(147, 197, 253, 0.14);
  --sidebar-art-line-strong: rgba(191, 219, 254, 0.22);
  --sidebar-art-dot: rgba(147, 197, 253, 0.12);
  --sidebar-art-node: #bfdbfe;
}
.app.is-personnel .nav__link.is-active { box-shadow: inset 3px 0 0 #7eb2ff; }
.app.is-personnel .topbar { border-bottom-color: rgba(126, 178, 255, 0.22); }

/* ---- Employee portal lists (dashboard impersonation, self-service) ---- */

.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.account-list__item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm, 10px);
}
.account-list__item + .account-list__item { border-top: 1px solid var(--border); }
.account-list__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.account-list__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-bar--inline { padding: 0 14px 12px; border-bottom: 0; }

.self-accounts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.self-account { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.self-account + .self-account { border-top: 1px solid var(--border); }
.self-account__meta { margin-left: auto; display: grid; justify-items: end; gap: 2px; }
.landing-footer__admin {
  align-self: flex-end;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: 999px;
  padding: 3px 11px;
  font-weight: 700;
  text-decoration: none;
  margin-right: 2px;
}
.landing-footer__admin:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  text-decoration: none;
}
[data-theme="dark"] .landing-footer__admin:hover { color: #450a0a; }

/* ---- Employee sign-in page (distinct from the admin console) ---- */

.auth-card--employee {
  padding: 26px 26px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.auth-card--employee::before {
  content: "";
  position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}
.auth-card--employee .auth-card__head { margin-bottom: 18px; }
.auth-card--employee .auth-card__head h2 {
  font-size: 25px;
  color: var(--text);
}
.auth-card--employee .auth-card__head p { color: var(--muted); }
.auth-card--employee .auth-card__alt a { color: var(--info); }

.auth-card__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; margin-bottom: 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--info-soft); color: var(--info);
}
.auth-card--employee .btn--primary {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.85);
}
.auth-card--employee .btn--primary:hover { filter: brightness(1.05); }

.auth-switch {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 12.5px; color: var(--muted);
}
.auth-switch a { font-weight: 600; color: var(--info); }
.auth-switch a:hover { text-decoration: underline; }

/* The employee sign-in hero gets the portal's blue gradient. */
.auth-body--employee .auth-hero {
  background: radial-gradient(circle at 20% 10%, #1d4e82 0%, #0a2540 55%, #061a2e 100%);
  --auth-art-line: rgba(147, 197, 253, 0.2);
  --auth-art-line-strong: rgba(191, 219, 254, 0.34);
  --auth-art-dot: rgba(147, 197, 253, 0.18);
  --auth-art-node: #bfdbfe;
}
.auth-body--employee .auth-hero h1 { color: #eaf3ff; }
.auth-body--employee .auth-hero p { color: #bcd6f5; }
.auth-body--employee .auth-hero__list { color: #dce9fa; }
.auth-body--employee .auth-hero__list li::before {
  background: #7eb2ff;
  box-shadow: 0 0 0 4px rgba(126, 178, 255, 0.2);
}
.auth-body--employee .auth-hero::after {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.3), transparent 65%);
}
.auth-body--employee .auth-hero__version { color: #7eb2ff; }
.auth-body--employee .auth-shell { border-color: var(--border); }

/* Dark theme keeps the badge legible on the darker card. */
[data-theme="dark"] .auth-card--employee { background: var(--surface); }
[data-theme="dark"] .auth-card__badge { background: rgba(126, 178, 255, 0.16); color: #a9caff; }

/* Compact statistic grid used by the employee portal. */
.stat-grid--compact { margin-bottom: 4px; }
.stat-grid--compact .stat-card strong { font-size: 18px; }

/* ---- Admin console sign-in (red accent, distinct from the blue portal) ---- */

.auth-card--console {
  padding: 26px 26px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.auth-card--console::before {
  content: "";
  position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, #b91c1c, #f87171);
}
.auth-card--console .auth-card__head { margin-bottom: 18px; }
.auth-card--console .btn--primary {
  background: linear-gradient(180deg, #dc2626, #b91c1c);
  border-color: #b91c1c;
  box-shadow: 0 8px 18px -10px rgba(220, 38, 38, 0.85);
}
.auth-card--console .btn--primary:hover { filter: brightness(1.06); }
.auth-card--console .auth-card__alt a { color: #b91c1c; }
.auth-card--console .auth-switch a { color: #b91c1c; }
.auth-card--console .auth-card__badge { background: var(--danger-soft); color: var(--danger); }
[data-theme="dark"] .auth-card--console .auth-card__badge { background: rgba(248, 113, 113, 0.16); color: #fca5a5; }
[data-theme="dark"] .auth-card--console .auth-card__alt a,
[data-theme="dark"] .auth-card--console .auth-switch a { color: #fca5a5; }

/* ---- Toast notifications and confirmation dialogs ---- */

/* Toastr sits above the layout instead of pushing page content around, so it
   carries every flash and result message. The palette follows the app instead
   of the library defaults. */
#toast-container > div {
  width: 340px;
  padding: 13px 16px 14px 48px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background-position: 15px 16px;
  font-family: var(--font);
  opacity: 1;
}
#toast-container > div:hover {
  opacity: 1;
  box-shadow: 0 18px 40px -20px rgba(10, 16, 33, 0.55);
}
#toast-container > .toast-success { background-color: var(--success); }
#toast-container > .toast-error { background-color: var(--danger); }
#toast-container > .toast-warning { background-color: var(--warning); }
#toast-container > .toast-info { background-color: var(--info); }
#toast-container .toast-title { font-weight: 700; letter-spacing: 0.01em; }
#toast-container .toast-message { font-size: 12.5px; line-height: 1.5; }
#toast-container .toast-progress { height: 3px; opacity: 0.4; }
#toast-container .toast-close-button { font-size: 17px; opacity: 0.75; }
#toast-container .toast-close-button:hover { opacity: 1; }
.toast-top-right { top: 76px; right: 20px; }
/* The public landing header is taller than the console topbar. */
.landing-body .toast-top-right { top: 120px; }
@media (max-width: 720px) {
  .toast-top-right,
  .landing-body .toast-top-right { top: 12px; right: 12px; left: 12px; }
  #toast-container > div { width: auto; max-width: 100%; }
}

.swal2-popup {
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.swal2-title { color: var(--text); font-size: 18px; font-weight: 700; }
.swal2-html-container { color: var(--text-soft); font-size: 13.5px; line-height: 1.6; margin-top: 6px; }
.swal2-styled { border-radius: var(--radius-sm); font-weight: 600; box-shadow: none; }
.swal2-actions { gap: 10px; }
/* Confirm is the filled action, cancel a neutral outline: never the same look. */
.swal2-popup .swal2-actions .btn { min-width: 8.5rem; justify-content: center; }
.swal2-popup .swal2-cancel.btn--ghost { border: 1px solid var(--border-strong); }
.swal2-backdrop-show { background: rgba(9, 13, 26, 0.55); }

/* Decorative backgrounds stay static for people who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
  .auth-hero__art *,
  .sidebar__art * { animation: none !important; }
}
