/* ===========================================================================
   Geelong Floorworld — Pickup Bookings
   Direction: a depot dispatch board. Signage type, concrete greys, one
   safety-amber accent reserved for "this one is yours", hazard hatching for
   anything you cannot have.
   ========================================================================= */

:root {
  --ink:        #131820;
  --ink-2:      #3a4552;
  --muted:      #6d7885;
  --paper:      #e6e9ec;
  --surface:    #ffffff;
  --line:       #d2d8de;
  --line-soft:  #e8ebee;

  --go:         #1c6b58;   /* available */
  --go-soft:    #e7f1ee;
  --hivis:      #f2c200;   /* yours — used sparingly, on purpose */
  --hivis-ink:  #6b5100;
  --stop:       #9e2b1e;
  --stop-soft:  #fbeceb;

  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r: 6px;
  --shadow: 0 1px 0 rgba(19,24,32,.04), 0 6px 20px -12px rgba(19,24,32,.35);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: .6rem 1rem; z-index: 10;
}
.skip:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Top bar -------------------------------------------------------------- */
.topbar {
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--hivis);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 62px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand-mark {
  width: 12px; height: 26px; border-radius: 2px;
  background: repeating-linear-gradient(135deg, var(--hivis) 0 4px, var(--ink) 4px 8px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--display); font-size: 1.28rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.brand-text span {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #9aa5b1;
}

.nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav a {
  color: #d7dce2; text-decoration: none; font-size: .82rem;
  letter-spacing: .09em; text-transform: uppercase; font-weight: 500;
  padding: .3rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: #fff; border-bottom-color: var(--hivis); }
.nav-user { color: #fff !important; font-weight: 600 !important; }
.nav-out { color: #8d97a3 !important; }

/* --- Headings and lede ---------------------------------------------------- */
main { padding: 2.2rem 0 3rem; }

.eyebrow {
  font-family: var(--display); font-size: .8rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 .25rem;
}
h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.02; letter-spacing: -.005em; margin: 0 0 .5rem;
}
h2 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; }

.lede { margin-bottom: 1.4rem; max-width: 46rem; }
.lede-note { color: var(--ink-2); margin: 0; }
.lede-shut { color: var(--stop); font-weight: 500; }

.crumb { margin: 0 0 1rem; font-size: .85rem; }
.fineprint { color: var(--muted); font-size: .84rem; max-width: 44rem; margin-top: 1.4rem; }

.sec-title {
  font-size: 1.05rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: .9rem;
}
.count {
  display: inline-block; background: var(--hivis); color: var(--hivis-ink);
  font-family: var(--body); font-size: .72rem; font-weight: 600;
  padding: .05rem .45rem; border-radius: 999px; vertical-align: middle; letter-spacing: 0;
}

/* --- Cards ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow);
}

.two-col { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* --- Flash ---------------------------------------------------------------- */
.flash {
  border-radius: var(--r); padding: .7rem 1rem; margin-bottom: 1rem;
  font-size: .9rem; border-left: 4px solid;
}
.flash-success { background: var(--go-soft);   border-color: var(--go);   color: #10453a; }
.flash-error   { background: var(--stop-soft); border-color: var(--stop); color: #7a2117; }
.flash-info    { background: #fdf6dc;          border-color: var(--hivis); color: var(--hivis-ink); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-block; font-family: var(--body); font-size: .82rem; font-weight: 600;
  letter-spacing: .02em; padding: .5rem .9rem; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-book { background: var(--go); border-color: var(--go); color: #fff; }
.btn-book:hover { background: #165646; border-color: #165646; }
.btn-cancel { background: transparent; border-color: #e0bdb8; color: var(--stop); }
.btn-cancel:hover { background: var(--stop-soft); border-color: var(--stop); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-block { width: 100%; padding: .7rem; font-size: .95rem; margin-top: .4rem; }

/* --- Forms ---------------------------------------------------------------- */
label {
  display: block; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-2); margin: 1rem 0 .3rem;
}
label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=time], input[type=number] {
  width: 100%; padding: .6rem .7rem; font: inherit; font-size: .95rem;
  border: 1px solid var(--line); border-radius: var(--r); background: #fbfcfd; color: var(--ink);
}
input:focus { background: #fff; border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 3px rgba(19,24,32,.08); }

.inline-form { display: flex; gap: .5rem; align-items: center; }
.inline-form input[type=date] { width: auto; }

.static-field { margin: 1.1rem 0 .4rem; font-size: .9rem; color: var(--ink-2); }
.static-field strong { display: block; color: var(--ink); }

/* --- Auth ----------------------------------------------------------------- */
.auth { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 880px) { .auth { grid-template-columns: 1.05fr .95fr; gap: 3.5rem; } }
.auth-pitch p { color: var(--ink-2); max-width: 32rem; }
.auth-card { padding: 1.6rem; }
.auth-card h2 { font-size: 1.1rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-2); }
.auth-alt { font-size: .87rem; color: var(--muted); margin: 1.1rem 0 0; }

.pitch-list { list-style: none; padding: 0; margin: 1.4rem 0 0; border-top: 1px solid var(--line); }
.pitch-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .65rem 0; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.pitch-list span {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .13em;
  font-size: .82rem; color: var(--muted); align-self: center;
}

/* --- Calendar ------------------------------------------------------------- */
.cal-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.month-name {
  font-size: 1.7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
.month-name span { color: var(--muted); font-weight: 500; }
.month-nav { display: flex; gap: .35rem; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 4px;
}
.cal-dow {
  font-family: var(--display); font-size: .74rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  text-align: center; padding: .35rem 0;
}

.cal-day {
  position: relative; display: flex; flex-direction: column; gap: .3rem;
  min-height: 92px; padding: .45rem .5rem; border-radius: 4px;
  background: #f4f6f7; color: var(--muted); text-decoration: none;
  border: 1px solid transparent;
}
.cal-day.is-outmonth { opacity: .42; }
.cal-day.is-open { background: var(--surface); color: var(--ink); border-color: var(--line); }
a.cal-day.is-open:hover { border-color: var(--go); box-shadow: 0 0 0 2px var(--go-soft); }
.cal-day.is-today { box-shadow: inset 0 3px 0 var(--ink); }
.cal-day.is-full { background: #f7f8f9; }
.cal-day.has-mine { border-color: var(--hivis); background: #fffdf3; }

.d-num {
  font-family: var(--display); font-size: 1.25rem; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.is-today .d-num::after {
  content: "Today"; display: block; font-size: .58rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-2); margin-top: .15rem;
}

/* The signature: one tick per 20-minute window, so a day's load reads at a
   glance without exposing who holds what. */
.d-meter {
  position: relative; display: flex; gap: 1px; height: 6px;
  background: var(--line); border-radius: 2px; overflow: hidden; margin-top: auto;
}
.d-meter i { flex: 1 1 0; background: #fff; }
.d-meter i.on { background: var(--go); }
.d-meter-fill { display: none; position: absolute; top: 0; bottom: 0; left: 0; background: var(--go); }

.d-note { font-size: .7rem; letter-spacing: .04em; color: var(--ink-2); }
.d-note-off {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .1em;
  font-size: .66rem; color: var(--muted); margin-top: auto;
}
.is-full .d-note { color: var(--stop); }
.d-mine {
  position: absolute; top: .4rem; right: .4rem;
  background: var(--hivis); color: var(--hivis-ink);
  font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .1rem .32rem; border-radius: 3px;
}

.legend {
  display: flex; flex-wrap: wrap; gap: 1.1rem; list-style: none;
  padding: 1rem 0 0; margin: 0; font-size: .76rem; color: var(--muted);
}
.legend li { display: flex; align-items: center; gap: .4rem; }
.key { width: 13px; height: 13px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.key-open { background: #fff; border-color: var(--go); }
.key-mine { background: #fffdf3; border-color: var(--hivis); }
.key-full { background: #f7f8f9; }
.key-off  { background: #e4e7ea; border-color: #d8dce0; }

/* --- Day run sheet -------------------------------------------------------- */
.run-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: .3rem;
}
.run-head h2 { font-size: 1.25rem; text-transform: uppercase; letter-spacing: .1em; }
.run-span {
  font-family: var(--display); font-size: .9rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums;
}

.rail { list-style: none; margin: 0; padding: 0; }
.slot {
  display: grid; grid-template-columns: 8.5rem 1fr auto;
  align-items: center; gap: .8rem;
  padding: .6rem .2rem .6rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.slot::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--line); border-radius: 2px;
}
.slot:last-child { border-bottom: 0; }

.slot-time { font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.t-start { font-family: var(--display); font-size: 1.3rem; font-weight: 600; line-height: 1.05; }
.t-end { font-size: .72rem; color: var(--muted); }

.slot-state {
  font-family: var(--display); font-size: .84rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.slot-action { justify-self: end; }

.slot-open::before { background: var(--go); }
.slot-open .slot-state { color: var(--go); }

.slot-mine { background: #fffdf3; }
.slot-mine::before { background: var(--hivis); }
.slot-mine .slot-state { color: var(--hivis-ink); }

/* Hazard hatching for anything the contractor cannot take. */
.slot-taken, .slot-passed, .slot-shut { color: var(--muted); }
.slot-taken::before, .slot-passed::before, .slot-shut::before {
  background: repeating-linear-gradient(135deg, #c9cfd6 0 3px, #eef0f2 3px 6px);
}
.slot-taken .t-start, .slot-passed .t-start, .slot-shut .t-start { color: var(--muted); font-weight: 500; }

/* --- Select and checkbox -------------------------------------------------- */
select {
  width: 100%; padding: .6rem .7rem; font: inherit; font-size: .95rem;
  border: 1px solid var(--line); border-radius: var(--r);
  background: #fbfcfd; color: var(--ink);
}
select:focus { background: #fff; border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 3px rgba(19,24,32,.08); }

label.check {
  display: flex; align-items: center; gap: .5rem;
  text-transform: none; letter-spacing: 0; font-size: .88rem;
  font-weight: 400; color: var(--ink); margin: 1rem 0 .2rem;
}
label.check input { width: auto; margin: 0; }

/* --- Extra runs / date-scoped bits ---------------------------------------- */
.pill-extra { background: var(--hivis); color: var(--hivis-ink); margin-left: .4rem; }
.check-tight { margin: 0; justify-content: flex-end; }
.check-inline { display: inline-flex; margin: 0; font-size: .82rem; }
.day-row { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin-top: .4rem; }
.is-past-row td { opacity: .55; }

/* --- Table row actions ---------------------------------------------------- */
.row-actions {
  display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; align-items: center;
}
.row-actions .btn { padding: .35rem .6rem; font-size: .76rem; }

/* --- Settings ------------------------------------------------------------- */
.runs-table td { padding: .35rem .4rem .35rem 0; vertical-align: middle; }
.runs-table input { margin: 0; }
.runs-table td:first-child { width: 40%; }
.runs-table th:last-child, .runs-table td:last-child { width: 5rem; text-align: right; }
.page-settings .card .muted { margin: .35rem 0 0; }
.page-settings label + .muted { margin-bottom: .2rem; }

@media (max-width: 560px) {
  .runs-table thead { display: none; }
  .runs-table, .runs-table tbody, .runs-table tr, .runs-table td { display: block; width: 100%; }
  .runs-table tr { padding: .5rem 0; border-bottom: 1px solid var(--line-soft); }
  .runs-table td { padding: .2rem 0; }
  .runs-table td:first-child { width: 100%; }
}

/* --- Admin toolbar -------------------------------------------------------- */
.toolbar {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  padding: .75rem .85rem; margin-bottom: 1.1rem;
  background: #f7f8f9; border: 1px solid var(--line-soft); border-radius: var(--r);
}
.toolbar-label {
  font-family: var(--display); font-size: .74rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase; color: var(--muted);
  margin-right: .15rem;
}
.toolbar-sep {
  width: 1px; height: 22px; background: var(--line); margin: 0 .4rem;
}
@media (max-width: 560px) {
  .toolbar-sep { display: none; }
  .toolbar { gap: .4rem; }
}

/* --- Lists and tables ----------------------------------------------------- */
.booking-list { list-style: none; margin: 0; padding: 0; }
.booking-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.booking-list li:last-child { border-bottom: 0; }
.bl-when { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.bl-when strong { font-family: var(--display); font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase; }
.bl-when span { font-size: .84rem; color: var(--muted); }
.bl-actions { display: flex; gap: .5rem; align-items: center; }
.booking-list.is-past { opacity: .8; }
.bl-tag {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  padding: .18rem .5rem; border-radius: 3px;
}
.tag-done { background: var(--go-soft); color: #10453a; }
.tag-cancelled { background: var(--stop-soft); color: var(--stop); }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left; font-family: var(--display); font-size: .74rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid var(--ink); padding: .4rem .6rem .4rem 0;
}
.table td { padding: .65rem .6rem .65rem 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table .right { text-align: right; }
.muted { color: var(--muted); font-size: .82rem; }
.mono { font-variant-numeric: tabular-nums; }
.pill {
  background: var(--ink); color: #fff; font-size: .6rem; letter-spacing: .1em;
  text-transform: uppercase; padding: .1rem .35rem; border-radius: 3px;
}
.empty { color: var(--muted); margin: 0; }

/* --- Footer --------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--line); padding: 1.6rem 0 2.5rem;
  color: var(--muted); font-size: .82rem;
}
.foot p { margin: .2rem 0; }

/* --- Small screens -------------------------------------------------------- */
@media (max-width: 720px) {
  .wrap { width: min(1080px, 100% - 1.6rem); }
  .brand-text strong { font-size: 1.1rem; }
  .topbar-inner { padding: .5rem 0; }
  .nav { gap: .8rem; }
  .cal-grid { gap: 3px; padding: 3px; }
  .cal-day { min-height: 66px; padding: .35rem .3rem; }
  .d-num { font-size: 1rem; }
  .is-today .d-num::after { content: none; }
  .d-note { font-size: .6rem; }
  .d-mine { font-size: .52rem; padding: .05rem .22rem; }
  .d-meter i { display: none; }
  .d-meter-fill { display: block; }
  .slot { grid-template-columns: 1fr auto; row-gap: .2rem; }
  .slot-time { grid-column: 1; }
  .slot-state { grid-column: 1; }
  .slot-action { grid-column: 2; grid-row: 1 / span 2; }
  .table { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
