:root,
[data-theme="light"] {
  color-scheme: light;

  --background: #f5f7fa;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f8fafc;
  --border: #e6eaf0;

  --accent: #269b62;
  --accent-soft: #e9f7ef;

  --text: #17211b;
  --muted: #748176;

  --success: #239b61;
  --warning: #c58a27;
  --danger: #dc5555;
  --info: #4386c7;

  --shadow: 0 4px 20px rgba(20, 35, 25, .035);
}

[data-theme="dark"] {
  color-scheme: dark;

  --background: #101216;
  --sidebar: #15181e;
  --surface: #1a1e25;
  --surface-raised: #222731;
  --border: #2d333e;

  --accent: #72d99a;
  --accent-soft: rgba(114, 217, 154, .12);

  --text: #f1f5f2;
  --muted: #9aa4a0;

  --success: #72d99a;
  --warning: #e9b86c;
  --danger: #f07878;
  --info: #82b9e8;

  --shadow: 0 4px 20px rgba(0, 0, 0, .12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  transition: background .25s ease, color .25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: background .25s, border-color .25s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 30px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
}

.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 750;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

#navigation {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  color: var(--muted);
  border-radius: 9px;
  font-weight: 600;
  transition: .2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 17px;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.theme-toggle {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 11px;
  cursor: pointer;
  text-align: left;
  transition: background .25s, color .25s, border-color .25s;
}

.theme-toggle:hover {
  background: var(--surface-raised);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.version {
  color: var(--muted);
  font-size: 11px;
  padding-left: 4px;
}

.main {
  margin-left: 250px;
  padding: 40px 48px;
  max-width: 1700px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -1.2px;
}

.topbar p {
  margin: 9px 0 0;
  color: var(--muted);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
}

.live-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.notice {
  padding: 17px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 25px;
  color: var(--muted);
}

.notice.success {
  border-left: 4px solid var(--success);
}

.notice.warning {
  border-left: 4px solid var(--warning);
}

.notice.danger {
  border-left: 4px solid var(--danger);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 21px;
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-value {
  margin-top: 13px;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -1px;
}

.stat-description {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.section {
  margin-bottom: 38px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.3px;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.monitor-card,
.content-card,
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.monitor-name {
  font-size: 15px;
  font-weight: 750;
}

.monitor-id {
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.operational {
  color: var(--success);
  background: var(--accent-soft);
}

.status.degraded {
  color: var(--warning);
  background: rgba(197, 138, 39, .12);
}

.status.outage {
  color: var(--danger);
  background: rgba(220, 85, 85, .12);
}

.status.maintenance {
  color: var(--info);
  background: rgba(67, 134, 199, .12);
}

.status.unknown {
  color: var(--muted);
  background: var(--surface-raised);
}

.monitor-uptime {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.monitor-uptime span {
  color: var(--muted);
  font-size: 11px;
}

.monitor-uptime strong {
  font-size: 14px;
}

.monitor-details {
  margin-top: 16px;
}

.monitor-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.monitor-details-content {
  margin-top: 17px;
}

.content-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.content-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.content-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.content-card h3 {
  font-size: 14px;
  margin: 0;
}

.content-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 12px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.impact {
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.impact.major,
.impact.critical {
  color: var(--danger);
}

.impact.minor {
  color: var(--warning);
}

.impact.none {
  color: var(--success);
}

.history-period {
  margin-top: 19px;
}

.history-period-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.history-period-header span {
  color: var(--muted);
  font-size: 11px;
}

.history-period-header strong {
  font-size: 12px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(var(--count), minmax(0, 1fr));
  gap: 3px;
  height: 27px;
}

.timeline-bar {
  border-radius: 3px;
  background: var(--surface-raised);
  min-width: 0;
}

.timeline-bar.operational {
  background: var(--success);
}

.timeline-bar.degraded {
  background: var(--warning);
}

.timeline-bar.outage {
  background: var(--danger);
}

.timeline-bar.maintenance {
  background: var(--info);
}

.timeline-bar.unknown {
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.empty-state {
  padding: 30px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 50px;
  color: var(--muted);
  font-size: 10px;
}

/* Transitions */
.sidebar,
.stat-card,
.monitor-card,
.content-card,
.history-card,
.notice,
.live-indicator,
.empty-state {
  transition:
    background-color .25s ease,
    color .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}

@media (max-width: 1100px) {
  .main {
    padding: 32px 28px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    padding: 0 5px 15px;
  }

  #navigation {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .nav-link {
    flex: 0 0 auto;
    padding: 10px;
    font-size: 11px;
  }

  .nav-icon {
    width: auto;
  }

  .sidebar-bottom {
    margin-top: 12px;
  }

  .version {
    display: none;
  }

  .theme-toggle {
    text-align: center;
  }

  .main {
    margin-left: 0;
    padding: 25px 16px;
  }

  .topbar {
    flex-direction: column;
  }

  .monitor-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 23px;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}