:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #06080c;
  color: #eef2f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(58, 96, 255, 0.13), transparent 36%),
    radial-gradient(circle at 100% 20%, rgba(0, 210, 170, 0.08), transparent 30%),
    #06080c;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1b2230;
  background: rgba(8, 11, 17, 0.88);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-wrap,
.topbar-actions,
.dashboard-header,
.header-metrics,
.side-card-header {
  display: flex;
  align-items: center;
}

.brand-wrap {
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, #5d78ff, #25d7bd);
  color: #05070b;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-subtitle,
.muted-text,
.user-label {
  color: #8e9aac;
  font-size: 12px;
}

.topbar-actions {
  gap: 12px;
}

.status-badge,
.count-pill {
  border: 1px solid #263044;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.status-badge.online {
  color: #5df0c8;
  border-color: rgba(93, 240, 200, 0.35);
  background: rgba(93, 240, 200, 0.08);
}

.status-badge.muted {
  color: #9aa5b5;
}

.login-view {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid #20293a;
  border-radius: 18px;
  background: rgba(12, 16, 24, 0.95);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.login-card h1,
.dashboard-header h1 {
  margin: 8px 0;
}

.eyebrow {
  color: #6f88ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: #c9d2df;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid #283247;
  border-radius: 10px;
  padding: 12px 14px;
  background: #0a0e15;
  color: #eef2f7;
  outline: none;
}

input:focus {
  border-color: #6980ff;
  box-shadow: 0 0 0 3px rgba(105, 128, 255, 0.14);
}

.button {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  background: linear-gradient(135deg, #6079ff, #4d66ea);
  color: white;
}

.button.secondary {
  background: #141a25;
  color: #dce3ed;
  border: 1px solid #283247;
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.error-message {
  color: #ff7d8e;
  min-height: 18px;
  font-size: 13px;
}

.dashboard {
  padding: 24px 28px 40px;
}

.dashboard-header {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.header-metrics {
  gap: 10px;
}

.metric-card {
  min-width: 108px;
  padding: 11px 14px;
  border: 1px solid #20293a;
  border-radius: 12px;
  background: rgba(12, 16, 24, 0.86);
}

.metric-card span {
  display: block;
  color: #7f8b9d;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 180px;
  gap: 10px;
}

.panel {
  min-width: 0;
  border: 1px solid #1f2939;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 20, 29, 0.97), rgba(9, 13, 20, 0.97));
  overflow: hidden;
  position: relative;
}

.panel.protected {
  border-color: rgba(96, 121, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(96, 121, 255, 0.08);
}

.panel-header {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #1b2433;
  font-size: 12px;
}

.panel-title {
  font-weight: 700;
}

.panel-meta {
  color: #758197;
}

.panel-body {
  height: calc(100% - 38px);
  display: grid;
  place-items: center;
  color: #667287;
  font-size: 12px;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 24px 24px;
}

.top-impact-bars {
  width: 82%;
  display: grid;
  gap: 8px;
}

.impact-row {
  display: grid;
  grid-template-columns: 36px 1fr 42px;
  align-items: center;
  gap: 8px;
  color: #aab5c5;
}

.impact-track {
  height: 7px;
  background: #1a2230;
  border-radius: 999px;
  overflow: hidden;
}

.impact-fill {
  height: 100%;
  background: linear-gradient(90deg, #5d78ff, #27d8bd);
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.side-card {
  border: 1px solid #20293a;
  border-radius: 14px;
  padding: 16px;
  background: rgba(12, 16, 24, 0.9);
}

.side-card-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.side-card h2 {
  margin: 0;
  font-size: 14px;
}

.watchlist-list {
  display: grid;
  gap: 8px;
}

.watchlist-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #1d2635;
  background: #0a0e15;
}

.watchlist-item strong,
.watchlist-item span {
  display: block;
}

.watchlist-item span {
  margin-top: 3px;
  color: #7d899b;
  font-size: 11px;
}

.event-log {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  color: #9fb0c5;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 780px) {
  .topbar,
  .dashboard {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-metrics {
    width: 100%;
    overflow-x: auto;
  }

  .panel-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 210px;
  }

  .panel {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

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

  .user-label {
    display: none;
  }
}
