/* Shared app shell (Nov 2026): the look of every logged-in page except the maps, taken from the landing page.
   A page loads this file and app_shell.js, sets <body data-nav="home|maps|reports|digests|account|admin">, and starts with <div id="app-nav"></div>.
   Page-specific rules stay in the page. */
:root {
  --bg: #0b0e14; --surface: #121722; --surface2: #1a2130; --surface3: #222b3d; --border: #2a3347;
  --text: #e6ebf2; --text-dim: #9aa4b5; --accent: #F5A623; --accent-hover: #ffb73d;
  --past: #F87171; --soon: #F5A623; --mid: #6C8EF5; --later: #6b7588; --safe: #34D399;
  --radius: 14px; --radius-sm: 10px; --nav-h: 64px; --page-w: 1240px; --gutter: 32px;
  --font-head: 'Space Grotesk', system-ui, sans-serif; --font-body: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: calc(var(--nav-h) + 12px); }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.5; min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* the top menu */
#app-nav { min-height: var(--nav-h); }                     /* holds the space before the script runs, so the page does not jump */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 1001; background: var(--accent); color: #0b0e14; font-weight: 700; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 10px; }
.shell-nav { position: sticky; top: 0; z-index: 900; background: rgba(11,14,20,0.97); border-bottom: 1px solid var(--border); }
#app-nav { position: sticky; top: 0; z-index: 900; }
.shell-inner { max-width: var(--page-w); margin: 0 auto; padding: 0 var(--gutter); height: calc(var(--nav-h) - 1px); display: flex; align-items: center; gap: 32px; }
.shell-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; text-decoration: none; }
.shell-logo .mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(140deg, var(--accent), #e07b12); display: grid; place-items: center; color: #0b0e14; }
.shell-logo svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.shell-links { display: flex; align-items: stretch; gap: 26px; height: 100%; flex: 1; }
.shell-links a { display: flex; align-items: center; color: var(--text-dim); font-size: 15px; font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; border-top: 2px solid transparent; transition: color .15s; }
.shell-links a:hover { color: var(--text); }
.shell-links a[aria-current="page"] { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.shell-side { display: flex; align-items: center; gap: 18px; }
.shell-account { color: var(--text-dim); font-size: 15px; font-weight: 500; text-decoration: none; }
.shell-account:hover, .shell-account[aria-current="page"] { color: var(--text); }
.shell-account[aria-current="page"] { font-weight: 700; }
.shell-logout { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: var(--radius-sm); min-height: 38px; padding: 0 14px; font-size: 14px; cursor: pointer; transition: color .15s, border-color .15s; }
.shell-logout:hover { color: var(--text); border-color: var(--accent); }
.shell-burger { display: none; margin-left: auto; width: 44px; height: 44px; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; place-items: center; }
.shell-burger svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .shell-burger { display: grid; }
  .shell-menu { display: none; position: absolute; left: 0; right: 0; top: var(--nav-h); background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 16px; }
  .shell-menu.open { display: block; }
  .shell-links { display: block; height: auto; }
  .shell-links a { min-height: 48px; border-bottom: none; border-top: none; border-left: 2px solid transparent; padding-left: 12px; }
  .shell-links a[aria-current="page"] { border-left-color: var(--accent); }
  .shell-side { display: block; }
  .shell-account { display: flex; align-items: center; min-height: 48px; padding-left: 14px; }
  .shell-logout { width: 100%; min-height: 44px; margin-top: 10px; }
}
@media (min-width: 761px) { .shell-menu { display: flex; align-items: center; flex: 1; height: 100%; gap: 26px; } }

/* page frame */
.wrap { max-width: var(--page-w); margin: 0 auto; padding: 32px var(--gutter) 72px; }
.wrap.narrow { max-width: 960px; }
.page-head { margin-bottom: 24px; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; }
.sub { color: var(--text-dim); font-size: 15px; margin-top: 6px; max-width: 680px; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.note { color: var(--text-dim); font-size: 14px; max-width: 680px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); background: var(--accent); color: #0b0e14; font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; border: none; cursor: pointer; transition: background .2s; }
.btn:hover { background: var(--accent-hover); }
.btn.alt { background: none; color: var(--text); border: 1px solid var(--border); }
.btn.alt:hover { border-color: var(--accent); }
.btn[disabled] { opacity: .7; cursor: default; }

/* form field */
.field { min-height: 44px; width: 100%; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.field:focus { outline: none; border-color: var(--accent); }

/* small tag, empty and error boxes */
.chip-tag { display: inline-block; font-size: 12px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 28px; color: var(--text-dim); font-size: 15px; }
.box h2 { color: var(--text); margin-bottom: 6px; }
.box .btn { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { #app-nav, .skip-link { display: none; } body { background: #fff; color: #000; } }
