:root {
  --navy: #0b1320;
  --navy-light: #162438;
  --navy-card: #1c2c44;
  --gold: #d4af37;
  --gold-light: #f3e5ab;
  --gold-dark: #aa8620;
  --paper: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-dark: #334155;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --radius: 10px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  padding: 20px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.brand small {
  display: block;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 3px;
  margin-top: 3px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-btn:hover, .nav-btn.active {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.auth-badge.unauthenticated {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 35px 5%;
}

.kicker {
  font-size: 12px;
  color: var(--gold-dark);
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -1px;
  color: var(--navy);
  margin-bottom: 12px;
  font-weight: 800;
}

.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 850px;
  margin-bottom: 24px;
}

.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
  color: #92400e;
  font-size: 14px;
}

.alert-banner.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.alert-banner.success {
  background: var(--success-bg);
  border-color: #a7f3d0;
  color: #065f46;
}

.alert-banner.danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: #991b1b;
}

.route-selector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.route-selector h3 {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.route-card {
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--paper);
}

.route-card:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.route-card.selected {
  border-color: var(--gold);
  background: #fffdf5;
  box-shadow: 0 0 0 1px var(--gold);
}

.route-card .route-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-card .route-desc {
  font-size: 13px;
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-free {
  background: #dcfce7;
  color: #166534;
}

.tag-paid {
  background: #fef3c7;
  color: #92400e;
}

.tag-admin {
  background: #e0e7ff;
  color: #3730a3;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.stat-card .label {
  font-size: 11px;
  color: var(--gold-dark);
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.stat-card .subtext {
  font-size: 13px;
  color: var(--muted);
}

.layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
}

aside.sidebar {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  align-self: start;
  box-shadow: var(--shadow);
}

aside.sidebar h4 {
  font-size: 13px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

aside.sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #cbd5e1;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

aside.sidebar a:hover, aside.sidebar a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-light);
}

.content-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.module-card h2 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 8px;
}

.module-card p.desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 20px;
}

.data-table th {
  background: #f8fafc;
  color: var(--navy);
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.data-table tr:hover td {
  background: #f8fafc;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.status-verified {
  background: #dcfce7;
  color: #15803d;
}

.status-pending {
  background: #fef3c7;
  color: #b45309;
}

.status-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: var(--navy);
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(212, 175, 55, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  border: 1px solid var(--line-dark);
  color: var(--navy);
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.download-box {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-lg);
}

.download-info h3 {
  font-size: 18px;
  margin-bottom: 6px;
  color: white;
}

.download-info p {
  font-size: 13px;
  color: #94a3b8;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-backdrop.show {
  display: flex;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius);
  max-width: 540px;
  width: 90%;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}

.modal-dialog h3 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 12px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
}

.live-log {
  background: #090d16;
  color: #a5f3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  padding: 16px;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #1e293b;
  margin-top: 16px;
}

footer {
  background: var(--navy);
  color: #94a3b8;
  padding: 30px 6%;
  margin-top: 60px;
  font-size: 13px;
  text-align: center;
  line-height: 1.8;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer strong {
  color: white;
}

@media (max-width: 900px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
  .download-box {
    flex-direction: column;
    align-items: flex-start;
  }
}
