/* =========================================================
   KitStore — shared stylesheet
   Used by index.html, asset-fx6.html, basket.html
   ========================================================= */

:root {
  /* Light mode, the default (owner, 1 Dec 2026: "make white mode default"). Dark mode = html[data-theme="dark"]
     below, the original colours; chosen in the ☰ menu, kept per device (localStorage kitstore_theme). */
  color-scheme: light;
  --bg: #f1f5f9;
  --card: #ffffff;
  --card-hover: #e8eef6;
  --card-alt: #f8fafc;
  --zebra: #f1f4f8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #cbd5e1;
  --text: #0f172a;
  --sub: #475569;
  --muted: #64748b;
  --disabled-text: #94a3b8;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --warn-border: #fcd34d;
  --warn-text: #92400e;
  --warn-hover: rgba(245, 158, 11, 0.15);
  --amber-status: #b45309;
  --danger: #dc2626;
  --danger-status: #dc2626;
  --success: #059669;
  --dark-past: #e2e8f0;
  --dark-container: #ffffff;
  /* text and shadows that were hard-coded for the dark background */
  --strong: #0f172a;
  --link: #1d4ed8;
  --info-text: #1e40af;
  --ok-text: #047857;
  --ok-strong: #065f46;
  --bad-text: #b91c1c;
  --bad-strong: #991b1b;
  --amber-text: #b45309;
  --purple-text: #7e22ce;
  --purple-strong: #6b21a8;
  --neutral-text: #475569;
  --covered-text: #15803d;
  --shadow-70: rgba(15, 23, 42, 0.16);
  --shadow-80: rgba(15, 23, 42, 0.22);
  --shadow-85: rgba(15, 23, 42, 0.2);
  --inset-15: rgba(15, 23, 42, 0.04);
  --inset-25: rgba(255, 255, 255, 0.6);
  --overlay: rgba(15, 23, 42, 0.45);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --card: #1e293b;
  --card-hover: #283548;
  --card-alt: #162032;
  --zebra: #243146;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #334155;
  --text: #f8fafc;
  --sub: #94a3b8;
  --muted: #475569;
  --disabled-text: #64748b;
  --warn: #f59e0b;
  --warn-bg: #451a03;
  --warn-border: #78350f;
  --warn-text: #fef08a;
  --warn-hover: rgba(245, 158, 11, 0.18);
  --amber-status: #fbbf24;
  --danger: #ef4444;
  --danger-status: #f87171;
  --success: #34d399;
  --dark-past: #111827;
  --dark-container: #090e17;
  --strong: #ffffff;
  --link: #93c5fd;
  --info-text: #dbeafe;
  --ok-text: #6ee7b7;
  --ok-strong: #d1fae5;
  --bad-text: #fca5a5;
  --bad-strong: #fecaca;
  --amber-text: #fcd34d;
  --purple-text: #d8b4fe;
  --purple-strong: #e9d5ff;
  --neutral-text: #cbd5e1;
  --covered-text: #86efac;
  --shadow-70: rgba(0,0,0,0.7);
  --shadow-80: rgba(0,0,0,0.8);
  --shadow-85: rgba(0,0,0,0.85);
  --inset-15: rgba(0,0,0,0.15);
  --inset-25: rgba(0,0,0,0.25);
  --overlay: rgba(2, 6, 23, 0.7);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px 24px 160px;   /* extra room to scroll past the bottom-most element */
  margin: 0;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

@media (max-width: 860px) {
  .container { grid-template-columns: minmax(0, 1fr); }
  .container > * { min-width: 0; }
}

/* ---------- Top nav ---------- */
.top-nav {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
}
.nav-btn-link {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-btn-link:hover { background: var(--border); }

/* ---------- Headers ---------- */
.page-header h1, .asset-header h1 { margin: 0 0 8px 0; font-size: 28px; }
.page-header p { color: var(--sub); margin: 0; font-size: 14px; }

.meta { color: var(--sub); font-size: 14px; margin-bottom: 20px; display: flex; gap: 12px; }
.meta > span { background: var(--bg); padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); }

/* ---------- Cards ---------- */
.main-card, .sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

/* ---------- Calendar ---------- */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-header h3 { margin: 0; font-size: 16px; min-width: 130px; text-align: center; color: var(--text); }
.nav-btn {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 14px; font-weight: bold;
  transition: background 0.15s ease;
}
.nav-btn:hover { background: var(--border); }

.calendar-wrapper { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.days-row { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg); border-bottom: 1px solid var(--border); }
.day-name { padding: 6px 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--sub); text-transform: uppercase; }
.dates-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); }

.date-cell {
  background: var(--card); aspect-ratio: 1 / 1; position: relative;
  box-sizing: border-box; transition: background 0.15s ease; user-select: none;
}
.date-num { position: absolute; top: 6px; right: 6px; font-size: 13px; font-weight: 700; line-height: 1; color: var(--muted); z-index: 2; pointer-events: none; }
.date-status { position: absolute; bottom: 6px; left: 6px; font-size: 15px; font-weight: 800; line-height: 1.1; z-index: 2; pointer-events: none; }

.empty { background: var(--bg); }
.past { background: var(--dark-past); }

.green { cursor: pointer; }
.green:hover:not(.selected) { background: var(--card-hover); }
.green .date-status { color: var(--success); }

.amber { cursor: pointer; }
.amber:hover:not(.selected) { background: var(--card-hover); }
.amber .date-status { color: var(--amber-status); }

.red { cursor: not-allowed; opacity: 0.7; }
.red .date-status { color: var(--danger-status); }

.date-cell.selected { background: var(--accent) !important; }
.date-cell.in-range { background: rgba(37, 99, 235, 0.25) !important; }
.date-cell.selected .date-num { color: #ffffff !important; }
.date-cell.in-range .date-num { color: var(--strong) !important; }

/* Compact calendar variant (used inside popovers) */
.pip-calendar .calendar-header h3 { font-size: 13px; min-width: 100px; }
.pip-calendar .nav-btn { padding: 4px 8px; font-size: 12px; }
.pip-calendar .date-status { font-size: 12px; }
.pip-calendar .date-num { font-size: 11px; }

/* ---------- Specs ---------- */
.spec-group { margin-bottom: 14px; }
.spec-group strong { color: var(--sub); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
.spec-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.spec-list li { padding: 5px 0; border-bottom: 1px solid var(--card-hover); display: flex; justify-content: space-between; }
.spec-list li span.val { color: var(--text); font-weight: 600; text-align: right; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--accent); color: #ffffff; border: none; padding: 12px;
  border-radius: 8px; font-size: 15px; font-weight: bold; width: 100%;
  cursor: pointer; margin-top: 12px; transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { background: var(--border); color: var(--disabled-text); cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; margin-top: 10px; width: 100%; }

.btn-add {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
  transition: 0.15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-add:hover { background: var(--accent); color: #ffffff; }

.btn-avail {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600;
  transition: 0.15s; white-space: nowrap;
}
.btn-avail:hover { background: var(--accent); color: #ffffff; }

/* ---------- Suggested / frequent item rows ---------- */
.suggested-item, .frequent-item {
  padding: 10px; border: 1px solid var(--border); border-radius: 8px;
  margin-top: 10px; font-size: 13px; background: var(--card-alt);
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px;
}

/* ---------- Alerts / deficits ---------- */
.alert-box { background: var(--warn-bg); border: 1px solid var(--warn); color: var(--warn-text); border-radius: 8px; padding: 16px; margin-top: 12px; font-size: 12px; }
.alert-box p { color: var(--warn-text); }
.alert-header { display: flex; align-items: center; font-size: 15px; font-weight: bold; margin-bottom: 12px; color: var(--warn-text); }
.deficit-list { font-family: inherit; font-size: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.fix-issue-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--inset-25); border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 12px 16px; border-radius: 8px; margin-top: 12px; gap: 12px; flex-wrap: wrap;
}

.arrow-container { width: 32px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.sub-arrow { color: var(--warn); font-size: 15px; font-weight: bold; }

.hover-asset-row { transition: background-color 0.15s ease; border-radius: 8px; padding: 12px 14px; }
.hover-asset-row:hover { background-color: var(--card-hover); }
.alert-box .hover-asset-row:hover { background-color: var(--warn-hover) !important; }

.basket-icon-green { width: 14px; height: 14px; stroke: var(--success); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-left: 6px; vertical-align: text-bottom; }

.empty-state { text-align: center; padding: 32px 16px; color: var(--sub); font-size: 14px; }
.empty-state a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* ---------- Slideshow ---------- */
.slideshow-container { position: relative; overflow: hidden; border-radius: 8px; user-select: none; background: var(--dark-container); }
.slide { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 12px; color: var(--sub); text-align: center; box-sizing: border-box; background-size: cover; background-position: center; word-wrap: break-word; padding: 4px; }
.slide.active { display: flex; }
/* Arrows: no background until hovered; a dark halo keeps the glyph visible on white photos. */
.slide-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,0.9), 0 1px 6px rgba(0,0,0,0.6); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; padding: 0; transition: background 0.15s ease; }
.slide-arrow:hover { background: rgba(15,23,42,0.75); text-shadow: none; }
/* Defaults for any slideshow; specific sizes below override. */
.slide-arrow { width: 22px; height: 34px; font-size: 14px; }
.slide-arrow.left { left: 0; border-radius: 0 5px 5px 0; }
.slide-arrow.right { right: 0; border-radius: 5px 0 0 5px; }
.card-photo .slide-arrow { width: 30px; height: 46px; font-size: 18px; }
.category-thumb .slide-arrow { width: 16px; height: 26px; font-size: 11px; }

.main-slideshow { width: 100%; aspect-ratio: 1 / 1; height: auto; margin-left: auto; margin-right: auto; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 24px; }
.main-slideshow .slide { font-size: 13px; }
/* Product photo slides: white backdrop so manufacturer shots (mostly on
   white) sit cleanly; the whole photo is always visible. */
.slide.photo { background: #fff; padding: 0; position: relative; overflow: hidden; }
.slide-photo { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }
.main-slideshow .slide-arrow { width: 28px; height: 44px; font-size: 16px; }
.main-slideshow .slide-arrow.left { left: 0; border-radius: 0 6px 6px 0; }
.main-slideshow .slide-arrow.right { right: 0; border-radius: 6px 0 0 6px; }

.thumb-slideshow { width: 56px; height: 56px; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; }
.thumb-slideshow .slide-arrow { width: 14px; height: 22px; font-size: 10px; }
.thumb-slideshow .slide-arrow.left { left: 0; border-radius: 0 3px 3px 0; }
.thumb-slideshow .slide-arrow.right { right: 0; border-radius: 3px 0 0 3px; }

/* Asset photos in thumbnails and cards (images are pre-cropped to 1:1). */
.thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.small-thumb-slideshow { width: 48px; height: 48px; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; }
.small-thumb-slideshow .slide-arrow { width: 12px; height: 20px; font-size: 9px; }
.small-thumb-slideshow .slide-arrow.left { left: 0; border-radius: 0 3px 3px 0; }
.small-thumb-slideshow .slide-arrow.right { right: 0; border-radius: 3px 0 0 3px; }

.slide-counter { position: absolute; bottom: 8px; right: 12px; background: rgba(0,0,0,0.65); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15); }

/* Single static icon tile (dynamically-added basket/asset rows with no gallery yet) */
.icon-tile { display: flex; align-items: center; justify-content: center; font-size: 20px; background: linear-gradient(135deg, var(--card), var(--bg)); }

/* ---------- Basket overlay (nav) ---------- */
.basket-wrapper { position: relative; display: inline-block; }
.basket-overlay {
  position: absolute; top: 0; left: 100%; margin-left: 12px; width: 500px;
  background: var(--card-alt); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px var(--shadow-70); z-index: 100; padding: 16px;
  display: none; opacity: 0; transform: translateX(-10px); transition: opacity 0.2s ease, transform 0.2s ease;
}
/* transform must be none (not translateX(0)) when open: any transform turns
   the overlay into the containing block for position:fixed descendants,
   which would break the floating date popovers inside it. */
.basket-overlay.show { display: block; opacity: 1; transform: none; }
.basket-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.basket-header h4 { margin: 0; font-size: 16px; }
.basket-items { max-height: 70vh; overflow-y: auto; padding-right: 4px; } /* JS (fitBasketList) extends this to the window bottom */
/* Overlay rows: asset name and date range on one line each. */
.basket-overlay .item-title,
.basket-overlay .item-dates-btn { white-space: nowrap; }

/* ---------- Basket line items (overlay + basket page share this) ---------- */
.basket-item { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 16px; border-bottom: 1px solid var(--border); align-items: center; position: relative; }
.basket-item:last-child { border-bottom: none; }
.item-title { margin: 0 0 4px 0; font-size: 16px; color: var(--text); font-weight: 600; }
.item-meta { color: var(--sub); font-size: 13px; margin: 0; }

.pip-container { position: relative; display: inline-block; }
.item-dates-btn {
  background: var(--bg); padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: 0.15s; font-family: inherit; font-weight: normal; margin-top: 8px;
}
.item-dates-btn:hover { background: var(--border); border-color: var(--sub); }
.item-dates-btn strong { font-weight: 600; color: var(--strong); }

.item-actions { display: flex; align-items: center; gap: 12px; }
.qty-input { width: 44px; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border); color: var(--strong); border-radius: 6px; padding: 10px 8px; text-align: center; font-size: 14px; font-family: monospace; }
.qty-input.qty-invalid, .qty-input.qty-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); outline: none; }

