:root {
  /* Same palette as Equipment Cloud and the Matchbox kiosk */
  --brand: #754e9d;
  --brand-d: #5e3f80;
  --brand-ink: #ffffff;
  --brand-soft: #efe9f6;
  --bg: #f6f4fb;
  --card: #ffffff;
  --panel-2: #f3f0f8;
  --ink: #1c1b22;
  --muted: #6b6878;
  --line: #e6e3ee;
  --shadow: 0 1px 2px rgba(28, 27, 34, .04);
  --danger: #b3261e;
  --ok: #1e7a46;
  --warn: #9a5b00;
  --radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }

button, input, select, textarea { font: inherit; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }

a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 11px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-weight: 600; font-size: 14px;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); color: #fff; }
.btn.danger { color: var(--danger); border-color: #e9c3c0; }
.btn:disabled { opacity: .55; cursor: default; }

@font-face { font-family: "Fraunces"; src: url("/book/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

/* ---------------------------------------------------------------- sign-in screens */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
  background:
    radial-gradient(1200px 600px at 10% 0%, #efe6fa 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #e7def3 0%, transparent 55%),
    var(--bg);
}
.auth-card {
  width: min(1080px, 100%); min-height: 620px; display: grid; grid-template-columns: minmax(340px, 440px) 1fr;
  background: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .8); border-radius: 28px; padding: 14px;
  box-shadow: 0 30px 80px -30px rgba(70, 40, 110, .35), 0 2px 6px rgba(28, 27, 34, .05);
  animation: auth-in .45s ease both;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(10px); } }
.auth-form { display: flex; flex-direction: column; padding: 30px 38px 22px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-tag { padding: 5px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.auth-logo { display: block; width: 44px; height: 44px; object-fit: contain; }
.auth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 360px; width: 100%; margin: 28px auto; }
.auth-body h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 34px; letter-spacing: -.01em; margin-bottom: 6px; }
.auth-body > .muted { font-size: 15px; margin-bottom: 14px; }
.auth-body input { padding: 12px 14px; border-radius: 12px; background: #fbfaff; }
.auth-body input:focus { background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.auth-body form .btn.primary { width: 100%; justify-content: center; padding: 13px 18px; border-radius: 999px; font-size: 15px; margin-top: 8px; }
.auth-body .qr { align-self: center; }
.auth-help { margin-top: 18px; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 13px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.pw-toggle:hover { background: var(--brand-soft); }
.pw-rules { list-style: none; margin: 2px 0 6px; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #bdb3cf; flex: none; box-sizing: border-box; }
.pw-rules li.met { color: var(--ok, #1f7a4d); }
.pw-rules li.met::before { border-color: currentColor; background: currentColor radial-gradient(circle, #fff 0 2px, transparent 2.5px); }
.auth-foot { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.auth-secure { display: inline-flex; align-items: center; gap: 5px; }
.auth-secure .ico { width: 13px; height: 13px; }
.auth-photo { position: relative; overflow: hidden; border-radius: 20px; background: #1b1023; min-height: 100%; }
.auth-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; transform: scale(1.02); }
.auth-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27, 16, 35, 0) 55%, rgba(27, 16, 35, .35) 100%); }
.auth-chip, .auth-caption { position: absolute; z-index: 1; color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); }
.auth-chip { top: 22px; left: 22px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.auth-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #b892e6; box-shadow: 0 0 0 4px rgba(184, 146, 230, .3); }
.auth-caption { left: 22px; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; }
.auth-caption-logo { width: 42px; height: 42px; flex: none; filter: brightness(0) invert(1); opacity: .95; }
.auth-caption strong { display: block; font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 600; line-height: 1.2; }
.auth-caption span { display: block; font-size: 13.5px; opacity: .85; margin-top: 2px; }
@media (max-width: 860px) {
  .auth { padding: 0; place-items: stretch; background: #fff; }
  .auth-card { grid-template-columns: minmax(0, 1fr); min-height: 100vh; border-radius: 0; border: 0; box-shadow: none; padding: 0; }
  .auth-photo { display: none; }
  .auth-form { padding: 24px 22px 20px; }
  .auth-body h1 { font-size: 30px; }
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.brand { color: var(--brand); font-weight: 800; letter-spacing: .02em; font-size: 22px; margin-bottom: 4px; }
.error { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 1em; }
.qr { display: block; margin: 12px auto; width: 200px; height: 200px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--bg); padding: 8px; border-radius: 6px; }
.stack > * + * { margin-top: 12px; }

.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; flex-wrap: wrap;
}
.topbar .brand { font-size: 18px; margin: 0; }
.topbar select { width: auto; min-width: 180px; padding: 7px 10px; }
.topbar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 7px 12px; border-radius: 8px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }

.layout { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.2fr); gap: 20px; padding: 20px 24px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; padding: 16px; } }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar input { flex: 1; }
.toolbar select { width: 150px; }
.toolbar .cal-range { align-self: center; margin-left: 4px; white-space: nowrap; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr[aria-selected="true"] { background: var(--brand-soft); }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); }
.pill.active { background: #e3f4ea; color: var(--ok); }
.pill.past_due { background: #fdecd6; color: var(--warn); }
.pill.cancelled { background: #f7e1df; color: var(--danger); }
.pill.paused { background: #e7e4f2; color: #4b3d7a; }

dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.notes { list-style: none; padding: 0; margin: 12px 0 0; }
.notes li { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.notes .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.notes .body { white-space: pre-wrap; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; font-size: 14px; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: min(460px, 92vw); }
dialog::backdrop { background: rgba(29, 26, 34, .35); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.audit-detail { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.layout > * { min-width: 0; }
form .stack { margin-top: 16px; }
@media (max-width: 600px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar input { flex-basis: 100%; }
  .toolbar select { flex: 1; width: auto; }
  .topbar { padding: 12px 16px; }
  dl { grid-template-columns: 110px 1fr; }
}

.pill.tag { background: var(--brand-soft); color: var(--brand); margin: 0 4px 4px 0; }
.pill.confirmed { background: #e8e1f2; color: #4b3d7a; }
.pill.completed { background: #e3f4ea; color: var(--ok); }
.pill.no_show { background: #fdecd6; color: var(--warn); }
.pill.refund_due { background: #f7e1df; color: var(--danger); }
.pill.pending_payment { background: var(--bg); color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.day-group + .day-group { margin-top: 20px; }
.day-head { font-size: 15px; margin: 0 0 4px; }
tr.static { cursor: default; }
tr.static:hover { background: none; }
.time-cell { font-weight: 700; font-variant-numeric: tabular-nums; width: 64px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 6px; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
.layout.single > .card + .card { margin-top: 20px; }
.setup h3 { margin-top: 24px; }
.grid4, .grid3 { display: grid; gap: 0 12px; }
.grid4 { grid-template-columns: repeat(4, 1fr); }
.grid3 { grid-template-columns: 2fr 1.4fr 1fr; }
@media (max-width: 900px) { .grid4 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr; } }
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }
.hours { border: 1px solid var(--line); border-radius: 10px; }
.hours-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 12px; align-items: start; }
.hours-row + .hours-row { border-top: 1px solid var(--line); }
.hours-day { font-weight: 600; font-size: 14px; padding-top: 6px; }
.hours-windows { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.window { display: inline-flex; align-items: center; gap: 6px; }
.window input { width: 132px; padding: 6px 8px; }
@media (max-width: 600px) { .hours-row { grid-template-columns: 1fr; } }
.save-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.save-row .error, .save-row .ok { margin: 0; }
.ok { color: var(--ok); font-size: 14px; }
.closures { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }
.closures li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* dialogs and forms */
dialog.wide { width: min(720px, 94vw); max-height: 90vh; overflow-y: auto; }
.field { margin-bottom: 10px; }
.field label { margin: 0; }
.field label > input, .field label > select, .field label > textarea { margin-top: 6px; font-weight: 400; }
.row2, .row3 { display: grid; gap: 0 12px; }
.row3 { grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }
.small { font-size: 12.5px; }
.suggest { margin: -2px 0 10px; display: grid; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--brand-soft); background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--brand); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.drawer-head h2 { margin: 0 0 2px; }
.notice-box { background: #fdf3e3; border: 1px solid #f1dcb6; color: #6a4300; border-radius: 8px; padding: 8px 12px; font-size: 14px; margin-bottom: 10px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; }
.panel h3 { margin: 0 0 8px; font-size: 15px; }
.panel .toolbar { align-items: center; }
.panel .toolbar input[type=number] { width: 100px; }
.body.warn { color: var(--warn); }
.pill.conflict { background: #f7e1df; color: var(--danger); }
.pill.expired { background: var(--bg); color: var(--muted); }
.pill.cancelled { background: #f1eff3; color: var(--muted); }

/* calendar */
.calendar-card .card-head strong { margin-left: 6px; }
.cal-legend { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.key.booking { background: var(--brand); }
.key.busy { background: #8a8494; }
.key.free { border: 1.5px dashed #8a8494; }
.key.open { background: #f4f0f8; border: 1px solid var(--line); }
.cal-wrap { overflow-x: auto; }
.cal { min-width: 760px; }
.cal-head, .cal-allday, .cal-body { display: grid; grid-template-columns: 56px repeat(7, 1fr); }
.cal-day { text-align: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cal-day small { color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-day.today b { background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 7px; }
.cal-day .link { display: block; margin: 2px auto 0; font-size: 11.5px; font-weight: 600; text-align: center; }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 30px; }
.cal-allday .cal-gutter { padding: 6px 4px; }
.cal-allday-cell { border-left: 1px solid var(--line); padding: 3px; display: grid; gap: 3px; align-content: start; }
.cal-chip { border: 0; border-radius: 6px; padding: 3px 6px; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.busy { background: #8a8494; color: #fff; }
.cal-chip.free { background: #fff; border: 1.5px dashed #8a8494; color: var(--ink); }
.cal-gutter { font-size: 11.5px; color: var(--muted); }
.cal-hour { text-align: right; padding-right: 6px; transform: translateY(-7px); }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 48px; }
.cal-col.today { background-color: #fcfbfe; }
.open-band { position: absolute; left: 0; right: 0; background: #f4f0f8; pointer-events: auto; }
.cal-item { position: absolute; border: 0; border-radius: 6px; padding: 2px 6px; font-size: 12px; line-height: 1.3; text-align: left; overflow: hidden;
  cursor: pointer; color: #fff; box-shadow: 0 0 0 1px #fff; }
.cal-item .cal-time { font-weight: 700; }
.cal-item.booking { background: var(--brand); }
.cal-item.booking.completed { background: #5b9a76; }
.cal-item.booking.no_show { background: #b98a3e; }
.cal-item.booking.pending_payment { background: #b7a3cc; }
.cal-item.busy { background: #8a8494; }
.cal-item.free { background: #fff; color: var(--ink); border: 1.5px dashed #8a8494; }

/* ---------------------------------------------------------------------------
   App shell: Equipment Cloud's sidebar. A 66px icon rail that expands to 224px
   over the page on hover/focus; a slide-in drawer on phones.
   --------------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.side-rail { width: 66px; flex: none; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 66px; z-index: 30;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden; transition: width .18s ease, box-shadow .18s ease;
}
.sidebar:hover, .sidebar:focus-within { width: 224px; box-shadow: 10px 0 34px rgba(28, 27, 34, .12); }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 14px 15px; white-space: nowrap; }
.side-logo { width: 36px; height: 36px; flex: none; object-fit: contain; }

.side-brand .label { font-weight: 800; font-size: 18px; letter-spacing: .06em; color: var(--brand); }
/* overflow-x hidden: the hidden labels are wider than the rail and would otherwise add a sideways scrollbar */
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.side-nav a, .side-foot a {
  display: flex; align-items: center; gap: 16px; padding: 11px; border-radius: 10px; color: var(--muted);
  white-space: nowrap; font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer;
}
.side-nav a:hover, .side-foot a:hover { background: var(--panel-2); color: var(--ink); }
.side-nav a.active { background: var(--brand); color: #fff; }
.side-nav a:focus-visible, .side-foot a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.side-foot { padding: 10px 12px; border-top: 1px solid var(--line); overflow: hidden; }
.sidebar .label { opacity: 0; transition: opacity .14s ease; }
.sidebar:hover .label, .sidebar:focus-within .label { opacity: 1; }
.ico { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main .topbar { padding: 12px 24px; gap: 14px; flex-wrap: nowrap; }
.page-title { font-size: 20px; margin: 0; font-weight: 700; }

.nav-toggle { display: none; background: none; border: none; color: var(--ink); font-size: 26px; line-height: 1; padding: 2px 8px; cursor: pointer; }
.nav-overlay { display: none; }

@media (max-width: 820px) {
  html, body { overflow-x: hidden; }
  .side-rail { display: none; }
  .nav-toggle { display: inline-flex; }
  .sidebar { width: 250px; transform: translateX(-100%); transition: transform .2s ease; z-index: 60; overflow-y: auto; }
  .sidebar:hover, .sidebar:focus-within { width: 250px; box-shadow: none; }
  .shell.nav-open .sidebar { transform: translateX(0); box-shadow: 12px 0 40px rgba(28, 27, 34, .22); }
  .sidebar .label { opacity: 1; }
  .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(28, 27, 34, .4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
  .shell.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
  .main .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .main .topbar select { min-width: 0; flex: 1; }
  .card { overflow-x: auto; }
}

/* access control */
.gate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.gate { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 6px; }
.gate .actions { margin: 6px 0 0; }
.gate-head { display: flex; gap: 10px; align-items: center; }
.gate-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.gate.online .gate-dot { background: #1f9d57; box-shadow: 0 0 0 4px #e6f6ee; }
.gate.offline .gate-dot { background: var(--danger); box-shadow: 0 0 0 4px #fdecea; }
.gate.offline { border-color: #f5c6c0; }
.gate.disabled { opacity: .6; }
pre.config { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.pair-code { font: 700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; text-align: center; padding: 16px; margin: 8px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; user-select: all; }
.pair-steps { padding-left: 20px; margin: 8px 0; line-height: 1.6; }
.pair-steps code { font-size: 12.5px; white-space: nowrap; }
.access-panel .access-qr { display: flex; gap: 14px; align-items: center; margin: 8px 0; }
.access-panel .access-qr img { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.access-panel .toolbar input { max-width: 220px; }
.notes.compact li { padding: 6px 0; font-size: 13px; }

/* ---------------------------------------------------------------------------
   Members list and a member's record
   --------------------------------------------------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { flex: none; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: inline-grid; place-items: center; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 112px; height: 112px; font-size: 34px; border-radius: 18px; }
.members-table td { vertical-align: middle; }
.link.back { margin-bottom: 12px; display: inline-block; }
.record > .link.back + div > .card + .card { margin-top: 0; }

.record-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: start; }
.photo-wrap { display: grid; justify-items: center; gap: 6px; }
.photo-btn { cursor: pointer; margin: 0; font-weight: 600; }
.record-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.record-title h2 { margin: 0; font-size: 22px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin-bottom: 10px; }
.record-meta a { color: var(--ink); text-decoration: none; }
.record-meta a:hover { color: var(--brand); text-decoration: underline; }
.record-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tags .pill.tag { margin: 0; }
.tag-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.tag-form { display: inline-flex; gap: 6px; }
.tag-form[hidden] { display: none; }
.tag-input { width: 160px; padding: 5px 8px; font-size: 13px; }

.record-tabs { display: flex; gap: 2px; overflow-x: auto; margin: 16px 0 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.rtab { border: 0; background: none; padding: 12px 16px; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.rtab:hover { color: var(--ink); }
.rtab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.record-body { margin-top: 16px; }
.record-body h3.section, .record-body h3 { margin-top: 20px; font-size: 15px; }
.record-body h2 + h3 { margin-top: 4px; }

details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(28, 27, 34, .14); padding: 6px; display: grid; }
.menu-list button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--ink); }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--panel-2); outline: none; }
.menu-list button.danger { color: var(--danger); }

.ms-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fff; }
.ms-card + .ms-card { margin-top: 14px; }
.ms-card.compact { padding: 12px 14px; background: var(--bg); border-color: transparent; }
.ms-card.compact + .ms-card.compact { margin-top: 8px; }
.ms-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.ms-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms-title h3 { margin: 0 !important; font-size: 18px; }
.ms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.ms-grid h4 { margin: 6px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ms-grid dl { grid-template-columns: minmax(130px, auto) 1fr; }
.ms-grid dd { font-weight: 600; }
.ms-history { margin-top: 6px; font-size: 14px; }
.ms-history summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13.5px; }
.notes.compact li { padding: 7px 0; }
.summary-box { background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; margin: -2px 0 12px; font-size: 14px; display: grid; gap: 2px; }
fieldset.plain { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 4px; margin: 6px 0 12px; }
fieldset.plain legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
.details-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 12px 32px; }
.details-grid section > h3:first-child { margin-top: 4px !important; }
.details-grid section > h3 { margin-top: 18px; }
.details-grid section h3 + * { margin-top: 0; }
.details-grid dl { grid-template-columns: 130px 1fr; }
.details-grid .check { margin: 8px 0 4px; font-size: 14px; }
.indent { margin: -2px 0 6px 26px; }
.notes-form { max-width: 760px; }
.pill.scheduled { background: #e8e1f2; color: #4b3d7a; }

@media (max-width: 1000px) {
  .details-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .record-head { grid-template-columns: auto 1fr; }
  .record-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .avatar.lg { width: 84px; height: 84px; font-size: 26px; }
  .ms-grid, .details-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .menu-list { left: 0; right: auto; }
}
@media (max-width: 760px) {
  .record-meta { gap: 4px 12px; }
  .record-meta .meta-item { overflow-wrap: anywhere; }
  .ms-head { flex-wrap: wrap; }
}

/* Staff permissions */
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 6px 0 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px 8px; margin: 0; }
.perm-group legend { font-size: 13px; font-weight: 700; padding: 0 6px; color: var(--brand); }
.perm { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-weight: 400; margin: 8px 0; cursor: pointer; }
.perm input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.perm strong { display: block; font-size: 14px; }
.perm .muted.small { display: block; line-height: 1.35; }
.perm.locked { pointer-events: none; opacity: .75; }
.perm input:disabled + span { opacity: .55; }
.site-ticks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.check.strong { font-weight: 600; }
.account-actions { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.account-actions h3 { font-size: 15px; margin: 10px 0 8px; }
.account-actions .actions { margin-bottom: 0; }
.dialog-actions .ok { margin-right: auto; align-self: center; }
@media (max-width: 640px) { .perm-grid { grid-template-columns: 1fr; } }

/* Emails page */
.page-tabs { margin: 0 0 16px; }
.email-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin: 12px 0; align-items: start; }
.email-side { position: sticky; top: 76px; }
.email-preview { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 12px; background: #faf8fc; }
.preview-subject { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.email-form textarea { font-family: inherit; line-height: 1.5; }
.strong { font-weight: 600; }
.chips { margin-top: 6px; }
.audience { display: grid; gap: 8px; }
.aud-row { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: start; font-size: 14px; }
.aud-row > strong { padding-top: 2px; }
.tick-row { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: center; }
.tick-row .check { margin: 0; }
.audience-count { font-size: 14px; font-weight: 600; color: var(--brand); padding-top: 4px; }
.sticky-save { position: sticky; bottom: 0; background: var(--card); padding: 12px 0; border-top: 1px solid var(--line); z-index: 3; align-items: end; }
.sticky-save .field { margin: 0; }
.sticky-save .divider { flex: 0 0 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
@media (max-width: 1000px) {
  .email-editor { grid-template-columns: 1fr; }
  .email-side { position: static; }
  .email-preview { height: 520px; }
}
@media (max-width: 600px) { .aud-row { grid-template-columns: 1fr; } }

/* Dashboard */
.dashboard { gap: 16px; }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.dash-head h2 { font-size: 22px; margin: 0 0 2px; }
.dash-periods .chip { background: #fff; border-color: var(--line); color: var(--muted); padding: 6px 12px; }
.dash-periods .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.dash-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-tile { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px 22px; font: inherit; color: var(--ink); box-shadow: var(--shadow); }
.dash-tile:hover { border-color: #cbbfdc; }
.dash-tile.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dash-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dash-num { font-size: 34px; font-weight: 800; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.dash-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.dash-icon .ico { width: 24px; height: 24px; }
.dash-tile.on_hold .dash-icon { background: #e7e4f2; color: #4b3d7a; }
.dash-tile.failed .dash-icon { background: #fdecd6; color: var(--warn); }
.dash-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -6px 0 4px; overflow-x: auto; scrollbar-width: none; }
.dash-rows { list-style: none; margin: 0; padding: 0; }
.dash-rows li + li { border-top: 1px solid var(--line); }
.dash-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 6px;
  border: 0; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; border-radius: 10px; }
.dash-row:hover { background: var(--brand-soft); }
.dash-who strong { display: block; font-size: 15px; }
.dash-contact { text-align: right; }
@media (max-width: 900px) { .dash-tiles { grid-template-columns: 1fr; gap: 10px; } .dash-tile { padding: 14px 16px; } .dash-num { font-size: 28px; } }
@media (max-width: 600px) { .dash-contact { display: none; } .dash-row { grid-template-columns: auto minmax(0, 1fr); } }

/* Control panel */
.side-foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.side-foot a { overflow: hidden; }
.side-foot a.active { background: var(--brand); color: #fff; }

/* Reports */
.report-body { display: grid; gap: 16px; }
.report-content { display: grid; gap: 16px; }
.report-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.report-head h2 { margin: 0 0 4px; font-size: 20px; }
.report-head p { margin: 0; }
.report-filters { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.report-filters select { width: auto; }
.period-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 1.5px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.segmented button { border: 0; background: none; padding: 8px 14px; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.segmented button + button { border-left: 1.5px solid var(--line); }
.segmented button.on { background: var(--brand); color: #fff; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper strong { min-width: 150px; text-align: center; }
.stepper input[type=date], .range input { width: auto; padding: 7px 10px; }
.range { display: inline-flex; align-items: center; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 800; margin: 4px 0; font-variant-numeric: tabular-nums; }
.stat.big .stat-value { font-size: 30px; }
.stat.warn .stat-value { color: var(--warn); }
.stat-sub { font-size: 13px; }
.trend { font-weight: 700; font-size: 13px; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--danger); }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .bar { fill: var(--brand); }
.bar-chart .bar:hover { fill: var(--brand-d); }
.bar-chart .grid { stroke: var(--line); stroke-width: 1; }
.bar-chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col h3, .report-body .card h3 { margin: 0 0 8px; font-size: 15px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.refused td { background: #fdf1f0; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats, .stats.three, .two-col { grid-template-columns: 1fr; } .stepper strong { min-width: 0; } }

/* Import */
.map-table select { width: auto; min-width: 200px; }
.map-table tr.mapped td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.value-maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 16px 0; }
.value-map { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.value-map h4 { margin: 0 0 6px; }
.value-map select { width: auto; max-width: 220px; padding: 6px 8px; }
.value-map td { padding: 6px 8px; vertical-align: middle; }
.import-summary { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; display: grid; gap: 12px; }
.import-summary h4 { margin: 4px 0 0; }
.issues { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }

.avatar.xl { width: 200px; height: 200px; font-size: 64px; border-radius: 24px; }
@media (max-width: 900px) {
  .avatar.xl { width: 140px; height: 140px; font-size: 44px; }
}
.occ-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.occ-chip { background: var(--brand-soft); color: var(--brand-d); border-radius: 999px; padding: 4px 12px; font-size: 13.5px; font-weight: 600; }

/* Member gate panel header with the Open gate button */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }

/* Printed pass card (members without a smartphone): 85.6 x 54 mm, the size of a bank card */
.print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 15mm; }
  body.printing > *:not(.print-sheet) { display: none !important; }
  body.printing { background: #fff; }
  body.printing .print-sheet { display: block; }
  .pass-card { width: 85.6mm; height: 54mm; box-sizing: border-box; border: 0.3mm dashed #999; border-radius: 3mm; padding: 4mm;
    display: flex; gap: 3mm; align-items: center; justify-content: space-between; color: #1c1b22; font-family: system-ui, sans-serif;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pass-card-text { display: grid; gap: 1mm; min-width: 0; align-content: center; }
  .pass-card-logo { width: 12mm; height: 12mm; }
  .pass-card-name { font-size: 11pt; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
  .pass-card-meta { font-size: 8pt; color: #555; }
  .pass-card-help { font-size: 6pt; color: #555; margin-top: 1mm; }
  .pass-card-qr { width: 40mm; height: 40mm; flex: none; image-rendering: pixelated; }
  .print-hint { font: 9pt system-ui, sans-serif; color: #555; max-width: 120mm; margin-top: 6mm; }
}

/* Payments */
.pm-line { font-weight: 700; font-size: 15.5px; margin: 2px 0 4px; }
.notice-box.ok-box { background: #e3f4ea; color: var(--ok); border-color: transparent; }
.msg { min-height: 1.2em; font-size: 14px; margin: 6px 0; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

/* Top bar: gate pass, sign out, account */
.top-icons { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn .ico { width: 20px; height: 20px; }
.profile { position: relative; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand-d); font: 700 13px/1 inherit; font-family: inherit; cursor: pointer; margin-left: 4px; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--brand); color: #fff; }
.icon-btn:focus-visible, .avatar-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 230px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(28, 27, 34, .14); padding: 6px; }
.profile-who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none;
  font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.profile-menu button:hover { background: var(--panel-2); }
.profile-menu .ico { width: 18px; height: 18px; color: var(--muted); }

/* Control panel: menu down the left */
.cp { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; align-items: start; }
.cp-nav { position: sticky; top: 0; display: grid; gap: 4px; padding: 20px 0 20px 24px; }
.cp-tab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 0; background: none;
  font: inherit; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; text-align: left; }
.cp-tab .ico { width: 18px; height: 18px; flex: none; }
.cp-tab:hover { background: var(--panel-2); color: var(--ink); }
.cp-tab[aria-current="page"] { background: var(--brand); color: #fff; }
.cp-body { min-width: 0; }
.cp-body > .layout { padding-left: 20px; }
@media (max-width: 900px) {
  .cp { grid-template-columns: minmax(0, 1fr); }
  .cp-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 0; scrollbar-width: none; }
  .cp-nav::-webkit-scrollbar { display: none; }
  .cp-tab { flex: none; padding: 8px 12px; font-size: 14px; }
  .cp-body > .layout { padding-left: 16px; }
}
@media (max-width: 900px) {
  .main .topbar { flex-wrap: nowrap; }
  .main .topbar .page-title { flex: 1; min-width: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .main .topbar .spacer { display: none; }
  .main .topbar select { flex: 0 1 140px; min-width: 0; }
}
@media (max-width: 520px) {
  .top-icons .icon-btn { display: none; } /* in the account menu instead */
}

/* Search (top bar + palette) */
.top-search { display: flex; align-items: center; gap: 10px; flex: 0 1 380px; min-width: 0; margin-left: 18px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); color: var(--muted); font: inherit; font-size: 14px; cursor: text; text-align: left; }
.top-search:hover { border-color: #cbbfdc; }
.top-search .ico { width: 18px; height: 18px; flex: none; }
.top-search-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search kbd, .search-hint kbd { font: 600 11.5px/1 inherit; font-family: inherit; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--card); }
.search-palette { position: fixed; inset: 0; z-index: 100; background: rgba(28, 27, 34, .32); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-box { width: min(640px, 100%); background: var(--card); border-radius: 18px; box-shadow: 0 24px 60px rgba(28, 27, 34, .25); overflow: hidden; display: flex; flex-direction: column; max-height: 75vh; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-input .ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-input input { border: 0; outline: none; background: none; font: inherit; font-size: 17px; width: 100%; padding: 4px 0; color: var(--ink); box-shadow: none; }
.search-input input::-webkit-search-cancel-button { display: none; }
.search-results { overflow-y: auto; padding: 6px; }
.search-group { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.search-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.search-item.active { background: var(--brand-soft); }
.search-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.search-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--panel-2); color: var(--muted); flex: none; }
.search-ico .ico { width: 17px; height: 17px; }
.search-empty { padding: 14px 12px; }
.search-hint { padding: 10px 18px; border-top: 1px solid var(--line); }
.search-flash { animation: search-flash 1.6s ease-out; }
@keyframes search-flash { 0%, 30% { box-shadow: 0 0 0 4px rgba(117, 78, 157, .35); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .search-flash { animation: none; outline: 3px solid rgba(117, 78, 157, .35); } }
@media (max-width: 1100px) { .top-search kbd { display: none; } }
@media (max-width: 900px) {
  .top-search { flex: none; margin-left: 0; width: 38px; height: 38px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .top-search-text { display: none; }
  .search-palette { padding: 0; }
  .search-box { max-height: 100vh; height: 100%; border-radius: 0; }
  .search-hint { display: none; }
}
.search-cancel { display: none; border: 0; background: none; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; padding: 6px 4px; }
@media (max-width: 900px) { .search-cancel { display: block; } }

/* Switching site: banner, page fade-in and a pulse on the site menu */
.main { position: relative; }
.site-toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px;
  padding: 12px 20px 12px 14px; border-radius: 14px; background: var(--brand); color: #fff; box-shadow: 0 14px 34px rgba(117, 78, 157, .35);
  animation: site-toast-in .35s cubic-bezier(.2, .9, .3, 1.2) both; pointer-events: none; white-space: nowrap; max-width: calc(100vw - 32px); }
.site-toast strong { overflow: hidden; text-overflow: ellipsis; }
.site-toast.leaving { animation: site-toast-out .45s ease-in both; }
.site-toast-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.site-toast-ico .ico { width: 18px; height: 18px; }
.site-toast-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.site-toast strong { display: block; font-size: 18px; line-height: 1.2; }
@keyframes site-toast-in { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes site-toast-out { to { opacity: 0; transform: translate(-50%, -10px); } }
#view.site-switch { animation: site-view-in .45s ease-out both; }
@keyframes site-view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.topbar select.site-pulse { animation: site-pulse 1.4s ease-out; }
@keyframes site-pulse { 0%, 35% { box-shadow: 0 0 0 4px rgba(117, 78, 157, .45); border-color: var(--brand); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) {
  .site-toast, .site-toast.leaving, #view.site-switch, .topbar select.site-pulse { animation: none; }
  .site-toast.leaving { opacity: 0; }
}

/* Tags: filter links and small chips in the members list */
.tag-link { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.tag-link:hover { text-decoration: underline; }
button.pill.tag.tag-link { padding: 3px 10px; }
.pill.tag.mini { font-size: 11px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }
.list-count { padding: 8px 4px 0; }
.toolbar select[aria-label="Tag"] { min-width: 190px; }

/* Member requests (from the member account) */
.requests { border-left: 4px solid var(--brand, #754e9d); }
.requests .dash-row.static { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.requests .dash-row.static:hover { background: none; }
.requests .actions { display: flex; gap: 6px; }
.card .requests { box-shadow: none; padding: 12px 14px; margin-bottom: 12px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin: 4px 0 16px; flex-wrap: wrap; }
.copy-row code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; overflow-wrap: anywhere; }
.setup textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.share-flag { border-color: #f0c36d; background: #fff8e8; }
.share-flag .actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.requests.share { border-left-color: #d08a00; }
.stripe-check { list-style: none; padding: 0; margin: 8px 0 12px; font-size: 14px; }
.stripe-check li { padding: 3px 0; }
.stripe-check li.ok { color: var(--ok, #1e7a46); }
.stripe-check li.bad { color: var(--danger); }

/* ---------- soft loading ---------- */
.loadbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--brand) 30%, #b48fd8 60%, transparent 100%);
  background-size: 200% 100%; opacity: 0; transition: opacity .2s ease;
}
.loadbar.on { opacity: 1; animation: loadbar 1.1s linear infinite; }
@keyframes loadbar { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.sk { display: grid; gap: 10px; padding: 6px 0; width: 100%; }
.sk-bar {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--panel-2) 0%, #e9e4f2 40%, var(--panel-2) 80%); background-size: 300% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
.sk-bar:first-of-type { height: 14px; }
.tick-row .sk, .muted.small .sk { padding: 2px 0; }
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

.soft-in { animation: soft-in .28s ease-out both; }
#view.soft-enter > *, .cp-body.soft-enter > * { animation: soft-in .3s ease-out both; }
@keyframes soft-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .loadbar.on { animation: none; background: var(--brand); }
  .sk-bar { animation: none; }
  .soft-in, #view.soft-enter > *, .cp-body.soft-enter > * { animation-duration: .01s; }
}

/* Screening deposits: what's left to collect */
.pill.warn { background: #fdecd6; color: var(--warn); }
.balance-panel { border-left: 4px solid var(--warn); }
.balance-panel .actions { flex-wrap: wrap; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted); }
details.panel > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.panel[open] > summary { margin-bottom: 8px; }

/* Dashboard: things to act on today */
.card.today h2 { font-size: 16px; margin: 0 0 10px; }
.today-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.today-item { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, #fff); font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.today-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.today-item strong { display: block; font-size: 14px; }
.today-item .muted { display: block; }
.today-num { flex: none; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.today-num.warn { background: #fdecd6; color: var(--warn); }
.check.small { font-size: 13px; }
.balance-panel.settled { border-left-color: var(--ok); }
.ret-head .toolbar { flex-wrap: nowrap; }
.ret-head .check { white-space: nowrap; }
@media (max-width: 700px) {
  .ret-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .ret-head .toolbar { justify-content: space-between; }
  .ret-row { grid-template-columns: auto minmax(0, 1fr); }
  .ret-row .actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.grid3 > .span2 { grid-column: span 2; }
@media (max-width: 700px) { .grid3 > .span2 { grid-column: auto; } }
.actions.nowrap { flex-wrap: nowrap; }
.photo-src { text-align: center; margin-top: 4px; font-size: 11.5px; }

/* Terms and conditions, reception iPad */
.terms-box { display: grid; gap: 6px; justify-items: start; margin-bottom: 8px; }
.sig-img { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.terms-read { white-space: pre-wrap; max-height: 360px; overflow: auto; font-size: 14px; line-height: 1.6; padding: 6px 2px; }
textarea.terms-edit { font-size: 14px; line-height: 1.55; }
.steps-list { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 4px; }
ul.plain { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }

/* Authenticator code: six boxes */
.otp { display: flex; justify-content: space-between; gap: 8px; margin: 22px 0 12px; min-width: 0; }
.otp-form { min-width: 0; }
.otp .otp-box {
  flex: 1 1 0; min-width: 0; max-width: 56px; width: auto; height: 62px; padding: 0; text-align: center; font-size: 26px; font-weight: 600;
  border: 1.5px solid #d6dbe6; border-radius: 12px; background: #fff; color: var(--ink); caret-color: var(--brand);
  transition: border-color .15s, box-shadow .15s;
}
.otp .otp-box:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(117, 78, 157, .12); }
.otp .otp-box.filled { border-color: #b9a6d3; }
.otp .otp-box.otp-error { border-color: #d64545; animation: otp-shake .3s; }
@keyframes otp-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.auth-body form.otp-form .btn.primary.otp-submit { border-radius: 12px; margin-top: 14px; }
.auth-body form.otp-form .btn.primary.otp-submit:disabled { opacity: 1; background: #c9b8e0; border-color: #c9b8e0; color: #fff; }
@media (max-width: 420px) { .otp { gap: 6px; } .otp .otp-box { height: 54px; font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .otp .otp-box.otp-error { animation: none; } }

/* Audit log filters and pages */
.audit-filters { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(180px, 1.6fr) repeat(2, minmax(130px, 1fr)) minmax(110px, .8fr) auto; gap: 10px; align-items: end; margin: 14px 0 16px; }
.audit-filters label { margin: 0; font-size: 12px; color: var(--muted); }
.audit-filters label > select, .audit-filters label > input { margin-top: 4px; }
.audit-filters .btn { height: 40px; }
.audit-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.audit-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.audit-pages .btn { min-width: 36px; justify-content: center; }
td.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }
.linkish { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
.loading { opacity: .55; transition: opacity .15s; }
@media (max-width: 900px) { .audit-filters { grid-template-columns: 1fr 1fr; } .audit-filters .btn { justify-self: start; } }
@media (max-width: 480px) { .audit-filters { grid-template-columns: 1fr; } }

/* Orders (supplies) */
.sup-lines td { vertical-align: middle; }
.sup-lines input { max-width: 120px; }
.sup-qty { display: flex; align-items: center; gap: 8px; }
.sup-qty input { max-width: 100px; }
.dash-row.sup-row { grid-template-columns: minmax(0, 1fr) auto; }
.warn-text { color: #a15c00; }
@media (max-width: 600px) { .dash-row.sup-row { grid-template-columns: 1fr; } .sup-lines input, .sup-qty input { max-width: 84px; } }
.sup-wide { min-width: 720px; }
.sup-dialog .sup-item { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 1fr; gap: 12px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sup-dialog .sup-item-name { align-self: center; }
.sup-dialog .sup-item-field { margin: 0; font-size: 12px; color: var(--muted); }
.sup-dialog .sup-item-field input { margin-top: 4px; }
@media (max-width: 560px) { .sup-dialog .sup-item { grid-template-columns: 1fr 1fr; } .sup-dialog .sup-item-name { grid-column: 1 / -1; } }

/* Team */
.team-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.team-top .page-tabs { margin: 0; }
.team-site { width: auto; min-width: 180px; }
.team-weeknav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-weeknav strong { font-size: 16px; min-width: 190px; text-align: center; }
.team-tools { margin: 0; flex-wrap: wrap; }
table.rota { min-width: 860px; table-layout: fixed; }
table.rota th:first-child { width: 150px; }
table.rota th:last-child, table.rota td.rota-total { width: 70px; text-align: right; }
table.rota thead th.today { color: var(--brand); }
table.rota th[scope=row] { font-weight: 600; vertical-align: top; padding-top: 12px; }
table.rota th[scope=row] small { display: block; font-weight: 400; color: var(--muted); }
.rota-cell { vertical-align: top; padding: 6px 4px !important; }
.rota-shift { display: block; width: 100%; text-align: left; border: 0; border-radius: 8px; background: var(--brand-soft); color: var(--brand-d, var(--brand)); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 8px; margin-bottom: 4px; cursor: default; }
button.rota-shift { cursor: pointer; }
button.rota-shift:hover { background: #e7dcf5; }
.rota-shift small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rota-add { width: 100%; border: 1.5px dashed transparent; background: none; border-radius: 8px; color: transparent; font-size: 16px; padding: 4px; cursor: pointer; }
.rota-cell.editable:hover .rota-add, .rota-add:focus-visible { border-color: var(--line); color: var(--muted); }
.rota-off { display: block; border-radius: 8px; background: #e8f4ec; color: #1e7a46; font-size: 12.5px; font-weight: 600; padding: 6px 8px; margin-bottom: 4px; }
.rota-off.pending { background: #fff4e5; color: #8a4b00; }
/* Rota colours (popular shifts). Light backgrounds with dark text, readable at a glance. */
.c-purple { --sc-bg: #efe7f8; --sc-ink: #4f2f78; --sc-bar: #8b5cc4; }
.c-blue   { --sc-bg: #e3eefc; --sc-ink: #1d4a85; --sc-bar: #3b7ddd; }
.c-teal   { --sc-bg: #def4f1; --sc-ink: #125e57; --sc-bar: #1f9e90; }
.c-green  { --sc-bg: #e4f4e6; --sc-ink: #1f6430; --sc-bar: #3a9a4f; }
.c-amber  { --sc-bg: #fdf2d6; --sc-ink: #7a5200; --sc-bar: #d9a316; }
.c-orange { --sc-bg: #fde8da; --sc-ink: #8a3c0b; --sc-bar: #e7782f; }
.c-red    { --sc-bg: #fbe3e3; --sc-ink: #8c1d1d; --sc-bar: #d64545; }
.c-pink   { --sc-bg: #fbe4f0; --sc-ink: #85224f; --sc-bar: #d6589a; }
.c-grey   { --sc-bg: #eceaf0; --sc-ink: #3f3d48; --sc-bar: #8a8796; }
.rota-shift[class*=" c-"] { background: var(--sc-bg); color: var(--sc-ink); box-shadow: inset 3px 0 0 var(--sc-bar); }
button.rota-shift[class*=" c-"]:hover { filter: brightness(.97); }
.rota-shift[class*=" c-"] small { color: var(--sc-ink); opacity: .8; }
/* Sites shown together: a solid label in the site's colour (its dark shade, white text). */
.site-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.4;
  border-radius: 999px; padding: 3px 10px; margin: 0 0 6px; background: var(--sc-ink, #4f4c5a); color: #fff; border: 0; white-space: nowrap; }
.rota-shift .site-tag { display: flex; width: max-content; max-width: 100%; padding: 3px 9px; }
button.site-tag { cursor: pointer; font-family: inherit; }
button.site-tag:hover { filter: brightness(1.15); }
.site-edit { font-weight: 400; opacity: .8; margin-left: 2px; }
.rota-sites { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.rota-site { margin: 0; gap: 6px; }
.rota-site .site-tag { margin: 0; }
.rota-site input:not(:checked) + .site-tag { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.rota-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.rota-legend .site-tag { margin: 0 4px 0 0; }
.rota-legend > span { display: inline-flex; align-items: center; }
.rota-unavail { display: block; width: 100%; text-align: left; border: 1px dashed #b9b5c4; border-radius: 8px; color: #55525f; font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 8px; margin-bottom: 4px;
  background: repeating-linear-gradient(135deg, #f4f3f7 0 6px, #ebe9f0 6px 12px); }
button.rota-unavail { cursor: pointer; }
.rota-unavail small { display: block; font-weight: 400; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: none) { .rota-cell.editable .rota-add { border-color: var(--line); color: var(--muted); } }
.rota-add.paint { border: 1.5px dashed var(--sc-bar, var(--line)); color: var(--sc-ink, var(--muted)); background: var(--sc-bg, transparent); font-size: 12px; font-weight: 600; opacity: .55; }
.rota-cell.painting:hover .rota-add.paint, .rota-add.paint:focus-visible { opacity: 1; }
@media (hover: none) { .rota-add.paint { opacity: .9; } }
.rota-head-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rota-all { margin: 0; font-size: 14px; }
.tpl-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.tpl-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer;
  background: var(--sc-bg, var(--panel-2)); color: var(--sc-ink, var(--ink)); box-shadow: inset 0 0 0 1px rgba(28, 27, 34, .06); }
span.tpl-chip { cursor: default; }
.tpl-chip .site-tag { margin: 0 0 0 8px; font-size: 10px; padding: 2px 8px; }
.tpl-chip[aria-pressed="true"] { border-color: var(--sc-bar, var(--brand)); box-shadow: 0 0 0 2px var(--sc-bar, var(--brand)); }
.paint-hint { font-size: 13px; color: var(--ink); background: #fff8e6; border-radius: 8px; padding: 4px 10px; }
.linklike { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.tpl-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tpl-list { list-style: none; margin: 0 0 6px; padding: 0; }
.tpl-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.tpl-row .actions { display: flex; gap: 6px; }
@media (max-width: 560px) { .tpl-row { grid-template-columns: 1fr; } }
.tpl-dialog h3 { font-size: 15px; margin: 16px 0 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: var(--sc-bar); cursor: pointer; padding: 0; }
.swatch.none { background: linear-gradient(135deg, #fff 45%, #d64545 45% 55%, #fff 55%); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 6px; }
.seg-btn { border: 0; background: none; border-radius: 8px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 27, 34, .12); }
.field > .label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 0; }
.pay-note { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; margin: 0 0 4px; }
tr.rota-me th[scope=row] { color: var(--brand); }
tr.rota-me td { background: #fbf9fe; }
table.rota tfoot th, table.rota tfoot td { font-weight: 600; color: var(--muted); font-size: 13px; }
.team-stats { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 0; }
@media (max-width: 760px) { .team-stats { grid-template-columns: 1fr; } }
.team-stats .stat strong { display: block; font-size: 20px; margin: 4px 0 2px; }
.dash-row.team-row { grid-template-columns: minmax(0, 1fr) auto; }
.team-pin { align-items: end; }
.clock-photos { display: flex; flex-wrap: wrap; gap: 12px; }
.clock-photos p { flex-basis: 100%; }
.clock-photos figure { margin: 0; }
.clock-photos img { width: 240px; height: 180px; object-fit: cover; border-radius: 12px; background: var(--bg); display: block; }
@media (max-width: 600px) { .dash-row.team-row { grid-template-columns: 1fr; } .team-weeknav strong { min-width: 0; } }
table.rota th[scope=row] { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.pin-show { font: 700 44px/1.1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; text-align: center; color: var(--brand); background: var(--brand-soft); border-radius: 14px; padding: 18px 10px; margin: 8px 0 14px; }

/* Team: Today, Employees, Timecards, Labour */
.tm-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #ece8f3; color: var(--muted); display: inline-grid; place-items: center; font-weight: 700; font-size: 13.5px; letter-spacing: .02em; }
.tm-today { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tm-today > .card, .tm-side > .card { margin: 0; }
.tm-side { display: grid; gap: 16px; }
@media (max-width: 900px) { .tm-today { grid-template-columns: 1fr; } }
.tm-attendance { padding-bottom: 0; overflow: hidden; }
.tm-att-list { list-style: none; margin: 0 -20px; padding: 0; max-height: 560px; overflow-y: auto; border-top: 1px solid var(--line); }
.tm-att { border-bottom: 1px solid var(--line); }
.tm-att-main { display: grid; grid-template-columns: auto minmax(0, 1fr) 84px 84px; gap: 14px; align-items: center; padding: 14px 20px; }
.tm-att-who strong { display: block; font-size: 15px; }
.tm-time span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tm-time b { font-size: 20px; font-variant-numeric: tabular-nums; color: #c9c3d3; }
.tm-time b.in { color: #2f8a3a; }
.tm-time b.out { color: var(--ink); }
.tm-att-foot { display: flex; align-items: center; gap: 12px; background: #f4f2f7; padding: 7px 20px; font-size: 12.5px; color: var(--muted); }
.tm-att-foot .tm-worked { margin-left: auto; font-variant-numeric: tabular-nums; }
.tm-late .tm-att-foot, .tm-missed .tm-att-foot { background: #fdf1ef; }
.tm-finished .tm-att-who strong { color: var(--muted); }
.tm-att-sum { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 -20px; border-top: 1px solid var(--line); }
.tm-att-sum > div { padding: 12px 20px; border-left: 1px solid var(--line); }
.tm-att-sum > div:first-child { border-left: 0; }
.tm-att-sum span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tm-att-sum b { font-size: 22px; font-weight: 500; }
@media (max-width: 600px) {
  .tm-att-main { grid-template-columns: auto minmax(0, 1fr) 62px 62px; gap: 10px; padding: 12px 16px; }
  .tm-time b { font-size: 17px; }
  .tm-att-sum { grid-template-columns: 1fr 1fr; }
  .tm-att-sum > div:nth-child(3) { border-left: 0; }
  .tm-att-sum > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tm-att-foot { flex-wrap: wrap; padding: 7px 16px; }
}
.tm-sub { font-weight: 400; }
.tm-coming { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-coming li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #f8f7fa; border-radius: 12px; padding: 10px 12px; }
.tm-coming strong { color: var(--brand); }
.tm-ico { font-size: 20px; }
.tm-emp { display: flex; align-items: center; gap: 10px; }
.tm-emp .tm-avatar { width: 34px; height: 34px; font-size: 12px; }
.tm-emp .linkish { font-weight: 600; font-size: 14.5px; padding: 0; text-align: left; }
.tm-emp-tools { margin: 0 0 12px; gap: 10px; flex-wrap: wrap; }
.tm-emp-tools select { width: auto; }
.tm-emp-tools input[type=search] { flex: 1 1 260px; max-width: 420px; }
table.tm-emp-table { min-width: 1080px; }
table.tm-emp-table td { vertical-align: middle; }
tr.muted td { color: var(--muted); }
.tm-tc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; margin-top: 12px; }
@media (max-width: 800px) { .tm-tc-grid { grid-template-columns: 1fr; } }
.tm-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tm-range select, .tm-range input { width: auto; }
.tm-range input[type=text] { max-width: 120px; background: #f6f4f9; }
.tm-sites, .tm-radio { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 4px; }
.tm-people details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.tm-people summary { cursor: pointer; font-weight: 600; }
.tm-people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
table.tm-tc { min-width: 980px; font-variant-numeric: tabular-nums; }
table.tm-tc td:not(:first-child), table.tm-tc th:not(:first-child) { text-align: right; }
table.tm-tc th.tm-ph { color: #a15c00; }
table.tm-tc tfoot td, table.tm-tc tfoot th { font-weight: 700; }
table.tm-lab { min-width: 980px; font-variant-numeric: tabular-nums; border-collapse: collapse; }
table.tm-lab tbody + tbody { border-top: 2px solid var(--line); }
table.tm-lab th[scope=rowgroup] { vertical-align: top; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); padding-top: 12px; min-width: 150px; }
.tm-lab-n { text-align: right; }
.tm-lab-n.today { background: #faf7fe; }
th.tm-lab-n.today { color: var(--brand); }
.tm-lab-k { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
tr.tm-lab-cost td { color: var(--muted); }
tr.total td, tr.total th { font-weight: 700; }
.tm-lab-max { min-width: 150px; vertical-align: middle; }
.tm-bar-wrap { display: grid; gap: 4px; }
.tm-bar { height: 8px; border-radius: 99px; background: #eee9f4; overflow: hidden; }
.tm-bar span { display: block; height: 100%; background: #2f8a3a; border-radius: 99px; }
.tm-bar.near span { background: #d48a00; }
.tm-bar.over span { background: #c0392b; }
table.tm-emp-table a { color: var(--ink); text-decoration: none; }
table.tm-emp-table a:hover { color: var(--brand); text-decoration: underline; }
.tm-emp-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 150px; }
.tm-att-list { max-height: 640px; }
.tm-contact { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 14px; font-size: 14px; background: #f8f7fa; border-radius: 10px; padding: 10px 12px; }
.tm-contact dt { color: var(--muted); }
.tm-contact dd { margin: 0; }
.tm-contact dd.muted { grid-column: 1 / -1; }

/* Support */
.support-dlg textarea { width: 100%; min-height: 120px; }
.support-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.support-shot { display: grid; gap: 6px; justify-items: start; margin-bottom: 8px; }
.support-shot img { max-width: 100%; max-height: 220px; border-radius: 10px; border: 1px solid var(--line); }
dialog.capturing { opacity: 0; }
dialog.capturing::backdrop { opacity: 0; }
.support-shot .linkish { font-size: 13.5px; }

/* ---------- leads ---------- */
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; }
.seg-n { margin-left: 6px; font-size: 12px; opacity: .7; font-weight: 500; }
.lead-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.lead-tools .segmented { flex-wrap: wrap; }
.lead-tools input[type=search] { flex: 1 1 200px; min-width: 160px; }
.lead-msg { max-width: 320px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lead-top { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.lead-actions { margin: 12px 0 6px; flex-wrap: wrap; }
.lead-log { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: start; margin-bottom: 12px; }
.lead-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.lead-timeline li { position: relative; }
.lead-timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.lead-timeline li.lt-enquiry::before { background: var(--brand); }
.lead-timeline li.lt-converted::before { background: var(--ok); }
.lead-timeline li.lt-call::before, .lead-timeline li.lt-email::before { background: #4b3d7a; }
.lt-meta { color: var(--muted); }
.lt-body { white-space: pre-wrap; margin-top: 2px; }
.lead-forms { display: grid; gap: 8px; margin-bottom: 6px; }
.lead-form-row { display: flex; gap: 8px; align-items: center; }
.lead-form-row input { width: 110px; }
.token-show { display: block; user-select: all; word-break: break-all; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card.warn { background: #fdf3e4; border-color: #f2d7ad; color: var(--warn); }
.card.ok { background: #e9f6ee; border-color: #c4e6d1; color: var(--ok); }
.danger-text { color: var(--danger); }
.switch.small { font-size: 13px; }
.switch.small input { width: 15px; height: 15px; }

/* ---------- contracts and checklists ---------- */
.hr-docs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.hr-docs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.hr-docs .row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hr-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; background: var(--panel-2); border-radius: 12px; }
.hr-upload input[type=file] { max-width: 230px; }
.hr-check { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.hr-check li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.hr-check li label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 500; cursor: pointer; }
.hr-check li label input { width: 17px; height: 17px; accent-color: var(--brand); }
.hr-check li.done label span { color: var(--muted); text-decoration: line-through; }
.hr-leave { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .lead-log { grid-template-columns: 1fr; }
}
.lead-h { margin-top: 22px; }
.hr-upload { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; align-items: end; padding: 14px; }
.hr-upload h3 { grid-column: 1 / -1; margin: 0 0 4px; font-size: 15px; }
.hr-upload .field { margin: 0; }
.hr-upload input[type=file] { max-width: none; width: 100%; padding: 8px; }
.hr-upload-go { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
.hr-docs .linkish { font-size: 14px; }
@media (max-width: 640px) { .hr-upload { grid-template-columns: 1fr; } }
.toolbar select.staff-show { width: auto; min-width: 210px; flex: 0 0 auto; }
/* onboarding pack */
.ok-text { color: var(--ok); }
.hr-when { text-align: right; }
.hr-check li > label > span .muted { font-weight: 400; }
.hr-sizes { margin: 4px 0 12px; }
.hr-ob-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lib-upload .lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.lib-sites { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.lib-upload .field:nth-of-type(3) { grid-column: 1 / -1; }
.hr-upload-opts { display: grid; gap: 6px; }
.email-log-tools { flex-wrap: wrap; }
.email-log-tools select { width: auto; flex: 0 0 auto; }
.email-log-tools input { flex: 1 1 220px; }
pre.email-text { white-space: pre-wrap; word-break: break-word; font: 14px/1.5 system-ui, sans-serif; background: var(--panel-2); border-radius: 12px; padding: 14px 16px; max-height: 55vh; overflow: auto; }
td.lead-pick, th.lead-pick { width: 34px; } td.lead-pick input, th.lead-pick input { width: 17px; height: 17px; accent-color: var(--brand); }
/* The member record's menus open over the tabs and cards below them. */
.card.record-head { position: relative; z-index: 5; overflow: visible; }
details.menu[open] { z-index: 30; }
.card.hr-owed { background: var(--panel-2); border: 0; margin: 4px 0 12px; padding: 14px 16px; }
.hr-owed-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 15px; }
.pps-show { display: flex; align-items: end; padding-bottom: 10px; }

/* ---------- first-login tour and page tips ---------- */
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour-hole {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 0 9999px rgba(20, 16, 30, .55);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
.tour::before { content: ''; position: fixed; inset: 0; }
.tour.no-hole::before { background: rgba(20, 16, 30, .55); }
.tour-card {
  position: fixed; background: var(--card); color: var(--ink); border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: 0 18px 50px rgba(20, 16, 30, .3); max-width: calc(100vw - 32px); transition: top .25s ease, left .25s ease;
}
.tour-card.centred { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); }
.tour-card h2 { margin: 0 0 6px; font-size: 18px; color: var(--brand-d); }
.tour-card p { margin: 0 0 14px; line-height: 1.5; }
.tour-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-actions .spacer { flex: 1; }
.shell.tour-on .sidebar { width: 224px; box-shadow: 10px 0 34px rgba(28, 27, 34, .12); }
.shell.tour-on .sidebar .label { opacity: 1; }
@media (max-width: 820px) {
  .shell.tour-on .sidebar { width: 250px; transform: translateX(0); }
}
.page-tip {
  position: fixed; right: 20px; bottom: 20px; z-index: 80; width: min(340px, calc(100vw - 32px));
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  box-shadow: 0 12px 34px rgba(28, 27, 34, .16); animation: tip-in .25s ease both;
}
.page-tip strong { display: block; margin-bottom: 2px; }
.page-tip p { margin: 0 0 10px; color: var(--muted); line-height: 1.45; font-size: 14px; }
.page-tip-ico { color: var(--brand); flex: none; margin-top: 1px; }
.page-tip-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.page-tip-x:hover { color: var(--ink); }
@keyframes tip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-tip { animation: none; } .tour-hole, .tour-card { transition: none; } }
@media print { .tour, .page-tip { display: none; } }

/* "View as": a full admin seeing LIFE as another staff member */
.view-as-bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 24px; background: #2b2140; color: #fff; font-size: 14px;
}
.view-as-bar strong { color: #fff; }
.view-as-bar .spacer { flex: 1; }
.view-as-bar .btn { background: #fff; color: var(--brand-d); border-color: #fff; }
.view-as-eye { display: inline-flex; opacity: .85; }
.view-as-btn { display: block; margin-top: 2px; font-size: 13px; }
.pin-show.small-pin { display: inline-block; font-size: 22px; padding: 6px 14px; margin: 0 8px 0 0; vertical-align: middle; }

/* Shown while LIFE loads, and when the server isn't answering */
.boot-wait { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; color: var(--muted); }
.boot-wait h1 { margin: 6px 0 0; font-size: 22px; color: var(--ink); }
.boot-wait p { margin: 0; max-width: 42ch; }

/* Team → Today: grouped attendance */
.pill.finished { background: #fbe4e2; color: #b3261e; }
.tm-grp { margin-top: 14px; }
.tm-grp:first-of-type { margin-top: 4px; }
.tm-grp-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tm-grp-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; background: var(--line); color: var(--ink); }
.tm-grp-in .tm-grp-head { color: var(--ok); }
.tm-grp-in .tm-grp-n { background: #e3f4ea; color: var(--ok); }
.tm-grp-late .tm-grp-head { color: #9a5b00; }
.tm-grp-late .tm-grp-n { background: #fff1d6; color: #9a5b00; }
.tm-grp-done .tm-grp-head { color: #b3261e; }
.tm-grp-done .tm-grp-n { background: #fbe4e2; color: #b3261e; }
.tm-grp-done .tm-att { opacity: .82; }
.tm-grp-done .tm-time b.out { color: #b3261e; }
