/* web/theme.css — the Cloudflare site's look: Apple-style calm surfaces and type, with bold black
   outlines and shades of yellow. Loaded after the base stylesheet, so it only overrides.
   src/Stylesheet.html is left as is (the Apps Script page keeps its own look); tools/build-pages.js
   also recasts the base stylesheet's hard-coded greens to the yellow family. */

:root {
  /* Brand: yellow is a FILL, never a text colour. Text on yellow is always ink. */
  --green:#FFD60A;        /* primary fill */
  --green-600:#1D1D1F;    /* was the dark brand text; now ink */
  --green-050:#FFF3B8;    /* soft tint: selected rows, chips */
  --gold:#FFB703;         /* deeper amber accent */
  --yellow-hover:#FFC300;
  --yellow-pale:#FFFAE0;

  --bg:#FFFBEA; --surface:#ffffff; --surface-2:#FFF9E0; --ink:#111111;
  --ink-2:#55524A; --line:#DEDACB; --line-strong:#111111;
  --danger:#C0271A; --danger-050:#FDECE9; --ok:#1F7A4D;

  --outline:2px solid #111111;
  --r-sm:10px; --r:14px; --r-lg:20px;
  --sh-1:3px 3px 0 #111111;
  --sh-2:5px 5px 0 #111111;
  --sh-focus:0 0 0 3px #FFD60A, 0 0 0 5px #111111;
}

body { background:var(--bg); }
a { color:var(--ink); text-decoration:underline; text-decoration-color:var(--gold); text-decoration-thickness:2px; text-underline-offset:2px; }
::selection { background:var(--green); color:var(--ink); }

