:root {
  --bg: #070b12;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --panel-soft: rgba(30, 41, 59, 0.62);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.32);
  --text: #e5edf8;
  --muted: #91a1b8;
  --faint: #64748b;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 30rem),
    linear-gradient(135deg, #05070d 0%, #0b1120 45%, #111827 100%);
}

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

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

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #020617;
  font-weight: 900;
  letter-spacing: -0.05em;
  box-shadow: 0 16px 40px rgba(56, 189, 248, 0.25);
}

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

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

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  padding: 13px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 650;
  transition: 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
}

.sidebar-footer {
  margin-top: auto;
}

.logout-button {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  margin-bottom: 8px;
}

h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

h2,
h3 {
  margin: 0;
  letter-spacing: -0.035em;
}

.topbar-status,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.9);
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(22px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
}

.card-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.metric {
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -0.055em;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.positive {
  color: var(--accent-2);
}

.negative {
  color: var(--danger);
}

.warning {
  color: var(--warning);
}

.button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  color: #020617;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(56, 189, 248, 0.22);
}

.button-secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.form-panel {
  max-width: 440px;
  margin: 10vh auto;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.62);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td {
  color: var(--text);
  font-size: 14px;
}

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

.chart-box {
  height: 360px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-weight: 700;
}

.log-box {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.78);
  padding: 18px;
  color: #b7c4d6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow: auto;
  max-height: 420px;
}

.flash {
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.flash-alert {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.flash-notice {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: 100%;
  max-width: 430px;
}

.inline-button-form {
  display: inline-block;
  margin-left: 8px;
}

.hero-card {
  padding: 38px;
}

.hero-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 24px;
}

.icon-tile {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.10);
  color: #60a5fa;
  font-size: 34px;
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.10);
}

.icon-tile.warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.10);
  color: #fbbf24;
}

.warning-panel {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 18px;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.75);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.11), rgba(15, 23, 42, 0.72));
  box-shadow: 0 0 38px rgba(245, 158, 11, 0.08);
}

.warning-title {
  color: #fbbf24;
  font-size: 20px;
  font-weight: 850;
  margin-bottom: 8px;
}

.warning-text {
  color: var(--text);
  font-size: 16px;
}

.warning-text strong {
  color: #fbbf24;
}

.section-heading {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
}

.icon-bolt::before {
  content: "";
  width: 18px;
  height: 34px;
  background: currentColor;
  clip-path: polygon(55% 0, 10% 55%, 46% 55%, 33% 100%, 90% 40%, 55% 40%);
}

.icon-alert::before {
  content: "!";
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 4px solid currentColor;
  border-radius: 14px;
  font-weight: 900;
  font-size: 28px;
}

.icon-stack::before {
  content: "";
  width: 34px;
  height: 24px;
  border: 3px solid currentColor;
  border-radius: 8px;
  box-shadow:
    0 -9px 0 -4px currentColor,
    0 9px 0 -4px currentColor;
}

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

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}