/* Admin page extras. */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; color: var(--muted); border-radius: 8px 8px 0 0; padding: 10px 12px; flex: none; }
.tabs button[aria-selected="true"] { color: var(--green); box-shadow: inset 0 -3px 0 var(--green); }
.tabs button:hover { background: var(--accent-soft); color: var(--green); }
.badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; margin-left: 4px; }
.day-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.day-head input[type="date"] { width: auto; }
.day-ticks { display: flex; gap: 16px; margin-left: auto; }
.day-ticks .check { margin: 0; }
.bay-tabs { display: none; }
.bay-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) {
  .bay-grid { grid-template-columns: 1fr; }
  .bay-tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
  .bay-tabs button { flex: 1; min-height: 44px; background: #fff; color: var(--green); border: 1px solid var(--green); border-radius: 8px; }
  .bay-tabs button[aria-selected="true"] { background: var(--green); color: #fff; }
  .bay-tabs .count { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; line-height: 20px; background: var(--accent-soft); color: var(--green); }
  .bay-col.bay-off { display: none; }
  .bay-col h3 { display: none; }
  .day-ticks { margin-left: 0; width: 100%; }
}
.bay-col h3 { margin: 0 0 8px; font-size: 16px; color: var(--green); }
.bk { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-weight: 400; }
.bk:hover { background: var(--accent-soft); }
.bk.block { border-left-color: #8a8f8b; background: #f1f3f2; }
.bk.awaiting_payment, .bk.held { border-left-color: #c58a00; }
.bk.cancelled, .bk.expired { border-left-color: var(--danger); opacity: 0.7; }
.bk .when { font-weight: 700; }
.bk .who { font-weight: 600; }
.bk .meta { font-size: 13px; color: var(--muted); }
.empty-col { color: var(--muted); font-size: 14px; padding: 8px 0; }
dialog { width: min(640px, calc(100vw - 32px)); border: 0; border-radius: var(--radius); padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
dialog::backdrop { background: rgba(23, 58, 37, 0.35); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; }
.dialog-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.history { font-size: 13px; color: var(--muted); padding-left: 18px; margin: 4px 0; }
.cust-results button { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; margin-top: 4px; font-weight: 400; padding: 8px 10px; }
.cust-results button:hover { background: var(--accent-soft); }
table.jobs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.jobs td, table.jobs th { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* Door tab */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #e3ece5; color: #214d32; }
.pill.bad { background: #fbe3e1; color: #9b1c12; }
.pill.wait { background: #fff3d6; color: #7a5300; }
.pill.off { background: #eceeed; color: #55665a; }
.lock-status { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 4px 0 8px; }
.pin { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: 1px; }
.table-wrap { overflow-x: auto; }
table.codes { width: 100%; border-collapse: collapse; font-size: 14px; }
table.codes th, table.codes td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e3ece5; vertical-align: top; }
table.codes tr.clickable { cursor: pointer; }
table.codes tr.clickable:hover { background: #f4f7f5; }
.credits li > .pill { align-self: flex-start; white-space: nowrap; }

/* Staff logins see bookings only (the server enforces it too). */
body.staff .owner-only { display: none !important; }

/* New booking: free bay grid */
.slot-grid-wrap { margin-top: 8px; }
table.slot-grid { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
table.slot-grid th { font-size: 14px; text-align: center; color: var(--muted); font-weight: 600; }
table.slot-grid tbody th { text-align: left; color: var(--ink); white-space: nowrap; width: 76px; }
table.slot-grid .night-tag { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.slot { display: block; width: 100%; min-height: 44px; padding: 8px 4px; border-radius: 8px; font-size: 14px; text-align: center; }
button.slot { background: var(--accent-soft); color: var(--green); border: 1px solid var(--green); font-weight: 600; }
button.slot:hover, button.slot:focus-visible { background: var(--green); color: #fff; }
.slot.taken { background: #eceeed; color: #8a968e; border: 1px solid transparent; line-height: 28px; }
.notice.chosen { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Phones (and the home-screen app) */
@media (max-width: 600px) {
  main { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .row > * { flex-basis: 100%; }
  .tabs { position: sticky; top: 0; z-index: 5; background: var(--bg, #f4f7f5); }
  table.slot-grid { border-spacing: 4px; }
  table.slot-grid tbody th { width: 62px; font-size: 13px; }
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; padding-top: 0; }
  /* Keep Close in reach: the header sits below the phone's status bar and stays put while scrolling,
     and there's a second Close at the bottom. */
  .dialog-head { position: sticky; top: 0; z-index: 2; background: #fff; margin: 0 -18px 8px; padding: calc(12px + env(safe-area-inset-top)) 18px 10px; border-bottom: 1px solid var(--line); }
  .dialog-head h2 { font-size: 18px; }
  .dialog-head button, .dialog-foot button { min-height: 44px; min-width: 88px; }
  .dialog-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
  body { padding-bottom: env(safe-area-inset-bottom); }
}