/* ---------- Boot and sign-in ---------- */
.login-wrap, .boot-wrap {
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(255,255,255,.75), transparent 62%),
    linear-gradient(165deg, #FFE45C 0%, #FFC300 100%);
}
.login-card, .boot-card { border:var(--outline); box-shadow:6px 6px 0 #111; border-radius:var(--r-lg); }
.brand .mark, .topbar .mark, .boot-card .mark {
  background:var(--green); color:var(--ink); border:var(--outline); font-weight:800;
}
.brand h1 { font-weight:800; letter-spacing:-.02em; }
.boot-bar { border:1.5px solid #111; }
.boot-bar i { background:#111; }

/* ---------- Shell ---------- */
.topbar { background:var(--green); border-bottom:var(--outline);
  -webkit-backdrop-filter:none; backdrop-filter:none; }
.topbar .mark { background:#111; color:var(--green); border-color:#111; }
.topbar h1 { font-weight:800; letter-spacing:-.015em; }
.topbar .who { color:#3A3320; }
.topbar .who b { color:var(--ink); }
.topbar .btn.ghost { background:#fff; }
.nav-toggle span { background:#111; }

.side { border-right:var(--outline); }
.side .group { color:var(--ink); letter-spacing:.09em; }
.side button { border:2px solid transparent; font-weight:500; }
.side button:hover { background:var(--yellow-pale); }
.side button.active { background:var(--green); color:var(--ink); border-color:#111; font-weight:700;
  box-shadow:2px 2px 0 #111; }
.side button .count { background:#fff; border:1.5px solid #111; color:var(--ink); }
.side button.active .count { background:#111; color:var(--green); }

/* ---------- Buttons ---------- */
.btn { color:var(--ink); border:var(--outline); font-weight:700; box-shadow:2px 2px 0 #111;
  transition:background var(--dur) var(--ease), transform .08s var(--ease), box-shadow .08s var(--ease); }
.btn:hover { background:var(--yellow-hover); }
.btn:active { transform:translate(2px,2px); box-shadow:0 0 0 #111; }
.btn:disabled { box-shadow:none; }
.btn.secondary, .btn.ghost { background:#fff; color:var(--ink); border-color:#111; }
.btn.secondary:hover, .btn.ghost:hover { background:var(--green-050); }
.btn.gold { background:var(--gold); color:var(--ink); }
.btn.danger { background:var(--danger); color:#fff; }
.btn.sm { box-shadow:1.5px 1.5px 0 #111; }
.spinner { border-color:rgba(17,17,17,.25); border-top-color:#111; }

.pb-btn { border:1.5px solid #111; font-weight:700; }
.pb-btn:hover { background:var(--green-050); border-color:#111; }
.pb-btn.primary { background:var(--green); border-color:#111; color:var(--ink); box-shadow:1.5px 1.5px 0 #111; }
.pb-btn.primary:hover { background:var(--yellow-hover); border-color:#111; }
.pb-btn.warn { border-color:#111; }
.pb-help { border-color:#111; color:var(--ink); }
.pb-status { border-width:1.5px; border-color:#111 !important; }

/* ---------- Surfaces ---------- */
.card, .pagebar, .stat, .table-wrap, .report { border:var(--outline); }
.card, .pagebar, .stat { box-shadow:var(--sh-1); }
.card h2, .pb-title, .welcome h2 { font-weight:800; letter-spacing:-.02em; }
.stat { transition:transform .12s var(--ease), box-shadow .12s var(--ease), background .12s; }
.stat:hover { transform:translate(-2px,-2px); box-shadow:var(--sh-2); background:var(--yellow-pale); border-color:#111; }
.stat .n { color:var(--ink); font-weight:800; }
.stat .l { color:var(--ink-2); }
.bar-track { border:1.5px solid #111; background:#fff; }
.bar-fill { background:linear-gradient(90deg, var(--green), var(--gold)); }

/* ---------- Forms ---------- */
input, select, textarea { border-width:1.5px; }
input:focus, select:focus, textarea:focus { border-color:#111; }
input[type="checkbox"], input[type="radio"] { accent-color:#111; }
label { font-weight:700; }
.pb-field select { background:#fff; border-color:#111; }

.segmented { background:#fff; border:1.5px solid #111; border-radius:10px; }
.segmented button { color:var(--ink-2); }
.segmented button.active { background:var(--green); color:var(--ink); box-shadow:0 0 0 1.5px #111; }

/* ---------- Tables ---------- */
thead th { background:var(--green-050); color:var(--ink); border-bottom:var(--outline); font-weight:800; }
tbody tr:hover td { background:var(--yellow-pale); }
tr.row-sel td { background:var(--green-050); }
.pill { color:var(--ink); border:1.5px solid #111; font-weight:700; }
.pill.warn { background:#FFE9A8; color:var(--ink); }
.chip-lec { background:#fff; color:var(--ink); border:1.5px solid #111; }
.chip-course { color:var(--ink); }
.tt.view-mode th { color:var(--ink); }
.cov-tab.active { color:var(--ink); border-color:#111; }
.cov-tab.active .cov-n, .cov-tab.active .cov-n.hot { background:#111; color:var(--green); }
.menu .mtick, .pick-item .tick { color:var(--ink); }
.ex-modetog button.active { background:#111; color:var(--green); }

/* ---------- Overlays ---------- */
.modal-backdrop { background:rgba(17,17,17,.42); }
.modal { border:var(--outline); box-shadow:8px 8px 0 #111; border-radius:var(--r-lg); }
.modal .head h3 { font-weight:800; }
.modal .foot { border-top:1.5px solid #111; background:var(--yellow-pale); }
.menu { border:var(--outline) !important; box-shadow:4px 4px 0 #111 !important; }
.toast { background:#111; color:#fff; border:2px solid #111; box-shadow:4px 4px 0 var(--green); }
.toast.ok { background:var(--green); color:var(--ink); box-shadow:4px 4px 0 #111; }
.toast.err { box-shadow:4px 4px 0 #111; }
#netbar::before, #netbar::after { background:#111 !important; }
.skeleton { background:linear-gradient(90deg,#FFF3B8 25%,#FFE98A 37%,#FFF3B8 63%); background-size:400% 100%; }

@media print {
  .card, .pagebar, .stat, .modal { box-shadow:none; }
}

/* ======================================================================
   Redesign layer (web/ux.js): sidebar, dashboard, top bar, sign-in.
   ====================================================================== */
.ux-ic { flex:none; }

/* Sidebar */
.side { width:236px; padding:14px 12px 24px; }
.ux-find { position:relative; display:flex; align-items:center; margin:0 0 6px; }
.ux-find .ux-ic { position:absolute; left:11px; color:var(--ink-2); pointer-events:none; }
.ux-find input { padding:8px 34px 8px 33px; font-size:13.5px; border:1.5px solid #111; border-radius:10px; background:#fff; }
.ux-find kbd { position:absolute; right:9px; font:600 11px/1 ui-monospace,monospace; padding:3px 6px;
  border:1.5px solid #111; border-radius:5px; background:var(--yellow-pale); color:var(--ink); }
.ux-find input:focus + kbd, .ux-find input:not(:placeholder-shown) + kbd { display:none; }
.ux-sec .group { padding:14px 10px 5px; font-size:10.5px; }
.ux-sec .group:empty { display:none; }
.side button { padding:8px 10px; margin:1px 0; }
.ux-nl { display:flex; align-items:center; gap:10px; min-width:0; }
.ux-nl > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.side button .ux-ic { color:#5A5340; }
.side button.active .ux-ic { color:var(--ink); }
.side button .count:empty { display:none; }
.ux-nomatch { padding:16px 10px; font-size:13px; color:var(--ink-2); }

/* Top bar */
.ux-avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; flex:none;
  background:#fff; border:2px solid #111; font-weight:800; font-size:13px; color:var(--ink); }
.topbar .who { text-align:left; }

/* Dashboard */
.ux-hero { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin:6px 0 20px; }
.ux-eyebrow { margin:0 0 4px; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2); }
.ux-hero h1 { margin:0; font-size:34px; line-height:1.1; font-weight:800; letter-spacing:-.03em; }
.ux-lead { margin:8px 0 0; font-size:16px; color:var(--ink-2); }
.ux-hero-tools .pb-btn { padding:8px 12px; font-size:13px; }
.ux-actions { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:16px; margin-bottom:24px; }
.ux-action { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:6px; text-align:left;
  padding:18px 18px 20px; border:var(--outline); border-radius:var(--r); background:#fff; color:var(--ink);
  box-shadow:var(--sh-1); cursor:pointer; font:inherit;
  transition:transform .12s var(--ease), box-shadow .12s var(--ease), background .12s; }
.ux-action:hover { transform:translate(-2px,-2px); box-shadow:var(--sh-2); background:var(--yellow-pale); }
.ux-action:active { transform:translate(2px,2px); box-shadow:0 0 0 #111; }
.ux-action-ic { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; margin-bottom:6px;
  background:var(--green); border:2px solid #111; }
.ux-action-t { font-size:16px; font-weight:800; letter-spacing:-.01em; }
.ux-action-d { font-size:13px; line-height:1.45; color:var(--ink-2); padding-right:22px; }
.ux-action-go { position:absolute; right:16px; top:20px; opacity:.35; transition:opacity .12s, transform .12s; }
.ux-action:hover .ux-action-go { opacity:1; transform:translateX(3px); }

.ux-card-h { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.ux-card-h h2 { margin:0; }
.ux-sems { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:14px; margin-top:12px; }
.ux-sem { border:1.5px solid #111; border-radius:12px; padding:14px; background:var(--yellow-pale);
  display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.ux-sem-h { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; }
.ux-sem-n { font-size:14px; color:var(--ink-2); }

.ux-h2 { margin:26px 0 12px; font-size:18px; font-weight:800; letter-spacing:-.02em; }
.ux-recs { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:10px; margin-bottom:24px; }
.ux-rec { display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; column-gap:10px; align-items:center;
  text-align:left; padding:12px 14px; border:1.5px solid #111; border-radius:12px; background:#fff; cursor:pointer; font:inherit;
  color:var(--ink); transition:background .12s, box-shadow .12s; }
.ux-rec .ux-ic { grid-row:span 2; color:#5A5340; }
.ux-rec-n { font-size:20px; font-weight:800; line-height:1.1; letter-spacing:-.02em; }
.ux-rec-l { font-size:12.5px; color:var(--ink-2); font-weight:600; }
.ux-rec:hover { background:var(--yellow-pale); box-shadow:2px 2px 0 #111; }
.ux-two { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:20px; align-items:start; }
.ux-two .card { margin-bottom:0; }

/* Tables and toolbar */
.ux-hide { display:none !important; }
.pb-btn.icon.ux-labelled { gap:6px; }
.ux-btn-l { font-size:12.5px; }

/* Sign-in */
.ux-pass { position:relative; }
.ux-pass input { padding-right:44px; }
.ux-eye { position:absolute; right:6px; top:50%; transform:translateY(-50%); width:34px; height:30px; display:grid; place-items:center;
  border:0; border-radius:8px; background:transparent; color:var(--ink-2); cursor:pointer; }
.ux-eye:hover { background:var(--yellow-pale); color:var(--ink); }
.ux-caps { color:var(--danger); font-weight:600; }

/* Phones and narrow windows: the menu becomes a drawer. */
@media (max-width:760px) {
  .layout { flex-direction:row; }
  .side { position:fixed; top:57px; left:0; bottom:0; z-index:40; width:min(300px, 86vw); min-height:0; display:block;
    overflow-y:auto; border-right:var(--outline); border-bottom:0;
    /* The dimmed backdrop is the drawer's own shadow, so it can never paint over the drawer. */
    box-shadow:0 0 0 100vmax rgba(17,17,17,.35); }
  .side button { width:100%; }
  .layout.nav-collapsed .side { display:none; }
  .topbar { padding:10px 14px; gap:10px; }
  .topbar h1 { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .topbar .who, .topbar .mark { display:none; }
  .ux-hero h1 { font-size:27px; }
  .ux-actions { grid-template-columns:1fr; gap:12px; }
  .ux-two { grid-template-columns:1fr; }
}
@media (max-width:1100px) { .topbar .who span { display:none; } }

/* Exam timetable: step guide */
.ux-steps { background:#fff; border:var(--outline); border-radius:var(--r); box-shadow:var(--sh-1); margin:0 0 18px; overflow:hidden; }
.ux-steps-h { display:flex; align-items:center; gap:16px; padding:12px 16px; background:var(--yellow-pale); flex-wrap:wrap; }
.ux-steps:not(.closed) .ux-steps-h { border-bottom:1.5px solid #111; }
.ux-steps-hl { flex:1 1 220px; min-width:0; display:flex; flex-direction:column; gap:2px; }
.ux-steps-hl .ux-eyebrow { margin:0; font-size:11px; }
.ux-steps-now { font-size:16px; font-weight:800; letter-spacing:-.01em; }
.ux-steps-meter { display:flex; gap:5px; }
.ux-steps-meter i { width:26px; height:8px; border-radius:4px; border:1.5px solid #111; background:#fff; }
.ux-steps-meter i.done { background:#111; }
.ux-steps-meter i.warn, .ux-steps-meter i.problem { background:var(--gold); }
.ux-steps-meter i.current { background:var(--green); }
.ux-step-list { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); }
.ux-step { display:flex; gap:11px; padding:16px 16px 18px; border-right:1.5px solid var(--line); min-width:0; }
.ux-step:last-child { border-right:0; }
.ux-step.current { background:var(--green-050); box-shadow:inset 0 -4px 0 #111; }
.ux-step-n { flex:none; display:grid; place-items:center; width:28px; height:28px; border-radius:50%;
  border:2px solid #111; background:#fff; font-weight:800; font-size:13px; }
.ux-step.done .ux-step-n { background:#111; color:var(--green); }
.ux-step.current .ux-step-n { background:var(--green); }
.ux-step.warn .ux-step-n, .ux-step.problem .ux-step-n { background:var(--gold); }
.ux-step.problem .ux-step-n { background:var(--danger); color:#fff; }
.ux-step-b { min-width:0; display:flex; flex-direction:column; gap:6px; }
.ux-step-t { font-weight:800; font-size:14px; line-height:1.25; }
.ux-opt { font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-2); margin-left:2px; }
.ux-step-d { font-size:12.5px; line-height:1.45; color:var(--ink-2); }
.ux-step-d b { color:var(--ink); }
.ux-step.todo:not(.current) .ux-step-t, .ux-step.loading .ux-step-t { color:var(--ink-2); }
.ux-step-warn { margin:6px 0 0; padding-left:16px; color:#7A4E00; }
.ux-step-a { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; align-items:center; }
.ux-step-a .pb-btn { padding:6px 10px; }
.ux-step-a .btn[disabled] { opacity:.5; }
.ux-empty { display:flex; align-items:center; gap:14px; }
.ux-empty p { margin:0; font-size:14.5px; }
.ux-empty .ux-ic { color:var(--ink-2); flex:none; }
@media (max-width:1250px) {
  .ux-step-list { grid-template-columns:1fr; }
  .ux-step { border-right:0; border-bottom:1.5px solid var(--line); padding:13px 16px; }
  .ux-step:last-child { border-bottom:0; }
  .ux-step.current { box-shadow:inset 5px 0 0 #111; }
  .ux-step-b { flex-direction:row; flex-wrap:wrap; align-items:baseline; column-gap:14px; }
  .ux-step-t { flex:0 0 200px; }
  .ux-step-d { flex:1 1 260px; }
  .ux-step-a { flex:1 0 100%; margin-top:2px; }
}
@media (max-width:760px) {
  .ux-step-b { flex-direction:column; }
  .ux-step-t { flex:none; }
  .ux-steps-meter { display:none; }
}
