/* BOBRO CART · operations app for venue managers.
   Quiet, precise surfaces; the brand magenta is reserved for what needs action. */

:root {
  --r-lg: 16px; --r-md: 12px; --r-sm: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f6; --surface: #ffffff; --raised: #f7f8fa; --sunken: #eceef2;
  --ink: #0d1220; --ink-2: #3a4152; --muted: #6a7284; --faint: #a3a9b6;
  --line: #e3e6eb; --line-2: #d3d7de;
  --accent: #c4005c; --accent-ink: #ffffff; --accent-soft: #fbe6ef;
  --teal: #00737b; --teal-soft: #e1f2f3;
  --ok: #127a56; --ok-soft: #e3f3ec; --warn: #9a5b00; --warn-soft: #fbf0de; --bad: #b42318;
  --shadow: 0 1px 2px rgba(13,18,32,.05), 0 6px 20px rgba(13,18,32,.05);
  --tabbar: rgba(255,255,255,.92);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1218; --surface: #171b23; --raised: #1d222c; --sunken: #12151c;
  --ink: #eef0f4; --ink-2: #c3c8d2; --muted: #8b93a3; --faint: #5c6474;
  --line: #262c37; --line-2: #333a47;
  --accent: #ff3d93; --accent-ink: #1a0610; --accent-soft: rgba(255,61,147,.13);
  --teal: #3cc6cf; --teal-soft: rgba(60,198,207,.12);
  --ok: #45cf95; --ok-soft: rgba(69,207,149,.12); --warn: #f1b44f; --warn-soft: rgba(241,180,79,.12); --bad: #ff7a70;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.3);
  --tabbar: rgba(23,27,35,.94);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.app { max-width: 680px; margin: 0 auto; }
.bar { position: sticky; top: 0; z-index: 20; padding: 10px 16px 12px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.bar__row { height: 36px; display: flex; align-items: center; justify-content: space-between; }
.bar__logo { height: 22px; }
[data-theme="light"] .bar__logo { filter: drop-shadow(0 0 .5px rgba(0,0,0,.4)); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover, .icon-btn:active { background: var(--sunken); color: var(--ink); }

.venues { margin-top: 10px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: var(--r-md); background: var(--sunken); }
.venues button { height: 34px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; transition: background .2s var(--ease), color .2s, box-shadow .2s; }
.venues button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.venues.single button { cursor: default; }

/* ---------- layout ---------- */
.view { padding: 4px 16px calc(92px + var(--safe-b)); }
.title { margin: 14px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.title h1 { margin: 0; font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.title h1 span { color: var(--muted); font-weight: 500; }
.title small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.note { margin: -6px 0 14px; color: var(--muted); font-size: 13px; max-width: 60ch; }
.section-label { margin: 22px 4px 8px; color: var(--muted); font-size: 13px; font-weight: 500; }

/* grouped list */
.group { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.group + .group { margin-top: 12px; }
.row { position: relative; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.row__main { flex: 1; min-width: 0; }
.row__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row__title { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { margin-top: 3px; color: var(--muted); font-size: 13.5px; }
.row__meta b { color: var(--ink-2); font-weight: 600; }
.row--tap { text-align: left; cursor: pointer; transition: background .15s; }
.row--tap:active { background: var(--raised); }

/* status pill */
.pill { flex: none; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--muted); }
.pill.new { background: var(--accent-soft); color: var(--accent); }
.pill.contacted { background: var(--warn-soft); color: var(--warn); }
.pill.booked { background: var(--ok-soft); color: var(--ok); }

/* buttons */
.actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; background: var(--sunken); color: var(--ink); font-size: 14px; font-weight: 600; transition: filter .15s, background .15s, transform .1s; }
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
[data-theme="light"] .btn.primary { color: #fff; }
.btn.quiet { background: transparent; color: var(--muted); padding: 0 8px; }
.btn.danger { background: transparent; color: var(--bad); }
.btn.round { width: 36px; padding: 0; }
.btn.block { width: 100%; height: 50px; border-radius: 14px; font-size: 15.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- date strip: the occupancy ribbon ---------- */
.strip { margin: 6px -16px 0; padding: 4px 16px 8px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.d { flex: none; width: 46px; padding: 8px 0 9px; display: grid; justify-items: center; gap: 3px; border-radius: 12px; scroll-snap-align: center; transition: background .2s var(--ease); }
.d small { font-size: 11.5px; color: var(--muted); }
.d strong { font-size: 18px; font-weight: 600; line-height: 1.1; }
.d.we small { color: var(--accent); }
.d.past { opacity: .45; }
.d.today strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.d .load { width: 26px; height: 4px; margin-top: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.d .load i { display: block; height: 100%; border-radius: 2px; background: var(--ink-2); }
.d .load.full i { background: var(--accent); }
.d.on { background: var(--ink); }
.d.on small, .d.on strong { color: var(--bg); }
.d.on .load { background: color-mix(in srgb, var(--bg) 25%, transparent); }
.d.on .load i { background: var(--bg); }
.d.on .load.full i { background: var(--accent); }
.month { flex: none; align-self: center; padding: 0 6px 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; }

.banner { margin: 12px 0 0; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.banner b { color: var(--accent); }

/* ---------- timetable ---------- */
.tt { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px 0; }
.hour { position: relative; height: 60px; display: flex; }
.hour__t { width: 62px; flex: none; padding: 7px 0 0 16px; font-size: 13px; font-weight: 500; color: var(--muted); }
.hour::after { content: ''; position: absolute; left: 62px; right: 0; top: 0; height: 1px; background: var(--line); }
.hour:first-child::after { display: none; }
.hour__free { flex: 1; margin: 4px 10px 4px 0; padding-left: 12px; display: flex; align-items: center; gap: 6px; border-radius: 10px; color: var(--faint); font-size: 14px; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.tt:hover .hour__free, .hour__free:focus-visible { opacity: 1; }
@media (hover: none) { .hour__free { opacity: 1; color: transparent; } .hour__free svg { color: var(--faint); } }
.hour__free:hover, .hour__free:active { background: var(--raised); color: var(--ink-2); opacity: 1; }
.hour__free svg { width: 16px; height: 16px; }
.picking .hour__free { opacity: 1; color: var(--accent); background: var(--accent-soft); }
.hour.past .hour__free { pointer-events: none; opacity: 0 !important; }
.hour.past .hour__t { color: var(--faint); }
.now { position: absolute; left: 56px; right: 0; height: 0; border-top: 1.5px solid var(--accent); z-index: 3; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -4px; top: -4.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.bk { position: absolute; left: 62px; right: 10px; z-index: 2; padding: 8px 12px 8px 14px; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; border-radius: 10px; background: var(--accent-soft); text-align: left; overflow: hidden; transition: transform .12s; }
.bk::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.bk.manual { background: var(--teal-soft); }
.bk.manual::before { background: var(--teal); }
.bk:active { transform: scale(.99); }
.bk strong { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk small { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk em { font-style: normal; color: var(--muted); font-weight: 500; }
.legend { margin: 10px 4px 0; display: flex; gap: 16px; color: var(--muted); font-size: 12.5px; }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--accent); }
.legend i.m { background: var(--teal); }

/* ---------- misc blocks ---------- */
.seg { display: inline-flex; padding: 3px; margin-bottom: 12px; border-radius: 10px; background: var(--sunken); }
.seg button { height: 30px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.search { position: relative; margin: 14px 0 6px; }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); width: 18px; height: 18px; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 38px; border: 0; border-radius: 12px; background: var(--sunken); outline: none; }
.search input:focus { box-shadow: 0 0 0 2px var(--accent); }

.details { margin-top: 10px; }
.details summary { list-style: none; color: var(--muted); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.details summary::-webkit-details-marker { display: none; }
.details summary svg { width: 14px; height: 14px; transition: rotate .2s; }
.details[open] summary svg { rotate: 90deg; }
.details pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--raised); white-space: pre-wrap; font: inherit; font-size: 13px; line-height: 1.55; color: var(--ink-2); }

.kids { margin-top: 10px; display: grid; gap: 6px; }
.kid { padding: 8px 10px 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 10px; background: var(--raised); font-size: 14px; }
.kid span { color: var(--muted); }
.kid b { color: var(--ink); font-weight: 600; }
.tag-ok { color: var(--ok); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tag-ok svg { width: 15px; height: 15px; }

.empty { padding: 56px 24px; text-align: center; color: var(--muted); font-size: 14.5px; }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 16px; font-weight: 600; }

/* stats */
.kpis { display: grid; grid-template-columns: 1fr 1fr; }
.kpi { padding: 16px; }
.kpi:nth-child(odd) { border-right: 1px solid var(--line); }
.kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
.kpi small { display: block; color: var(--muted); font-size: 13px; }
.kpi strong { display: block; margin-top: 2px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.funnel { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.funnel__bar { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; display: flex; }
.funnel__bar i { display: block; height: 100%; }
.funnel__legend { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.funnel__legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--c); }
.reason { display: flex; justify-content: space-between; }

/* chips for staff cities */
.chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }

/* ---------- bottom tabs ---------- */
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 6px 8px calc(6px + var(--safe-b)); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--tabbar); border-top: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.tabs button { position: relative; height: 50px; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 500; }
.tabs svg { width: 23px; height: 23px; }
.tabs button.on { color: var(--ink); }
.tabs button.on svg { color: var(--accent); stroke-width: 1.9; }
.tabs b { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet__bg { position: absolute; inset: 0; background: rgba(5,8,14,.45); animation: fade .2s; }
.sheet__card { position: relative; width: 100%; max-width: 680px; max-height: 92vh; overflow: auto; padding: 8px 16px calc(18px + var(--safe-b)); border-radius: 20px 20px 0 0; background: var(--surface); box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: rise .3s var(--ease); }
.sheet__card::before { content: ''; display: block; width: 36px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: var(--line-2); }
.sheet h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.sheet .sub { margin: 3px 0 16px; color: var(--muted); font-size: 14px; }
.quick { margin-bottom: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick .btn { height: 44px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { color: var(--muted); font-size: 13px; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { margin: 4px 0 16px; display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.sheet-actions { display: flex; gap: 8px; margin-top: 6px; }
.sheet-actions .btn { height: 50px; flex: 1; border-radius: 14px; font-size: 15.5px; }
.sheet-actions .btn.danger { flex: 0 0 auto; padding: 0 16px; background: var(--sunken); }
.reasons { display: grid; gap: 8px; }
.reasons .btn { height: 48px; justify-content: flex-start; padding: 0 16px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(80px + var(--safe-b)); translate: -50% 0; max-width: calc(100vw - 32px); padding: 11px 16px; display: flex; align-items: center; gap: 8px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: rise .25s var(--ease); }
.toast svg { width: 18px; height: 18px; color: var(--ok); }
.toast.err svg { color: var(--bad); }

.skel { height: 64px; margin-bottom: 1px; background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: sh 1.3s infinite linear; }
.skel:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.skel:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }

@keyframes rise { from { transform: translateY(28px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- header tools & web login ---------- */
.bar__tools { display: flex; align-items: center; gap: 2px; }
.bar__me { margin-right: 6px; color: var(--muted); font-size: 13.5px; }
.login { max-width: 400px; margin: 12vh auto 0; padding: 28px 24px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.login h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.02em; }
.login p { margin: 0 0 20px; color: var(--muted); }
.login small { display: block; margin-top: 14px; color: var(--faint); font-size: 12.5px; }

/* ---------- desktop: sidebar navigation, wider content ---------- */
@media (min-width: 960px) {
  .app { max-width: 1120px; padding-left: 232px; }
  .bar { padding: 18px 24px 14px; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 16px; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .bar__logo { position: fixed; top: 24px; left: calc(max(0px, (100vw - 1120px) / 2) + 28px); height: 26px; }
  .bar__row { flex: none; }
  .venues { flex: none; width: 420px; margin-top: 0; }
  .view { padding: 0 24px 48px; }
  .tabs { top: 76px; bottom: auto; left: max(16px, calc((100vw - 1120px) / 2 + 16px)); right: auto; width: 200px; padding: 0; display: grid; grid-template-columns: 1fr; gap: 2px; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabs button { height: 42px; padding: 0 12px; grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; border-radius: 10px; font-size: 14.5px; color: var(--muted); }
  .tabs button:hover { background: var(--sunken); color: var(--ink); }
  .tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
  .tabs svg { width: 20px; height: 20px; }
  .tabs b { position: static; margin-left: auto; box-shadow: none; }
  .title h1 { font-size: 28px; }
  .group .row { padding: 16px 20px; }
  .toast { bottom: 28px; }
  .sheet { align-items: center; }
  .sheet__card { max-width: 520px; border-radius: 20px; max-height: 88vh; }
  .sheet__card::before { display: none; }
  .sheet__card { padding-top: 22px; }
}