.trash-btn { background: none; border: none; cursor: pointer; padding: 6px; transition: transform 0.2s; display: flex; align-items: center; justify-content: center; }
.trash-btn:hover { transform: scale(1.15); }

/* ---------- Deficit dropdown (accessory options) ---------- */
.deficit-dropdown { display: none; background: var(--inset-15); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-top: 10px; }
.deficit-dropdown.show { display: block; }
.option-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); gap: 12px; margin: 4px 0; padding: 6px 0; }
.option-row:last-child { border-bottom: none; }
.option-indent-prefix { display: flex; align-items: center; width: 142px; justify-content: flex-end; flex-shrink: 0; }

/* ---------- PiP calendar popover ---------- */
.pip-calendar {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 8px; width: 270px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; box-shadow: 0 12px 30px var(--shadow-85); z-index: 200; cursor: default;
}
.pip-calendar.right-align { left: auto; right: 0; }
.pip-calendar.show { display: block; }
/* Deficit alert: host booking photos, booked days (uncovered highlighted),
   then one block per uncovered range. */
.deficit-host { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.host-slideshow { width: 84px; height: 84px; border-radius: 8px; border: 1px solid var(--warn-border); flex-shrink: 0; background: #fff; }
.host-slideshow .slide-arrow { width: 16px; height: 26px; font-size: 10px; }
.host-slideshow .slide-arrow.left { left: 0; border-radius: 0 4px 4px 0; }
.host-slideshow .slide-arrow.right { right: 0; border-radius: 4px 0 0 4px; }
.deficit-host-name { font-size: 15px; font-weight: 700; color: var(--strong); }
.deficit-host-dates { font-size: 12px; margin: 2px 0 8px; }
.day-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.day-chip { min-width: 26px; height: 26px; padding: 0 4px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 12px; font-weight: 700; }
.day-chip.covered { background: rgba(34, 197, 94, 0.15); color: var(--covered-text); border: 1px solid rgba(34, 197, 94, 0.35); }
.day-chip.missing { background: var(--warn); color: #1c1003; border: 1px solid var(--warn); }
.deficit-host-note { font-size: 12px; }
.deficit-range { border-top: 1px solid var(--warn-border); padding-top: 10px; margin-top: 10px; }
.deficit-range-head { font-size: 13px; margin-bottom: 4px; }
.range-pill { display: inline-block; background: var(--warn); color: #1c1003; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }

.nav-left { display: flex; align-items: center; gap: 8px; }
/* KitStore link centred at the top of the page (the container is the frame). */
.container { position: relative; }
.brand-link { position: absolute; left: 50%; top: 0; transform: translateX(-50%); height: 32px; display: flex; align-items: center; box-sizing: border-box; z-index: 2; }
.top-nav .basket-wrapper { margin-left: auto; }

/* ---------- ☰ Menu (every page, top right) ---------- */
/* Placed in the page's top-right corner (the container is the frame, as for the
   centred KitStore link); the top bars keep clear of it. */
.audit-page { position: relative; }
.top-nav.has-menu, .sidebar-nav.top-nav { padding-right: 50px; }
.menu-wrapper { position: absolute; top: 0; right: 0; z-index: 310; }
.menu-toggle { width: 40px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; }
.menu-toggle[aria-expanded="true"] { background: var(--card); border-color: var(--accent); }
.menu-overlay {
  position: absolute; top: 100%; right: 0; margin-top: 8px; width: 260px; box-sizing: border-box;
  background: var(--card-alt); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px var(--shadow-70); padding: 8px; display: none; flex-direction: column; gap: 2px;
}
.menu-overlay.show { display: flex; }
.menu-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.menu-link:hover { background: var(--card); }
.menu-link.current { background: rgba(37, 99, 235, 0.18); color: var(--info-text); font-weight: 600; }
.menu-icon { width: 22px; text-align: center; }
.menu-theme { background: none; border: none; width: 100%; font: inherit; font-size: 15px; text-align: left; cursor: pointer; border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; padding-top: 12px; }
.menu-theme + .menu-logout { margin-top: 0; }
.menu-logout { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; color: var(--sub); }

/* ---------- Manage Bookings (manage.html) ---------- */
.manage-page { max-width: none; }
.manage-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.manage-toolbar .btn { width: auto; margin-top: 0; }
.toolbar-spacer { flex: 1; }
.bulk-select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font: inherit; font-size: 13px; }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--link); }
.btn-outline:hover:not(:disabled) { background: var(--accent); color: #fff; }
.btn-outline:disabled { background: transparent; border-color: var(--border); color: var(--sub); }
.btn-danger { background: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.manage-flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.manage-flash.ok { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.5); color: var(--ok-strong); }
.manage-flash.warn { background: var(--warn-bg); border: 1px solid var(--warn); color: var(--warn-text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.manage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.manage-table th, .manage-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.manage-table thead th { background: var(--card-alt); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.manage-table .head-labels th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--sub); padding-bottom: 4px; border-bottom: none; }
.manage-table .head-filters th { padding-top: 0; }
.col-range-pair { display: flex; gap: 4px; }
.col-range-pair .col-range { width: 0; flex: 1 1 0; min-width: 44px; -moz-appearance: textfield; }
.col-range::-webkit-outer-spin-button, .col-range::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.manage-table th.sortable { cursor: pointer; user-select: none; }
.manage-table th.sortable:hover { color: var(--text); }
.manage-table th.sorted { color: var(--link); }
.sort-arrow { display: inline-block; min-width: 12px; margin-left: 4px; font-size: 10px; }
.filter-suggest { position: fixed; z-index: 600; background: var(--card); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 10px 25px var(--shadow-70); max-height: 320px; overflow-y: auto; padding: 4px 0; font-size: 13px; }
.suggest-item { padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.suggest-item:hover, .suggest-item.active { background: var(--card-hover); color: var(--strong); }
.detail-stock { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; font-size: 13px; }
.stock-line { white-space: nowrap; }
.muted-cell { color: var(--sub); }
.barcode-cell .unit-chip { font-size: 12px; }
.manage-table td[data-col="assets"] { min-width: 220px; }
.modal-lock { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.5); color: var(--purple-strong); border-radius: 6px; padding: 8px 10px; font-size: 13px; margin: 0 0 12px; }
.modal input:disabled, .modal .qty-input:disabled { opacity: 0.5; cursor: not-allowed; }
.manage-table td[data-col="picked"], .manage-table td[data-col="collected"], .manage-table td[data-col="restocked"] { white-space: nowrap; }
.manage-table td[data-col="qty"] { text-align: center; font-weight: 700; }
.manage-table td[data-col="description"] { color: var(--sub); min-width: 160px; }
.col-filter { width: 100%; min-width: 80px; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 5px; padding: 5px 7px; font: inherit; font-size: 12px; }
.col-filter:focus { outline: none; border-color: var(--accent); }
.booking-row { cursor: pointer; transition: background-color 0.12s; }
.booking-row:hover { background: var(--card-hover); }
.booking-row.expanded { background: var(--card-hover); }
.booking-row.selected { background: rgba(37, 99, 235, 0.14); }
.manage-table td[data-col="asset"] { min-width: 160px; font-weight: 600; }
.manage-table td[data-col="notes"] { min-width: 180px; color: var(--sub); }
.manage-table td[data-col="from"], .manage-table td[data-col="to"], .manage-table td[data-col="requested"],
.manage-table td[data-col="id"] { white-space: nowrap; }
.col-controls { white-space: nowrap; width: 1%; }
.col-select { width: 1%; white-space: nowrap; }
.col-select input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.select-all-btns { display: flex; flex-direction: column; gap: 3px; }
.select-all-btns button { background: transparent; border: 1px solid var(--border); color: var(--link); border-radius: 4px; font-size: 11px; padding: 2px 6px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.select-all-btns button:hover { border-color: var(--accent); }
.icon-btn { background: transparent; border: none; color: var(--sub); padding: 4px; border-radius: 5px; cursor: pointer; display: inline-flex; }
.icon-btn:hover:not(:disabled) { color: var(--strong); background: var(--border); }
.icon-btn.danger:hover:not(:disabled) { color: var(--danger); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.state-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.state-booked { background: rgba(37, 99, 235, 0.2); color: var(--link); }
.state-picked { background: rgba(245, 158, 11, 0.2); color: var(--amber-text); }
.state-collected { background: rgba(168, 85, 247, 0.2); color: var(--purple-text); }
.state-restocked { background: rgba(52, 211, 153, 0.18); color: var(--ok-text); }
.scan-times { font-family: inherit; font-size: 12px; font-weight: 700; color: var(--amber-text); margin-left: 4px; }
.audit-shelf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.audit-shelf label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.audit-shelf-input { width: 90px; }
.state-cancelled, .state-missed { background: rgba(148, 163, 184, 0.16); color: var(--neutral-text); }
.overdue-yes { background: rgba(239, 68, 68, 0.2); color: var(--bad-text); }
.booking-detail > td { background: var(--bg); padding: 0; }
.booking-detail-inner { padding: 14px 18px 18px; border-left: 3px solid var(--accent); }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.detail-head .btn { width: auto; margin-top: 0; }
.detail-note { font-size: 12px; color: var(--sub); margin: 6px 0 10px; }
.detail-items { width: 100%; border-collapse: collapse; }
.detail-items th { font-size: 11px; text-transform: uppercase; color: var(--sub); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.detail-items td { padding: 8px; border-bottom: 1px solid var(--card-hover); vertical-align: middle; }
.detail-item { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.detail-items .num { font-weight: 700; font-size: 14px; }
.stock-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(52, 211, 153, 0.15); color: var(--ok-text); font-weight: 700; white-space: nowrap; }
.stock-chip.short { background: rgba(239, 68, 68, 0.2); color: var(--bad-text); }
.short-note { font-size: 11px; color: var(--bad-text); margin-top: 3px; }
.line-state { white-space: nowrap; }
.units { display: flex; flex-wrap: wrap; gap: 4px; }
.unit-chip { display: inline-flex; align-items: center; gap: 6px; font-family: monospace; font-size: 12px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--border); background: var(--card); }
.unit-chip em { font-style: normal; font-family: inherit; font-size: 10px; text-transform: uppercase; opacity: 0.8; }
.unit-picked { border-color: rgba(245, 158, 11, 0.6); }
.unit-collected { border-color: rgba(168, 85, 247, 0.6); }
.unit-restocked { border-color: rgba(52, 211, 153, 0.6); opacity: 0.75; }
.muted { color: var(--sub); font-size: 12px; }
.scan-cell { white-space: nowrap; text-align: right; }
.detail-items .unit-actions { width: 1%; white-space: nowrap; padding-left: 0; padding-right: 0; }
.unit-actions .icon-btn:hover { color: var(--ok-text); }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 500; overflow-y: auto; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; width: min(560px, 100%); box-shadow: 0 20px 50px var(--shadow-80); }
.modal-title { margin: 0 0 6px; font-size: 18px; }
.modal-sub { color: var(--sub); font-size: 13px; margin: 0 0 12px; }
.modal-body p { font-size: 14px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); }
.modal input[type="date"] { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; }
.modal-label { font-size: 12px; color: var(--sub); margin: 8px 0 6px; }
.edit-items { display: flex; flex-direction: column; gap: 8px; }
.edit-item { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 10px; align-items: center; }
.edit-item-name { font-size: 14px; }
.edit-item-error { grid-column: 2 / -1; font-size: 12px; color: var(--danger-status); }
.edit-item-error:empty { display: none; }
.edit-add { display: flex; gap: 8px; margin-top: 10px; }
.edit-add select { flex: 1; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 7px; font: inherit; font-size: 13px; }
.edit-add .btn { width: auto; margin-top: 0; }
.modal-error { color: var(--danger-status); font-size: 12px; margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-actions .btn { width: auto; margin-top: 0; }

/* Merge suggestion (blue, same layout as a deficit alert) */
.merge-box { background: rgba(37, 99, 235, 0.12); border: 1px solid var(--accent); border-radius: 8px; padding: 16px; margin-top: 12px; font-size: 12px; color: var(--text); }
.merge-header { font-size: 15px; font-weight: bold; margin-bottom: 12px; color: var(--link); }
.merge-slideshow { border-color: var(--accent); }
.booking-bubble { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--info-text); }
.booking-bubble.seg-a { background: rgba(37, 99, 235, 0.45); border: 1px solid rgba(96, 165, 250, 0.6); }
.booking-bubble.seg-b { background: rgba(96, 165, 250, 0.18); border: 1px solid rgba(96, 165, 250, 0.4); }
.merge-btn { margin-top: 4px; }
.bubble-qty { font-style: normal; font-weight: 800; color: var(--strong); margin-right: -2px; }
.merge-after { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.merge-arrow { font-size: 12px; color: var(--link); margin-right: 2px; }
.merge-arrow::after { content: ' \2192'; }
.booking-bubble.result { background: rgba(52, 211, 153, 0.18); border: 1px solid rgba(52, 211, 153, 0.6); color: var(--ok-strong); }
.merge-btn.confirmed { background: var(--success); color: #000; }

/* Nav basket: deficit count bar above the list */
.basket-deficit-bar { background: var(--warn); color: #1c1003; font-weight: 700; font-size: 13px; text-align: center; padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; }

/* Basket rows: bigger photos, tighter padding */
[data-basket-page-items] .basket-item { padding: 10px 16px 10px 8px; }
[data-basket-page-items] .basket-item > div:first-child { align-items: center !important; }
[data-basket-page-items] .thumb-slideshow { width: 88px; height: 88px; }
.basket-overlay .basket-item { padding: 8px 12px 8px 6px; }
.basket-overlay .thumb-slideshow { width: 64px; height: 64px; }
.brand-link { font-weight: 700; font-size: 15px; text-decoration: none; border-color: transparent; }

.cal-offview { display: flex; justify-content: space-between; gap: 8px; margin: -4px 0 8px; font-size: 12px; font-weight: 600; color: var(--accent); }
.cal-warning { margin-top: 8px; font-size: 12px; color: var(--danger-status); text-align: center; }
/* Popovers inside the nav basket overlay: pinned to the viewport by JS
   (placeFloatingPopover) so the overlay's scrolling list can't clip them. */
.pip-calendar.floating { position: fixed; right: auto; margin-top: 0; }

/* ---------- Booking summary sidebar ---------- */
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 12px; color: var(--sub); }
.summary-row.highlight { font-size: 15px; font-weight: 600; color: var(--text); border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.notes-box { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--strong); padding: 10px; border-radius: 6px; font-size: 13px; box-sizing: border-box; resize: vertical; margin-top: 8px; }

/* ---------- Asset catalog (index page) ---------- */
.catalog-group { font-size: 18px; margin: 32px 0 12px; }
.catalog-group:first-child { margin-top: 0; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.asset-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--text); transition: border-color 0.15s ease, transform 0.15s ease; display: block; }
.asset-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.asset-card .card-photo { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: #fff; }
.asset-card .card-photo .icon-tile { width: 100%; height: 100%; font-size: 36px; }

/* Browse page: category filter column + catalog */
.catalog-layout { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: start; }
.catalog-filter { position: sticky; top: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.catalog-filter h3 { margin: 0 0 10px; font-size: 14px; color: var(--sub); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-option { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.filter-option:hover { background: var(--card-hover); }
.filter-option input { accent-color: var(--accent); margin: 0; cursor: pointer; }
.filter-pic { width: 30px; height: 30px; flex-shrink: 0; border-radius: 5px; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.filter-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.catalog-section:first-child .catalog-group { margin-top: 0; }
@media (max-width: 860px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-filter { position: static; }
}

/* Asset page category chip + same-category popover */
.category-wrapper { position: relative; display: inline-block; }
.category-chip { background: var(--bg); color: var(--sub); font: inherit; font-size: 14px; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; transition: 0.15s; }
.category-chip:hover { border-color: var(--sub); color: var(--text); }
.chip-caret { font-size: 10px; margin-left: 4px; }
.category-popover { display: none; position: absolute; top: 100%; left: 0; margin-top: 8px; z-index: 150; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; box-shadow: 0 12px 30px var(--shadow-85); width: max-content; max-width: min(640px, 90vw); }
.category-popover.show { display: block; }
.category-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.category-thumb { flex: 0 0 auto; width: 88px; height: 88px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: #fff; transition: border-color 0.15s, transform 0.15s; }
.category-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.category-page-btn { display: block; text-align: center; text-decoration: none; margin-top: 10px; }
.asset-card h3 { margin: 0 0 4px 0; font-size: 16px; }
.asset-card p { margin: 0; font-size: 13px; color: var(--sub); }

/* Create booking form (booking-form.html) */
a.btn { display: inline-block; text-decoration: none; text-align: center; box-sizing: border-box; }
.form-step { margin-bottom: 18px; }
.form-step-label { display: block; font-size: 13px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.user-search { width: min(460px, 100%); box-sizing: border-box; background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; }
.user-search:focus { outline: none; border-color: var(--accent); }
.user-suggest { min-width: 320px; }
.user-option { display: grid; grid-template-columns: 1fr auto; gap: 0 14px; padding: 2px 0; }
.user-option .muted { grid-column: 1; }
.user-open { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 12px; color: var(--ok-text); }
.user-open.none { color: var(--sub); }
.user-chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-size: 15px; }
.user-chosen .muted { margin: 0 6px; }
.user-chosen .btn { width: auto; margin-top: 0; }
.form-row { cursor: pointer; }
.form-asset { display: flex; align-items: center; gap: 10px; min-width: 200px; font-weight: 600; }
.manage-table td[data-col="qty"] { text-align: center; font-weight: 700; }
.form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 14px 0; }
.create-form-btn { width: auto; margin-top: 0; padding: 10px 22px; }
.create-form-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Stock audit (audit.html) — phone first */
.audit-page { max-width: 1100px; margin: 0 auto; }
.audit-h2 { font-size: 16px; margin: 22px 0 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.3px; }
.audit-new { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.audit-new .btn { width: auto; margin-top: 0; }
.audit-list { display: flex; flex-direction: column; gap: 8px; }
.audit-list-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.audit-list-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 180px; }
.audit-list-actions { display: flex; align-items: center; gap: 8px; }
.audit-list-actions .btn, .audit-actions .btn { width: auto; margin-top: 0; }
.phone-card { display: flex; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 6px 0 10px; }
.phone-card p { margin: 6px 0; font-size: 13px; }
.phone-qr { width: 150px; height: 150px; flex-shrink: 0; background: #fff; border-radius: 8px; padding: 4px; }
.phone-qr svg { width: 100%; height: 100%; display: block; }
.phone-url { font-size: 12px; color: var(--link); word-break: break-all; }
.scan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: env(safe-area-inset-top); z-index: 5; background: var(--bg); padding: 6px 0 10px; }
.scan-head .btn { width: auto; margin-top: 0; }
.scan-title { font-size: 18px; font-weight: 700; }
.scan-result { border-radius: 10px; padding: 12px 14px; font-size: 16px; font-weight: 600; margin-bottom: 10px; border: 1px solid var(--border); background: var(--card); min-height: 48px; }
.scan-result.good { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.6); color: var(--ok-strong); }
.scan-result.new { background: rgba(37, 99, 235, 0.18); border-color: rgba(96, 165, 250, 0.7); color: var(--info-text); }
.scan-result.dup { background: var(--warn-bg); border-color: var(--warn); color: var(--warn-text); }
.scan-result.bad { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.6); color: var(--bad-strong); }
.scan-camera { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 60vh; background: #000; border-radius: 12px; overflow: hidden; }
.scan-camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-freeze { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-freeze[hidden] { display: none; }
.scan-camera-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; background: var(--card); }
.scan-camera-off[hidden] { display: none; }
.scan-camera-off .btn { width: auto; padding: 14px 26px; font-size: 17px; }
.scan-camera-off a { color: var(--link); word-break: break-all; }
.scan-camera.compact:not(.live) { aspect-ratio: auto; background: none; overflow: visible; margin-bottom: 10px; }
.scan-camera.compact:not(.live) video { display: none; }
.scan-camera.compact .scan-camera-off { position: static; align-items: flex-start; text-align: left; padding: 0; background: none; font-size: 14px; }
.scan-camera.compact .scan-camera-off .btn { padding: 6px 12px; font-size: 14px; }
.scan-camera.compact .scan-camera-off p { margin: 0 0 6px; }
.scan-tally { display: flex; flex-direction: column; margin-top: 2px; }
.scan-tally.off .scan-tally-missing { color: var(--bad-text); }
.scan-tally-inactive { color: var(--warn-text); }
.scan-tools { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.scan-tools .btn { width: auto; margin-top: 0; flex: 1; }
.scan-tools[hidden] { display: none; }
.scan-tools .torch-on { background: #facc15; border-color: #facc15; color: #1c1003; }
.scan-photo { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; width: auto; margin-top: 0; }
.scan-list { display: flex; flex-direction: column; gap: 6px; }
.scan-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.scan-row.pending { opacity: 0.6; }
.scan-list-more { align-self: center; margin-top: 4px; }
.scan-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 14px; }
.scan-row-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-unknown-icon { width: 48px; height: 48px; border-radius: 6px; border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--sub); flex-shrink: 0; font-weight: 700; }
.scan-time { font-size: 12px; white-space: nowrap; }
.audit-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.audit-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.audit-tile { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.audit-tile.warn { border-color: var(--warn); }
.audit-tile-n { font-size: 26px; font-weight: 800; }
.unlinked-group { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.unlinked-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.unlinked-select, .unlinked-batch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.unlinked-bar .btn { width: auto; margin: 0; }
.unlinked-why { font-size: 12px; }
.unlinked-tick { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.unlinked-tick input { width: 18px; height: 18px; accent-color: var(--accent); }
.unlinked-row.selected { background: rgba(37, 99, 235, 0.14); margin: 0 -12px; padding: 6px 12px; }
.unlinked-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--card-hover); }
.audit-find { margin: 14px 0 4px; }
.audit-find-result { margin-top: 8px; font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.audit-find-result .muted { font-weight: 400; }
.unlinked-code { font-weight: 700; min-width: 90px; }
.unlinked-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.unlinked-actions .btn { width: auto; margin-top: 0; }
.audit-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); margin-bottom: 8px; }
/* Import bookings (import.html) */
.import-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.import-card .btn { width: auto; margin: 0; align-self: flex-start; }
.import-paste { width: 100%; font-family: monospace; font-size: 12px; resize: vertical; }
.import-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.import-group-head .unlinked-tick { flex: 1; min-width: 0; }
.import-names { display: flex; flex-direction: column; gap: 2px; }
.import-why { font-size: 12px; margin: 4px 0 0; }
.import-details { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.import-details summary { cursor: pointer; }
.import-details ul { margin: 8px 0 0; padding-left: 20px; columns: 2; font-size: 13px; }
.import-by { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 10px; }
.import-by .modal-label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.import-table td, .import-table th { white-space: nowrap; }
.import-table td:last-child { white-space: normal; }
.import-name { min-width: 180px; padding: 6px 8px; }
.import-go { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.import-go .btn { width: auto; margin: 0; }
.import-go .muted { font-size: 13px; flex: 1; min-width: 220px; }
.import-plan { padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
/* Audit summary (owner, 30 Oct 2026): a wider page so the items table fits, and its header rows (labels + filters)
   stay at the top while scrolling. Sticky needs the table not to sit in a scrolling box: on wide screens the box
   doesn't scroll; on narrower ones it scrolls itself (both ways) with the headers stuck to its top. */
.audit-wide .audit-page { max-width: 1500px; }
.audit-items thead { position: sticky; top: 0; z-index: 20; }
.audit-items thead th { position: static; }
.audit-items .head-labels th { white-space: normal; min-width: 70px; }
@media (min-width: 1001px) {
  .audit-items-wrap { overflow: visible; }
  .audit-items thead th:first-child { border-top-left-radius: 12px; }
  .audit-items thead th:last-child { border-top-right-radius: 12px; }
}
@media (max-width: 1000px) {
  .audit-items-wrap { overflow: auto; max-height: calc(100dvh - 16px); }
}
.audit-items td[data-col="owned"], .audit-items td[data-col="inStore"], .audit-items td[data-col="out"], .audit-items td[data-col="both"], .audit-items td[data-col="missing"] { text-align: center; }
.audit-count { min-width: 44px; padding: 4px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.audit-count:hover, .audit-count.active { border-color: var(--accent); }
.audit-count.active { background: rgba(37, 99, 235, 0.18); }
.audit-items tr.audit-issue td[data-col="missing"] .audit-count { color: var(--bad-text); border-color: rgba(239, 68, 68, 0.6); font-weight: 700; }
.audit-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.audit-views .btn { width: auto; margin: 0; }
.audit-nobc { align-self: center; font-size: 13px; }
.audit-issues { margin: 0 0 8px; padding-left: 18px; color: var(--bad-strong); font-size: 13px; }
.audit-barcodes { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-missing { border-color: rgba(239, 68, 68, 0.6); }
.chip-x { background: none; border: none; color: var(--sub); cursor: pointer; padding: 0 0 0 2px; font-size: 11px; }
.chip-x:hover { color: var(--danger); }
.audit-modal { width: min(620px, 100%); }
.picker-search { width: 100%; margin-bottom: 8px; }
.picker-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.picker-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; color: var(--text); font: inherit; cursor: pointer; }
.picker-item:hover:not(.disabled) { border-color: var(--accent); }
.picker-item.chosen { border-color: var(--accent); background: rgba(37, 99, 235, 0.18); }
.picker-item.disabled { opacity: 0.45; cursor: not-allowed; }
.picker-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.picker-count { font-size: 12px; white-space: nowrap; }
.modal .user-search { width: 100%; }
.new-asset-preview img { width: 120px; height: 120px; border-radius: 8px; margin-top: 8px; object-fit: cover; }


/* Medium widths: the page buttons (Manage Bookings, Stock audit, Basket)
   would run into the centred KitStore title, so they move to a second row. */
@media (max-width: 1000px) {
  .top-nav { height: auto; flex-wrap: wrap; row-gap: 8px; }
  .top-nav > .nav-left { flex: 1 0 100%; min-height: 32px; }
}

/* ==========================================================================
   Phones (≤ 640px): every page. Desktop layout above is unchanged.
   ========================================================================== */
@media (max-width: 640px) {
  body, body.audit-body { padding: calc(env(safe-area-inset-top) + 24px) 12px calc(120px + env(safe-area-inset-bottom)); }
  .container { gap: 16px; }
  .page-header h1, .asset-header h1 { font-size: 22px; }
  .page-header p { font-size: 13px; }
  .main-card, .sidebar-card { padding: 14px; margin-bottom: 16px; border-radius: 10px; }

  /* Top nav: Back (left) + KitStore (centre) on the first row; page links
     (Manage Bookings, Stock audit, Basket) share the second row. */
  .top-nav { height: auto; flex-wrap: wrap; row-gap: 8px; margin-bottom: 14px; }
  .top-nav > .nav-left { flex: 1 0 100%; min-height: 32px; }
  .top-nav .basket-wrapper { margin-left: 0; flex: 1 1 auto; min-width: 0; }
  .top-nav { column-gap: 6px; }
  .top-nav .basket-wrapper > .nav-btn-link { justify-content: center; font-size: 12px; padding: 7px 6px; white-space: nowrap; gap: 3px; }
  .top-nav .basket-wrapper > .nav-btn-link { width: 100%; }
  /* Asset page: the basket button floats top-right instead of sitting below the page. */
  .sidebar-nav, .sidebar-nav.top-nav { position: fixed; top: calc(env(safe-area-inset-top) + 24px); right: 60px; z-index: 300; margin: 0; height: 32px; padding-right: 0; }   /* left of the ☰ menu */
  .menu-overlay { position: fixed; top: calc(env(safe-area-inset-top) + 64px); left: 8px; right: 8px; width: auto; margin-top: 0; }
  .sidebar-nav .nav-btn-link { background: var(--card); padding: 6px 10px; font-size: 13px; }

  /* Basket popup: a full-width sheet under the top bar. */
  .basket-overlay { position: fixed; top: calc(env(safe-area-inset-top) + 68px); left: 8px; right: 8px; width: auto; margin-left: 0; padding: 12px; }
  .basket-overlay .item-title, .basket-overlay .item-dates-btn { white-space: normal; }
  .basket-overlay .basket-item { gap: 8px; }

  /* Browse page: categories as a swipeable row of chips above the grid. */
  .catalog-layout { gap: 14px; }
  .catalog-filter { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; background: none; border: none; border-radius: 0; position: sticky; top: env(safe-area-inset-top); z-index: 20; background: var(--bg); scrollbar-width: none; }
  .catalog-filter::-webkit-scrollbar { display: none; }
  .catalog-filter h3 { display: none; }
  .filter-option { flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px 5px 5px; background: var(--card); font-size: 13px; position: relative; }
  .filter-option:first-of-type { padding-left: 12px; }
  .filter-option input { position: absolute; opacity: 0; pointer-events: none; }
  .filter-option:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
  .filter-pic { width: 24px; height: 24px; border-radius: 50%; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .asset-card { padding: 8px; border-radius: 10px; }
  .asset-card .card-photo { margin-bottom: 8px; }
  .asset-card h3 { font-size: 14px; }
  .asset-card p { font-size: 12px; }
  .catalog-group { font-size: 16px; margin: 20px 0 10px; }

  /* Suggestion rows (frequently booked, deficit options): photo + name, the
     availability button underneath at full width. */
  .frequent-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
  .suggested-item, .frequent-item { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
  .suggested-item > .pip-container { grid-column: 1 / -1; }
  .suggested-item .btn-avail { width: 100%; }

  /* Calendars and popovers fit the screen. */
  .pip-calendar { width: min(300px, calc(100vw - 24px)); }
  .calendar-header h3 { min-width: 0; font-size: 15px; }
  .date-num { top: 4px; right: 4px; font-size: 11px; }
  .date-status { bottom: 4px; left: 4px; font-size: 13px; }
  .category-popover { max-width: calc(100vw - 24px); }

  /* Basket rows (basket page + popup): photo + details, bin on the right. */
  .basket-item { gap: 8px; padding: 10px 6px; }
  .basket-item > div:first-child { min-width: 0; }
  .item-dates-btn { font-size: 12px; padding: 6px 8px; }
  [data-basket-page-items] .thumb-slideshow { width: 64px; height: 64px; }
  .option-row { flex-wrap: wrap; }
  .option-indent-prefix { width: auto; justify-content: flex-start; }
  .deficit-host { gap: 10px; }
  .host-slideshow { width: 64px; height: 64px; }

  /* Admin tables (Manage Bookings, booking form, audit summary) scroll sideways
     inside their frame; toolbars and modals stack. */
  .manage-toolbar { gap: 8px; }
  .manage-toolbar .bulk-select, .manage-toolbar .btn { flex: 1 1 calc(50% - 8px); }
  .toolbar-spacer { display: none; }
  .table-wrap { margin: 0 -12px; border-radius: 0; border-left: none; border-right: none; -webkit-overflow-scrolling: touch; }
  .manage-table { font-size: 12px; }
  .manage-table th, .manage-table td { padding: 6px 8px; }
  /* The first column (tick boxes / edit + cancel) stays put while the table scrolls sideways. */
  .manage-table tr > :first-child { position: sticky; left: 0; z-index: 2; background: var(--card); }
  .manage-table thead tr > :first-child { background: var(--card-alt); z-index: 3; }
  .manage-table tr.booking-detail > td:first-child { background: var(--bg); }
  /* An opened booking stays in view (screen-wide, pinned left) while the wide
     table scrolls; its own unit table scrolls inside it. */
  .booking-detail-inner { padding: 10px; overflow-x: auto; position: sticky; left: 0; width: 100vw; max-width: 100vw; }
  .detail-items { min-width: 560px; }
  .detail-head { font-size: 13px; }
  .detail-stock { flex-direction: column; gap: 4px; }
  .stock-line { white-space: normal; }
  .modal-backdrop { padding: 12px 8px; align-items: flex-start; }
  .modal { padding: 16px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-actions .btn { flex: 1; }

  /* Create booking form */
  .user-search { width: 100%; }
  .user-chosen { padding: 10px 12px; font-size: 14px; }
  .form-footer { position: sticky; bottom: 0; z-index: 10; background: var(--bg); margin: 0 -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); justify-content: space-between; }
  .create-form-btn { padding: 10px 18px; }

  /* Stock audit */
  .phone-card { flex-direction: column; align-items: flex-start; }
  .import-details ul { columns: 1; }
  .unlinked-actions { margin-left: 0; width: 100%; }
  .unlinked-actions .btn { flex: 1; }
  .audit-new .user-search { flex: 1 1 100%; }
  .audit-new .btn { flex: 1; }
  .audit-list-actions { width: 100%; }
  .audit-list-actions .btn { flex: 1; }
  .audit-tiles { grid-template-columns: repeat(2, 1fr); }
}
.trust-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 6px 0 10px; font-size: 14px; }
.trust-card summary { cursor: pointer; font-weight: 600; }
.trust-card ol { padding-left: 20px; margin: 10px 0 6px; }
.trust-card li { margin-bottom: 8px; }
.trust-card .btn { width: auto; margin-top: 0; }

/* Phone on http: one-time "trust this PC" prompt (app.js section 12). */
.trust-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(37, 99, 235, 0.18); border: 1px solid rgba(96, 165, 250, 0.6); color: var(--info-text); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.trust-bar span { flex: 1 1 200px; }
.trust-bar a { color: var(--strong); font-weight: 700; }
.trust-bar button { background: none; border: none; color: var(--link); cursor: pointer; font-size: 14px; }

/* Scanner status line (audit.js setStatus): what the camera sees right now. */
.scan-status { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); font-size: 14px; }
.scan-status[hidden] { display: none; }
.scan-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--sub); }
.scan-status.searching .scan-dot { background: #60a5fa; animation: scan-pulse 1.2s ease-in-out infinite; }
.scan-status.seen { border-color: var(--warn); }
.scan-status.seen .scan-dot, .scan-status.blurry .scan-dot { background: #fbbf24; }
.scan-status.dark .scan-dot, .scan-status.paused .scan-dot { background: #f87171; }
.scan-status.read { border-color: rgba(52, 211, 153, 0.6); }
.scan-status.read .scan-dot { background: #34d399; }
@keyframes scan-pulse { 50% { opacity: 0.3; } }

/* Asset management (assets.html) */
.save-state { display: inline-block; font-size: 13px; padding: 5px 10px; border-radius: 999px; margin-bottom: 12px; border: 1px solid var(--border); }
.save-state.saved { color: var(--ok-text); border-color: rgba(52, 211, 153, 0.5); }
.save-state.saving { color: var(--link); border-color: rgba(96, 165, 250, 0.6); }
.save-state.error { color: var(--bad-strong); border-color: rgba(239, 68, 68, 0.7); background: rgba(239, 68, 68, 0.12); }
.assets-toolbar { margin-top: 12px; }
.assets-footnote { font-size: 12px; margin-top: 12px; }
.asset-editor-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; margin-bottom: 14px; }
.asset-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.asset-photo { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.asset-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.asset-photo .chip-x { position: absolute; top: 4px; right: 4px; background: rgba(15, 23, 42, 0.8); color: #fff; border-radius: 50%; width: 22px; height: 22px; padding: 0; }
.asset-photo.add { display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--sub); background: var(--bg); cursor: pointer; border-style: dashed; }
.asset-photo.add:hover { color: var(--strong); border-color: var(--accent); }
.asset-fields { display: flex; flex-direction: column; gap: 10px; }
.asset-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); }
.asset-fields .modal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0; }
.asset-fields .user-search { width: 100%; font-size: 14px; padding: 8px 10px; }
.asset-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.asset-editor-actions .btn { width: auto; margin-top: 0; }
.danger-outline { border-color: var(--danger) !important; color: var(--bad-text) !important; }
.danger-outline:hover { background: var(--danger) !important; color: #fff !important; }
.barcode-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.barcode-add .user-search { flex: 1 1 260px; width: auto; text-transform: uppercase; }
.barcode-add .btn { width: auto; margin-top: 0; }
.removed-list { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.removed-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--card-hover); }
.removed-row .btn { width: auto; margin-top: 0; }
.link-btn { background: none; border: none; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
@media (max-width: 760px) {
  .asset-editor-grid { grid-template-columns: 1fr; }
  .asset-fields .modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-editor { width: 100vw; position: sticky; left: 0; }
}
.barcode-add .user-search::placeholder { text-transform: none; }

/* Login page */
.login-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 0; font-size: 24px; }
.login-card p { margin: 0; }
.login-brand { font-weight: 800; font-size: 18px; }
.login-card .btn { margin-top: 4px; }
.login-card .manage-flash { margin: 0; }
.login-card .modal-label { display: block; margin: 0; font-size: 13px; }
.login-card .user-search { display: block; width: 100%; margin-top: 6px; background: var(--bg); }

/* Hardware barcode scanner field (audit scan screen) */
.wedge-box { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; font-size: 13px; }
.wedge-box .user-search { width: 100%; }
.typed-row { display: flex; gap: 8px; }
.typed-row .user-search { flex: 1; min-width: 0; font-size: 22px; padding: 12px 14px; letter-spacing: 0.04em; }
.typed-row .btn { flex: none; width: auto; margin: 0; padding-left: 22px; padding-right: 22px; }
/* The scanner's landing box only has to be selectable: kept small (owner: the typed box is the one to read). */
.wedge-small { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.wedge-small .user-search { width: 140px; flex: none; padding: 4px 8px; font-size: 16px; }   /* < 16px makes iPhones zoom in on tap */

/* Booking form: who is creating it */
.form-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 13px; }
.form-admin .user-search { width: min(260px, 100%); }
/* Manage Bookings: scan boxes */
.manage-scan { margin: 0 0 12px; }
.detail-scan { margin: 4px 0 12px; }
.detail-scan .user-search, .manage-scan .user-search { max-width: 420px; }

/* Asset management: barcode lookup */
.asset-missing { color: var(--danger-status); font-weight: 700; }
.asset-audit-key { margin: 4px 0; }
.asset-audit-key .unit-chip { padding: 1px 6px; }
.lookup-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.lookup-box { margin: 0; }
.lookup-box .user-search { max-width: 360px; }
.lookup-result { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.lookup-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lookup-code { font-size: 18px; font-weight: 800; }
.lookup-asset { display: flex; gap: 12px; align-items: flex-start; }
.lookup-asset .small-thumb-slideshow { width: 88px; height: 88px; flex: none; }
.lookup-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.lookup-actions .btn { width: auto; margin: 0; }
.lookup-h { font-size: 14px; margin: 8px 0 0; }
.lookup-list { margin: 0; padding-left: 18px; font-size: 13px; }
.lookup-table td, .lookup-table th { white-space: nowrap; }

/* "Show what the scanner sends" */
.keylog { margin: 4px 0 8px; font-size: 13px; }
.keylog summary { cursor: pointer; color: var(--sub); }
.keylog-out { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 11px; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* Inactive units (kept in asset management, never bookable) */
.unit-inactive { opacity: 0.6; border-style: dashed; }
.asset-inactive-count { color: var(--warn-text); font-weight: 700; }
.asset-active-help { font-size: 12px; margin: 2px 0 8px; }
.asset-active-all { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.asset-active-all .btn { width: auto; margin: 0; }

/* Booking history (history.html) */
.history-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.history-search .user-search { flex: 1 1 320px; width: auto; max-width: 520px; font-size: 16px; }
.history-search .btn { width: auto; margin: 0; }
.history-count { font-size: 13px; margin: 0 0 8px; }
.history-table td { white-space: nowrap; }
.history-table td[data-col="notes"] { white-space: normal; min-width: 200px; font-size: 12px; color: var(--sub); }
.history-table tr.done td { color: var(--sub); }
.history-table a { color: var(--link); }
.activity-table td[data-col="changes"] { white-space: normal; min-width: 340px; }
.activity-table td[data-col="changes"] summary { cursor: pointer; color: var(--link); }
.history-thumb { width: 32px; height: 32px; border-radius: 4px; background: #fff; object-fit: contain; flex-shrink: 0; }

/* Scan anything (scan.html) */
.scan-info-wrap { margin-bottom: 12px; }
.scan-info-empty { padding: 18px; border: 1px dashed var(--border); border-radius: 10px; text-align: center; }
.scan-info { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.scan-info .lookup-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scan-info .lookup-asset { display: flex; gap: 12px; align-items: flex-start; }
.scan-photo { width: 96px; height: 96px; border-radius: 8px; background: #fff; flex-shrink: 0; }
.scan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.scan-fact { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.scan-fact strong { font-size: 24px; }
.scan-now { border: 1px solid rgba(96, 165, 250, 0.6); background: rgba(37, 99, 235, 0.12); border-radius: 10px; padding: 10px 12px; }
.scan-now-head { margin-bottom: 6px; }
.scan-now-dates { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.scan-now-dates dt { color: var(--sub); }
.scan-now-dates dd { margin: 0; }
.scan-now a, .scan-history a { color: var(--link); }
.overdue-text { color: var(--bad-text); font-weight: 700; }
.scan-history summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.scan-history .table-wrap { margin-top: 8px; }

/* Create booking (create-booking.html) */
.cb-list { display: flex; flex-direction: column; gap: 6px; }
/* One compact line per asset: photo, then name and barcode chips flowing together, small Remove all on the right. */
.cb-line { display: flex; align-items: flex-start; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.cb-line-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; font-size: 14px; }
.cb-line-name { margin-right: 4px; }
.cb-remove-all { flex: none; align-self: flex-start; background: transparent; border: 1px solid var(--border); color: var(--sub); border-radius: 5px; padding: 2px 7px; font: inherit; font-size: 11px; line-height: 1.4; cursor: pointer; white-space: nowrap; }
.cb-remove-all:hover { border-color: var(--danger); color: var(--danger); }
.cb-remove-all.armed, .cb-remove-all.armed:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.cb-nobc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.cb-add-nobc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.cb-add-nobc select { width: min(360px, 100%); }
.cb-clear { margin-left: auto; }
.cb-details { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.cb-details label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sub); }
.cb-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cb-handover { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.cb-handover label { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.cb-problems { color: var(--warn-text); margin: 14px 0 0; padding-left: 20px; font-size: 14px; }
.cb-create { margin-top: 14px; min-width: 200px; }
.cb-create:disabled { opacity: 0.5; cursor: not-allowed; }
.cb-qty { width: 64px; text-align: center; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px; font: inherit; font-size: 16px; }

/* UK date boxes (app.js ukDate): dd/mm/yyyy text box + 📅, the browser's own date
   input laid invisibly over the 📅 so a tap opens its calendar. */
.uk-date { display: inline-flex; align-items: center; gap: 6px; position: relative; max-width: 100%; }
.uk-date-text { flex: 1; min-width: 0; width: 9.5em; }
.uk-date-text.user-search { width: auto; }
.uk-date-text.uk-date-bad { border-color: var(--danger); }
.uk-date-pick { position: relative; flex: none; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font-size: 18px; cursor: pointer; overflow: hidden; }
.uk-date-pick input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.uk-date.disabled .uk-date-pick { opacity: 0.4; pointer-events: none; }
.modal .uk-date-text { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; }

/* Test copy (server.py test_copy_page; owner, 30 Nov 2026): a slim purple TEST stripe across the very top of every
   page. The live Pi doesn't have it. */
.test-stripe { margin: -24px -24px 8px; height: 16px; line-height: 16px; background: #7c3aed; color: #fff; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4em; padding-left: 0.4em; }
@media (max-width: 640px) {
  .test-stripe { margin: calc(-1 * (env(safe-area-inset-top) + 24px)) -12px 8px; padding-top: env(safe-area-inset-top); height: auto; }
}

/* Updates page (updates.js) */
[data-updates-root] { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.updates-card h2 { margin: 0; font-size: 17px; }
.updates-card p { margin: 0; }
.updates-changes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.updates-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.updates-actions .btn { width: auto; margin: 0; }
.updates-armed, .updates-armed:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
.updates-job { border-color: var(--accent); }
.updates-ok { border-color: var(--success); }
.updates-bad { border-color: var(--danger); }
.updates-error { color: var(--danger-status); }
.updates-version { border-top: 1px solid var(--border); padding-top: 8px; }
.updates-version summary { cursor: pointer; }
.updates-version > * + * { margin-top: 8px; }
.updates-current { margin-left: 8px; font-size: 12px; color: var(--success); }

/* ---------- Phone tab shell (app.html, shell.js; owner, 1 Dec 2026) ----------
   The pages used most as tabs along the bottom, each kept loaded in its own frame; the rest under More. */
html:has(.shell-body) { height: 100%; }
body.shell-body { padding: 0; height: 100%; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.shell-body .test-stripe { margin: 0; flex: none; padding-top: env(safe-area-inset-top); height: auto; }
.shell-frames { flex: 1; position: relative; min-height: 0; }
.shell-frames iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }
.shell-frames iframe[hidden] { display: none; }
.tab-bar { flex: none; display: flex; background: var(--card); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); position: relative; z-index: 20; }
.tab-btn { flex: 1; min-width: 0; background: none; border: 0; color: var(--sub); font: inherit; font-size: 11px;
  padding: 7px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.tab-icon { font-size: 21px; line-height: 1; filter: grayscale(0.6); opacity: 0.8; }
.tab-btn.current, .tab-btn[aria-expanded="true"] { color: var(--accent); font-weight: 700; }
.tab-btn.current .tab-icon, .tab-btn[aria-expanded="true"] .tab-icon { filter: none; opacity: 1; }
.more-sheet { position: fixed; left: 0; right: 0; top: 0; bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 10;
  background: var(--overlay); display: flex; align-items: flex-end; }
.more-sheet[hidden] { display: none; }
.more-panel { width: 100%; background: var(--card-alt); border-top: 1px solid var(--border); border-radius: 14px 14px 0 0;
  padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 -10px 30px var(--shadow-70); }
.more-panel .menu-link { background: none; border: 0; width: 100%; font: inherit; font-size: 16px; text-align: left; cursor: pointer; padding: 12px; }
.more-panel .menu-theme { border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; }
/* A page inside a tab: the bar replaces its own Back / KitStore / ☰ and the TEST stripe is the shell's. */
.in-frame [data-nav-back], .in-frame .brand-link, .in-frame .menu-wrapper, .in-frame .test-stripe { display: none !important; }
.in-frame .top-nav:not(.sidebar-nav):not(:has(.basket-wrapper)) { display: none; }
.in-frame .top-nav.has-menu { padding-right: 0; }
@media (max-width: 640px) {
  .in-frame body, .in-frame body.audit-body { padding-top: 14px; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* ---------- Manage Bookings on phones: cards, no sideways scrolling (owner, 1 Dec 2026: "when opening a booking
   its all off the screen and have to scroll sideways") ---------- */
.manage-phone-search { display: none; }
@media (max-width: 640px) {
  .manage-phone-search { display: block; width: 100%; margin: 0 0 4px; }
  .manage-page .table-wrap { overflow: visible; margin: 0; border: 0; background: none; }
  [data-manage-table], [data-manage-table] > tbody { display: block; font-size: 14px; }
  [data-manage-table] > thead { display: none; }
  [data-manage-table] > tbody > tr.booking-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px;
    padding: 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
  [data-manage-table] > tbody > tr.booking-row.expanded { border-color: var(--accent); border-radius: 10px 10px 0 0; }
  [data-manage-table] > tbody > tr > td { display: block; padding: 0; border: 0; position: static; background: none; white-space: normal; }
  [data-manage-table] td.col-select { order: 0; }
  [data-manage-table] td[data-col="bookedBy"] { order: 1; flex: 1 1 0; min-width: 0; font-weight: 700; font-size: 15px; }
  [data-manage-table] td[data-col="id"] { order: 2; flex: none; color: var(--sub); font-size: 12px; }
  [data-manage-table] td.col-controls { order: 3; flex: none; width: auto; display: flex; gap: 2px; white-space: nowrap; }
  [data-manage-table] td[data-col="assets"] { order: 4; flex: 1 1 100%; }
  [data-manage-table] td[data-col="from"], [data-manage-table] td[data-col="to"] { order: 5; font-size: 13px; color: var(--sub); }
  [data-manage-table] td[data-col="from"]::before { content: 'From '; }
  [data-manage-table] td[data-col="to"]::before { content: '→ '; }
  [data-manage-table] td[data-col="state"] { order: 6; }
  [data-manage-table] td[data-col="overdue"] { order: 7; }
  [data-manage-table] td[data-col="overdue"]:not(:has(.overdue-yes)) { display: none; }
  [data-manage-table] td[data-col="notes"] { order: 8; flex: 1 1 100%; font-size: 12px; color: var(--sub); }
  [data-manage-table] td[data-col="notes"]:empty,
  [data-manage-table] td[data-col="level"], [data-manage-table] td[data-col="renewed"], [data-manage-table] td[data-col="requested"],
  [data-manage-table] td[data-col="picked"], [data-manage-table] td[data-col="collected"] { display: none; }
  /* The opened booking: right under its card, as wide as the screen; one line per unit. */
  [data-manage-table] > tbody > tr.booking-detail { display: block; margin: 0; }
  [data-manage-table] > tbody > tr.booking-detail > td { display: block; }
  [data-manage-table] .booking-detail-inner { position: static; width: auto; max-width: none; overflow: visible; padding: 10px 12px;
    background: var(--card-alt); border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 10px 10px; }
  /* Open: the kit list is listed below, so it goes; the empty cell still ends the line, keeping From → To together. */
  [data-manage-table] > tbody > tr.booking-row.expanded > td[data-col="assets"] { height: 0; overflow: hidden; color: transparent; }
  .detail-units { padding-left: 0; }
}

/* ---------- Asset management on phones: one card per asset (name + photo, owned / active / missing); the asset
   filter stays above the cards, the other columns are on the desktop page. ---------- */
@media (max-width: 640px) {
  .assets-page .table-wrap, [data-assets-table] { overflow: visible; margin: 0; border: 0; background: none; }
  [data-assets-table], [data-assets-table] > thead, [data-assets-table] > tbody { display: block; font-size: 14px; }
  [data-assets-table] tr.head-labels { display: none; }
  [data-assets-table] tr.head-filters { display: block; }
  [data-assets-table] tr.head-filters > th { display: none; }
  [data-assets-table] tr.head-filters > th:first-child { display: block; padding: 0; background: none; border: 0; position: static; }
  [data-assets-table] tr.head-filters > th:first-child input { width: 100%; font-size: 15px; padding: 10px 12px; }
  [data-assets-table] tr.head-filters > th:first-child input::placeholder { color: var(--sub); }
  [data-assets-table] > tbody > tr.booking-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px;
    padding: 8px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
  [data-assets-table] > tbody > tr.booking-row.expanded { border-color: var(--accent); border-radius: 10px 10px 0 0; }
  [data-assets-table] > tbody > tr > td { display: none; padding: 0; border: 0; position: static; background: none; }
  [data-assets-table] > tbody > tr > td[data-col="name"] { display: block; flex: 1 1 100%; font-weight: 600; }
  [data-assets-table] > tbody > tr > td[data-col="owned"], [data-assets-table] > tbody > tr > td[data-col="active"],
  [data-assets-table] > tbody > tr > td[data-col="missing"]:not(:empty) { display: block; font-size: 13px; }
  [data-assets-table] > tbody > tr > td[data-col="owned"]::before, [data-assets-table] > tbody > tr > td[data-col="active"]::before,
  [data-assets-table] > tbody > tr > td[data-col="missing"]::before { content: attr(data-label) ' '; color: var(--sub); font-weight: 400; }
  [data-assets-table] > tbody > tr.booking-detail { display: block; }
  [data-assets-table] > tbody > tr.booking-detail > td { display: block; }
  [data-assets-table] .booking-detail-inner, [data-assets-table] > tbody > tr.booking-detail > td > * { position: static; width: auto; max-width: none; }
  [data-assets-table] > tbody > tr.booking-detail > td { background: var(--card-alt); border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 10px 10px; padding: 10px 12px; }
}

/* ---------- An opened booking (Manage Bookings): each asset once, one short line per unit under it (owner,
   1 Dec 2026: no duplicate information). The row's own kit list is hidden while it's open. ---------- */
.booking-row.expanded td[data-col="assets"] { color: transparent; }
.detail-email { color: var(--sub); font-size: 13px; word-break: break-all; }
.detail-assets { display: flex; flex-direction: column; margin-top: 4px; }
.detail-asset { padding: 10px 0; border-top: 1px solid var(--border); }
.detail-asset:first-child { border-top: 0; }
.detail-asset-head { display: flex; align-items: center; gap: 10px; }
.detail-asset-text { min-width: 0; }
.detail-asset-name { font-weight: 600; font-size: 14px; }
.detail-asset-meta { font-size: 12px; }
.detail-asset-stock { font-size: 13px; margin-top: 3px; }
.detail-units { display: flex; flex-direction: column; padding-left: 58px; margin-top: 4px; max-width: 560px; }
.detail-unit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; font-size: 13px; }
.detail-unit + .detail-unit { border-top: 1px dashed var(--card-hover); }
.detail-unit .unit-actions { margin-left: auto; }

/* ---------- SISO API page (siso.html; live Pi only) ---------- */
.siso-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.siso-h { margin: 0 0 4px; font-size: 16px; }
.siso-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.siso-actions .btn { width: auto; margin-top: 0; }
.siso-form { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.siso-form label, .siso-args { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sub); }
.siso-args { margin-bottom: 10px; }
.siso-args textarea { font-family: monospace; }
.siso-card > .btn { width: auto; }
.siso-ok { color: var(--ok-text); }
.siso-bad { color: var(--bad-text); }
.siso-answer { margin-top: 12px; }
.siso-raw { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow: auto; max-height: 420px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.siso-raw-box summary { cursor: pointer; color: var(--link); margin: 10px 0 6px; }
.siso-table-wrap { margin-top: 10px; max-height: 60vh; overflow: auto; }
.siso-table td { white-space: nowrap; font-size: 12px; }
/* The latest SISO update, on the pages that show bookings or stock (live Pi; app.js initSisoLine). */
.siso-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--sub);
  margin: 0 0 10px; grid-column: 1 / -1; }
.siso-line.bad { color: var(--bad-text); }
.siso-line button { background: none; border: 1px solid var(--border); color: var(--link); border-radius: 6px; padding: 2px 8px;
  font: inherit; font-size: 12px; cursor: pointer; }
.siso-line button:disabled { opacity: 0.6; cursor: default; }
.siso-sync-lines { margin: 8px 0; padding-left: 20px; font-size: 13px; }
/* SISO's limits + the API log (siso.js) */
.siso-known { border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.siso-known th { text-align: left; font-weight: 600; color: var(--sub); padding: 4px 14px 4px 0; vertical-align: top; white-space: nowrap; }
.siso-known td { padding: 4px 0; }
.siso-probe-running { border: 1px solid var(--link); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.siso-test { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.siso-test-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.siso-test-head .btn { width: auto; margin-top: 0; }
.siso-test p { margin: 4px 0; font-size: 13px; }
.siso-test-result { font-size: 13px; }
.siso-test-result .siso-sync-lines li { margin: 3px 0; }
.siso-log td:nth-child(4) { white-space: normal; min-width: 120px; }
.siso-log-bad td { color: var(--bad-text); }
.siso-log-note td { color: var(--sub); font-style: italic; white-space: normal; }
@media (max-width: 640px) {
  .siso-known th { white-space: normal; }
}

/* ---------- Questions for SISO (siso-questions.html) ---------- */
.questions-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.questions-bar .btn { width: auto; margin-top: 0; }
.question-add { display: flex; flex-direction: column; gap: 8px; }
.question-add textarea { margin-top: 0; }
.question-add .btn { align-self: flex-start; width: auto; margin-top: 0; }
.question-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.question-head { display: flex; gap: 8px; align-items: flex-start; }
.question-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px;
  font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.question-card textarea { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; background: transparent; color: var(--text);
  border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; font: inherit; }
.question-card textarea:hover, .question-card textarea:focus { border-color: var(--border); background: var(--bg); outline: none; }
.question-text { font-weight: 600; font-size: 15px; }
.question-why { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 13px; }
.question-why > span { font-size: 11px; padding-left: 6px; }
.question-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.question-actions .btn { width: auto; margin-top: 0; }
.question-actions .toolbar-spacer { flex: 1; display: block; }

/* ---------- SISO differences (siso-differences.html) ---------- */
.diff-section { margin-bottom: 12px; }
.diff-count { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 10px; background: var(--accent); color: #fff;
  font-size: 12px; text-align: center; vertical-align: middle; }
.diff-group { border-top: 1px solid var(--border); padding: 8px 0; }
.diff-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.diff-group-head .btn { width: auto; margin: 0 0 0 auto; }
.diff-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.diff-group select { max-width: 100%; }
.diff-section .btn { width: auto; margin-top: 0; }
/* SISO tables scroll sideways inside their card on phones too (the phone rule for Manage Bookings' cards turns that off) */
.manage-page .siso-table-wrap { overflow: auto; }
.diff-desc { margin: 2px 0 0; font-size: 13px; }
.diff-group-btns { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.diff-tick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.diff-bulk { margin-bottom: 4px; }
.diff-chip-btn { cursor: pointer; color: var(--text); }
.diff-chip-btn:hover { border-color: var(--bad-text); }
.diff-section .btn.armed, .diff-chip-btn.armed { background: var(--bad-text); border-color: var(--bad-text); color: #fff; }
.diff-new { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.diff-new label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.diff-new .siso-actions, .diff-new p { grid-column: 1 / -1; margin: 0; }

/* ---------- Sticky table headers everywhere ----------
   Owner, 2 Dec 2026: "all tables should have sticky headers so when you scroll down they stay on your screen". A header
   only sticks inside its scrolling box, and every table's box scrolls sideways, so each box also scrolls down itself, at
   most a screen tall, with the header rows (labels + filters) held at its top. Short tables look the same as before.
   The audit summary keeps its own way on wide screens (sticks to the page); Manage Bookings and Asset management are
   cards on phones (no header). */
.table-wrap { overflow: auto; max-height: calc(100dvh - 16px); }
.table-wrap > table > thead { position: sticky; top: 0; z-index: 4; }
.table-wrap > table > thead th { position: static; background: var(--card-alt); }
@media (min-width: 1001px) {
  .table-wrap.audit-items-wrap { overflow: visible; max-height: none; }
}
@media (max-width: 640px) {
  .manage-page .table-wrap:not(.table-cards) { overflow: auto; }
  .manage-page .table-wrap.table-cards { max-height: none; }
}

/* ---------- Scan anything: availability (owner, 2 Dec 2026) ---------- */
.scan-avail { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.scan-avail > .btn { align-self: flex-start; width: auto; margin: 0; }
.scan-avail-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.avail-day { display: flex; flex-direction: column; align-items: center; border-radius: 6px; padding: 3px 0; border: 1px solid var(--border); }
.avail-day small { font-size: 10px; color: var(--sub); }
.avail-day b { font-size: 15px; }
.avail-ok b { color: var(--ok-text); }
.avail-low { border-color: rgba(245, 158, 11, 0.7); }
.avail-low b { color: #b45309; }
html[data-theme="dark"] .avail-low b { color: #fbbf24; }
.avail-none { border-color: rgba(239, 68, 68, 0.6); }
.avail-none b { color: var(--bad-text); }
.scan-avail-siso { margin: 0; font-size: 14px; }
.detail-siso { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-siso .btn { width: auto; margin: 0; }
.diff-tabs { margin-bottom: 8px; }
/* SISO vs KitStore (siso-parity.html) */
.parity-table select, .parity-table textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; }
.parity-table textarea { width: 100%; min-width: 180px; resize: vertical; box-sizing: border-box; }
.parity-table td { white-space: normal; vertical-align: top; }
.parity-table tr.parity-todo td:first-child { box-shadow: inset 3px 0 0 var(--bad-text); }
.parity-table tr.parity-yes td:first-child { box-shadow: inset 3px 0 0 var(--ok-text); }
.parity-add { display: flex; flex-wrap: wrap; gap: 8px; }
.parity-add input { flex: 1; min-width: 180px; margin: 0; }
.parity-add .btn { width: auto; margin: 0; }
.cb-add-nobc input[type=search] { flex: 1; min-width: 200px; margin: 0; }
.todo-summary textarea { width: 100%; box-sizing: border-box; font-family: monospace; font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.todo-summary p { margin: 8px 0 4px; }
.check-tools input[type=search] { flex: 1; min-width: 200px; margin: 0; }
.check-line { margin-top: 4px; }
.diff-section-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diff-section-head .siso-h { margin-right: auto; }
.diff-section .diff-fold { margin: 0; }
.diff-more { display: block; width: 100%; margin-top: 6px; padding: 6px; border: 1px dashed var(--border); border-radius: 8px;
  background: none; color: var(--link); cursor: pointer; font: inherit; font-size: 13px; }
.check-chip .check-ignore { font-size: 11px; opacity: .65; margin-left: 4px; text-decoration: underline; }
.check-vs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 15px; }
.check-vs .muted { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.check-arrow { color: var(--bad-text); font-weight: 700; }
.check-group > p.muted { margin: 4px 0 6px; }
.check-fix select { max-width: 100%; flex: 1 1 240px; }
.check-same { border-left: 3px solid var(--border); padding: 4px 0 4px 10px; margin: 6px 0; }
.diff-ignored-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.diff-ignored-line .btn { margin-left: auto; }
.check-line .muted { font-size: 12px; }

/* SISO differences (owner, 3 Dec 2026: one clear shape for every list: SISO | KitStore | Barcodes | buttons) */
.diff-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.diff-top .btn { width: auto; margin: 0; }
.diff-top input[type=search] { flex: 1 1 220px; margin: 0; }
.diff-none { margin: 4px 0 12px; }
.diff-list { margin-bottom: 12px; padding: 0; overflow: hidden; }
.diff-list-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; background: none; border: 0;
  color: var(--strong); font: inherit; text-align: left; cursor: pointer; }
.diff-list-head .siso-h { margin: 0; }
.diff-fold-label { margin-left: auto; font-size: 13px; color: var(--link); }
.diff-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 70px 250px; gap: 4px 14px; align-items: center;
  padding: 8px 14px; border-top: 1px solid var(--border); }
.diff-head { padding-top: 4px; padding-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #888); }
.diff-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.diff-n { text-align: center; }
.diff-btns .btn { width: auto; margin: 0; white-space: nowrap; }
.diff-btns .btn.armed { background: var(--bad-text); border-color: var(--bad-text); color: #fff; }
.diff-codes-btn { background: none; border: 1px solid var(--border); border-radius: 12px; padding: 2px 10px; color: var(--text);
  font: inherit; font-size: 13px; cursor: pointer; }
.diff-codes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; padding-top: 4px; }
.diff-chip-mark { border-style: dashed; }
.diff-line { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.diff-more { display: block; width: 100%; padding: 8px; border: 0; border-top: 1px solid var(--border); background: none;
  color: var(--link); cursor: pointer; font: inherit; font-size: 13px; }
@media (max-width: 700px) {
  .diff-head { display: none; }
  .diff-row { grid-template-columns: minmax(0, 1fr) auto; }
  .diff-siso, .diff-kit { grid-column: 1; }
  .diff-cell[data-label]::before { content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted, #888); }
  .diff-n { grid-row: 1 / 3; grid-column: 2; align-self: start; }
  .diff-btns { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Alternating rows in every table (owner, 3 Dec 2026: "all tables should have alternating white and light gray
   background for the rows"). An opened booking's detail row doesn't count, so opening one doesn't shift the stripes. */
.detail-items > tbody > tr:nth-child(even) > td { background-color: var(--zebra); }
/* its own rule: a browser without "of" drops only this one */
.manage-table > tbody > tr:nth-child(even of :not(.booking-detail)) > td { background-color: var(--zebra); }
.manage-table > tbody > tr.booking-row:hover > td, .manage-table > tbody > tr.booking-row.expanded > td { background-color: var(--card-hover); }

/* SISO differences: as wide as its four columns need, not the whole screen; striped rows; tighter */
[data-diff-root], .diff-page .page-header { max-width: 1000px; margin-left: auto; margin-right: auto; }
.diff-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px 250px; padding: 6px 14px; }
.diff-rows > .diff-row:nth-child(even), .diff-rows > .diff-line:nth-child(even) { background: var(--zebra); }
.diff-line { padding: 6px 14px; }
.diff-list-head { padding: 10px 14px; }
@media (max-width: 700px) {
  .diff-row { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; }
}
.diff-key { align-self: center; font-size: 12px; margin-left: 4px; }
.diff-codes-n { color: var(--text); }
/* Log-in page with passkeys (owner, 4 Dec 2026) */
.login-card section { display: flex; flex-direction: column; gap: 12px; }
.login-card section[hidden] { display: none; }
.login-big { padding: 14px; font-size: 17px; }
.login-card .link-btn { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 4px; }
.login-card .manage-flash.ok { border-color: var(--ok-text); }
.menu-badge { margin-left: auto; background: var(--danger, #dc2626); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; line-height: 18px; }
/* Accounts + My bookings (owner, 4 Dec 2026) */
.acc-page { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.acc-section h2 .menu-badge { margin-left: 0; }
.acc-section h2 { font-size: 17px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.acc-table { width: 100%; border-collapse: collapse; }
.acc-table th { text-align: left; font-size: 12px; color: var(--sub); font-weight: 600; padding: 4px 8px; }
.acc-table td { padding: 7px 8px; vertical-align: middle; }
.acc-table > tbody > tr:nth-child(even of :not(.acc-detail)) > td { background: var(--zebra); }
.acc-table .acc-detail > td { background: var(--card); border-top: 0; }
.acc-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.acc-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--link); cursor: pointer; text-align: left; }
.acc-edit, .acc-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.acc-edit .user-search, .acc-add .user-search { flex: 1 1 160px; margin: 0; }
.acc-level { padding: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.acc-key { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.acc-link { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.acc-link .acc-qr { width: 180px; flex: none; background: #fff; border-radius: 8px; }
.acc-link .user-search { width: 100%; margin: 8px 0; }
.acc-link .acc-btns { justify-content: flex-start; }
.my-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.my-card + .my-card { margin-top: 10px; }
.my-head { display: flex; gap: 8px; align-items: center; }
.my-items { margin: 0; padding-left: 18px; }
.my-edit { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.my-edit label { display: flex; flex-direction: column; font-size: 12px; color: var(--sub); gap: 3px; }
.my-qty input { width: 70px; }
.my-history summary { cursor: pointer; color: var(--sub); margin: 6px 0; }
.my-done { opacity: .75; }
@media (max-width: 640px) { .acc-link { flex-direction: column; } .acc-people th:nth-child(3), .acc-people > tbody > tr:not(.acc-detail) > td:nth-child(3) { display: none; } .acc-table td { padding: 7px 4px; } }
.acc-page, .acc-page * { box-sizing: border-box; }
.acc-page { min-width: 0; width: 100%; }
