/* Notifikasi.id 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-bg: #0d1326;
  --sidebar-text: #9aa5c0;
  --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;
  --sidebar-bg: #070b16;
  --sidebar-text: #98a4c2;
  --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;
}

* { 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;
  background: radial-gradient(circle at 20% 0%, #1b2450 0%, var(--sidebar-bg) 55%, #080d1c 100%);
  color: var(--sidebar-text);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
  color: #fff;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.9);
}
.brand__mark--lg { width: 54px; height: 54px; border-radius: 16px; font-size: 20px; }
.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: #7f8bab; 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: #5d6787;
}
.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: rgba(255, 255, 255, 0.05); color: #eef1fa; text-decoration: none; }
.nav__link svg { width: 17px; height: 17px; opacity: 0.85; }
.nav__link.is-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0.08));
  color: #fff;
}
.nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #818cf8;
}

.sidebar__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  color: #6d7898;
}
.sidebar__footer a { margin-left: auto; color: #a5b0cc; }

.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; }
.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; }

.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__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); }

/* 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__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--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-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; }

/* 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; }

/* 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, #1e1b4b 0%, #312e81 55%, #4c1d95 100%);
  color: #e0e7ff;
  overflow: hidden;
}
.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.35), transparent 65%);
}
.auth-hero h1 { font-size: 34px; letter-spacing: -0.03em; color: #fff; }
.auth-hero p { color: #c7d2fe; 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: #dbeafe; }
.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: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(165, 180, 252, 0.18);
}
.auth-hero__version { position: absolute; bottom: 22px; left: 48px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #818cf8; }
.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;
  /* The global pre rule paints light text for dark blocks; these blocks follow
     the theme surface, so the colour has to come from the theme too. */
  color: var(--text-soft);
}
.code-block code, .code-block .tok { color: inherit; }
.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-body .brand__mark { border-radius: 12px; }

.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__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; }
.brand__mark--sm { width: 30px; height: 30px; font-size: 11px; border-radius: 9px; }
.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; }
}

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

/* Public API reference (/docs) — reuses the landing shell, adds a docs column. */
.landing-nav__docs {
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 6px 10px; border-radius: 8px;
}
.landing-nav__docs:hover { color: var(--text); background: var(--surface); }

.hero--docs { padding: 56px 0 32px; text-align: left; }
.hero--docs .hero__inner { margin: 0; max-width: 820px; }
.hero--docs .hero__actions { justify-content: flex-start; }
.hero--docs .hero__title { font-size: clamp(26px, 4vw, 38px); }

.docs-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px; margin: 32px 0 0; padding: 0;
}
.docs-facts > div {
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.docs-facts dt {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 4px;
}
.docs-facts dd { margin: 0; font-size: 12.5px; word-break: break-all; }

.docs-body {
  display: grid; gap: 18px; max-width: 900px; margin: 0 auto; padding: 0 0 64px;
}
.docs-body .card { margin: 0; }
.docs-body h2 { margin: 0; font-size: 18px; }
.docs-body h3 { margin: 18px 0 8px; font-size: 13.5px; }
.docs-body .code-block { font-size: 12px; line-height: 1.6; }
.docs-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.docs-list li + li { margin-top: 6px; }
.docs-list code { color: var(--text); }

@media (max-width: 720px) {
  .hero--docs { padding-top: 32px; }
  .docs-body { padding-bottom: 40px; }
  .docs-facts { grid-template-columns: 1fr; }
}

/* Gateway API-key ⇄ .env panel and the services log viewer. */
.env-key-box {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--surface));
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.env-key-box__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.env-key-box__head strong { font-size: 13.5px; }
.env-key-box__head p { margin: 4px 0 0; font-size: 12px; }
.env-key-box .meta-list { margin: 0; }

.log-view {
  max-height: 420px; overflow: auto; margin: 0; border-radius: 0 0 12px 12px;
  font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}

/* WhatsApp pairing: QR frame, pairing code and the follow-along steps. */
.pair-qr { grid-column: 1 / -1; }
.pair-qr__frame {
  display: flex; align-items: center; justify-content: center; min-height: 260px;
  padding: 16px; background: var(--surface-2, var(--surface));
}
.pair-qr__frame img { width: 240px; height: 240px; image-rendering: pixelated; border-radius: 8px; background: #fff; padding: 8px; }
.pair-qr__hint { color: var(--muted); font-size: 12.5px; text-align: center; max-width: 420px; }
.pair-qr__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px 16px; }
.pair-qr__foot p { margin: 0; font-size: 12px; }
.pair-qr__foot [hidden] { display: none; }
.pair-code {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin: 16px; padding: 16px; border: 1px dashed var(--border); border-radius: 12px;
  background: var(--surface-2, var(--surface));
}
.pair-code[hidden], .pair-qr__frame img[hidden] { display: none; }
.pair-code__value { font-size: 30px; letter-spacing: 8px; font-family: var(--font-mono, monospace); }
.pair-steps { margin: 0; padding: 0 16px 0 34px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.pair-steps strong { color: var(--text); }

/* API key copy affordances on the client detail page. */
.key-reveal {
  margin: 0 16px 16px; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2, var(--surface)); display: flex; flex-direction: column; gap: 8px;
}
.key-reveal strong { font-size: 13px; }
.key-reveal p { margin: 0; font-size: 12px; }
.copy-field { display: flex; align-items: center; gap: 8px; }
.copy-field code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 8px 10px;
  border: 1px dashed var(--border); border-radius: 8px; font-size: 12px; user-select: all;
}
.copy-field__btn { display: inline-flex; align-items: center; gap: 6px; }
.copy-field__btn svg, .icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.copy-inline { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  padding: 0; border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--text); }
[data-copy].is-copied { border-color: var(--success, #16a34a); color: var(--success, #16a34a); }
/* The toast carries the message; inline text would break the 26px icon button. */
[data-copy][data-copy-done]::after { content: none; }

/* Bulk save row of the WhatsApp assignment table. */
.assign-actions {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 16px 18px; border-top: 1px solid var(--border);
}

/* Toast shown after a copy action. */
.copy-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  padding: 10px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--badge-dark-bg); color: var(--badge-dark-text);
  box-shadow: var(--shadow); z-index: 120; opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.copy-toast--error { background: var(--danger); color: #fff; }
