/* Modern operations admin surface */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --color-obsidian: 232 236 242;
  --color-console: 249 250 252;
  --color-panel: 239 243 248;
  --color-grid: 207 216 228;
  --color-health: 31 150 96;
  --color-warn: 180 104 32;
  --color-danger: 202 52 60;
  --color-ink: 24 32 43;
  --color-mist: 93 104 120;
  --canvas: #e8ecf2;
  --canvas-start: #f5f7fb;
  --canvas-end: #dce3ec;
  --surface: #f9fafc;
  --surface-glass: rgba(249, 250, 252, 0.95);
  --surface-muted: #eef3f8;
  --surface-hover: #e5ebf2;
  --line: #cfd8e4;
  --line-strong: #aeb9c8;
  --ink: #18202b;
  --muted: #5d6878;
  --muted-soft: #8a95a6;
  --health: #1f9660;
  --health-soft: rgba(31, 150, 96, 0.12);
  --warn: #b46820;
  --warn-soft: rgba(180, 104, 32, 0.13);
  --danger: #ca343c;
  --danger-soft: rgba(202, 52, 60, 0.12);
  --focus: #3178c6;
  --shadow-sm: 0 1px 2px rgba(24, 32, 43, 0.08);
  --shadow-md: 0 20px 48px rgba(24, 32, 43, 0.16);
  --workspace-edge: 0;
  --admin-sticky-top: clamp(0.5rem, 1.4vw, 1.25rem);
  --sidebar-sticky-top: 0;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-obsidian: 14 17 23;
  --color-console: 18 24 33;
  --color-panel: 26 34 46;
  --color-grid: 45 55 70;
  --color-health: 71 196 130;
  --color-warn: 210 138 52;
  --color-danger: 239 95 98;
  --color-ink: 231 237 245;
  --color-mist: 148 158 174;
  --canvas: #0e1117;
  --canvas-start: #1b2029;
  --canvas-end: #090c11;
  --surface: #121821;
  --surface-glass: rgba(18, 24, 33, 0.95);
  --surface-muted: #1a222e;
  --surface-hover: #222c39;
  --line: #2d3746;
  --line-strong: #424d5f;
  --ink: #e7edf5;
  --muted: #949eae;
  --muted-soft: #6f7a8b;
  --health: #47c482;
  --health-soft: rgba(71, 196, 130, 0.14);
  --warn: #d28a34;
  --warn-soft: rgba(210, 138, 52, 0.15);
  --danger: #ef5f62;
  --danger-soft: rgba(239, 95, 98, 0.14);
  --focus: #6bb8ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.36);
  --shadow-md: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, var(--canvas-start) 0%, var(--canvas) 42%, var(--canvas-end) 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  background: transparent;
}

.ops-shell {
  align-items: start;
}

.page-header {
  position: relative;
  z-index: 50;
}

.dashboard-body {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.side-dashboard,
.top-navbar,
.data-panel,
.readiness-panel,
.service-lane,
.summary-tile,
.auth-card {
  background: var(--surface-glass);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.side-dashboard,
.top-navbar,
.auth-card {
  backdrop-filter: blur(12px);
}

.top-navbar {
  display: grid;
  align-items: center;
  gap: 0.85rem 1rem;
}

.top-navbar__brand {
  min-width: 0;
}

.navbar-checked-at,
.sidebar-checked-at {
  display: grid;
  flex: 0 0 auto;
  gap: 0.16rem;
  min-width: min(100%, 14.5rem);
  padding: 0.15rem 0.35rem;
  color: var(--muted);
  text-align: left;
}

.navbar-checked-at strong,
.sidebar-checked-at strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
}

.navbar-checked-at span:last-child,
.sidebar-checked-at span:last-child {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.1;
}

.account-control form {
  margin: 0;
}

@media (min-width: 768px) {
  .top-navbar {
    grid-template-columns: minmax(18rem, 1fr) auto;
  }

}

.side-dashboard::-webkit-scrollbar {
  width: 8px;
}

.side-dashboard::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 34%, transparent);
  background-clip: padding-box;
}

