:root {
  --bg: #050b18;
  --bg-soft: #081325;
  --sidebar: #071426;
  --surface: #0b1930;
  --surface-2: #10213d;
  --surface-3: #142746;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(103, 232, 249, 0.24);
  --text: #edf7ff;
  --muted: #8fa4bf;
  --muted-2: #627894;
  --indigo: #7179ff;
  --indigo-strong: #5865f2;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --emerald: #31d69b;
  --emerald-soft: rgba(49, 214, 155, 0.12);
  --amber: #f6bd60;
  --amber-soft: rgba(246, 189, 96, 0.12);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-width: 278px;
  --topbar-height: 76px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { min-height: 100%; font-size: 16px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 2%, rgba(88, 101, 242, 0.1), transparent 30rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #7be9f8; }

svg { width: 1.25rem; height: 1.25rem; display: block; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: .7rem 1rem;
  color: #03121e;
  background: var(--cyan);
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid rgba(34, 211, 238, .85);
  outline-offset: 3px;
}

.admin-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(113, 121, 255, .06), transparent 12rem),
    var(--sidebar);
  border-right: 1px solid var(--border);
  box-shadow: 14px 0 45px rgba(0, 0, 0, .16);
}

.sidebar__header {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(145deg, var(--indigo), #424ed1 55%, #1aacc6);
  box-shadow: 0 10px 28px rgba(88, 101, 242, .3), inset 0 1px rgba(255,255,255,.22);
}
.brand__copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand__copy strong { font-size: .96rem; letter-spacing: -.01em; }
.brand__copy small { margin-top: .25rem; color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.brand--large .brand__mark { width: 52px; height: 52px; flex-basis: 52px; border-radius: 16px; font-size: 1rem; }
.brand--large .brand__copy strong { font-size: 1.08rem; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 1rem .85rem 1.5rem; scrollbar-width: thin; }
.nav-caption { margin: 1.25rem .85rem .55rem; color: #546b88; font-size: .65rem; font-weight: 800; letter-spacing: .14em; }
.nav-caption:first-child { margin-top: .25rem; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .82rem;
  min-height: 46px;
  margin: .18rem 0;
  padding: .72rem .85rem;
  color: #9eb0c8;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .87rem;
  font-weight: 650;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.nav-link svg { width: 1.16rem; height: 1.16rem; color: #6d84a3; }
.nav-link:hover { color: #e8f7ff; background: rgba(255,255,255,.035); transform: translateX(2px); }
.nav-link:hover svg { color: var(--cyan); }
.nav-link.is-active {
  color: white;
  background: linear-gradient(90deg, rgba(88,101,242,.22), rgba(34,211,238,.07));
  border-color: rgba(113,121,255,.18);
  box-shadow: inset 3px 0 var(--indigo);
}
.nav-link.is-active svg { color: #9ca3ff; }

.sidebar__footer { padding: .9rem; border-top: 1px solid var(--border); }
.environment-card { display: flex; align-items: center; gap: .68rem; padding: .8rem; margin-bottom: .45rem; border-radius: 12px; background: rgba(255,255,255,.025); }
.environment-card > span:not(.status-dot) { display: flex; flex-direction: column; min-width: 0; }
.environment-card strong { font-size: .76rem; }
.environment-card small { margin-top: .15rem; color: var(--muted-2); font-size: .65rem; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 999px; background: var(--muted); box-shadow: 0 0 0 4px rgba(148,163,184,.08); }
.status-dot--ok { background: var(--emerald); box-shadow: 0 0 0 4px rgba(49,214,155,.1), 0 0 15px rgba(49,214,155,.32); }
.logout-form { margin: 0; }
.logout-button { width: 100%; display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; color: var(--muted); border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-size: .78rem; font-weight: 650; }
.logout-button:hover { color: #ffd7dd; background: var(--red-soft); }
.logout-button svg { width: 1.05rem; height: 1.05rem; }

.sidebar__close, .topbar__menu { display: none; }
.sidebar-backdrop { display: none; }

.admin-main { min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem clamp(1.1rem, 3vw, 2.35rem);
  background: rgba(5, 11, 24, .8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.topbar__context { display: flex; align-items: center; gap: .65rem; }
.topbar__identity { margin-left: auto; display: flex; align-items: center; gap: .65rem; }
.topbar__identity > span:last-child { display: flex; flex-direction: column; text-align: right; }
.topbar__identity strong { max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; }
.topbar__identity small { color: var(--muted); font-size: .65rem; margin-top: .12rem; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(113,121,255,.3); border-radius: 11px; color: #cfd3ff; background: rgba(113,121,255,.13); font-size: .76rem; font-weight: 800; }
.live-pill, .demo-badge { display: inline-flex; align-items: center; gap: .38rem; padding: .35rem .55rem; border-radius: 999px; font-size: .6rem; font-weight: 850; letter-spacing: .08em; }
.live-pill { color: #8df1c9; border: 1px solid rgba(49,214,155,.18); background: var(--emerald-soft); }
.live-pill i { width: 6px; height: 6px; border-radius: 999px; background: var(--emerald); box-shadow: 0 0 10px var(--emerald); }
.demo-badge { color: #ffe1a5; border: 1px solid rgba(246,189,96,.2); background: var(--amber-soft); }

.page-content { width: min(100%, 1540px); flex: 1; padding: clamp(1.35rem, 3.2vw, 2.5rem); margin: 0 auto; }
.admin-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1.35rem, 3vw, 2.4rem); color: var(--muted-2); border-top: 1px solid var(--border); font-size: .68rem; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.75rem; }
.page-header__copy { max-width: 780px; }
.eyebrow { display: block; margin-bottom: .5rem; color: var(--cyan); font-size: .66rem; font-weight: 850; letter-spacing: .13em; }
.page-header h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.55rem); line-height: 1.04; letter-spacing: -.045em; }
.page-header p { margin: .7rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.metric-card {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(16,33,61,.9), rgba(8,19,37,.9));
  box-shadow: 0 12px 35px rgba(0,0,0,.13);
}
.metric-card::after { content: ""; position: absolute; right: -30px; bottom: -45px; width: 115px; height: 115px; border-radius: 999px; background: var(--metric-glow, rgba(113,121,255,.12)); filter: blur(4px); }
.metric-card__top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.metric-card__label { color: var(--muted); font-size: .73rem; font-weight: 650; }
.metric-card__icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--metric-color, #9ea5ff); border-radius: 10px; background: var(--metric-glow, rgba(113,121,255,.12)); }
.metric-card__icon svg { width: 1rem; height: 1rem; }
.metric-card__value { position: relative; z-index: 1; display: block; margin-top: 1.1rem; font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.04em; }
.metric-card__meta { position: relative; z-index: 1; display: flex; align-items: center; gap: .4rem; margin-top: .45rem; color: var(--muted-2); font-size: .66rem; }
.trend { color: var(--emerald); font-weight: 800; }
.trend--down { color: var(--red); }
.metric-card--cyan { --metric-color: var(--cyan); --metric-glow: rgba(34,211,238,.11); }
.metric-card--green { --metric-color: var(--emerald); --metric-glow: rgba(49,214,155,.11); }
.metric-card--amber { --metric-color: var(--amber); --metric-glow: rgba(246,189,96,.11); }

.content-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.content-grid--2 { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); }
.content-grid--equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-gap { margin-top: 1rem; }

.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(11,25,48,.82); box-shadow: 0 18px 50px rgba(0,0,0,.12); }
.panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.2rem; border-bottom: 1px solid var(--border); }
.panel__header h2, .panel__header h3 { margin: 0; font-size: .9rem; letter-spacing: -.015em; }
.panel__header p { margin: .3rem 0 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.panel__body { padding: 1.2rem; }
.panel__body--flush { padding: 0; }
.panel__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .68rem; }
.panel-link { display: inline-flex; align-items: center; gap: .3rem; color: #9ba2ff; font-size: .7rem; font-weight: 750; }
.panel-link svg { width: .85rem; height: .85rem; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .65rem .9rem; color: var(--text); border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); cursor: pointer; font-size: .73rem; font-weight: 750; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { color: white; border-color: rgba(113,121,255,.35); background: var(--surface-3); transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button svg { width: 1rem; height: 1rem; }
.button--primary { color: white; border-color: rgba(113,121,255,.42); background: linear-gradient(135deg, var(--indigo-strong), #4b52c7); box-shadow: 0 10px 25px rgba(88,101,242,.19); }
.button--primary:hover { background: linear-gradient(135deg, #6a75ff, #5865f2); }
.button--success { color: #b7ffe2; border-color: rgba(49,214,155,.22); background: var(--emerald-soft); }
.button--danger { color: #ffd0d8; border-color: rgba(251,113,133,.22); background: var(--red-soft); }
.button--ghost { background: transparent; }
.button--small { min-height: 34px; padding: .45rem .65rem; font-size: .66rem; }

.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; color: var(--muted); border: 1px solid var(--border); border-radius: 11px; background: rgba(16,33,61,.75); cursor: pointer; }
.icon-button:hover { color: white; border-color: var(--border-strong); }

.status-badge, .demo-tag { display: inline-flex; align-items: center; gap: .35rem; width: max-content; padding: .28rem .5rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: rgba(148,163,184,.08); font-size: .6rem; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.status-badge--success { color: #74e7b9; border-color: rgba(49,214,155,.17); background: var(--emerald-soft); }
.status-badge--warning { color: #ffd184; border-color: rgba(246,189,96,.18); background: var(--amber-soft); }
.status-badge--danger { color: #ff9aaa; border-color: rgba(251,113,133,.18); background: var(--red-soft); }
.status-badge--info { color: #6ce9f8; border-color: rgba(34,211,238,.18); background: var(--cyan-soft); }
.demo-tag { color: #ffe1a5; border-color: rgba(246,189,96,.18); background: var(--amber-soft); }

.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .73rem; }
.data-table th { padding: .78rem 1rem; color: var(--muted-2); background: rgba(5,11,24,.2); border-bottom: 1px solid var(--border); text-align: left; font-size: .58rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: .86rem 1rem; color: #c9d8e9; border-bottom: 1px solid rgba(148,163,184,.08); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(113,121,255,.035); }
.cell-title { display: flex; flex-direction: column; gap: .18rem; min-width: 120px; }
.cell-title strong { color: var(--text); font-size: .74rem; }
.cell-title small, .muted { color: var(--muted); font-size: .64rem; }
.numeric { font-variant-numeric: tabular-nums; }
.table-actions { display: flex; justify-content: flex-end; gap: .4rem; }

.empty-state { min-height: 220px; display: grid; place-items: center; padding: 2rem; text-align: center; }
.empty-state__inner { max-width: 390px; }
.empty-state__icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 1rem; color: var(--cyan); border: 1px solid rgba(34,211,238,.18); border-radius: 16px; background: var(--cyan-soft); }
.empty-state__icon svg { width: 1.5rem; height: 1.5rem; }
.empty-state h3 { margin: 0; font-size: .88rem; }
.empty-state p { margin: .55rem auto 0; color: var(--muted); font-size: .7rem; line-height: 1.65; }

.notice { display: flex; align-items: flex-start; gap: .8rem; padding: .9rem 1rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: #c8d7e9; background: rgba(16,33,61,.65); font-size: .72rem; line-height: 1.55; }
.notice svg { flex: 0 0 auto; color: var(--cyan); }
.notice--warning { border-color: rgba(246,189,96,.18); background: var(--amber-soft); }
.notice--warning svg { color: var(--amber); }
.notice--danger { border-color: rgba(251,113,133,.18); background: var(--red-soft); }
.notice--danger svg { color: var(--red); }
.notice strong { color: var(--text); }

.filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem; padding: .9rem 1rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(11,25,48,.72); }
.field { display: flex; flex-direction: column; gap: .38rem; min-width: 0; }
.field--grow { flex: 1; }
.field label { color: #a9bbcf; font-size: .66rem; font-weight: 700; }
.field-hint { color: var(--muted-2); font-size: .6rem; line-height: 1.45; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-spacer { margin-top: .9rem; }
.form-control, .form-select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: .65rem .75rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(5,11,24,.58);
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 94px; resize: vertical; }
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(34,211,238,.55); background: rgba(5,11,24,.82); box-shadow: 0 0 0 3px rgba(34,211,238,.09); }
select option { background: var(--surface); color: var(--text); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.form-check { display: flex; align-items: center; gap: .55rem; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--indigo); }
.form-check-label { color: var(--muted); font-size: .7rem; }
.switch { position: relative; display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 38px; height: 22px; position: relative; border: 1px solid var(--border); border-radius: 999px; background: #17263e; transition: .15s ease; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 999px; background: #8395ad; transition: .15s ease; }
.switch input:checked + .switch__track { border-color: rgba(49,214,155,.4); background: rgba(49,214,155,.18); }
.switch input:checked + .switch__track::after { left: 19px; background: var(--emerald); }
.switch input:focus-visible + .switch__track { outline: 3px solid rgba(34,211,238,.45); outline-offset: 3px; }

.chart-shell { min-height: 290px; display: flex; flex-direction: column; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--muted); font-size: .62rem; }
.legend-key { display: inline-flex; align-items: center; gap: .35rem; }
.legend-key i { width: 8px; height: 8px; border-radius: 3px; background: var(--indigo); }
.legend-key--cyan i { background: var(--cyan); }
.legend-key--green i { background: var(--emerald); }
.chart-svg { width: 100%; height: auto; min-height: 230px; margin-top: .7rem; overflow: visible; }
.chart-grid { stroke: rgba(148,163,184,.1); stroke-width: 1; }
.chart-axis-label { fill: #60758f; font-size: 9px; }
.chart-line { fill: none; stroke: var(--indigo); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 5px 7px rgba(88,101,242,.25)); }
.chart-line--cyan { stroke: var(--cyan); }
.chart-area { fill: url(#lineArea); opacity: .38; }
.chart-point { fill: var(--surface); stroke: var(--indigo); stroke-width: 3; }
.bar-chart { height: 240px; display: flex; align-items: end; gap: clamp(.5rem, 2vw, 1rem); padding: 1.3rem .2rem 0; border-bottom: 1px solid var(--border); }
.bar-column { flex: 1; min-width: 20px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: .5rem; color: var(--muted-2); font-size: .57rem; }
.bar { width: min(100%, 36px); min-height: 4px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--cyan), rgba(88,101,242,.75)); box-shadow: 0 5px 18px rgba(34,211,238,.12); }
.donut-layout { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 1rem; }
.donut { width: 142px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 999px; background: conic-gradient(var(--indigo) 0 var(--p1, 45%), var(--cyan) var(--p1, 45%) var(--p2, 75%), var(--emerald) var(--p2, 75%) 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 20px; border-radius: inherit; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.donut__center { position: relative; z-index: 1; text-align: center; }
.donut__center strong { display: block; font-size: 1.35rem; }
.donut__center small { color: var(--muted); font-size: .58rem; }
.legend-list { display: grid; gap: .68rem; }
.legend-list__item { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; color: var(--muted); font-size: .66rem; }
.legend-list__item i { width: 8px; height: 8px; border-radius: 3px; background: var(--indigo); }
.legend-list__item strong { color: var(--text); }

.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: .7rem; padding-bottom: 1rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 13px; top: 24px; bottom: 0; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-icon { width: 28px; height: 28px; position: relative; z-index: 1; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: var(--cyan); background: var(--surface-2); }
.timeline-icon svg { width: .82rem; height: .82rem; }
.timeline-copy strong { display: block; font-size: .72rem; }
.timeline-copy p { margin: .25rem 0; color: var(--muted); font-size: .65rem; line-height: 1.45; }
.timeline-copy time { color: var(--muted-2); font-size: .58rem; }

.progress { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(148,163,184,.1); }
.progress__bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--indigo), var(--cyan)); }
.progress__bar--green { background: linear-gradient(90deg, #20a97b, var(--emerald)); }
.progress__bar--amber { background: linear-gradient(90deg, #c48327, var(--amber)); }
.readiness-score { display: grid; place-items: center; min-height: 255px; text-align: center; }
.score-ring { --score: 0; width: 150px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 999px; background: conic-gradient(var(--emerald) calc(var(--score) * 1%), rgba(148,163,184,.1) 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 14px; border-radius: inherit; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.score-ring__value { position: relative; z-index: 1; }
.score-ring__value strong { display: block; font-size: 2rem; letter-spacing: -.05em; }
.score-ring__value small { color: var(--muted); font-size: .62rem; }
.check-list { display: grid; gap: .65rem; }
.check-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .72rem; border: 1px solid var(--border); border-radius: 11px; background: rgba(5,11,24,.22); }
.check-item__icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--emerald); background: var(--emerald-soft); }
.check-item__icon--warning { color: var(--amber); background: var(--amber-soft); }
.check-item__icon--danger { color: var(--red); background: var(--red-soft); }
.check-item__icon svg { width: .9rem; height: .9rem; }
.check-item strong { display: block; font-size: .7rem; }
.check-item p { margin: .18rem 0 0; color: var(--muted); font-size: .61rem; line-height: 1.45; }

.kpi-list { display: grid; gap: .75rem; }
.kpi-row { display: grid; grid-template-columns: 1fr auto; gap: .55rem; align-items: center; }
.kpi-row__label { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .65rem; }
.kpi-row > .progress { grid-column: 1 / -1; }

.auth-body { overflow-x: hidden; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.12fr) minmax(420px, .88fr); }
.auth-brand { position: relative; overflow: hidden; padding: clamp(2rem, 5vw, 5.5rem); background: linear-gradient(145deg, #07152b, #111c48 55%, #082738); }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 999px; filter: blur(2px); }
.auth-brand::before { width: 500px; height: 500px; right: -180px; top: -180px; background: radial-gradient(circle, rgba(113,121,255,.25), transparent 68%); }
.auth-brand::after { width: 420px; height: 420px; left: -220px; bottom: -240px; background: radial-gradient(circle, rgba(34,211,238,.18), transparent 68%); }
.auth-brand__content { position: relative; z-index: 1; min-height: calc(100vh - clamp(4rem, 10vw, 11rem)); display: flex; flex-direction: column; }
.auth-brand__message { margin: auto 0; max-width: 650px; padding: 4rem 0; }
.auth-brand__message h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 5.2rem); line-height: .98; letter-spacing: -.065em; }
.auth-brand__message h1 span { color: #8beaf5; }
.auth-brand__message p { max-width: 560px; margin: 1.4rem 0 0; color: #a7bbd2; font-size: clamp(.94rem, 1.4vw, 1.12rem); line-height: 1.7; }
.auth-trust-list { display: flex; flex-wrap: wrap; gap: 1.25rem; color: #8fa7c1; font-size: .7rem; }
.auth-trust-list span { display: inline-flex; align-items: center; gap: .45rem; }
.auth-trust-list svg { width: 1rem; height: 1rem; color: var(--emerald); }
.auth-panel { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 7vw, 7rem); background: rgba(5,11,24,.96); }
.auth-panel__inner { width: min(100%, 430px); margin: auto; }
.auth-footer { margin: 2rem 0 0; color: var(--muted-2); text-align: center; font-size: .63rem; }
.auth-card__eyebrow { color: var(--cyan); font-size: .65rem; font-weight: 850; letter-spacing: .13em; }
.auth-card h2 { margin: .55rem 0 0; font-size: clamp(1.7rem, 4vw, 2.25rem); letter-spacing: -.045em; }
.auth-card__lead { margin: .65rem 0 1.65rem; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.auth-form { display: grid; gap: .9rem; }
.auth-form .field label { font-size: .7rem; }
.auth-form .form-control { min-height: 50px; }
.auth-submit { width: 100%; min-height: 50px; margin-top: .35rem; }
.auth-note { display: flex; align-items: flex-start; gap: .6rem; margin-top: 1.4rem; padding: .8rem; color: var(--muted); border: 1px solid var(--border); border-radius: 11px; background: rgba(16,33,61,.45); font-size: .65rem; line-height: 1.5; }
.auth-note svg { flex: 0 0 auto; width: 1rem; height: 1rem; color: var(--cyan); }
.validation-summary-errors, .field-validation-error { color: #ff9aaa; font-size: .66rem; }
.validation-summary-errors ul { margin: 0 0 .8rem; padding: .75rem .75rem .75rem 1.8rem; border: 1px solid rgba(251,113,133,.2); border-radius: 10px; background: var(--red-soft); }
.input-validation-error { border-color: rgba(251,113,133,.6) !important; }

.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.error-code { display: block; color: var(--cyan); font-size: 4.5rem; font-weight: 900; letter-spacing: -.08em; }
.error-page h1 { margin: .25rem 0; }
.error-page p { max-width: 560px; color: var(--muted); line-height: 1.6; }
.code-chip { display: inline-block; padding: .35rem .55rem; border-radius: 8px; color: #c8d7e9; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .65rem; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.text-danger { color: var(--red) !important; }
.text-muted { color: var(--muted) !important; }
.text-success { color: var(--emerald) !important; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid--2, .content-grid--3 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --topbar-height: 66px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 22px 0 55px rgba(0,0,0,.4); }
  .admin-shell.is-sidebar-open .sidebar { transform: translateX(0); }
  .sidebar__close, .topbar__menu { display: inline-grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 50; width: 100%; height: 100%; border: 0; background: rgba(1,5,14,.66); backdrop-filter: blur(3px); }
  .admin-shell.is-sidebar-open .sidebar-backdrop { display: block; }
  .admin-main { margin-left: 0; }
  .topbar__menu { margin-right: .2rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 240px; padding: 1.5rem; }
  .auth-brand__content { min-height: 190px; }
  .auth-brand__message { margin: auto 0 0; padding: 2.5rem 0 0; }
  .auth-brand__message h1 { font-size: clamp(2.05rem, 10vw, 3.4rem); }
  .auth-brand__message p, .auth-trust-list { display: none; }
  .auth-panel { min-height: calc(100vh - 240px); padding: 2rem 1.25rem; }
}

@media (max-width: 680px) {
  .page-content { padding: 1.15rem; }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 1.2rem; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .button { flex: 1; }
  .metrics-grid { grid-template-columns: 1fr; gap: .75rem; }
  .metric-card { min-height: 132px; }
  .content-grid--equal { grid-template-columns: 1fr; }
  .field-grid, .field-grid--3 { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar .button { width: 100%; }
  .topbar { padding-inline: 1rem; }
  .topbar__identity > span:last-child { display: none; }
  .demo-badge { display: none; }
  .panel__header { padding: 1rem; }
  .panel__body { padding: 1rem; }
  .donut-layout { grid-template-columns: 1fr; justify-items: center; }
  .legend-list { width: 100%; }
  .admin-footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
