/* La Belle Forme diary viewer.
   Tokens mirror the LBF tenant's Surgerly palette (organisation_settings
   PALETTE_*): teal primary, gold CTA (Surgerly's default, unset on the
   tenant), bright-blue secondary, cool light grey. Roboto is the website's
   typeface; system fallback, no web-font download. */
:root {
  --lbf-primary: #1c3a46;
  --lbf-primary-dark: #1c3a46;
  --lbf-black: #000000;
  --lbf-white: #ffffff;
  --lbf-secondary: #009cff;
  --lbf-light-gray: #e8f0f3;
  --lbf-dark-gray: #8a8e91;
  --lbf-cta: #be9b5a;
  --lbf-warning: #b4823b;
  --lbf-text: #090c0e;
  --lbf-border: #d9e1e6;
  --lbf-grid-line: #c9d3da;
  --lbf-bg: #f4f7f9;
  --lbf-panel: #ffffff;
  --lbf-danger: #dc3545;
  --lbf-booked: #1c3a46;
  --lbf-booked-text: #ffffff;
  --lbf-empty: #e3e8ec;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.4 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--lbf-text);
  background: var(--lbf-bg);
}
body.calendar-page { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body.calendar-page > header.top, body.calendar-page > .cal-toolbar { flex: 0 0 auto; }

/* ── Header ────────────────────────────────────────────────────────────── */
header.top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--lbf-primary); color: #fff;
  border-bottom: 3px solid var(--lbf-cta);
}
header.top .logo { height: 34px; width: auto; margin-right: auto; }
form.logout { margin: 0; }