.domain-chip,
.visibility-control,
.readiness-item,
[data-component="stat-box"],
.probe-value,
.auth-brief,
.auth-form input {
  background: var(--surface-muted);
  border-color: var(--line);
}

.theme-toggle,
.account-control__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.theme-toggle {
  gap: 0.45rem;
  padding: 0 0.7rem;
}

.theme-toggle:hover,
.account-control__action:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.theme-toggle__icon {
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.theme-toggle__icon::after {
  position: absolute;
  inset: -0.28rem -0.28rem auto auto;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  content: "";
  background: var(--surface);
  box-shadow: -0.08rem 0.08rem 0 0 currentColor;
}

html[data-theme="dark"] .theme-toggle__icon::after {
  inset: 0.08rem 0.08rem auto auto;
  width: 0.48rem;
  height: 0.48rem;
  background: var(--surface);
  box-shadow: -0.22rem 0.18rem 0 0 currentColor;
}

.account-control {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-menu[open] {
  z-index: 80;
}

.account-control__summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.55rem;
  padding: 0.14rem 0.6rem 0.14rem 0.14rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.account-control__summary::-webkit-details-marker {
  display: none;
}

.account-control__summary:hover,
.account-menu[open] .account-control__summary {
  border-color: var(--line);
  background: var(--surface);
}

.account-control__identity {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.45rem;
  padding: 0.2rem 0.25rem 0.2rem 0.2rem;
}

.account-control__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.78rem;
  font-weight: 850;
}

.account-control__copy {
  display: grid;
  gap: 0.12rem;
  line-height: 1.05;
}

.account-control__copy strong {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.account-control__copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.account-control__chevron {
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-0.1rem);
  transition: transform 160ms ease;
}

.account-menu[open] .account-control__chevron {
  transform: rotate(225deg) translate(-0.05rem, -0.05rem);
}

.account-menu__panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 0.55rem);
  right: 0;
  display: grid;
  gap: 0.45rem;
  width: min(16rem, calc(100vw - 2rem));
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.account-menu__panel form {
  width: 100%;
}

.account-menu__panel .theme-toggle,
.account-menu__panel .account-control__action {
  width: 100%;
  justify-content: flex-start;
  min-height: 2.5rem;
}

.account-control__action {
  padding: 0 0.75rem;
}

.account-control__action--primary,
.auth-submit {
  border-color: transparent;
  background: var(--ink);
  color: var(--surface);
}

.account-control__action--primary:hover,
.auth-submit:hover {
  background: color-mix(in srgb, var(--ink) 88%, var(--muted));
}

.side-nav__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.5rem;
  transition:
    background-color 160ms ease,
    opacity 160ms ease;
}

.side-nav__row--toggleable {
  grid-template-columns: minmax(0, 1fr) auto;
}

.side-nav__link {
  color: var(--muted);
}

.side-nav__link:hover {
  background: var(--surface-hover);
}

.side-nav__row[data-section-hidden="true"] .side-nav__link {
  color: var(--muted-soft);
  opacity: 0.72;
}

.side-nav__row[data-section-hidden="true"] .nav-dot {
  background: var(--line-strong);
}

.visibility-control {
  line-height: 1;
}

.visibility-control:hover {
  background: var(--surface-hover);
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45rem;
  min-height: 2rem;
  cursor: pointer;
}

.section-toggle__track {
  position: relative;
  display: inline-flex;
  width: 2.1rem;
  height: 1.16rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--line);
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.section-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.24);
  transform: translateY(-50%);
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.section-toggle__input:checked + .section-toggle__track {
  border-color: color-mix(in srgb, var(--health) 42%, var(--line));
  background: color-mix(in srgb, var(--health) 28%, transparent);
}

.section-toggle__input:checked + .section-toggle__track .section-toggle__thumb {
  transform: translate(0.9rem, -50%);
}

