/* Sprocket Networks Fiber Map — shared styles */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-mid: #475569;
  --text-mute: #94a3b8;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --good: #16a34a;
  --good-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }

/* ────── Navbar (shared across all pages) ────── */
.wg-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
  height: 52px; background: #0f172a; color: white;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wg-navbar .brand { display: flex; align-items: center; gap: 11px; }
.wg-navbar .wg-box {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; letter-spacing: -0.5px;
}
.wg-navbar .brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.wg-navbar .brand-sub { color: rgba(255,255,255,0.5); font-size: 13px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,0.15); margin-left: 4px; }
.wg-navbar nav { display: flex; align-items: center; gap: 4px; }
.wg-navbar nav a {
  color: rgba(255,255,255,0.7); font-size: 13px; text-decoration: none;
  padding: 6px 10px; border-radius: 6px;
  transition: all 0.12s;
}
.wg-navbar nav a:hover { background: rgba(255,255,255,0.08); color: white; }
.wg-navbar nav a.active { background: rgba(255,255,255,0.12); color: white; }
.wg-navbar nav a.admin {
  color: rgba(248,113,113,0.85); border: 1px solid rgba(248,113,113,0.3); margin-left: 8px;
}
.wg-navbar nav a.admin:hover { background: rgba(248,113,113,0.1); color: #fca5a5; }

/* ────── Page-level layout helpers ────── */
.page-wrap { padding-top: 52px; min-height: 100vh; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ────── Hero (hub page) ────── */
.hero {
  padding: 64px 0 32px;
  background: radial-gradient(ellipse at top left, rgba(59,130,246,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at bottom right, rgba(139,92,246,0.04) 0%, transparent 60%);
}
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.7px; margin: 0 0 10px; }
.hero p  { font-size: 15px; color: var(--text-mid); margin: 0; max-width: 680px; line-height: 1.55; }

/* ────── Card grid ────── */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px; padding: 24px 0 56px;
}
.card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; text-decoration: none; color: inherit;
  transition: all 0.18s ease;
  border-left: 4px solid var(--accent);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(15,23,42,0.07), 0 2px 5px rgba(15,23,42,0.04);
  border-color: var(--accent);
}
.card .icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(29,78,216,0.08); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.card .sub { font-size: 12px; color: var(--text-mute); margin-bottom: 12px; font-weight: 500; }
.card .desc { font-size: 13px; color: var(--text-mid); line-height: 1.55; margin: 0 0 12px; }
.card .kpis {
  display: flex; gap: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12px;
}
.card .kpi .num { display: block; font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.card .kpi .lbl { display: block; color: var(--text-mute); margin-top: 1px; }

/* Card accent variants */
.card.accent-blue   { border-left-color: #3b82f6; }
.card.accent-blue   .icon { background: rgba(59,130,246,0.10); color: #3b82f6; }
.card.accent-cyan   { border-left-color: #0891b2; }
.card.accent-cyan   .icon { background: rgba(8,145,178,0.10); color: #0891b2; }
.card.accent-purple { border-left-color: #9333ea; }
.card.accent-purple .icon { background: rgba(147,51,234,0.10); color: #9333ea; }
.card.accent-amber  { border-left-color: #d97706; }
.card.accent-amber  .icon { background: rgba(217,119,6,0.10); color: #d97706; }
.card.accent-green  { border-left-color: #16a34a; }
.card.accent-green  .icon { background: rgba(22,163,74,0.10); color: #16a34a; }
.card.accent-pink   { border-left-color: #ec4899; }
.card.accent-pink   .icon { background: rgba(236,72,153,0.10); color: #ec4899; }
.card.accent-slate  { border-left-color: #64748b; }
.card.accent-slate  .icon { background: rgba(100,116,139,0.10); color: #64748b; }

/* ────── Focused-page layout: sidebar + map ────── */
.focused-wrap {
  position: absolute; top: 52px; left: 0; right: 0; bottom: 0;
  display: flex;
}
.focused-side {
  width: 360px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 22px 24px 28px;
}
.focused-map { flex: 1; }
.focused-side h1 { font-size: 19px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.3px; }
.focused-side .breadcrumb {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-mute); margin-bottom: 14px;
}
.focused-side .lead {
  font-size: 13.5px; color: var(--text-mid); line-height: 1.55; margin: 0 0 18px;
}

/* KPI strip */
.kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.kpi-cell {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px;
}
.kpi-cell .num { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.kpi-cell .lbl { display: block; font-size: 11px; color: var(--text-mute); margin-top: 1px; }

/* Section heading inside sidebar */
.focused-side h2 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--text-mid);
  margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--border);
}
.focused-side h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

/* Layer toggles in sidebar (smaller than checkboxes — use clickable rows) */
.toggle-list { display: grid; gap: 4px; }
.toggle-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); cursor: pointer; font-size: 13px;
  transition: all 0.1s;
}
.toggle-row:hover { background: white; border-color: var(--border-strong); }
.toggle-row input { cursor: pointer; margin: 0; }
.toggle-row .swatch {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.toggle-row .swatch-tri {
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 8px solid currentColor;
}
.toggle-row .swatch-sq { width: 10px; height: 10px; border-radius: 2px; }
.toggle-row .swatch-line { width: 16px; height: 2px; border-radius: 1px; }
.toggle-row .label { flex: 1; }
.toggle-row .count { color: var(--text-mute); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* Verdict callouts */
.verdict { font-size: 13.5px; padding: 11px 13px; border-radius: 8px; margin-bottom: 12px; line-height: 1.5; }
.verdict.bad  { background: var(--bad-bg);  color: #991b1b; border: 1px solid #fecaca; }
.verdict.good { background: var(--good-bg); color: #065f46; border: 1px solid #a7f3d0; }
.verdict.warn { background: var(--warn-bg); color: #92400e; border: 1px solid #fcd34d; }

/* Tables */
table.stats { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0 12px; }
table.stats th { text-align: left; font-weight: 600; color: var(--text-mid); padding: 7px 8px; border-bottom: 1px solid var(--border-strong); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }
table.stats td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
table.stats td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.stats tr.total td { font-weight: 700; border-top: 2px solid var(--border-strong); border-bottom: none; }

/* Generic helpers */
.muted { color: var(--text-mute); font-size: 12px; }
.btn-primary {
  display: inline-block; background: var(--accent); color: white;
  padding: 9px 16px; border-radius: 7px; text-decoration: none;
  font-size: 13px; font-weight: 500; transition: background 0.12s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  display: inline-block; padding: 8px 14px; border-radius: 7px;
  text-decoration: none; font-size: 13px; font-weight: 500;
  color: var(--accent); border: 1px solid var(--border-strong);
  background: white; transition: all 0.12s;
}
.btn-ghost:hover { background: var(--bg); border-color: var(--accent); }

/* Responsive: collapse focused-side on mobile */
@media (max-width: 900px) {
  .focused-wrap { flex-direction: column; }
  .focused-side { width: 100%; max-height: 55vh; border-right: none; border-bottom: 1px solid var(--border); }
  .hero h1 { font-size: 26px; }
  .card-grid { grid-template-columns: 1fr; }
}
