:root {
  color-scheme: dark;
  --bg: #0f141b;
  --panel: #151b23;
  --panel-soft: #171e27;
  --panel-muted: #111720;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e7edf5;
  --muted: #99a5b5;
  --muted-strong: #c5ced9;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --maintenance: #60a5fa;
  --shadow-soft: 0 10px 30px rgba(3, 7, 18, 0.16);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 27, 0.96);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: #1b2330;
  border: 1px solid var(--border);
  color: var(--muted-strong);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-tab {
  border-radius: 0.65rem;
  padding: 0.55rem 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.nav-tab.active {
  background: #202734;
  color: var(--text);
}

.mobile-tabs {
  display: none;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.9rem;
}

.status-summary {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel-muted);
  padding: 1.25rem 1.25rem 1.1rem;
}

.hero-stack {
  padding: 2rem 0 1.8rem;
  text-align: center;
}

.hero-stack-icon {
  width: 2.9rem;
  height: 2.9rem;
  margin: 0 auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1d232d;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.hero-stack-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #94a3b8;
}

.hero-stack-title {
  margin: 1rem 0 0;
  font-size: 2.05rem;
  line-height: 1.15;
  font-weight: 700;
  color: #f5f7fa;
}

.hero-stack-meta {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

.hero-stack-operational .hero-stack-icon {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.18);
}

.hero-stack-operational .hero-stack-dot {
  background: var(--success);
}

.hero-stack-degraded .hero-stack-icon,
.hero-stack-maintenance .hero-stack-icon {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.18);
}

.hero-stack-degraded .hero-stack-dot,
.hero-stack-maintenance .hero-stack-dot {
  background: var(--warning);
}

.hero-stack-down .hero-stack-icon,
.hero-stack-downtime .hero-stack-icon {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.18);
}

.hero-stack-down .hero-stack-dot,
.hero-stack-downtime .hero-stack-dot {
  background: var(--danger);
}

.section-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.section-heading {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-title {
  margin-top: 0.85rem;
  font-size: 1.85rem;
  line-height: 1.2;
  font-weight: 650;
  color: #f4f7fb;
}

.status-meta {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  border-radius: 999px;
  padding: 0.38rem 0.78rem;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
}

.status-operational {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
  color: #bde8c9;
}

.status-operational .status-dot {
  background: var(--success);
}

.status-degraded,
.status-major {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.16);
  color: #f3d39b;
}

.status-degraded .status-dot,
.status-major .status-dot {
  background: var(--warning);
}

.status-down,
.status-downtime,
.status-critical {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.16);
  color: #f1b0b0;
}

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

.status-maintenance,
.status-scheduled,
.status-in_progress {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.16);
  color: #bdd4f6;
}

.status-maintenance .status-dot,
.status-scheduled .status-dot,
.status-in_progress .status-dot {
  background: var(--maintenance);
}

.status-monitoring,
.status-identified,
.status-investigating,
.status-minor,
.status-completed,
.status-cancelled {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.16);
  color: #d2dae3;
}

.status-monitoring .status-dot,
.status-identified .status-dot,
.status-investigating .status-dot,
.status-minor .status-dot,
.status-completed .status-dot,
.status-cancelled .status-dot {
  background: #94a3b8;
}

.service-board {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #1a202a;
  padding: 0.75rem;
}

.category-dropdown + .category-dropdown {
  margin-top: 0.85rem;
}

.category-dropdown {
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 0.95rem;
  background: #202631;
  overflow: hidden;
}

.category-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
}

.category-summary::-webkit-details-marker {
  display: none;
}

.category-summary-left,
.category-summary-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.category-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #f4f7fb;
}

.category-count {
  font-size: 0.82rem;
  color: var(--muted);
}

.category-chevron {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 1.5px solid #7f8ba0;
  border-bottom: 1.5px solid #7f8ba0;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.category-dropdown[open] .category-chevron {
  transform: rotate(225deg);
}

.category-services {
  padding: 0 0.75rem 0.75rem;
}

.service-panel + .service-panel {
  margin-top: 0.7rem;
}

.service-panel {
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 0.9rem;
  background: #212631;
  padding: 0.8rem 0.9rem 0.8rem;
}

.service-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.service-panel-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #f4f7fb;
}