.section-toggle__input:focus-visible + .section-toggle__track,
.side-nav__link:focus-visible,
.visibility-control:focus-visible,
.sidebar-refresh:focus-visible,
.theme-toggle:focus-visible,
.account-control__summary:focus-visible,
.account-control__action:focus-visible,
.auth-submit:focus-visible,
.auth-back-link:focus-visible,
.auth-form input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.summary-tile,
.side-metric {
  position: relative;
  overflow: hidden;
}

.summary-tile::before,
.side-metric::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: var(--line-strong);
}

.summary-tile--ok::before,
.side-metric--ok::before {
  background: var(--health);
}

.summary-tile--warning::before,
.side-metric--warning::before {
  background: var(--warn);
}

.summary-tile--critical::before,
.side-metric--critical::before {
  background: var(--danger);
}

.summary-tile--muted::before,
.side-metric--muted::before {
  background: var(--muted-soft);
}

.nav-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--muted-soft);
}

.status-dot--ok {
  background: var(--health);
}

.status-dot--warning {
  background: var(--warn);
}

.status-dot--critical {
  background: var(--danger);
}

.status-dot--muted {
  background: var(--muted-soft);
}

.signal-rail {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line-strong);
}

.signal-rail--ok {
  background: var(--health);
}

.signal-rail--warning {
  background: var(--warn);
}

.signal-rail--critical {
  background: var(--danger);
}

.signal-rail--muted {
  background: var(--muted-soft);
}

.service-lane {
  isolation: isolate;
}

.check-row {
  background: var(--surface);
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.check-row:hover {
  background: var(--surface-hover);
}

.probe-value {
  max-width: 100%;
  color: var(--muted);
}

.signal {
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  width: fit-content;
  min-height: 1.75rem;
  padding: 0.28rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.status__icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
}

.status--ok {
  color: var(--health);
  border-color: color-mix(in srgb, var(--health) 26%, var(--line));
  background: var(--health-soft);
}

.status--warning {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 28%, var(--line));
  background: var(--warn-soft);
}

.status--critical {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 26%, var(--line));
  background: var(--danger-soft);
}

.status--muted {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-muted);
}

.status--ok .status__icon {
  border-radius: 999px;
  background: currentColor;
}

.status--warning .status__icon {
  width: 0;
  height: 0;
  border-right: 0.3rem solid transparent;
  border-bottom: 0.52rem solid currentColor;
  border-left: 0.3rem solid transparent;
}

.status--critical .status__icon::before,
.status--critical .status__icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.64rem;
  height: 0.12rem;
  border-radius: 999px;
  content: "";
  background: currentColor;
}

.status--critical .status__icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.status--critical .status__icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.status--muted .status__icon {
  border: 1px solid currentColor;
  border-radius: 999px;
}

