:root {
  color-scheme: dark;
  --bg: #001e42;
  --bg-deep: #031127;
  --panel: rgba(31, 55, 140, 0.92);
  --panel-strong: rgba(18, 34, 93, 0.96);
  --panel-soft: rgba(6, 20, 52, 0.82);
  --text: #ffffff;
  --muted: #d6dee2;
  --accent: #0018ff;
  --accent-strong: #2d44ac;
  --neon: #00ffe8;
  --border: rgba(146, 195, 254, 0.32);
  --shadow: 0 18px 40px rgba(0, 16, 44, 0.42);
  --glow: 0 0 0 1px rgba(0, 24, 255, 0.24), 0 0 26px rgba(0, 255, 232, 0.1);
  --danger: #ff8ca0;
  --danger-bg: rgba(255, 92, 120, 0.16);
  --success: #8ff3c6;
  --success-bg: rgba(0, 211, 141, 0.18);
  --warning: #ffd166;
  --warning-bg: rgba(255, 209, 102, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 2%, rgba(0, 255, 232, 0.08), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(0, 24, 255, 0.2), transparent 28%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg) 46%, #0a1a4f 100%);
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

code,
.code {
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.screen-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(84px);
  pointer-events: none;
  z-index: 0;
}

.screen-glow-a {
  top: -120px;
  left: -80px;
  background: rgba(45, 68, 172, 0.4);
}

.screen-glow-b {
  bottom: -140px;
  right: -70px;
  background: rgba(0, 255, 232, 0.12);
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(circle at center, black 50%, transparent 95%);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, 94vw);
  margin: 0 auto;
  padding: 26px 0 42px;
  display: grid;
  gap: 20px;
}

.dashboard-page .page-shell {
  width: min(1440px, 96vw);
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
}

.flash.error {
  color: #ffd7dd;
  border-color: rgba(255, 92, 120, 0.3);
  background: rgba(255, 92, 120, 0.14);
}

.flash.warning {
  color: #ffe8aa;
  border-color: rgba(255, 209, 102, 0.26);
  background: rgba(255, 209, 102, 0.12);
}

.flash.success {
  color: #ccffeb;
  border-color: rgba(0, 211, 141, 0.26);
  background: rgba(0, 211, 141, 0.12);
}

.card,
.topbar,
.user-card,
.service-status-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--panel), var(--panel-strong));
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 22px;
  align-items: center;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-mark {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(0, 255, 232, 0.18), rgba(0, 24, 255, 0.24)),
    rgba(0, 16, 44, 0.35);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  box-shadow: var(--glow);
}

.eyebrow,
.section-kicker,
.status-kicker,
.user-label,
.metric-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--neon);
}

h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.02;
}

h2 {
  font-size: 24px;
  line-height: 1.15;
}

.lede {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 820px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-card {
  min-width: 240px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: rgba(0, 16, 44, 0.34);
}

.user-card p {
  color: var(--muted);
  font-size: 14px;
}

.service-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  padding: 12px 14px;
  background: rgba(0, 16, 44, 0.28);
}

.service-status-title {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-status-text {
  font-weight: 700;
  font-size: 14px;
}

.service-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9aa7b4;
  box-shadow: 0 0 0 3px rgba(154, 167, 180, 0.16);
}

.service-status-card.online .service-status-dot {
  background: #00d38d;
  box-shadow: 0 0 0 3px rgba(0, 211, 141, 0.2);
}

.service-status-card.offline .service-status-dot {
  background: #ff5c78;
  box-shadow: 0 0 0 3px rgba(255, 92, 120, 0.2);
}

.service-status-card.checking .service-status-dot {
  background: #ffd166;
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.18);
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--accent);
  color: #ffffff;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-strong);
  box-shadow: 0 12px 22px rgba(0, 16, 44, 0.36);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button.secondary {
  background: transparent;
  border-color: rgba(146, 195, 254, 0.36);
  color: var(--muted);
}

.button.secondary:hover:not(:disabled),
.button.ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--neon);
  background: rgba(146, 195, 254, 0.12);
}

.button.ghost {
  background: transparent;
  border-color: rgba(146, 195, 254, 0.26);
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 22px;
}

.hero-card,
.checklist-card,
.status-card,
.metric-card,
.control-card,
.table-card {
  padding: 24px;
}

.feature-list {
  margin: 18px 0 0;
  padding-left: 18px;
  line-height: 1.7;
  color: var(--muted);
}

.feature-list li + li {
  margin-top: 8px;
}

.status-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(0, 16, 44, 0.26);
  border: 1px solid rgba(146, 195, 254, 0.18);
}

.status-card {
  display: grid;
  gap: 14px;
}

.status-card code {
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #dff8ff;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.dashboard-layout-full {
  grid-template-columns: minmax(0, 1fr);
}

.main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  min-height: 162px;
  display: grid;
  align-content: start;
  gap: 10px;
  box-shadow: var(--shadow), var(--glow);
}

.metric-number {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
}

.metric-note {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
  min-height: 162px;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: skeleton-scan 1.4s linear infinite;
}

