/* Callboard - Phase 0 styles.
 *
 * The brand palette lives here as custom properties from the start, so that
 * when real pages arrive they ask for a token rather than pasting a hex code.
 *
 * Signal Red and Confirmed Green are defined but deliberately unused on this
 * page. Red means one thing in this app - something a worker needs to act on
 * now, like an expiring offer or a cancelled call - and it keeps that meaning
 * only by never being spent on decoration. */

:root {
  --ink: #1C1F26;
  --slate: #4A5160;
  --marquee-amber: #E8A33D;
  --signal-red: #C0392B;
  --confirmed-green: #3E7C59;

  --paper: #F7F7F5;
  --rule: #D8D8D4;

  --font: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1.25rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  /* Workers read this on a phone at 5am, so nothing is set small. */
  font-size: 1rem;
  line-height: 1.5;
}

.shell {
  max-width: 34rem;
  margin: 0 auto;
}

.wordmark {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0.25rem 0 2rem;
  color: var(--slate);
}

.panel {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #FFF;
  padding: 1.25rem;
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
}

.note {
  margin: 0 0 1rem;
  color: var(--slate);
}

.status {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 4px;
  border-left: 3px solid var(--slate);
  background: var(--paper);
}

.status-waiting { border-left-color: var(--rule); color: var(--slate); }
.status-ok      { border-left-color: var(--confirmed-green); }

/* Amber, not red. A misconfigured deploy check is a thing to go and fix, not
 * an emergency a worker is looking at - and red is spoken for. */
.status-problem { border-left-color: var(--marquee-amber); }

/* ---------------------------------------------------------------------------
 * The worker profile
 *
 * Read on a phone, often outdoors, often early. So: nothing under 16px, real
 * spacing between anything tappable, and no colour carrying meaning on its
 * own - every badge says its status in words as well.
 * ------------------------------------------------------------------------ */

.topbar {
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 1.25rem;
  margin: -2rem -1.25rem 1.5rem;
  background: #FFF;
}

.wordmark-link { text-decoration: none; color: inherit; }
.wordmark-sm { font-weight: 700; letter-spacing: -0.01em; }

h1 { font-size: 1.5rem; margin: 0 0 1.25rem; }

.panel + .panel { margin-top: 1.25rem; }

.panel h3 {
  margin: 1rem 0 0.25rem;
  font-size: 1.0625rem;
}

.hint {
  margin: 0.25rem 0 0;
  color: var(--slate);
  font-size: 0.9375rem;
}

/* Forms ------------------------------------------------------------------ */

.stack { display: flex; flex-direction: column; gap: 0.35rem; }
.stack label { font-weight: 600; font-size: 0.9375rem; margin-top: 0.6rem; }

input[type="text"], input[type="tel"], input[type="email"],
input[type="date"], select {
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #FFF;
  color: var(--ink);
  min-width: 0;
  width: 100%;
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--marquee-amber);
  outline-offset: 1px;
}

/* A read-only field should look unavailable without looking broken. */
input[readonly] {
  background: var(--paper);
  color: var(--slate);
}

.row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.9rem; }
.row-wrap { flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1 1 8rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }

.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.check input { width: auto; }

/* Buttons ---------------------------------------------------------------- */

.btn {
  font: inherit;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #FFF;
  color: var(--ink);
  cursor: pointer;
  /* Big enough to hit with a thumb in the dark. */
  min-height: 2.75rem;
}

.btn:hover { border-color: var(--slate); }

.btn-primary {
  background: var(--marquee-amber);
  border-color: var(--marquee-amber);
  color: var(--ink);
  font-weight: 600;
}

.btn-quiet { padding: 0.4rem 0.6rem; min-height: 2.25rem; color: var(--slate); }
.btn:disabled { opacity: 0.4; cursor: default; }

/* Records ---------------------------------------------------------------- */

.records { list-style: none; margin: 0.75rem 0 0; padding: 0; }

.record {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.75rem 0.85rem;
  background: var(--paper);
}
.record + .record { margin-top: 0.6rem; }

.record-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.record-title, .list-code { font-weight: 600; }
.list-code { letter-spacing: 0.02em; }
.record-line { margin: 0.35rem 0 0; }

.record-head .btn-quiet { margin-left: auto; }