.data-table {
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.data-table tbody th {
  color: var(--ink);
  font-weight: 750;
}

.data-table tbody td {
  color: var(--muted);
  font-size: 0.88rem;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.threshold-policy-note {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
}

.threshold-scroll {
  scrollbar-color: color-mix(in srgb, var(--muted) 34%, transparent) transparent;
}

.data-table--thresholds {
  table-layout: fixed;
}

.data-table--thresholds th,
.data-table--thresholds td {
  line-height: 1.45;
}

.threshold-col--metric {
  width: 22%;
}

.threshold-col--current {
  width: 24%;
}

.threshold-col--rule {
  width: 14%;
}

.threshold-col--status {
  width: 15%;
}

.threshold-col--source {
  width: 11%;
}

.threshold-current-cell,
.threshold-source-cell code {
  overflow-wrap: anywhere;
  word-break: normal;
}

.threshold-group-row th {
  padding: 0.58rem 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.threshold-row--critical th,
.threshold-row--critical td {
  background: var(--danger-soft);
}

.threshold-row--critical th[scope="row"] {
  box-shadow: inset 3px 0 0 var(--danger);
  color: var(--danger);
}

.threshold-current-visual {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.threshold-current-visual strong,
.threshold-current-text,
.threshold-days-badge {
  color: currentColor;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.2;
}

.threshold-current-visual--ok,
.threshold-current-text--ok,
.threshold-days-badge--ok {
  color: var(--health);
}

.threshold-current-visual--warning,
.threshold-current-text--warning,
.threshold-days-badge--warning {
  color: var(--warn);
}

.threshold-current-visual--critical,
.threshold-current-text--critical,
.threshold-days-badge--critical {
  color: var(--danger);
}

.threshold-current-visual--muted,
.threshold-current-text--muted,
.threshold-days-badge--muted {
  color: var(--muted);
}

.threshold-meter {
  display: block;
  width: min(14rem, 100%);
  height: 0.44rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.threshold-meter__fill {
  display: block;
  width: var(--meter-value, 0%);
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.threshold-days-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--surface);
}

.threshold-details {
  max-width: 14rem;
}

.threshold-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.threshold-details summary:hover {
  color: var(--ink);
}

.threshold-details code,
.threshold-details span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.threshold-rule {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.18rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.data-table--thresholds td:nth-child(3),
.threshold-rule--warning {
  color: var(--warn);
}

.data-table--thresholds td:nth-child(4),
.threshold-rule--critical {
  color: var(--danger);
}

.threshold-status-cell .status {
  white-space: nowrap;
}

.auth-shell {
  min-height: calc(100vh - 2rem);
}

.auth-card {
  box-shadow: var(--shadow-md);
}

.auth-brief__stack > div {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}

.auth-brief__stack span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-brief__stack strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.auth-form {
  color: var(--ink);
}

.auth-field {
  display: grid;
  gap: 0.55rem;
}

.auth-field label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
}

.auth-form input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--ink);
  font: inherit;
}

.auth-form input:focus {
  border-color: var(--focus);
}

.auth-form__errors {
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 0.65rem;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 0.85rem;
  font-weight: 650;
}

.auth-form__errors ul {
  margin: 0;
  padding-left: 1rem;
}

.auth-submit {
  min-height: 2.9rem;
  border: 0;
  border-radius: 0.65rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 1024px) {
  .side-dashboard {
    width: 15rem;
  }

  .ops-content {
    grid-column: 2;
  }
}

@media (min-width: 1280px) {
  .side-dashboard {
    width: 16rem;
  }
}

@media (max-width: 1023px) {
  .side-dashboard {
    position: static;
    width: auto;
  }
}

@media (max-width: 640px) {
  .top-navbar {
    padding: 1rem;
  }

  .navbar-checked-at {
    width: 100%;
    min-width: 0;
    padding: 0;
  }

  .theme-toggle,
  .account-control,
  .account-control__action {
    width: 100%;
  }

  .account-control {
    display: grid;
  }

  .account-menu,
  .account-control__summary {
    width: 100%;
  }

  .account-control__summary {
    justify-content: space-between;
  }

  .account-menu__panel {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
  }

  .account-control form {
    width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 0.78rem;
  }
}

/* Reference-style admin dashboard skin */
body {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--muted) 32%, transparent) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(180deg, var(--canvas-start) 0%, var(--canvas) 44%, var(--canvas-end) 100%);
}

.app-shell {
  display: grid;
  align-items: stretch;
  padding: 0 0.75rem 0 var(--workspace-edge);
}

.auth-card {
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #ffffff 4%) 0%, var(--surface) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 30px 90px rgba(0, 0, 0, 0.45);
}

.ops-admin-shell {
  display: grid;
  gap: 1rem;
  width: 100%;
  min-height: calc(100vh - clamp(1rem, 2.8vw, 2.5rem));
  margin: 0;
}

.admin-navbar,
.auth-navbar,
.admin-footer,
.auth-footer {
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 0.45rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 74%, var(--surface)) 0%, var(--surface-muted) 100%);
  box-shadow: var(--shadow-sm);
}