.btn {
  font: inherit; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff;
}
.btn:hover { background: rgba(255,255,255,.16); }
.btn-ghost { background: transparent; }
.btn-primary { background: var(--lbf-cta); border-color: var(--lbf-cta); color: var(--lbf-black); font-weight: 500; }
.btn-primary:hover { background: #a98849; }
/* ── Toolbar (white strip, as Surgerly's calendar) ─────────────────────── */
.cal-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 6px 12px; background: var(--lbf-panel); border-bottom: 1px solid var(--lbf-border);
  position: relative; z-index: 20; min-height: 45px;
}
.tb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font: inherit; font-size: 13px; height: 31px; padding: 0 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--lbf-border); background: #fff; color: var(--lbf-dark-gray); white-space: nowrap;
}
.tb-btn:hover { color: var(--lbf-primary); border-color: var(--lbf-primary); background: color-mix(in srgb, var(--lbf-primary) 8%, #fff); }
.tb-btn.active { color: var(--lbf-primary); border-color: var(--lbf-primary); background: color-mix(in srgb, var(--lbf-primary) 14%, #fff); font-weight: 500; }
.tb-icon { font-size: 12px; line-height: 1; }
.tb-count { font-size: 11px; color: var(--lbf-dark-gray); background: var(--lbf-light-gray); border-radius: 10px; padding: 1px 6px; }
.tb-btn.active .tb-count { background: #fff; color: var(--lbf-primary); }
.date-wrap { position: relative; }
.date-group { display: inline-flex; }
.date-group .tb-btn { border-radius: 0; }
.date-group .tb-btn:first-child { border-radius: 6px 0 0 6px; }
.date-group .tb-btn:last-child { border-radius: 0 6px 6px 0; }
.date-group .tb-btn + .tb-btn { margin-left: -1px; }
.date-nav { width: 32px; padding: 0; font-size: 18px; line-height: 1; }
.date-label { min-width: 190px; color: var(--lbf-text); font-weight: 500; }
.date-label[aria-expanded="true"] { color: var(--lbf-primary); border-color: var(--lbf-primary); position: relative; z-index: 1; }
.date-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; width: 268px;
  background: #fff; border: 1px solid var(--lbf-border); border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.12); padding: 10px;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.picker-nav { width: 28px; height: 28px; padding: 0; font-size: 16px; }
.picker-month { font-weight: 600; font-size: 13px; color: var(--lbf-text); }
.picker-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 3px; }
.picker-dow > span { text-align: center; font-size: 11px; font-weight: 700; color: var(--lbf-dark-gray); }
.picker-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.picker-cell {
  font: inherit; font-size: 13px; text-align: center; padding: 4px 0; line-height: 1.6;
  border: 0; background: none; border-radius: 4px; cursor: pointer; color: var(--lbf-text);
}
.picker-cell:hover:not(.empty) { background: var(--lbf-light-gray); }
.picker-cell.empty { cursor: default; }
.picker-cell.today { font-weight: 700; color: var(--lbf-cta); }
.picker-cell.in-range { background: color-mix(in srgb, var(--lbf-primary) 14%, #fff); border-radius: 0; }
.picker-cell.range-start { border-radius: 4px 0 0 4px; }
.picker-cell.range-end { border-radius: 0 4px 4px 0; }
.picker-cell.range-start.range-end { border-radius: 4px; }
.picker-cell.range-start, .picker-cell.range-end { background: var(--lbf-primary); color: #fff; }
.picker-presets { display: flex; gap: 12px; justify-content: center; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--lbf-border); }
.views { display: inline-flex; margin-left: auto; }
.views .tb-btn { border-radius: 0; }
.views .tb-btn + .tb-btn { margin-left: -1px; }
.views .tb-btn:first-child { border-radius: 6px 0 0 6px; }
.views .tb-btn:last-child { border-radius: 0 6px 6px 0; }
.views .tb-btn.active { position: relative; z-index: 1; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.layout { display: flex; flex: 1 1 auto; min-height: 0; }
.filters {
  width: 280px; flex: 0 0 280px; overflow-y: auto; overflow-x: hidden; background: var(--lbf-panel);
  border-right: 1px solid var(--lbf-border); padding: 12px 14px; display: none;
  flex-direction: column;
}
body.filters-open .filters { display: flex; }
.cal-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding: 12px 16px 6px; position: relative; }
#calendar { flex: 1 1 auto; min-height: 0; background: var(--lbf-panel); border: 1px solid var(--lbf-border); border-radius: 8px; overflow: hidden; }
.chip-layer { position: absolute; overflow: hidden; pointer-events: none; z-index: 5; }
.scroll-chip {
  position: absolute; transform: translateX(-50%); pointer-events: auto; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 12px;
  background: var(--lbf-primary); color: #fff; border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 3px 10px rgba(0,0,0,.25); white-space: nowrap; opacity: .92;
}
.scroll-chip:hover { opacity: 1; background: var(--lbf-cta); color: var(--lbf-black); }
.scroll-chip.up { top: 6px; }
.scroll-chip.down { bottom: 6px; }
.meta { color: var(--lbf-dark-gray); font-size: 12px; margin: 6px 0 0; }
.notice { color: var(--lbf-dark-gray); background: var(--lbf-panel); border: 1px solid var(--lbf-border); padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; }
body.loading #calendar { opacity: .6; transition: opacity .15s; }

/* ── Filter panel ──────────────────────────────────────────────────────── */
.filter-group { padding: 10px 0; border-bottom: 1px solid var(--lbf-border); }
.filter-group:last-child { border-bottom: 0; }
.filter-group h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--lbf-primary); margin: 0 0 6px; font-weight: 600; }
.filter-group h2 .count { color: var(--lbf-dark-gray); font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 4px; }
.filters input[type=search] { font: inherit; padding: 5px 8px; border: 1px solid var(--lbf-border); border-radius: 6px; background: #fff; width: 100%; }
.quick { display: flex; gap: 10px; margin: 6px 0 4px; }
.link { background: none; border: 0; padding: 0; color: var(--lbf-secondary); cursor: pointer; font: inherit; font-size: 12px; }
.link:hover { text-decoration: underline; }
.checks { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.check { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.check:hover { background: var(--lbf-light-gray); }
.check.off span { color: var(--lbf-dark-gray); }
.check input { accent-color: var(--lbf-primary); margin: 0; }
.hint { color: var(--lbf-dark-gray); font-size: 12px; margin: 6px 0 0; }

/* ── Availability finder ───────────────────────────────────────────────── */
.finder-form { display: flex; flex-direction: column; gap: 8px; }
.finder-form label { display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--lbf-dark-gray); }
.finder-form select, .finder-form input { display: block; width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--lbf-border); border-radius: 6px; background: #fff; color: var(--lbf-text); margin-top: 3px; }
.finder-form input:focus, .finder-form select:focus { outline: 2px solid var(--lbf-secondary); outline-offset: 1px; border-color: var(--lbf-secondary); }
.finder-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.finder-form input[type=date] { min-width: 0; }
.finder-go { font: inherit; font-size: 13px; font-weight: 500; padding: 8px; border-radius: 6px; cursor: pointer; background: var(--lbf-primary); color: #fff; border: 1px solid var(--lbf-primary); }
.finder-go:hover { background: #24505f; }
.finder-results { margin-top: 10px; font-size: 12px; }
.finder-summary { margin: 0 0 6px; color: var(--lbf-text); }
.finder-day { padding: 5px 0; border-top: 1px dotted var(--lbf-border); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.finder-date { font-weight: 600; color: var(--lbf-primary); font-size: 12px; min-width: 64px; text-align: left; }
.finder-slot { background: rgba(52,160,96,.22); color: #1f5c38; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.finder-slot small { color: #4a7a5c; }
.finder-next { border-top: 1px solid var(--lbf-border); margin-top: 4px; padding-top: 8px; }
.finder-next-label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--lbf-cta); font-weight: 600; width: 100%; }
.finder-none { margin: 6px 0 0; color: var(--lbf-danger); }

/* ── FullCalendar skin ─────────────────────────────────────────────────── */
/* Free time is white with clear lines; booked time is a solid block. */
.fc { --fc-border-color: var(--lbf-border); --fc-today-bg-color: transparent; --fc-page-bg-color: #fff; --fc-neutral-bg-color: var(--lbf-light-gray); --fc-event-text-color: var(--lbf-booked-text); --fc-event-bg-color: var(--lbf-booked); --fc-event-border-color: var(--lbf-booked); }
.fc .fc-col-header-cell { background: var(--lbf-light-gray); }
.fc .fc-col-header-cell-cushion { padding: 5px 4px; color: var(--lbf-primary); font-weight: 600; text-decoration: none; }
/* Our date row (see paintDayRow in diary.js). */
.fc .lbf-day-row th.lbf-day { background: var(--lbf-primary); color: #fff; text-align: center; padding: 0; border-color: rgba(255,255,255,.25); }
.fc .lbf-day-row th.lbf-day span { display: inline-block; padding: 5px 12px; font-weight: 500; letter-spacing: .04em; font-size: 12px; will-change: transform; }
.fc .lbf-day-row th.lbf-day.is-today { background: var(--lbf-cta); color: var(--lbf-black); }
.fc .fc-timegrid-slot-label-cushion { font-size: 11px; color: var(--lbf-dark-gray); }
.fc .fc-timegrid-slot { height: 1.5em; }
.fc .fc-timegrid-slot.fc-timegrid-slot-lane { border-top-color: #a9b8c1; }
.fc .fc-timegrid-slot-minor { border-top-style: dotted; border-top-color: #b6c3cb; }
.fc .fc-timegrid-col.fc-resource { background: #fff; }
/* Unavailable time (outside the rota) is hatched, like a day with no
   bookings, so nothing flat and grey can be mistaken for a booking. The
   rostered band is a transparent tint so the 15-minute lines show through. */
.fc .fc-non-business { background: repeating-linear-gradient(135deg, #dfe4e8 0 7px, #f4f6f8 7px 14px); }
.fc .fc-bg-event.rostered { background: rgba(52, 160, 96, .30); opacity: 1; }
.res-free { font-size: 11px; color: #22703f; font-weight: 600; margin-top: 2px; white-space: normal; }
.res-free.muted { color: var(--lbf-dark-gray); font-weight: 400; font-style: italic; }
.res-label { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.res-name { font-weight: 600; font-size: 12px; color: var(--lbf-text); white-space: normal; }
.res-job { font-weight: 400; font-size: 10px; color: var(--lbf-dark-gray); white-space: normal; }
.res-empty { color: var(--lbf-dark-gray); font-weight: 400; font-size: 11px; font-style: italic; }
.res-summary { font-size: 10px; color: var(--lbf-dark-gray); margin-top: 1px; }
.fc .fc-timegrid-body { position: relative; }
.now-line { position: absolute; height: 0; border-top: 2px solid var(--lbf-cta); z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--lbf-cta); }
.tb-btn.ok { color: #0f5132; border-color: #a7dcbd; background: #d7efe1; }
.fc .fc-timegrid-event {
  background: var(--lbf-booked); border: 1px solid var(--lbf-primary-dark); border-left: 3px solid #4f9a6b; border-radius: 3px;
  box-shadow: none; color: var(--lbf-booked-text);
  --kind: var(--lbf-booked);
}
.fc .fc-timegrid-event { overflow: hidden; }
.fc .fc-timegrid-event .fc-event-main { padding: 2px 5px; color: var(--lbf-booked-text); overflow: hidden; }
/* A booking shorter than about two slots shows its time only. */
.fc .fc-timegrid-event-short .ev-type, .fc .fc-timegrid-event-short .ev-meta { display: none; }
.fc .fc-timegrid-event-short .fc-event-main { padding-top: 0; padding-bottom: 0; }
:root { --kind-operating: #1c3a46; --kind-clinic: #0b6fa8; --kind-other: #5b6670; --kind-note: #8a8e91; }
.fc .fc-timegrid-event.kind-note { background: rgba(255,255,255,.85); border: 1px dashed var(--kind-note); border-left: 3px solid var(--kind-note); color: var(--lbf-text); }
.fc .fc-timegrid-event.kind-note .fc-event-main { color: var(--lbf-text); }
.fc .fc-timegrid-event.kind-note .ev-type { color: var(--lbf-dark-gray); font-style: italic; }
.kind-dot.kind-note { background: #fff; border: 1px dashed var(--kind-note); }
.fc .fc-timegrid-event.kind-operating { background: var(--kind-operating); border-color: var(--kind-operating); }
.fc .fc-timegrid-event.kind-clinic { background: var(--kind-clinic); border-color: var(--kind-clinic); }
.fc .fc-timegrid-event.kind-other { background: var(--kind-other); border-color: var(--kind-other); }
.kind-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; background: var(--kind-other); }
.kind-dot.kind-operating { background: var(--kind-operating); }
.kind-dot.kind-clinic { background: var(--kind-clinic); }
.tip-kind { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 10px; font-size: 10px; font-weight: 500; vertical-align: 1px; background: rgba(255,255,255,.18); }
.ev { font-size: 11px; line-height: 1.25; overflow: hidden; max-height: 100%; }
/* Status: a green pip for a live booking, red for a cancelled one, and a
   cancelled block goes pale red so it cannot be read as busy time. */
:root { --state-booked: #2bb673; --state-cancelled: #c62828; }
.state-pip { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; background: var(--state-booked); box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.state-pip.state-cancelled { background: var(--state-cancelled); }
.fc .fc-timegrid-event.state-cancelled { background: #fdecec; border: 1px solid #e7a4a4; border-left: 3px solid var(--state-cancelled); }
.fc .fc-timegrid-event.state-cancelled .fc-event-main { color: #7a1f1f; }
.fc .fc-timegrid-event.state-cancelled .ev-type, .fc .fc-timegrid-event.state-cancelled .ev-meta { text-decoration: line-through; opacity: .8; }
.ev-state { font-weight: 700; color: var(--state-cancelled); text-transform: uppercase; font-size: 9px; letter-spacing: .04em; }
.kind-dot.state-cancelled { background: #fdecec; border: 1px solid var(--state-cancelled); }
.state-checks { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--lbf-light-gray); }
.tip-status { font-weight: 600; }
.tip-status.state-booked { color: #1b7d4a; }
.tip-status.state-cancelled { color: var(--state-cancelled); }
.ev-time { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-type { opacity: .95; }
.ev-meta { opacity: .75; font-size: 10px; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--lbf-border); }
.fc .fc-scrollgrid { border-radius: 8px; }

/* ── Booking card ──────────────────────────────────────────────────────── */
.tip {
  position: fixed; z-index: 50; width: 320px; max-width: calc(100vw - 16px);
  background: var(--lbf-panel); color: var(--lbf-text); border: 1px solid var(--lbf-border);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 13px; overflow: hidden;
}
.tip.pinned { border-color: var(--lbf-cta); box-shadow: 0 0 0 2px rgba(190,155,90,.35), 0 10px 30px rgba(0,0,0,.18); }
.tip-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--lbf-primary); color: #fff; }
.tip-title { font-weight: 600; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.tip-close { background: none; border: 0; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: .8; }
.tip-close:hover { opacity: 1; }
.tip-body { margin: 0; padding: 8px 10px 4px; }
.tip-body > div { display: grid; grid-template-columns: 88px 1fr; gap: 6px; padding: 3px 0; align-items: baseline; }
.tip-body dt { color: var(--lbf-dark-gray); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.tip-body dd { margin: 0; display: flex; align-items: flex-start; gap: 8px; }
.tip-body dd > span { flex: 1 1 auto; min-width: 0; }
.tip-body dd > .tip-copy { flex: 0 0 auto; margin-top: 1px; }
.tip-copy { white-space: nowrap; }
.tip-body code { font-family: ui-monospace, Consolas, monospace; background: var(--lbf-light-gray); padding: 1px 5px; border-radius: 4px; }
.tip-copy {
  font: inherit; font-size: 11px; padding: 2px 8px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--lbf-border); background: var(--lbf-light-gray); color: var(--lbf-primary);
}
.tip-copy:hover { background: #dbe6eb; }
.tip-copy.ok { background: #d7efe1; border-color: #a7dcbd; color: #0f5132; }
.tip-head .tip-copy { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; }
.tip-head .tip-copy:hover { background: rgba(255,255,255,.22); }
.tip-head .tip-copy.ok { background: var(--lbf-cta); border-color: var(--lbf-cta); color: var(--lbf-black); }
.tip-hint { margin: 0; padding: 4px 10px 8px; color: var(--lbf-dark-gray); font-size: 11px; }
.fc .fc-timegrid-event { cursor: pointer; }

/* ── Login ─────────────────────────────────────────────────────────────── */
body.login-page { background: radial-gradient(120% 90% at 50% 0%, #27505f 0%, var(--lbf-primary) 55%, #142b34 100%); min-height: 100%; }
.login-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; gap: 30px; }
.login-logo { width: min(300px, 78vw); height: auto; filter: drop-shadow(0 4px 14px rgba(0,0,0,.25)); }
.login-card {
  width: min(400px, 100%); background: var(--lbf-panel); border-radius: 14px; padding: 30px 32px 26px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06);
  position: relative; overflow: hidden;
}
.login-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--lbf-cta), #d8bc86); }
.login-kicker { margin: 0 0 2px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--lbf-cta); font-weight: 600; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; font-weight: 500; color: var(--lbf-primary); letter-spacing: -.01em; }
.login-sub { margin: 0 0 18px; color: var(--lbf-dark-gray); line-height: 1.5; }
.login-card label { display: block; margin: 0 0 6px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--lbf-dark-gray); text-align: left; }
.login-card input {
  display: block; width: 100%; font: inherit; font-size: 15px; padding: 11px 13px; margin: 0 0 14px; text-align: left;
  border: 1px solid var(--lbf-border); border-radius: 8px; color: var(--lbf-text); background: #fbfcfd;
  transition: border-color .12s, box-shadow .12s;
}
.login-card input::placeholder { color: #b7c0c7; }
.login-card input:focus { outline: none; border-color: var(--lbf-primary); box-shadow: 0 0 0 3px rgba(28,58,70,.14); background: #fff; }
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 15px; border-radius: 8px; box-shadow: 0 6px 16px rgba(190,155,90,.35); transition: transform .08s, box-shadow .12s; }
.login-card .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(190,155,90,.45); }
.login-card .btn-primary:active { transform: translateY(0); }
.otp { display: flex; gap: 8px; justify-content: center; margin: 4px 0 16px; }
.login-card .otp-box {
  flex: 1 1 0; min-width: 0; max-width: 52px; height: 56px; margin: 0; padding: 0; text-align: center;
  font-size: 1.5rem; font-weight: 600; color: var(--lbf-text); border: 1.5px solid var(--lbf-border); border-radius: 12px; background: #fff;
}
.login-card .otp-box:focus { border-color: var(--lbf-primary); box-shadow: 0 0 0 3px rgba(28,58,70,.14); }
.login-card form { text-align: left; }
.login-hint { margin: 14px 0 0; font-size: 12px; color: var(--lbf-dark-gray); line-height: 1.5; }
.login-hint a { color: var(--lbf-secondary); }
.login-card .notice { margin: 0 0 12px; }
.error { color: var(--lbf-danger); background: #fde7e9; border: 1px solid #f5c2c7; padding: 8px 12px; border-radius: 8px; margin: 0 0 14px; font-size: 13px; }

@media (max-width: 900px) {
  header.top { padding: 6px 12px; gap: 10px; }
  header.top .logo { height: 28px; }
  header.top .btn { padding: 5px 10px; font-size: 13px; }
  /* One row: ☰, the date with its arrows, ⋯. Everything else is in the menu. */
  .cal-toolbar { padding: 6px 8px; gap: 6px; flex-wrap: nowrap; }
  .cal-toolbar .tb-label, #btnFilters .tb-count, #btnToday, #btnSummary, .views { display: none; }
  .tb-btn { padding: 0 9px; }
  .date-wrap { flex: 1 1 auto; min-width: 0; }
  .date-group { display: flex; width: 100%; }
  .date-label { flex: 1 1 auto; min-width: 0; font-size: 13px; padding: 0 6px; }
  .date-label span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .date-dropdown { left: 0; right: 0; width: auto; max-width: 320px; }
  .cal-toolbar .more-wrap { display: block; }

  /* The panel becomes a drawer over the grid, closed by default on phones. */
  .filters {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 88vw); z-index: 40;
    border-right: 0; box-shadow: 0 0 40px rgba(0,0,0,.35); padding-top: 14px;
    transform: translateX(-105%); transition: transform .18s ease-out; display: flex; overflow-y: auto;
  }
  body.filters-open .filters { transform: translateX(0); }
  .drawer-backdrop { position: fixed; inset: 0; background: rgba(20,43,52,.45); z-index: 39; display: none; }
  body.filters-open .drawer-backdrop { display: block; }
  .filters .drawer-close { display: flex; }

  .cal-main { padding: 8px 8px 4px; }
  #calendar { border-radius: 6px; }
  .meta { font-size: 11px; }
  .fc .fc-timegrid-slot { height: 1.35em; }
  .fc .fc-timegrid-slot-label-cushion { font-size: 10px; }
  .res-name { font-size: 11px; }
  .res-free { font-size: 10px; }
  .now-line::before { display: none; }

  /* Booking card as a bottom sheet. */
  .tip { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none; border-radius: 12px 12px 0 0; }
}
.drawer-backdrop { display: none; }
.more-wrap { display: none; position: relative; }
#btnMore { width: 36px; padding: 0; font-size: 18px; line-height: 1; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 170px;
  background: #fff; border: 1px solid var(--lbf-border); border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.12); padding: 6px;
}
.more-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 14px; padding: 9px 10px; border: 0; background: none; border-radius: 6px; color: var(--lbf-text); cursor: pointer; }
.more-item:hover { background: var(--lbf-light-gray); }
.more-item.active { background: color-mix(in srgb, var(--lbf-primary) 14%, #fff); color: var(--lbf-primary); font-weight: 500; }
.more-item.ok { background: #d7efe1; color: #0f5132; }
.more-sep { border-top: 1px solid var(--lbf-border); margin: 6px 4px; }
.drawer-close { display: none; align-items: center; justify-content: flex-end; margin: -6px 0 6px; }
.drawer-close button { font: inherit; background: none; border: 0; color: var(--lbf-dark-gray); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }

/* ── Admin: sign-ins ──────────────────────────────────────────────────── */
body.admin-page { background: var(--lbf-bg, #f4f6f8); }
header.top a.btn { text-decoration: none; }
.admin-main { max-width: 1400px; margin: 0 auto; padding: 18px 20px 40px; }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.admin-head h1 { margin: 0 0 4px; font-size: 22px; font-weight: 500; color: var(--lbf-primary); }
.admin-sub { margin: 0; color: var(--lbf-dark-gray); font-size: 13px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-nav a { text-decoration: none; color: var(--lbf-primary); border: 1px solid var(--lbf-border); background: #fff; padding: 4px 10px; border-radius: 14px; font-size: 13px; }
.admin-nav a.on { background: var(--lbf-primary); border-color: var(--lbf-primary); color: #fff; }
.admin-nav a.dl { margin-left: 8px; border-color: var(--lbf-cta); color: var(--lbf-black); background: #fff8ea; }
.admin-section { margin-top: 18px; }
.admin-section h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--lbf-primary); display: flex; align-items: center; gap: 8px; }
.admin-section h2 .count { font-weight: 500; font-size: 12px; color: var(--lbf-dark-gray); background: var(--lbf-light-gray); border-radius: 10px; padding: 1px 8px; }
.filters-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filters-bar input[type=search], .filters-bar select { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--lbf-border); border-radius: 6px; background: #fff; color: var(--lbf-text); }
.filters-bar input[type=search] { flex: 1 1 260px; min-width: 200px; }
.filters-bar select { max-width: 340px; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--lbf-secondary); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--lbf-border); border-radius: 8px; }
.admin-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.admin-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--lbf-dark-gray); padding: 8px 10px; border-bottom: 1px solid var(--lbf-border); background: var(--lbf-panel); white-space: nowrap; position: sticky; top: 0; }
.admin-table th[data-sort] { cursor: pointer; user-select: none; }
.admin-table th[data-sort]:hover { color: var(--lbf-primary); }
.admin-table th[data-sort]::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; opacity: 0; vertical-align: -3px; }
.admin-table th.sorted::after { opacity: .9; border-top-color: transparent; border-bottom-color: currentColor; vertical-align: 1px; }
.admin-table th.sorted.desc::after { border-top-color: currentColor; border-bottom-color: transparent; vertical-align: -3px; }
.admin-table td { padding: 6px 10px; border-bottom: 1px solid var(--lbf-light-gray); vertical-align: top; }
.admin-table tbody tr:nth-child(even) td { background: #fafbfc; }
.admin-table tbody tr:hover td { background: #f1f5f7; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .nowrap { white-space: nowrap; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .num small { display: block; font-weight: 400; color: var(--lbf-dark-gray); white-space: nowrap; }
.admin-table .bad { color: #842029; font-weight: 600; }
.admin-table .warn { color: #664d03; font-weight: 600; }
.admin-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--lbf-light-gray); color: var(--lbf-text); white-space: nowrap; }
.pill-login_ok { background: #d7efe1; color: #0f5132; }
.pill-otp_refused, .pill-otp_locked, .pill-otp_send_failed { background: #fde7e9; color: #842029; }
.pill-otp_failed { background: #fff3cd; color: #664d03; }
.admin-empty, .admit-count { color: var(--lbf-dark-gray); font-size: 13px; }

@media print {
  header.top, .filters, .meta { display: none; }
  .layout { height: auto; }
}
