﻿:root {
  --bg: #0b1220;
  --bg-secondary: #111827;
  --card: #141d2f;
  --card-elevated: #18243a;
  --primary: #2dd4bf;
  --primary-soft: rgba(45,212,191,0.14);
  --secondary: #60a5fa;
  --text: #e5edf8;
  --muted: #9fb0c7;
  --danger: #f87171;
  --warning: #fbbf24;
  --border: #273449;
  --grid: rgba(96, 165, 250, 0.05);
  --shadow: 0 12px 32px rgba(2, 8, 23, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 270px;
  --transition: 180ms ease;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-secondary: #ffffff;
  --card: #ffffff;
  --card-elevated: #f8fafc;
  --text: #0f172a;
  --muted: #5b6b85;
  --border: #e2e8f0;
  --grid: rgba(96, 165, 250, 0.08);
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before { content: none; }

a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--primary); }
img, svg { max-width: 100%; }
code, pre, .mono { font-family: var(--mono); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 650; }
h3 { font-size: 1.1rem; margin-bottom: 0.5em; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.mt { margin-top: 0.75rem; }

.skip-link { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 1rem; top: 1rem; width: auto; height: auto; padding: 0.5rem 1rem; background: var(--primary); color: #042f2e; border-radius: 8px; z-index: 1000; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.85rem;
  z-index: 30;
  box-shadow: 6px 0 24px rgba(2, 8, 23, 0.04);
}
.sidebar-brand { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; padding: 0.25rem 0.35rem 0.85rem; border-bottom: 1px solid rgba(39,52,73,0.8); }
.brand-mark { color: var(--primary); background: rgba(45,212,191,0.12); border: 1px solid rgba(45,212,191,0.28); border-radius: 10px; padding: 0.4rem; display: flex; }
.brand-mark-logo { padding: 0.2rem; background: rgba(20,29,47,0.6); border-color: var(--border); overflow: hidden; }
.brand-logo-img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; display: block; }
.brand-title { font-weight: 700; font-size: 0.95rem; color: #f3f7ff; }
.brand-subtitle { color: var(--muted); font-size: 0.8rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; overflow-y: auto; flex: 1; padding: 0.25rem 0; }
.nav-link { color: #a8b7cc; padding: 0.6rem 0.75rem; border-radius: 10px; font-size: 0.94rem; transition: var(--transition); font-weight: 500; border: 1px solid transparent; }
.nav-link:hover { color: #f3f7ff; background: rgba(148,163,184,0.08); }
.nav-link.active { color: #f3f7ff; background: rgba(45,212,191,0.10); border-color: rgba(45,212,191,0.22); }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }
.sidebar-credit { color: var(--muted); font-size: 0.8rem; margin-top: 0.5rem; }
.sidebar-link { display: inline-block; margin-top: 0.5rem; color: var(--secondary); font-size: 0.85rem; font-weight: 500; }
.sidebar-link:hover { color: var(--primary); }
.progress-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
.progress-bar { height: 8px; background: #0a1324; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 300ms ease; }
.progress-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.25rem; background: rgba(11,18,32,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(39,52,73,0.9); }
#menu-toggle { display: none; }
.search-wrap { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 0.5rem; background: rgba(20,29,47,0.7); border: 1px solid rgba(39,52,73,0.9); border-radius: 12px; padding: 0.45rem 0.75rem; }
.search-wrap input { background: transparent; border: none; color: var(--text); width: 100%; outline: none; font-size: 0.95rem; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #121b2d; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; display: none; }
.search-results.open { display: block; }
.search-item { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.search-item:hover { background: rgba(96,165,250,0.08); }
.search-item:last-child { border-bottom: none; }
.search-item .s-title { font-weight: 600; }
.search-item .s-meta { font-size: 0.8rem; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; gap: 0.5rem; }

main { padding: 1rem 1rem 2.5rem; }
main > .section { max-width: 1480px; margin: 0 auto; width: 100%; }
.section { padding: 2.25rem 0; border-bottom: 1px solid rgba(39,52,73,0.5); scroll-margin-top: 84px; }
.hero.section { min-height: calc(100svh - 72px); display: flex; align-items: center; padding: 1.5rem 0; }
.hero.section .hero-grid { width: 100%; }
.section:last-of-type { border-bottom: none; }
.section-head { margin-bottom: 1rem; max-width: 760px; display: grid; gap: 0.35rem; }
.section-head .section-head-row { display: flex; align-items: center; gap: 0.7rem; }
.section-head .section-num { font-family: var(--mono); font-size: 0.78rem; color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(45,212,191,0.3); border-radius: 999px; padding: 0.15rem 0.6rem; }
.section-head .section-progress { width: 70px; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-left: auto; }
.section-head .section-progress span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 400ms ease; }
.section-head p { color: var(--muted); font-size: 1rem; margin-bottom: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: none; transition: border-color var(--transition), box-shadow var(--transition); }
.card:hover { border-color: rgba(45,212,191,0.28); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.65rem 1rem; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; transition: var(--transition); font-size: 0.95rem; background: var(--card); color: var(--text); border-color: var(--border); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(2,8,23,0.12); border-color: rgba(45,212,191,0.4); }
.btn-primary { background: linear-gradient(135deg, #14b8a6, #2dd4bf); color: #042f2e; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.05); color: #042f2e; }
.btn-secondary { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.35); color: var(--text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: rgba(45,212,191,0.45); background: var(--primary-soft); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; border-radius: 8px; }
.icon-btn { background: var(--card); border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 0.4rem; cursor: pointer; display: inline-flex; }
.icon-btn:hover { color: var(--text); border-color: rgba(45,212,191,0.45); background: var(--primary-soft); }

input, select, textarea { width: 100%; padding: 0.6rem 0.7rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(45,212,191,0.28); border-color: rgba(45,212,191,0.5); }
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.6rem; font-weight: 500; }
label > input, label > select { margin-top: 0.25rem; font-weight: 400; }
.check { display: flex; align-items: flex-start; gap: 0.5rem; color: var(--text); margin: 0.4rem 0; cursor: pointer; font-weight: 400; }
.check input { width: auto; margin-top: 0.2rem; accent-color: var(--primary); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.25rem 0.75rem; }

.notice { padding: 0.8rem 0.95rem; border-radius: 12px; border: 1px solid var(--border); margin-top: 1rem; }
.notice-warning { background: rgba(251,191,36,0.10); border-color: rgba(251,191,36,0.30); color: #fde68a; }
.notice-danger { background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.30); color: #fecaca; }
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--border); }
.badge-sim { background: rgba(96,165,250,0.14); color: #bfdbfe; border-color: rgba(96,165,250,0.35); }
.pill { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.pill.open, .dot.open { background: rgba(45,212,191,0.18); color: #99f6e4; }
.pill.closed, .dot.closed { background: rgba(248,113,113,0.18); color: #fecaca; }
.pill.filtered, .dot.filtered { background: rgba(251,191,36,0.18); color: #fde68a; }
.pill.open\|filtered, .pill.closed\|filtered, .pill.unfiltered { background: rgba(96,165,250,0.18); color: #bfdbfe; }
.pill.unknown, .dot.unknown { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; color: var(--muted); font-size: 0.9rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }

.site-footer { margin-top: auto; padding: 1.5rem; border-top: 1px solid var(--border); color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: rgba(17,24,39,0.6); }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; }
.footer-logo { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.tagline { color: var(--primary); font-weight: 600; }