.admin-navbar,
.auth-navbar {
  position: sticky;
  top: var(--admin-sticky-top);
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(12rem, 0.8fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  min-height: 4rem;
  padding: 0.7rem 0.8rem;
}

.admin-navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  object-fit: contain;
}

.admin-navbar__brand span:last-child {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.admin-navbar__brand strong {
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1;
}

.admin-navbar__brand small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.1;
}

.admin-navbar__actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
}

.admin-footer,
.auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.ops-shell {
  min-height: min(48rem, calc(100vh - 4rem));
  gap: 1rem;
  align-items: stretch;
}

.ops-content {
  display: grid;
  align-content: start;
  min-height: inherit;
  padding: clamp(1.2rem, 2.2vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--line) 28%, transparent), transparent 28rem),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, var(--surface-muted) 6%) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-sm);
}

.content-section {
  min-width: 0;
}

.page-header {
  z-index: 20;
  margin-bottom: 1.35rem;
}

.top-navbar {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.top-navbar__brand h1 {
  max-width: 40rem;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: 0;
}

.top-navbar__subtitle {
  max-width: 45rem;
  color: var(--muted);
}

.navbar-checked-at {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  justify-content: center;
  min-width: 0;
  margin-top: 0;
  padding: 0;
  color: var(--muted-soft);
}

.navbar-checked-at span {
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.25;
}

.navbar-checked-at span:last-child {
  color: color-mix(in srgb, var(--muted) 84%, var(--ink));
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.76rem;
}

.side-dashboard {
  position: fixed;
  top: var(--sidebar-sticky-top);
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: start;
  height: 100vh;
  min-height: auto;
  max-height: 100vh;
  overflow-y: auto;
  left: var(--workspace-edge);
  padding: 0.9rem 0.55rem;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 88%, #000 12%) 0%, var(--surface-muted) 100%);
  box-shadow: none;
}

.side-dashboard__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.05rem 0.45rem 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.side-dashboard__brand-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.side-dashboard__brand strong {
  font-size: 1rem;
  font-weight: 850;
  line-height: 1;
}

.side-dashboard__brand small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.1;
}

.sidebar-checked-at {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
  min-width: 0;
  margin: 0;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  color: var(--muted);
}

.sidebar-checked-at__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid var(--line);
  border-radius: 0.36rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}

.sidebar-checked-at__icon svg,
.sidebar-refresh svg,
.side-nav__icon svg,
.account-control__action-icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sidebar-checked-at__copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.sidebar-checked-at__copy span:first-child {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

.sidebar-checked-at__copy span:last-child {
  color: color-mix(in srgb, var(--muted) 84%, var(--ink));
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.68rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.sidebar-refresh-form {
  margin: 0;
}

.sidebar-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--line);
  border-radius: 0.38rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.sidebar-refresh:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink);
}

.sidebar-bottom {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
  padding: 1rem 0.45rem 0;
  border-top: 1px solid var(--line);
}

.sidebar-account {
  position: relative;
  z-index: 70;
  margin: 0;
  padding: 0;
}

.sidebar-account .account-control,
.sidebar-account form,
.sidebar-account .theme-toggle,
.sidebar-account .account-control__action {
  width: 100%;
}

.sidebar-account .account-control {
  display: grid;
  gap: 0.65rem;
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.sidebar-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.sidebar-user__copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  line-height: 1.05;
}

.sidebar-user__copy strong,
.sidebar-user__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__copy strong {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.sidebar-user__copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.sidebar-utility-actions {
  display: grid;
  gap: 0.5rem;
}

.sidebar-utility-actions .theme-toggle,
.sidebar-utility-actions .account-control__action {
  justify-content: flex-start;
  min-height: 2.35rem;
}

.account-control__action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.side-dashboard__screen {
  position: relative;
  width: 1.05rem;
  height: 0.78rem;
  border: 2px solid var(--muted-soft);
  border-radius: 0.18rem;
}

.side-dashboard__screen::after {
  position: absolute;
  left: 50%;
  bottom: -0.38rem;
  width: 0.55rem;
  height: 0.12rem;
  border-radius: 999px;
  content: "";
  background: var(--muted-soft);
  transform: translateX(-50%);
}

.side-dashboard [data-component="sidebar-domains"] {
  padding: 0.35rem 0.45rem 0.75rem;
}

.domain-chip {
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--muted);
}

