/* KasBook crew portal.
   Same palette as the app, but this page is read one-handed, outdoors, often
   in a hurry — so everything is a size bigger than the app's equivalent and
   nothing you can tap is under 44px. Secondary text uses the app's `ink2`
   rather than its `ink3`: the muted grey reads fine on a desk and badly on a
   phone in daylight. */

:root {
  --ink: #17241D;
  --ink2: #56675D;
  --green: #1E5B3F;
  --green-d: #16462F;
  --green-p: #E8F2EC;
  --gold: #FFDB20;
  --bg: #E8ECE7;
  --surface: #FFFFFF;
  --border: #DCE6DE;
  --border-s: #E9EFEA;
  --ok: #1E7A47;
  --ok-bg: #E4F5EA;
  --wait: #7A5800;
  --wait-bg: #FFF4DE;
  --off: #C6483B;
  --off-bg: #FBEBE8;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --r: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--sans);
  padding-bottom: env(safe-area-inset-bottom);
}

/* --- top bar --------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(232, 236, 231, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.bar-mark { display: block; }

.bar-name { font-size: 15px; letter-spacing: -0.01em; }
.bar-name strong { font-weight: 700; }
.bar-name span { color: var(--ink2); font-weight: 500; }

.bar-out {
  margin-left: auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink2);
  font: 500 13px var(--sans);
  cursor: pointer;
}
.bar-out:hover { color: var(--ink); border-color: #C9D6CC; }

/* --- layout ---------------------------------------------------------- */

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.loading, .empty {
  margin: 48px 0;
  text-align: center;
  color: var(--ink2);
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  font: 600 18px/1.3 var(--serif);
  color: var(--ink);
}

/* --- sign-in --------------------------------------------------------- */

.gate {
  /* Sits a little below centre rather than at the top: on a phone this is the
     only thing on the screen, and a card pinned under the bar reads as the
     first of a list that never arrived. */
  margin: min(11vh, 86px) auto 0;
  max-width: 400px;
  padding: 32px 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(23, 36, 29, .06);
}

.gate img { display: block; margin: 0 auto 18px; }

.gate h1 {
  margin: 0 0 8px;
  font: 600 25px/1.2 var(--serif);
  letter-spacing: -0.015em;
}

.gate p { margin: 0 0 22px; color: var(--ink2); font-size: 14.5px; }

.gate .gbtn { display: flex; justify-content: center; min-height: 44px; }

.gate code {
  display: inline-block;
  margin: 2px 0 20px;
  padding: 8px 12px;
  background: var(--green-p);
  border-radius: 10px;
  color: var(--green-d);
  font: 500 14px var(--sans);
  word-break: break-all;
}

.gate .ghost {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--ink2);
  font: 500 14px var(--sans);
  cursor: pointer;
}

/* --- month headings -------------------------------------------------- */

.month {
  margin: 26px 0 10px;
  font: 600 12px var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink2);
}
.month:first-child { margin-top: 4px; }

/* --- a job ----------------------------------------------------------- */

.job {
  margin-bottom: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 1px 3px rgba(23, 36, 29, .05);
}

.job.is-mine { border-color: #BDD9C7; box-shadow: 0 1px 3px rgba(30, 122, 71, .12); }

.job-top { display: flex; gap: 13px; align-items: flex-start; }

/* The date block is the thing you look for when you open this page, so it is
   the only element allowed to be loud. */
.cal {
  flex: 0 0 auto;
  width: 54px;
  padding: 7px 0 8px;
  background: var(--green-p);
  border-radius: 12px;
  text-align: center;
}
.cal b {
  display: block;
  font: 700 24px/1 var(--serif);
  color: var(--green-d);
  font-variant-numeric: lining-nums tabular-nums;
}
.cal span {
  display: block;
  margin-top: 3px;
  font: 600 10px var(--sans);
  letter-spacing: .08em;
  color: var(--green);
}

.job-main { flex: 1; min-width: 0; }

.job-when {
  font: 600 16px var(--sans);
  letter-spacing: -0.01em;
}

.job-hours { color: var(--ink2); font-weight: 500; }

.job-where {
  margin-top: 4px;
  color: var(--ink2);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.job-where.none { font-style: italic; }

.note {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 11px;
  background: var(--wait-bg);
  border-radius: 10px;
  color: #5E4400;
  font-size: 13.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.note svg { flex: 0 0 auto; margin-top: 1px; }

.roster {
  margin-top: 9px;
  font-size: 13px;
  color: var(--ink2);
}
.roster b { color: var(--ok); font-weight: 600; }

/* --- the one thing a worker can do ----------------------------------- */

.act {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 14.5px var(--sans);
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}

.act-go { background: var(--green); color: #fff; }
.act-go:hover { background: var(--green-d); }

.act-wait { background: var(--wait-bg); border-color: #F0DFB8; color: var(--wait); }
.act-wait:hover { border-color: #E2CC97; }

.act-on {
  background: var(--ok-bg);
  border-color: #BFE3CC;
  color: var(--ok);
  cursor: default;
}

.act-no {
  background: var(--off-bg);
  border-color: #F2D6D1;
  color: var(--off);
}

.act[disabled] { opacity: .55; cursor: default; }

.act:focus-visible,
.bar-out:focus-visible,
.gate .ghost:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.sub {
  margin: 7px 2px 0;
  font-size: 12.5px;
  color: var(--ink2);
  text-align: center;
}

/* --- a problem worth reading ----------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  font: 500 13.5px var(--sans);
  box-shadow: 0 6px 20px rgba(23, 36, 29, .28);
}
