:root {
  --bg: #050914;
  --bg-soft: #08111f;
  --panel: rgba(15, 23, 42, 0.88);
  --panel-2: rgba(17, 24, 39, 0.82);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --blue: #38bdf8;
  --blue-2: #2563eb;
  --purple: #a855f7;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.28), transparent 34%),
    radial-gradient(circle at bottom right, rgba(88, 28, 135, 0.42), transparent 36%),
    linear-gradient(135deg, #020617 0%, #07111f 46%, #0b0718 100%);
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: rgba(2, 6, 23, 0.76);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.38));
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.menu {
  display: grid;
  gap: 7px;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 650;
  border: 1px solid transparent;
  transition: 0.18s ease;
}

.menu-item:hover {
  background: rgba(30, 41, 59, 0.72);
  border-color: var(--border);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 165, 233, 0.12));
  border-color: rgba(56, 189, 248, 0.24);
  color: #eff6ff;
}

.dot {
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.9);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
}

.mini-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-status {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12), 0 0 18px rgba(34, 197, 94, 0.8);
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  min-height: 82px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.44);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  border: 0;
  font: inherit;
  cursor: default;
}

.range,
.refresh {
  height: 36px;
  padding: 0 13px;
  border-radius: 11px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 750;
}

.range.active {
  color: #eff6ff;
  background: rgba(37, 99, 235, 0.4);
  border-color: rgba(59, 130, 246, 0.45);
}

.refresh {
  color: #bae6fd;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.stat-card {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.stat-value {
  margin-top: 12px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.stat-value.blue {
  color: var(--blue);
  text-shadow: 0 0 28px rgba(56, 189, 248, 0.2);
}

.stat-value.purple {
  color: #c084fc;
  text-shadow: 0 0 28px rgba(168, 85, 247, 0.22);
}

.stat-note {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.stat-note.positive {
  color: #86efac;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.panel-large {
  min-height: 438px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.panel-badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 12px;
  font-weight: 850;
}

.graph-wrap {
  position: relative;
  min-height: 330px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(2, 6, 23, 0.35)),
    rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.traffic-svg {
  width: 100%;
  height: 310px;
  display: block;
}

.grid-lines line {
  stroke: rgba(148, 163, 184, 0.13);
  stroke-width: 1;
}

.area-in {
  fill: url(#inGradient);
}

.area-out {
  fill: url(#outGradient);
}

.line-in,
.line-out {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-in {
  stroke: var(--blue);
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.44));
}

.line-out {
  stroke: var(--purple);
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.42));
}

.legend {
  position: absolute;
  left: 18px;
  bottom: 16px;
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-in {
  background: var(--blue);
}

.legend-out {
  background: var(--purple);
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.46);
  border: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 13px;
  font-weight: 700;
}

.status-row strong {
  color: #e5e7eb;
}

.status-row strong.ok {
  color: #86efac;
}

.status-row strong.warn {
  color: #fbbf24;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 15px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 13px;
}

th {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.72);
  font-weight: 850;
}

td {
  color: #cbd5e1;
  font-weight: 650;
}

tr:last-child td {
  border-bottom: 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.timeline-item {
  position: relative;
  padding: 16px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.46);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.timeline-item > span {
  width: 11px;
  height: 11px;
  display: block;
  border-radius: 999px;
  margin-bottom: 12px;
  background: var(--muted-2);
}

.timeline-item.done > span {
  background: var(--green);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.65);
}

.timeline-item.current > span {
  background: var(--blue);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.65);
}

.timeline-item strong {
  display: block;
  font-size: 14px;
}

.timeline-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-footer {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .sidebar {
    padding: 16px;
  }

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

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

  .panel {
    padding: 15px;
    border-radius: 18px;
  }

  .graph-wrap {
    min-height: 260px;
  }

  .traffic-svg {
    height: 250px;
  }

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