/* Horizon Admin — tokens & components from design-system_v2.html */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --paper: #ffffff;
  --ink: #003366;
  --ink-2: #001e3d;
  --ink-soft: #4a5e7a;
  --muted: #7b8aa0;
  --line: #e3e8f0;
  --line-2: #c9d2e0;
  --sun: #ffd100;
  --sun-2: #f0be00;
  --sun-soft: #fff4bf;
  --sun-wash: #fffbe6;
  --blue: #004fff;
  --blue-2: #003bcc;
  --blue-soft: #e6edff;
  --shadow: 0 1px 0 rgba(0, 51, 102, 0.04), 0 8px 24px -12px rgba(0, 51, 102, 0.18);
  --shadow-lg: 0 1px 0 rgba(0, 51, 102, 0.04), 0 30px 60px -30px rgba(0, 51, 102, 0.35);
  --ds-sidebar: 260px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button,
input,
select {
  font-family: inherit;
}

.ds-shell {
  display: grid;
  grid-template-columns: var(--ds-sidebar) 1fr;
  min-height: 100vh;
}

.ds-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border-right: 1.5px solid var(--line);
  padding: 24px 0 48px;
  display: flex;
  flex-direction: column;
}
.ds-nav-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.ds-nav-logo img {
  height: 36px;
  width: auto;
  margin-bottom: 10px;
}
.ds-nav-logo .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.ds-nav-group {
  padding: 6px 16px 4px;
}
.ds-nav-group-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 8px;
  margin-bottom: 4px;
}
.ds-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.12s, color 0.12s;
}
.ds-nav-link:hover {
  background: var(--line);
  color: var(--ink);
}
.ds-nav-link.active {
  background: var(--blue);
  color: #fff;
}

.ds-main {
  min-width: 0;
}
.ds-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--line);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ds-topbar-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ds-content {
  padding: 32px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}
.section-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--blue);
}
.page-title {
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 8px;
}
.page-lede {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 72ch;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.badge-sun {
  background: var(--sun-soft);
  color: var(--ink);
}
.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
}
.badge-ink {
  background: var(--ink);
  color: #fff;
}
.badge-ok {
  background: #e8f8ef;
  color: #0d6b3a;
}
.badge-warn {
  background: var(--sun-wash);
  color: var(--ink);
}
.badge-err {
  background: #fde8e8;
  color: #9b1c1c;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .ds-shell {
    grid-template-columns: 1fr;
  }
  .ds-nav {
    position: relative;
    height: auto;
  }
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.stat {
  text-align: left;
  padding: 24px 22px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
  transition: border-color 0.15s, transform 0.15s;
}
.stat:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.stat::before {
  content: "";
  width: 28px;
  height: 4px;
  background: var(--sun);
  border-radius: 2px;
  display: block;
  margin-bottom: 14px;
}
.stat .num {
  font-weight: 800;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.stat .lbl {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 10px;
  font-weight: 700;
}

.panel {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.panel-head {
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.token-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.token-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 22px;
  border-bottom: 1.5px solid var(--line);
  background: var(--bg-soft);
}
.token-table td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.token-table tr:last-child td {
  border-bottom: 0;
}
.token-table tr:hover td {
  background: var(--bg-soft);
}
.token-table a {
  color: var(--blue);
  font-weight: 700;
}
.token-table a:hover {
  text-decoration: underline;
}
.table-muted {
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.field {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input,
.field select {
  height: 44px;
  min-width: 180px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 79, 255, 0.15);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 30px -8px rgba(255, 209, 0, 0.55);
}
.cta-btn:hover {
  background: var(--sun-2);
}
.cta-btn.secondary {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: none;
}
.cta-btn.secondary:hover {
  background: var(--line);
}

.alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1.5px solid var(--line);
}
.alert-err {
  background: #fde8e8;
  border-color: #f5c2c2;
  color: #9b1c1c;
}
.alert-ok {
  background: #e8f8ef;
  border-color: #b8e6c8;
  color: #0d6b3a;
}
.alert-warn {
  background: var(--sun-wash);
  border-color: var(--sun-soft);
  color: var(--ink);
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  padding: 24px;
}
.form-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  position: relative;
}
.form-card::before {
  content: "";
  position: absolute;
  inset: -2px -2px auto -2px;
  height: 6px;
  background: linear-gradient(90deg, var(--sun) 0%, var(--sun) 50%, var(--blue) 100%);
  border-radius: 20px 20px 0 0;
}
.form-card h1 {
  font-weight: 800;
  font-size: 26px;
  margin: 12px 0 8px;
  letter-spacing: -0.02em;
}
.form-card .lede {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.form-card .field {
  margin-bottom: 14px;
}
.form-card .field input {
  width: 100%;
  height: 52px;
}
.cta-full {
  width: 100%;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
  padding: 22px;
}
.detail-grid dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.detail-grid dd {
  margin: 4px 0 16px;
  font-weight: 600;
  color: var(--ink);
}
.detail-grid dd a {
  color: var(--blue);
  word-break: break-all;
}

.empty-state {
  padding: 32px 22px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.chart-wrap {
  padding: 16px 22px 8px;
  max-height: 360px;
}