.visibility-control {
  min-height: 1.95rem;
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.side-nav {
  display: grid;
  gap: 0.25rem;
  padding: 0.4rem 0.35rem 0;
}

.side-nav__row {
  display: block;
}

.side-nav__link {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.85rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.side-nav__link:hover {
  background: color-mix(in srgb, var(--surface-hover) 76%, transparent);
}

.side-nav__link[aria-current="page"] {
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  color: var(--ink);
}

.nav-dot {
  width: 0.42rem;
  height: 0.42rem;
}

.side-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 0.38rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 52%, transparent);
}

.side-nav__link[aria-current="page"] .side-nav__icon,
.side-nav__link:hover .side-nav__icon {
  color: var(--ink);
}

.side-nav__label {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav__meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
  color: var(--muted);
}

.side-nav__meta small {
  max-width: 4.4rem;
  overflow: hidden;
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-toggle__track {
  width: 1.92rem;
  height: 1.05rem;
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.section-toggle__thumb {
  width: 0.62rem;
  height: 0.62rem;
}

.section-toggle__input:checked + .section-toggle__track .section-toggle__thumb {
  transform: translate(0.82rem, -50%);
}

.summary-grid {
  margin-top: 0;
}

.summary-tile,
.data-panel,
.readiness-panel,
.service-lane {
  border-color: var(--line);
  border-radius: 0.45rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 46%, var(--surface)) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-sm);
}

.summary-tile {
  min-height: 5.15rem;
  padding: 1rem 1rem 0.95rem;
  border-left: 3px solid var(--line-strong);
}

.summary-tile::before {
  display: none;
}

.summary-tile strong {
  margin-top: 0.35rem;
  font-size: 1.55rem;
}

.summary-tile small {
  margin-top: 0.28rem;
  color: var(--muted);
}

.summary-tile--ok {
  border-left-color: var(--health);
}

.summary-tile--warning {
  border-left-color: var(--warn);
}

.summary-tile--critical {
  border-left-color: var(--danger);
}

.summary-tile--muted {
  border-left-color: var(--line-strong);
}

.summary-tile--ok strong {
  color: var(--health);
}

.summary-tile--warning strong {
  color: var(--warn);
}

.summary-tile--critical strong {
  color: var(--danger);
}

.summary-tile--muted strong {
  color: var(--muted);
}

.data-panel {
  margin-top: 0;
}

.data-panel > div:first-child,
.service-lane > header {
  background: transparent;
}

.data-table {
  background: transparent;
}

.data-table th,
.data-table td {
  padding: 0.76rem 0.9rem;
  border-bottom-color: var(--line);
}

.data-table thead th,
.threshold-group-row th {
  background: transparent;
  color: var(--muted-soft);
  font-size: 0.7rem;
  font-weight: 850;
}

.data-table tbody th {
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
}

.data-table tbody td {
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
}

.threshold-row--critical th,
.threshold-row--critical td {
  background: transparent;
}

.threshold-row--critical th[scope="row"] {
  box-shadow: inset 3px 0 0 var(--danger);
  color: color-mix(in srgb, var(--ink) 86%, var(--danger));
}

.threshold-meter {
  display: none;
}

.threshold-current-visual {
  gap: 0;
}

.threshold-current-visual strong,
.threshold-current-text,
.threshold-days-badge,
.threshold-rule {
  font-size: 0.84rem;
}

.threshold-policy-note,
.threshold-rule,
.threshold-days-badge {
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--surface-muted) 68%, transparent);
}