@keyframes skeleton-scan {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(320px, 2fr) minmax(210px, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  margin-top: 16px;
}

.input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(146, 195, 254, 0.22);
  background: rgba(0, 16, 44, 0.34);
  color: var(--text);
  padding: 0 14px;
}

.input::placeholder {
  color: rgba(214, 222, 226, 0.7);
}

.multi-select {
  position: relative;
  min-width: 0;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 0 14px;
}

.multi-select-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select-badge {
  flex: none;
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 255, 232, 0.14);
  border: 1px solid rgba(0, 255, 232, 0.24);
  color: var(--neon);
  font-size: 12px;
  font-weight: 800;
}

.multi-select-arrow {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  transition: transform 160ms ease;
}

.multi-select.is-open .multi-select-arrow {
  transform: rotate(180deg);
}

.multi-select-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(146, 195, 254, 0.3);
  background: linear-gradient(145deg, rgba(9, 25, 66, 0.98), rgba(18, 34, 93, 0.98));
  box-shadow: var(--shadow), var(--glow);
}

.multi-select-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.multi-select-search {
  padding: 0 14px;
}

.multi-select-options {
  max-height: 320px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.multi-select-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(146, 195, 254, 0.18);
  background: rgba(0, 16, 44, 0.28);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.multi-select-option:hover {
  border-color: rgba(0, 255, 232, 0.28);
  background: rgba(146, 195, 254, 0.1);
  transform: translateY(-1px);
}

.multi-select-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.multi-select-option-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.multi-select-option-copy strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.multi-select-empty {
  padding: 16px;
  border-radius: 14px;
  background: rgba(0, 16, 44, 0.28);
  border: 1px dashed rgba(146, 195, 254, 0.18);
  color: var(--muted);
  line-height: 1.55;
}

.selected-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.selected-pill {
  appearance: none;
  border: 1px solid rgba(146, 195, 254, 0.28);
  border-radius: 999px;
  background: rgba(146, 195, 254, 0.1);
  color: var(--text);
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.selected-pill:hover {
  border-color: rgba(0, 255, 232, 0.28);
  background: rgba(0, 255, 232, 0.12);
}

.selected-pill-label {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-pill-close {
  color: var(--neon);
  font-size: 16px;
  line-height: 1;
}

.inline-banner {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.24);
  color: #ffe9b0;
  line-height: 1.55;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: min(72vh, 780px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-top: 16px;
}

.table-card {
  min-width: 0;
}

.table-scroll-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1280px;
}

.dashboard-table thead th {
  text-align: left;
  background: rgba(45, 68, 172, 0.96);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 13px 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.dashboard-table tbody tr {
  background: rgba(0, 30, 66, 0.55);
}

.dashboard-table tbody tr:nth-child(even) {
  background: rgba(45, 68, 172, 0.38);
}

.dashboard-table td {
  padding: 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  line-height: 1.55;
}

.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(0, 16, 44, 0.4);
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(146, 195, 254, 0.4);
  border-radius: 999px;
  border: 2px solid rgba(0, 16, 44, 0.32);
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 232, 0.42);
}

.small {
  color: var(--muted);
  font-size: 12px;
}

.report-stack {
  display: grid;
  gap: 6px;
}

.report-line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.report-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.report-value {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(146, 195, 254, 0.28);
  background: rgba(146, 195, 254, 0.08);
  color: #eef7ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill.success {
  background: var(--success-bg);
  border-color: rgba(0, 211, 141, 0.26);
  color: var(--success);
}

.pill.error {
  background: var(--danger-bg);
  border-color: rgba(255, 92, 120, 0.26);
  color: #ffd7dd;
}

.pill.info {
  background: rgba(0, 255, 232, 0.12);
  border-color: rgba(0, 255, 232, 0.2);
  color: #e8fffc;
}

.meta-cell {
  display: grid;
  gap: 10px;
}

.empty-state-cell {
  text-align: center;
  color: var(--muted);
  padding: 26px 18px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 15, 36, 0.62);
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
}

.loader-card {
  min-width: 280px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(145deg, rgba(31, 55, 140, 0.97), rgba(18, 34, 93, 0.97));
  box-shadow: var(--shadow), var(--glow);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.loader-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(214, 222, 226, 0.35);
  border-top-color: var(--neon);
  animation: loader-spin 0.9s linear infinite;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.hide {
  display: none !important;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(214, 222, 226, 0.76);
  font-size: 12px;
  padding: 0 4px;
}

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

@media (max-width: 980px) {
  .topbar,
  .dashboard-layout,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .topbar-right {
    justify-content: stretch;
  }

  .user-card,
  .service-status-card {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell,
  .dashboard-page .page-shell {
    width: min(96vw, 96vw);
    padding-top: 18px;
  }

  .topbar,
  .hero-card,
  .checklist-card,
  .status-card,
  .metric-card,
  .control-card,
  .table-card {
    padding: 18px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 22px;
  }

  .metrics-grid,
  .dashboard-filters {
    grid-template-columns: 1fr;
  }

  .multi-select-toolbar {
    grid-template-columns: 1fr;
  }

  .selected-pill-label {
    max-width: 100%;
  }

  .table-wrap {
    max-height: min(64vh, 680px);
  }

  .footer {
    flex-direction: column;
  }
}
