/* ===========================================================
   Roadmap Tracker — Design System
   Direction: engineering blueprint / mission control.
   The signature element is the circuit-rail timeline: roadmap
   items are genuinely a sequence of work, so the rail encodes
   that order instead of decorating it.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg:            #0F1419;
  --bg-panel:      #161D26;
  --bg-elevated:   #1C2530;
  --bg-hover:      #212B38;
  --grid-line:     rgba(79, 157, 255, 0.07);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary:   #E8EDF4;
  --text-secondary: #8B96A5;
  --text-dim:       #5A6472;

  --accent-blue:   #4F9DFF;
  --accent-amber:  #FFB454;
  --accent-purple: #C792EA;
  --accent-green:  #3DDC97;
  --accent-red:    #FF6B6B;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 42px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 42px 100%,
    var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

.mono { font-family: var(--font-mono); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Top bar ------------------------------------------------ */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: #0F1419;
  flex-shrink: 0;
}
.brand-text h1 { font-size: 17px; color: var(--text-primary); }
.brand-text span { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); }
.topbar-nav { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--text-secondary); }
.topbar-nav a { padding: 8px 4px; border-bottom: 2px solid transparent; }
.topbar-nav a:hover { color: var(--text-primary); }
.topbar-nav a.active { color: var(--text-primary); border-color: var(--accent-blue); }

/* --- Hero ----------------------------------------------------- */
.hero { padding: 48px 0 28px; }
.hero .eyebrow {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-blue);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; display: block;
}
.hero h2 { font-size: 32px; color: var(--text-primary); max-width: 620px; }
.hero p.lead { margin-top: 10px; color: var(--text-secondary); max-width: 560px; font-size: 15px; }

/* --- Ledger (stat strip) --------------------------------------- */
.ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0 8px;
  background: var(--bg-panel);
}
.ledger-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
}
.ledger-cell:last-child { border-right: none; }
.ledger-cell .num { font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: var(--text-primary); }
.ledger-cell .lbl { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.ledger-cell.accent-progress .num { color: var(--accent-amber); }
.ledger-cell.accent-done .num { color: var(--accent-green); }
.ledger-cell.accent-planned .num { color: var(--accent-blue); }

/* --- Filter tabs ------------------------------------------------ */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 28px 0 10px;
}
.filter-tab {
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-secondary);
  background: var(--bg-panel);
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.filter-tab:hover { color: var(--text-primary); border-color: var(--border-strong); }
.filter-tab.active { color: var(--bg); background: var(--text-primary); border-color: var(--text-primary); }

/* --- Circuit-rail timeline (signature element) ------------------ */
.rail {
  position: relative;
  margin: 30px 0 60px;
  padding-left: 34px;
}
.rail::before {
  content: '';
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--border-strong), var(--border-strong) 60%, transparent);
}
.rail-quarter {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.05em; text-transform: uppercase;
  margin: 32px 0 14px; position: relative;
}
.rail-quarter:first-child { margin-top: 0; }
.rail-quarter::before {
  content: ''; position: absolute; left: -30px; top: 4px;
  width: 9px; height: 9px; border-radius: 2px; background: var(--text-dim);
  transform: rotate(45deg);
}

.rail-item { position: relative; margin-bottom: 14px; }
.rail-item::before {
  content: '';
  position: absolute; left: -29px; top: 22px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--node-color, var(--accent-blue));
  box-shadow: 0 0 0 3px var(--bg);
}
.rail-item::after {
  content: '';
  position: absolute; left: -18px; top: 27px;
  width: 18px; height: 1px; background: var(--border-strong);
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .15s ease, background .15s ease;
}
.card:hover { border-color: var(--border-strong); background: var(--bg-elevated); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card-desc { color: var(--text-secondary); font-size: 13.5px; margin-top: 6px; max-width: 640px; }

.pill {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-cat {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
  border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px;
}

.card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.card-dates { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); margin-left: auto; }

.progress-track { height: 5px; border-radius: 4px; background: var(--bg-elevated); overflow: hidden; margin-top: 12px; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--node-color, var(--accent-blue)); }

.updates-list { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.updates-list .update-row { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-secondary); padding: 4px 0; }
.updates-list .update-row time { font-family: var(--font-mono); color: var(--text-dim); flex-shrink: 0; width: 78px; }

/* --- Suggestions -------------------------------------------------- */
.suggestion-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px;
}
.vote-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--text-secondary); font-family: var(--font-mono); font-size: 13px;
  cursor: pointer; flex-shrink: 0; min-width: 52px;
}
.vote-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.vote-btn.voted { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(79,157,255,0.08); cursor: default; }
.vote-btn svg { width: 14px; height: 14px; }

.suggest-form {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin: 24px 0 40px;
}
.suggest-form h3 { font-size: 16px; margin-bottom: 4px; }
.suggest-form p.hint { color: var(--text-dim); font-size: 12.5px; margin-bottom: 16px; }

/* --- Forms (shared, admin + public) ------------------------------ */
label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; font-family: var(--font-mono); }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], textarea, select {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm); padding: 10px 12px;
  font-family: var(--font-body); font-size: 14px;
}
textarea { min-height: 90px; resize: vertical; font-family: var(--font-body); }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, textarea:focus, select:focus { border-color: var(--accent-blue); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--text-primary); cursor: pointer;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--accent-blue); border-color: var(--accent-blue); color: #0B1220; font-weight: 600; }
.btn-primary:hover { background: #6BAEFF; }
.btn-danger { border-color: var(--accent-red); color: var(--accent-red); background: transparent; }
.btn-danger:hover { background: rgba(255,107,107,0.1); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* --- Admin shell --------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg-panel); border-right: 1px solid var(--border);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .brand-text h1 { font-size: 15px; }
.admin-nav { margin-top: 28px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 9px;
}
.admin-nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.admin-nav a.active { background: rgba(79,157,255,0.1); color: var(--accent-blue); }
.admin-main { flex: 1; padding: 30px 34px; max-width: 1100px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.admin-header h2 { font-size: 22px; }
.admin-user { font-size: 12.5px; color: var(--text-dim); font-family: var(--font-mono); }

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-panel); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-elevated); }
td.actions { display: flex; gap: 8px; }

.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent-red); color: #fff; font-size: 10.5px; font-family: var(--font-mono);
}

/* --- Login page ------------------------------------------------- */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card p.hint { color: var(--text-dim); font-size: 12.5px; margin-bottom: 22px; }

/* --- Flash / alerts ------------------------------------------------ */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; border: 1px solid; }
.alert-success { background: rgba(61,220,151,0.08); border-color: rgba(61,220,151,0.35); color: var(--accent-green); }
.alert-error { background: rgba(255,107,107,0.08); border-color: rgba(255,107,107,0.35); color: var(--accent-red); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state h3 { color: var(--text-secondary); font-size: 15px; margin-bottom: 6px; }

footer.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0; color: var(--text-dim); font-size: 12px; font-family: var(--font-mono); }

/* --- Responsive --------------------------------------------------- */
@media (max-width: 720px) {
  .ledger { grid-template-columns: repeat(2, 1fr); }
  .ledger-cell:nth-child(2) { border-right: none; }
  .field-row { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-main { padding: 22px 18px; }
  .hero h2 { font-size: 26px; }
  .card-dates { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
