/* ============================================================
   VA4U Weekly Planner & KPI Dashboard — Prototype design system
   Brand: navy + gold, sourced from the planner artwork.
   Self-contained, no build step. Works from file:// or any host.
   ============================================================ */

:root {
  /* Brand palette */
  --navy:        #17264f;   /* primary navy (headers, text)      */
  --navy-deep:   #0e1a3c;   /* darkest navy (footer bar)         */
  --navy-600:    #24386e;
  --navy-100:    #e8ecf5;   /* tint for soft panels              */
  --gold:        #c0891e;   /* heritage gold (Mon/Fri headers only) */
  --gold-bright: #e0a92e;
  --gold-soft:   #fbf3df;

  /* VA4U BRAND GREEN (#01B069) — hero accent, 3 accessible tones */
  --green:        #01b069;   /* vibrant brand green: accents, borders, on-navy text, gradients */
  --green-strong: #018a50;   /* darker fill under WHITE content (buttons, checks, icons) — AA */
  --green-text:   #017a45;   /* green text on light backgrounds — AA */
  --green-soft:   #e3f7ee;   /* green tint background */

  /* KPI accent colours */
  --blue:   #2f6fb5;
  --purple: #6b4c9a;

  /* Status (Red / Amber / Green performance bands) */
  --rag-green: #017a45;      /* readable On-Track green (text + fills w/ white) */
  --rag-amber: #d99a24;
  --rag-red:   #cf3f3f;
  --rag-green-bg: #e3f7ee;
  --rag-amber-bg: #fbf1dc;
  --rag-red-bg:   #fbe8e8;

  /* Neutrals */
  --page:    #e9edf2;
  --card:    #ffffff;
  --ink:     #1f2733;
  --muted:   #5b6472;
  --faint:   #8a93a3;
  --line:    #d6dce6;
  --line-soft:#e7ebf1;

  --radius:   12px;
  --radius-sm: 8px;
  --shadow:   0 1px 2px rgba(16,26,60,.06), 0 6px 22px rgba(16,26,60,.08);
  --shadow-sm:0 1px 2px rgba(16,26,60,.08);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Poppins", var(--font);
  --script: "Caveat", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--display); color: var(--navy); margin: 0; line-height: 1.2; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- Top app bar ---------- */
