:root {
  --bg: #0a0e13;
  --panel: #121922;
  --panel-raised: #17202b;
  --border: #24303d;
  --text-primary: #e7edf3;
  --text-secondary: #a7b4c2;
  --text-muted: #6b7a8a;
  --accent: #22d3b8;
  --accent-dim: #14877a;
  --amber: #f2b84b;
  --error: #ef6461;
  --radius: 10px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(34, 211, 184, 0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(34, 211, 184, 0.04), transparent 45%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
  animation: sweep 4s linear infinite;
  z-index: 50;
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .scan-line { animation: none; }
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 25, 34, 0.6);
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand-mark { color: var(--accent); }
.brand-accent { color: var(--accent); }

.nav-links { display: flex; gap: 6px; }

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.88rem;
  transition: 0.15s ease;
}

.nav-links a:hover { color: var(--text-primary); background: var(--panel-raised); }
.nav-links a.active { color: var(--bg); background: var(--accent); }

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent);
  margin: 0 0 10px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 0 0 28px;
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: #06120f;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 13px 22px;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) { background: #3ee6ca; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.muted { color: var(--text-secondary); }
.muted a { color: var(--accent); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

.log-box {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin: 0;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-row-split {
  flex-direction: row;
  gap: 16px;
}

.form-row-split > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"],
input[type="date"] {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  outline: none;
  transition: 0.15s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 184, 0.15);
}

.hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.flash-stack { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.flash-info { color: var(--accent); border-color: var(--accent-dim); }
.flash-warning { color: var(--amber); border-color: var(--amber); }
.flash-error { color: var(--error); border-color: var(--error); }

@media (max-width: 640px) {
  .topnav { padding: 16px 20px; }
  .page { padding: 32px 18px 60px; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-row-split { flex-direction: column; }
}