.service-panel-subtitle {
  margin-top: 0.12rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.service-panel-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.service-panel-meta {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.uptime-strip {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 2px;
  margin-top: 0.7rem;
}

.uptime-segment {
  height: 1.45rem;
  border-radius: 2px;
  background: #2c3240;
}

.uptime-segment.is-up,
.uptime-segment.is-operational {
  background: #19d27c;
}

.uptime-segment.is-degraded {
  background: #f59e0b;
}

.uptime-segment.is-down,
.uptime-segment.is-downtime {
  background: #f87171;
}

.uptime-segment.is-maintenance {
  background: #60a5fa;
}

.uptime-segment.is-empty {
  background: #2c3240;
}

.uptime-strip-legend {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.service-panel-foot {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.stack-section {
  margin-top: 1.4rem;
}

.stack-section + .stack-section {
  margin-top: 1rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.section-head h2 {
  font-size: 1.02rem;
  font-weight: 600;
  color: #f2f5f9;
}

.section-link {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-link:hover {
  color: var(--text);
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notice-item {
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  background: var(--panel);
  padding: 1rem 1.05rem;
}

.notice-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #eff3f8;
}

.notice-copy {
  margin-top: 0.45rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted-strong);
}

.notice-meta {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.notice-updates {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.timeline-item {
  position: relative;
  padding-left: 1rem;
}

.timeline-item + .timeline-item {
  margin-top: 0.9rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 0;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #7f8ba0;
}

.timeline-copy {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted-strong);
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: 1rem;
  background: var(--panel);
  padding: 1rem 1.05rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.simple-page-header {
  margin-top: 2rem;
  margin-bottom: 1.2rem;
}

.simple-page-title {
  font-size: 1.55rem;
  font-weight: 650;
  color: #f4f7fb;
}

.simple-page-copy {
  margin-top: 0.5rem;
  max-width: 46rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
}

.footer-bar {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding: 1rem 0 2rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.footer-link:hover {
  color: var(--text);
}

.error-shell {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.error-card {
  max-width: 42rem;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel);
  padding: 2rem;
}

.login-shell {
  max-width: 420px;
  margin: 4rem auto 0;
}

.login-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel);
  padding: 1.5rem;
}

.admin-grid {
  display: grid;
  gap: 1rem;
}

.admin-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel);
  padding: 1.2rem;
}

.admin-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.admin-muted {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-stack {
  margin-top: 1rem;
  display: grid;
  gap: 0.9rem;
}

.admin-service-form {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--panel-soft);
  padding: 1rem;
}

.admin-inline-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-inline-grid-3 {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-checklist {
  display: grid;
  gap: 0.55rem;
}

.admin-check-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--panel-soft);
  padding: 0.7rem 0.8rem;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.admin-check-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
  font-size: 0.88rem;
}

.admin-check-table th,
.admin-check-table td {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.admin-check-table th {
  color: var(--muted);
  font-weight: 600;
}

.error-banner {
  margin-top: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 0.85rem;
  background: rgba(239, 68, 68, 0.08);
  color: #f1b0b0;
  padding: 0.8rem 0.9rem;
  font-size: 0.9rem;
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0.8rem 0.9rem;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.08);
}

.admin-textarea {
  min-height: 7rem;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  border-radius: 0.75rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-primary {
  background: #e7edf5;
  color: #10161f;
}

.btn-secondary {
  background: var(--panel-soft);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #f1b0b0;
  border-color: rgba(239, 68, 68, 0.18);
}

@media (max-width: 767px) {
  .nav-tabs {
    display: none;
  }

  .mobile-tabs {
    display: flex;
  }

  .topbar-row {
    min-height: 62px;
  }

  .status-summary {
    margin-top: 1.35rem;
    padding: 1rem;
  }

  .status-title {
    font-size: 1.45rem;
  }

  .hero-stack {
    padding-top: 1.35rem;
    padding-bottom: 1.2rem;
  }

  .hero-stack-title {
    font-size: 1.6rem;
  }

  .hero-stack-meta {
    font-size: 0.84rem;
  }

  .service-panel-head,
  .service-panel-foot,
  .category-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .uptime-strip {
    grid-template-columns: repeat(45, minmax(0, 1fr));
  }

  .admin-inline-grid,
  .admin-inline-grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