.appbar {
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 2px 12px rgba(14,26,60,.25);
}
.appbar .brand { display: flex; align-items: center; gap: 12px; }
.appbar .brand img { height: 26px; width: auto; background:#fff; padding:5px 8px; border-radius:8px; }
.appbar .brand .brand-txt { font-family: var(--display); font-weight: 700; letter-spacing: .3px; font-size: 17px; }
.appbar .brand .brand-txt small { display:block; font-family: var(--font); font-weight:400; font-size:11px; letter-spacing:1.5px; text-transform:uppercase; color: var(--green); }
.appbar nav { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.appbar nav a {
  color: #cdd6e8; padding: 7px 13px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.appbar nav a:hover { background: var(--navy-600); color:#fff; text-decoration: none; }
.appbar nav a.active { background: var(--green-strong); color: #fff; font-weight: 600; }
.appbar .spacer { flex: 1; }
.appbar .who { display:flex; align-items:center; gap:10px; font-size:14px; color:#dfe5f1; }
.appbar .who .avatar { width:32px; height:32px; border-radius:50%; background:var(--green-strong); color:#fff; display:grid; place-items:center; font-weight:700; font-family:var(--display); }
.appbar .who .role-tag { font-size:11px; text-transform:uppercase; letter-spacing:1px; color:var(--green); }
@media (max-width: 720px){
  .appbar { flex-wrap: wrap; row-gap: 10px; padding: 10px 14px; gap: 10px; }
  .appbar .spacer { display: none; }
  .appbar .who { margin-left: auto; }
  .appbar nav { order: 3; width: 100%; }
}

/* ---------- Layout ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 26px 22px 60px; }
.page-wide { max-width: 1560px; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; letter-spacing:-.3px; }
.page-head .sub { color: var(--muted); font-size: 15px; margin-top: 2px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ---------- Cards & panels ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.panel > .panel-head {
  display:flex; align-items:center; gap:10px;
  background: var(--navy); color:#fff; padding: 10px 16px;
  font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing:.4px; text-transform: uppercase;
}
.panel > .panel-head .ico { width:22px; height:22px; }
.panel > .panel-body { padding: 16px 18px; }
.panel.gold > .panel-head { background: var(--gold); color: var(--navy-deep); }

.section-title { font-family: var(--display); font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:var(--navy); font-size: 13px; display:flex; align-items:center; gap:8px; }

/* ---------- Buttons ---------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 14px; padding: 10px 18px; min-height: 44px;
  transition: background .15s, box-shadow .15s, transform .05s; text-decoration:none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color:#fff; }
.btn-primary:hover { background: var(--navy-600); text-decoration:none; color:#fff; }
.btn-gold { background: var(--green-strong); color: #fff; }
.btn-gold:hover { background: var(--green-text); text-decoration:none; color:#fff; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: var(--navy-100); text-decoration:none; color:var(--navy); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity:.5; cursor: not-allowed; }

/* ---------- Pills / badges ---------- */
.pill { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding: 4px 11px; border-radius: 999px; letter-spacing:.2px; }
.pill-gray  { background:#eef1f6; color:#5b6472; }
.pill-navy  { background: var(--navy-100); color: var(--navy); }
.pill-green { background: var(--rag-green-bg); color: var(--rag-green); }
.pill-amber { background: var(--rag-amber-bg); color: #a5741a; }
.pill-red   { background: var(--rag-red-bg);   color: var(--rag-red); }
.pill .dot { width:8px; height:8px; border-radius:50%; background: currentColor; }

/* status dots for RAG */
.rag { --c: var(--rag-green); display:inline-flex; align-items:center; gap:7px; font-weight:600; font-size:13px; }
.rag .dot { width:10px; height:10px; border-radius:50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.rag.green { --c: var(--rag-green); }
.rag.amber { --c: var(--rag-amber); }
.rag.red   { --c: var(--rag-red); }

/* ---------- Checkboxes ---------- */
.check { display:flex; align-items:flex-start; gap:9px; cursor:pointer; user-select:none; padding: 3px 0; }
.check input { position:absolute; opacity:0; width:0; height:0; }
.check .box {
  flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px; border-radius: 5px;
  border: 1.8px solid #b9c1d0; background:#fff; display:grid; place-items:center;
  transition: background .12s, border-color .12s;
}
.check .box svg { width: 12px; height: 12px; stroke:#fff; stroke-width: 3.2; fill:none; opacity:0; transition: opacity .12s; }
.check input:checked + .box { background: var(--green-strong); border-color: var(--green-strong); }
.check input:checked + .box svg { opacity:1; }
.check input:focus-visible + .box { outline: 2px solid var(--blue); outline-offset: 2px; }
.check .lbl { font-size: 14px; color: var(--ink); line-height: 1.4; }
.check input:checked ~ .lbl { color: var(--muted); }
/* compact grid checkbox (day cells) */
.gcheck { display:inline-grid; place-items:center; cursor:pointer; }
.gcheck input { position:absolute; opacity:0; width:0; height:0; }
.gcheck .box { width:18px; height:18px; border-radius:5px; border:1.8px solid #b9c1d0; background:#fff; display:grid; place-items:center; }
.gcheck .box svg { width:11px; height:11px; stroke:#fff; stroke-width:3.4; fill:none; opacity:0; }
.gcheck input:checked + .box { background: var(--green-strong); border-color: var(--green-strong); }
.gcheck input:checked + .box svg { opacity:1; }

/* ---------- Tables ---------- */
.table { width:100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align:left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.table th { font-family: var(--display); font-size:12px; text-transform:uppercase; letter-spacing:.5px; color: var(--muted); font-weight:600; background:#f7f9fc; }
.table tbody tr:hover { background: #f9fbfd; }
.table td.num { font-variant-numeric: tabular-nums; font-weight:600; }

/* ---------- Score chip ---------- */
.score-chip { display:inline-flex; align-items:baseline; gap:2px; font-family:var(--display); font-weight:700; }
.score-chip .big { font-size: 20px; }
.score-chip .den { font-size: 13px; color: var(--faint); font-weight:600; }

/* mini sparkline bars */
.spark { display:inline-flex; align-items:flex-end; gap:3px; height:26px; }
.spark span { width:6px; background: var(--navy-100); border-radius:2px; display:block; }
.spark span.hi { background: var(--gold); }

/* ---------- Utility ---------- */
.stack { display:flex; flex-direction:column; }
.row { display:flex; align-items:center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-6{gap:6px}.gap-8{gap:8px}.gap-10{gap:10px}.gap-12{gap:12px}.gap-16{gap:16px}.gap-20{gap:20px}
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.center { text-align:center; }
.right { text-align:right; }
.upper { text-transform: uppercase; letter-spacing:.6px; }
.divider { height:1px; background: var(--line-soft); margin: 14px 0; border:0; }
.hidden { display:none !important; }

/* text inputs used across pages */
.field { display:flex; flex-direction:column; gap:6px; }
.field label { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); }
.input, .textarea, select.input {
  width:100%; border:1px solid var(--line); border-radius:10px; padding:11px 13px; font-size:15px; font-family:var(--font);
  color:var(--ink); background:#fff;
}
.input:focus, .textarea:focus, select.input:focus { outline:2px solid var(--blue); outline-offset:0; border-color:var(--blue); }
.textarea { resize: vertical; min-height: 70px; line-height:1.5; }

/* a subtle "prototype" tag — bottom-left, out of the way */
.proto-flag { position:fixed; left:14px; bottom:14px; background: var(--gold); color:var(--navy-deep); font-size:11px; font-weight:700; letter-spacing:1.5px; padding:6px 14px; border-radius:999px; z-index:60; box-shadow: var(--shadow); opacity:.92; }

/* footer values bar (planner + login) */
.values-bar {
  background: var(--navy-deep); color:#fff; border-radius: var(--radius);
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px;
  padding: 14px 22px; margin-top: 20px;
}
.values-bar .val { display:flex; align-items:center; gap:9px; font-size:13px; font-weight:600; letter-spacing:.4px; text-transform:uppercase; color:#eaeefb; }
.values-bar .val svg { width:18px; height:18px; color: var(--green); }
.values-bar .tagline { font-family: var(--script); font-size: 22px; color: var(--gold-bright); text-transform:none; letter-spacing:0; }
@media (max-width: 800px){ .values-bar { justify-content:center; text-align:center; } }