.threshold-details summary {
  min-height: 1.85rem;
  padding: 0.32rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--surface-muted) 68%, transparent);
  color: var(--ink);
  font-size: 0.76rem;
}

.status {
  min-height: 1.42rem;
  gap: 0;
  padding: 0.22rem 0.58rem;
  border: 0;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status__icon {
  display: none;
}

.status--ok {
  background: color-mix(in srgb, var(--health) 76%, #ffffff 10%);
  color: #f4fff9;
}

.status--warning {
  background: color-mix(in srgb, var(--warn) 72%, #1b130a 28%);
  color: #fff8ec;
}

.status--critical {
  background: color-mix(in srgb, var(--danger) 78%, #1f090a 22%);
  color: #fff6f6;
}

.status--muted {
  background: color-mix(in srgb, var(--muted-soft) 66%, #151a22 34%);
  color: #f5f7fa;
}

.service-lane {
  border-left: 0;
}

.service-lane header h2 {
  font-size: 1.12rem;
}

.check-row {
  background: transparent;
}

.check-row:hover {
  background: color-mix(in srgb, var(--surface-hover) 58%, transparent);
}

.probe-value,
[data-component="stat-box"] {
  background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
}

.theme-toggle,
.account-control__action,
.auth-back-link {
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}

.account-control__summary {
  min-height: 2.35rem;
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--surface-muted) 42%, transparent);
}

.account-control__summary:hover,
.account-menu[open] .account-control__summary {
  background: color-mix(in srgb, var(--surface-hover) 72%, transparent);
}

.account-control__avatar {
  background: var(--surface-hover);
  color: var(--ink);
}

.account-menu__panel {
  border-radius: 0.45rem;
  background: var(--surface-muted);
}

.auth-admin-shell {
  display: grid;
  gap: 1rem;
  width: min(100%, 78rem);
  min-height: calc(100vh - clamp(1rem, 2.8vw, 2.5rem));
  margin: 0.75rem auto;
}

.auth-layout {
  display: grid;
  place-items: center;
  min-height: min(42rem, calc(100vh - 9rem));
}

.auth-card {
  border-radius: 0.5rem;
}

.auth-brief {
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--danger) 18%, transparent), transparent 12rem),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 86%, #000 14%), var(--surface-muted));
}

.auth-brief__brand {
  padding-inline: 0;
}

.auth-brief__stack > div {
  border-radius: 0.42rem;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.auth-card__main {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, var(--surface-muted) 4%), var(--surface));
}

.auth-form input {
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}

.auth-submit {
  border-radius: 0.45rem;
  background: var(--danger);
  color: white;
}

.auth-submit:hover {
  background: color-mix(in srgb, var(--danger) 88%, var(--ink));
}

html[data-theme="light"] .admin-navbar,
html[data-theme="light"] .auth-navbar,
html[data-theme="light"] .ops-content,
html[data-theme="light"] .admin-footer,
html[data-theme="light"] .auth-footer,
html[data-theme="light"] .auth-card {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72) inset,
    0 30px 80px rgba(42, 54, 72, 0.22);
}

@media (max-width: 1023px) {
  .ops-admin-shell {
    overflow: visible;
  }

  .side-dashboard {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .ops-content {
    min-height: auto;
  }

  .admin-navbar,
  .auth-navbar {
    position: static;
    grid-template-columns: minmax(0, 1fr);
  }

  .navbar-checked-at {
    justify-content: flex-start;
  }

  .admin-navbar__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0;
  }

  .auth-card {
    border-radius: 0;
  }

  .ops-admin-shell,
  .auth-admin-shell {
    gap: 0;
  }

  .admin-navbar,
  .auth-navbar,
  .side-dashboard,
  .ops-content,
  .admin-footer,
  .auth-footer {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .ops-content {
    padding: 1rem;
  }

  .top-navbar {
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
  }

  .admin-navbar__actions {
    justify-content: stretch;
  }

  .summary-tile {
    min-height: 4.7rem;
  }
}