.membership + .membership {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

/* Badges ----------------------------------------------------------------- */
/*
 * The word is the badge. Colour is a second signal, never the only one, so
 * these still read correctly in greyscale or to someone who cannot separate
 * amber from green.
 */

.badge {
  font-size: 0.8125rem;
  font-weight: 600;
  /* No text-transform. Statuses are already lowercase in the database, so it
   * bought nothing there, and it was mangling the badges that carry a real
   * name - "Lighting Board Operator" is not a status word. */
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: #FFF;
  color: var(--slate);
}

.badge-ok   { border-color: var(--confirmed-green); color: var(--confirmed-green); }
.badge-warn { border-color: var(--marquee-amber); color: #8A5A12; }
.badge-note { border-color: var(--slate); color: var(--slate); }

/* Banners and feedback --------------------------------------------------- */

.banner {
  border: 1px solid var(--rule);
  border-left-width: 3px;
  border-radius: 4px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 1rem;
  background: #FFF;
}

.banner p { margin: 0; }
.banner label { display: block; margin-top: 0.6rem; font-weight: 600; font-size: 0.9375rem; }
.banner input { margin-top: 0.25rem; }
.banner .btn { margin-top: 0.5rem; }

/* Amber, not red. A missing Access configuration is something to go and fix,
 * and red in this app means an offer is about to expire or a confirmed call
 * has been cancelled. Spending it here would blunt it there. */
.banner-warn { border-left-color: var(--marquee-amber); }
.banner-note { border-left-color: var(--slate); }

.said { font-size: 0.9375rem; color: var(--slate); }
.said-ok { color: var(--confirmed-green); }
.said-problem { color: #8A5A12; font-weight: 600; }

@media (max-width: 30rem) {
  .row { flex-wrap: wrap; }
  .record-head .btn-quiet { margin-left: 0; }
}

/* ---------------------------------------------------------------------------
 * The dispatcher's back office
 *
 * Read at a desk rather than on a phone, and denser than the worker side: a
 * dispatcher is scanning a list of names against the clock. Wider shell, but
 * the same components, so the two sides of the app do not drift apart.
 * ------------------------------------------------------------------------ */

.shell-wide { max-width: 52rem; }

.topbar { display: flex; align-items: center; gap: 1.25rem; }

.topnav { display: flex; gap: 1rem; margin-left: auto; }
.topnav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
}
.topnav a:hover { color: var(--ink); }

/* The page you are on, marked without relying on colour alone. */
.topnav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 2px solid var(--marquee-amber);
}

/* Inline controls inside a record - a status dropdown and its reason box -
 * should not each stretch to the full width the way stacked form fields do. */
.record .row select,
.record .row input[type="text"] { width: auto; flex: 1 1 10rem; }
.record .row select { flex: 0 1 12rem; }

.membership h3 { margin: 0; }

/* The venue's slot lines: several short fields on one row rather than a stack,
 * because a call is read across - how many, of what, when. */
.qty { width: 5rem; flex: 0 0 auto; }
.record .row input[type="number"],
.record .row input[type="datetime-local"] { width: auto; flex: 0 1 auto; }

.crew { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.crew li {
  padding: 0.3rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* The landing page's three doors. */
.doors { list-style: none; margin: 0; padding: 0; }
.doors li + li { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.doors a { display: block; font-weight: 600; color: var(--ink); }
.doors .hint { display: block; margin-top: 0.15rem; }

/* Why a slot could not be filled. Dense on purpose: a dispatcher reads the
 * whole list, and summarising it would hide the one name they need. */
.reasons { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.reasons li { color: var(--slate); font-size: 0.9375rem; }

/* ---------------------------------------------------------------------------
 * The call board
 *
 * The one screen somebody reads at five in the morning, half awake, outdoors,
 * deciding whether to get in the van. The offer is the largest thing on the
 * page and the two answers are far apart, because a mis-tap here costs
 * somebody a day's work or gets them a no-show.
 * ------------------------------------------------------------------------ */

.offer {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--marquee-amber);
  border-radius: 6px;
  background: #FFF;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.offer-lapsed { border-left-color: var(--rule); opacity: 0.65; }

/* THE ONE PLACE RED IS SPENT.
 *
 * The brand reserves Signal Red for things a worker must act on now. An offer
 * about to run out is exactly that, and it earns its weight by appearing
 * nowhere else - not on errors, not on destructive buttons, not on validation.
 * Under five minutes it turns red; before that it is ordinary text. */
.countdown {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.35rem;
  color: var(--slate);
}

.countdown-urgent { color: var(--signal-red); }
.countdown-gone { color: var(--slate); font-weight: 400; }

.offer-event { font-size: 1.375rem; margin: 0 0 0.15rem; line-height: 1.2; }
.offer-where { margin: 0; font-weight: 600; color: var(--slate); }

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.9rem;
  margin: 0.9rem 0 0;
}
.facts dt { color: var(--slate); font-size: 0.9375rem; }
.facts dd { margin: 0; font-weight: 600; }

.offer-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Both full-size and equally weighted. Declining is not a lesser action and
 * should not be a lesser button - but they are far enough apart that a thumb
 * does not find the wrong one. */
.offer-actions .btn { flex: 1; min-height: 3.25rem; font-size: 1.0625rem; font-weight: 600; }

.btn-accept {
  background: var(--confirmed-green);
  border-color: var(--confirmed-green);
  color: #FFF;
}

/* Not red. Declining is a normal, legitimate answer, and colouring it as a
 * danger would both misuse red and imply the worker is doing something wrong. */
.btn-decline { background: #FFF; border-color: var(--slate); color: var(--ink); }

#work h3 { margin: 1.1rem 0 0; font-size: 1rem; }
#work h3:first-child { margin-top: 0; }

/* The words a dispatcher reads out. Set apart so it is obviously a script to
 * be spoken rather than another label on the screen. */
.script {
  margin: 0.75rem 0;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--marquee-amber);
  background: var(--paper);
  font-size: 1.0625rem;
}
