/* ---------------------------------------------------------------------------
   Refinery Mission Transportation — the one theme and tokens file.
   §1: the brand colours live here and nowhere else. Every other stylesheet
   and template reads these variables, so changing a brand colour is one edit.
   The logo is NOT restyled, recoloured, cropped or re-exported anywhere in
   this app (§11). It is served as the original 1400x401 JPEG and only ever
   scaled by width.
--------------------------------------------------------------------------- */
:root {
  --refinery-orange: #F04925;
  --refinery-grey:   #55565A;
  --refinery-white:  #FFFFFF;

  --ink:        var(--refinery-grey);
  --ink-strong: #2F3033;
  --page:       #F4F4F5;
  --card:       var(--refinery-white);
  --rule:       #DCDCDE;
  --accent:     var(--refinery-orange);

  /* Status colours. Deliberately not red/green only: "Needs Scheduling" is a
     normal state on day one, not an error (§3). */
  --needs:      #8A5A00;
  --needs-bg:   #FFF4DD;
  --warn:       #8C2B13;
  --warn-bg:    #FDE8E3;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  -webkit-text-size-adjust: 100%;   /* iOS Safari: Neel tests on an iPhone */
}

/* §A5.1 build-state banner. On every page until the lane closes. */
.buildstate {
  background: var(--refinery-grey);
  color: var(--refinery-white);
  font-size: 13px;
  line-height: 1.4;
  padding: 7px 14px;
  text-align: center;
}
.buildstate b { color: #FFD9CF; font-weight: 600; }

header.site {
  background: var(--card);
  border-bottom: 3px solid var(--accent);
  padding: 14px;
}
header.site .logo { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }

nav.site { background: var(--card); border-bottom: 1px solid var(--rule); padding: 0 8px; }
nav.site ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
nav.site a {
  display: block; padding: 11px 13px; color: var(--ink);
  text-decoration: none; font-size: 15px; border-bottom: 3px solid transparent;
}
nav.site a[aria-current="page"] { color: var(--ink-strong); font-weight: 600; border-bottom-color: var(--accent); }
nav.site a:hover { background: var(--page); }

main { max-width: 1100px; margin: 0 auto; padding: 18px 14px 60px; }
h1 { font-size: 22px; color: var(--ink-strong); margin: 0 0 4px; }
h2 { font-size: 17px; color: var(--ink-strong); margin: 26px 0 8px; }
p.lede { margin: 0 0 18px; font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }

/* The honest empty state (§3). Day one, every trip is unscheduled; the empty
   state has to say so and link to the fix, not look like a failure. */
.empty { background: var(--needs-bg); border: 1px solid #E8CF9B; border-radius: var(--radius); padding: 18px; color: var(--needs); }
.empty h3 { margin: 0 0 8px; font-size: 16px; }
.empty p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.empty a { color: var(--warn); font-weight: 600; }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
table.grid th, table.grid td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; }
table.grid thead th { background: var(--page); color: var(--ink-strong); font-weight: 600; }

/* PIN gate */
.gate { min-height: 100vh; display: flex; flex-direction: column; }
.gate .gatebody { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 34px 14px; }
.gate form { width: 100%; max-width: 360px; }
.gate img.logo { display: block; width: 100%; height: auto; margin: 0 auto 26px; }
label { display: block; font-size: 14px; margin-bottom: 7px; color: var(--ink-strong); font-weight: 600; }
input[type="password"], input[type="text"] {
  width: 100%; font-size: 20px; padding: 13px; border: 1px solid var(--rule);
  border-radius: var(--radius); font-family: var(--font); letter-spacing: .25em;
}
button.primary {
  width: 100%; margin-top: 14px; font-size: 17px; padding: 14px;
  background: var(--accent); color: var(--refinery-white);
  border: 0; border-radius: var(--radius); font-weight: 600; cursor: pointer;
}
button.primary[disabled] { opacity: .6; cursor: default; }
.msg { margin-top: 14px; font-size: 14px; padding: 11px 13px; border-radius: var(--radius); display: none; }
.msg.show { display: block; }
.msg.err { background: var(--warn-bg); color: var(--warn); border: 1px solid #F0C4B8; }
footer.site { color: #87888C; font-size: 12px; text-align: center; padding: 18px 14px 34px; }

/* ---------------------------------------------------------------------------
   Roster screen (Amendment 9).
--------------------------------------------------------------------------- */
h2 .count {
  display: inline-block; margin-left: 8px; font-size: 13px; font-weight: 600;
  background: var(--page); border: 1px solid var(--rule); border-radius: 999px;
  padding: 1px 9px; color: var(--ink-strong); vertical-align: middle;
}
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

.notice { margin: 0 0 16px; font-size: 14px; line-height: 1.5; padding: 11px 13px;
          border-radius: var(--radius); }
.notice.ok  { background: var(--card); border: 1px solid var(--rule); color: var(--ink-strong); }
.notice.bad { background: var(--warn-bg); border: 1px solid #F0C4B8; color: var(--warn); }

.addrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
          margin: 0 0 22px; }
.addrow label { flex: 0 0 100%; margin-bottom: 0; }
/* The gate's input rule sets letter-spacing: .25em so a four-digit PIN reads
   clearly. A name is not a PIN. Overridden here rather than by narrowing the
   gate's selector, so nothing about the login screen changes. */
.addrow input[type="text"] { flex: 1 1 220px; width: auto; font-size: 17px;
                             letter-spacing: normal; padding: 11px 12px; }
.addrow button, form.inline button {
  font-size: 16px; padding: 11px 18px; background: var(--accent);
  color: var(--refinery-white); border: 0; border-radius: var(--radius);
  font-weight: 600; cursor: pointer;
}
form.inline { display: inline-block; margin: 6px 0; }
form.inline button.danger { background: var(--warn); }
a.btn-link { color: var(--warn); font-weight: 600; text-decoration: none; }
a.btn-link:hover { text-decoration: underline; }
