:root {
  --bg: #0A2540;
  --bg-2: #122e4d;
  --bg-3: #1a3a5c;
  --ink: #f5f7fa;
  --ink-mute: #a8b8cc;
  --ink-soft: #6f8298;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.16);
  --cyan: #1AC8D4;
  --cyan-soft: rgba(26,200,212,.12);
  --orange: #F7941D;
  --orange-soft: rgba(247,148,29,.14);
  --green: #4ade80;
  --red: #f87171;
  --amber: #fbbf24;
  --r: 10px;
  --r-lg: 14px;
}
* { box-sizing: border-box; }

/* Scrollbars.
   Every scrollable region was rendering in the browser's default light chrome,
   which on a dark navy app reads as a bright white bar down the side of the
   page and a white slab under every table. Themed here rather than per element
   so nothing added later reintroduces it.

   Both syntaxes are needed: the standard properties for Firefox, the -webkit-
   pseudo-elements for Chrome and Edge, which is what everyone here uses. */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14);
  border-radius: 8px;
  /* Inset the thumb so it reads as a slim pill rather than a full-width slab. */
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #5ce0e8; }
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 18px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 0 4px; }
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text .name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.brand-text .sub { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.nav-section { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; padding: 16px 8px 6px; font-weight: 500; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-mute); font-size: 13px; font-weight: 500; }
.nav a:hover { background: var(--bg-3); color: var(--ink); }
.nav a.on { background: var(--cyan-soft); color: var(--cyan); }
.nav a .ic { width: 16px; height: 16px; opacity: .85; }
.who { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-mute); display: flex; align-items: center; gap: 10px; }
.who .av { width: 28px; height: 28px; border-radius: 50%; background: var(--cyan-soft); color: var(--cyan); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; }
.who .me { line-height: 1.2; }
.who .me strong { display: block; color: var(--ink); font-weight: 500; font-size: 13px; }
.who .me a { font-size: 11px; color: var(--ink-soft); }
.main { padding: 28px 40px 60px; max-width: 1600px; width: 100%; }
h1.page-title { margin: 0 0 4px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.page-sub { color: var(--ink-mute); font-size: 13px; margin: 0 0 24px; }
.scaffold-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 28px; margin-bottom: 18px; }
.scaffold-card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.scaffold-card p { margin: 0; color: var(--ink-mute); font-size: 13px; line-height: 1.6; }
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 18px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--bg-3); border-radius: var(--r); border: 1px solid var(--line); }
.check .b { font-size: 16px; line-height: 1; margin-top: 1px; }
.check.ok .b { color: var(--green); }
.check.pend .b { color: var(--amber); }
.check.todo .b { color: var(--ink-soft); }
.check .t { display: flex; flex-direction: column; line-height: 1.35; }
.check .t b { font-weight: 500; font-size: 13px; }
.check .t span { color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.foot { margin-top: 32px; font-size: 11px; color: var(--ink-soft); text-align: center; }

/* CW-06. The layout was a fixed 240px sidebar with no breakpoints, so anything
   narrower than a laptop got a squeezed column and horizontal scrolling. Below
   900px the sidebar becomes a horizontal strip across the top and the nav scrolls
   sideways, which keeps every route reachable on a tablet or phone without
   restructuring the markup. Tables are the other half of the problem: they are wide
   by nature, so they scroll within their own container rather than dragging the
   whole page sideways. */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 12px 14px; gap: 2px;
    position: sticky; top: 0; z-index: 20;
  }
  .brand { margin-bottom: 12px; }
  .brand img { width: 28px; height: 28px; }
  .nav { display: flex; overflow-x: auto; gap: 4px; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { height: 0; }
  .nav a { white-space: nowrap; padding: 7px 12px; }
  .nav-section { display: none; }
  .who { margin-top: 12px; padding: 10px 4px 2px; }
  .main { padding: 18px 16px 48px; }
  h1.page-title { font-size: 20px; }
  .scaffold-card { padding: 16px 18px; }
  /* Stat tiles and any auto-fit grid collapse to one column rather than
     overflowing; several pages build these inline with a shared style var. */
  .checklist { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  th, td { padding: 8px 10px !important; }
}

@media (max-width: 560px) {
  .main { padding: 14px 12px 40px; }
  .brand-text .sub { display: none; }
  table { font-size: 11px; }
}

/* Wide tables should scroll inside their own box on every screen size, not push
   the page out. Applied to the wrapper divs the templates already use. */
[style*="overflow:auto"], [style*="overflow: auto"] { -webkit-overflow-scrolling: touch; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 40px 36px; max-width: 400px; width: 100%; text-align: center; }
.login-card img { width: 64px; height: 64px; margin-bottom: 18px; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.login-card .tag { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 24px; }
.btn { display: inline-block; padding: 11px 24px; background: var(--cyan); color: var(--bg); border-radius: 8px; font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: transform .1s ease, background .15s ease; }
.btn:hover { background: #5ce0e8; color: var(--bg); }
.btn:active { transform: scale(0.98); }
.note { color: var(--ink-soft); font-size: 12px; margin-top: 18px; }
.err { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-top: 16px; text-align: left; }
.placeholder-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 48px; text-align: center; }
.placeholder-card .ic { font-size: 32px; margin-bottom: 8px; opacity: .5; }
.placeholder-card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.placeholder-card p { margin: 0; color: var(--ink-mute); font-size: 13px; }
