:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #14202e;
  --muted: #5b6878;
  --line: #dde3ea;
  --brand: #0a5bd3;
  --brand-ink: #ffffff;
  --brand-soft: #e6f0fd;
  --side: #0e2236;
  --side-ink: #c9d6e4;
  --good: #137a3f;
  --good-soft: #e3f5ea;
  --warn: #8a5300;
  --warn-soft: #fff1d6;
  --bad: #b3261e;
  --bad-soft: #fde8e6;
  --st-open: #5b6878;
  --st-standby: #8a5300;
  --st-gearup: #a8420a;
  --st-inair: #0a5bd3;
  --st-landed: #137a3f;
  --st-cancelled: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(14, 34, 54, 0.08), 0 4px 14px rgba(14, 34, 54, 0.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1520;
    --panel: #132131;
    --panel-2: #172839;
    --ink: #e6edf5;
    --muted: #9aabbd;
    --line: #26394d;
    --brand: #5aa2ff;
    --brand-ink: #06192e;
    --brand-soft: #172f4d;
    --side: #08111b;
    --side-ink: #a9bbcd;
    --good: #4cc982;
    --good-soft: #12301f;
    --warn: #f0b24a;
    --warn-soft: #3a2b0e;
    --bad: #ff8a80;
    --bad-soft: #3d1815;
    --st-open: #9aabbd;
    --st-standby: #f0b24a;
    --st-gearup: #ff9a5c;
    --st-inair: #5aa2ff;
    --st-landed: #4cc982;
    --st-cancelled: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; padding: 6px 10px 14px; }
.brand small { display: block; font-weight: 400; color: var(--side-ink); font-size: 0.78rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--side-ink); text-decoration: none; padding: 9px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a[aria-current="page"] { background: rgba(90, 162, 255, 0.2); color: #fff; font-weight: 600; }
.side-foot { margin-top: auto; padding: 10px; font-size: 0.85rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.side-foot .row { gap: 6px; margin-top: 8px; }
.side-foot .btn { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: transparent; }
.main { padding: 20px 24px 60px; max-width: 1500px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-right: auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 14px; cursor: pointer; min-height: 38px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 0.88rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.neg { color: var(--bad); font-weight: 600; }
.pos { color: var(--good); }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; font-weight: 600; }
label.field.check { flex-direction: row; align-items: center; font-weight: 500; gap: 8px; min-height: 38px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-height: 38px; font-weight: 400;
}
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.multi { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.multi label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.error { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 7px 14px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }

table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--panel-2); }
table.data tr.dim td { opacity: 0.55; }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; }
.kpi .v { font-size: 1.7rem; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: 0.82rem; }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(5, 12, 20, 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; z-index: 50; }
.modal { background: var(--panel); border-radius: 14px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(520px, calc(100% - 24px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.toast.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.toast.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.toast ul { margin: 4px 0 0; padding-left: 18px; }

/* manifest */
.loads { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.load { overflow: hidden; border-top: 5px solid var(--st-open); }
.load.s-standby { border-top-color: var(--st-standby); }
.load.s-gearup { border-top-color: var(--st-gearup); }
.load.s-inair { border-top-color: var(--st-inair); }
.load.s-landed { border-top-color: var(--st-landed); opacity: 0.85; }
.load.s-cancelled { border-top-color: var(--st-cancelled); opacity: 0.6; }
.load-head { padding: 12px 14px 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.load-head h2 { margin-right: auto; }
.status { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 6px; color: #fff; background: var(--st-open); }
.status.standby { background: var(--st-standby); }
.status.gearup { background: var(--st-gearup); }
.status.inair { background: var(--st-inair); }
.status.landed { background: var(--st-landed); }
.status.cancelled { background: var(--st-cancelled); }
@media (prefers-color-scheme: dark) { .status { color: #06192e; } }
.load-meta { padding: 0 14px 8px; color: var(--muted); font-size: 0.88rem; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.seatbar { height: 6px; background: var(--line); border-radius: 3px; margin: 0 14px 8px; overflow: hidden; }
.seatbar > span { display: block; height: 100%; background: var(--brand); }
.seatbar.full > span { background: var(--bad); }
.slots { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.slot { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.slot:hover { background: var(--panel-2); }
.slot.noshow { opacity: 0.5; text-decoration: line-through; }
.slot .nm { font-weight: 600; }
.slot .sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.load-foot { padding: 10px 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.countdown.due { color: var(--bad); }

/* search picker */
.picker { position: relative; }
.picker-results { position: absolute; z-index: 5; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.picker-results button { display: flex; justify-content: space-between; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; }
.picker-results button:hover, .picker-results button:focus { background: var(--brand-soft); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 10px; }
.bars .bar { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars .bar:hover { filter: brightness(1.15); }

/* login */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(440px, 100%); }
.login h1 { margin-bottom: 4px; }

/* public pages */
.public { max-width: 640px; margin: 0 auto; padding: 24px 16px 60px; }
.tv { background: #07101a; color: #e6edf5; min-height: 100vh; padding: 24px; }
.tv h1 { font-size: 2.2rem; }
.tv .tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin-top: 18px; }
.tv .tv-load { background: #0f1d2c; border-radius: 14px; padding: 18px; border-top: 8px solid var(--st-open); }
.tv .tv-load.standby { border-top-color: #f0b24a; }
.tv .tv-load.gearup { border-top-color: #ff9a5c; }
.tv .tv-load.inair { border-top-color: #5aa2ff; }
.tv .tv-load.landed { border-top-color: #4cc982; opacity: 0.7; }
.tv .big { font-size: 2.4rem; font-weight: 800; }
.tv .names { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tv .names span { background: #19304a; padding: 3px 10px; border-radius: 6px; font-size: 1.05rem; }
.tv .banner { background: #5a1a14; padding: 12px 18px; border-radius: 10px; margin-top: 14px; font-size: 1.3rem; }
.tv .banner.ok { background: #12301f; }
.honeypot { position: absolute; left: -5000px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform 0.2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar .btn { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: transparent; }
  .main { padding: 14px 12px 60px; }
  .form-grid { grid-template-columns: 1fr; }
  .loads { grid-template-columns: 1fr; }
}
@media print {
  .side, .topbar, .btn, .toasts { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- drag-and-drop manifest board ---------- */
.board { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.board.readonly { grid-template-columns: minmax(0, 1fr); }
.dock { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.dock-sec { padding: 12px; }
.dock-sec h3 { margin-bottom: 2px; }
.dock-sec p { margin: 0 0 8px; }
.dock-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.dock-item { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--panel-2); cursor: grab; user-select: none; }
.dock-item:hover { border-color: var(--brand); }
.dock-item.dragging { opacity: 0.45; }
.dock-item.picked { outline: 3px solid var(--brand); background: var(--brand-soft); }
.di-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.di-sub { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.good-t { color: var(--good); font-size: 0.8rem; }
.warnt { color: var(--warn); }
.chip.role-pilot { background: #e3ecfb; color: #0a4aa8; border-color: transparent; }
.chip.role-tandem { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.role-aff { background: #efe5fb; color: #5a2ea6; border-color: transparent; }
.chip.role-coach { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.role-video { background: #fbe6ef; color: #a0215a; border-color: transparent; }
@media (prefers-color-scheme: dark) {
  .chip.role-pilot { background: #172f4d; color: #8fbfff; }
  .chip.role-aff { background: #2a1f45; color: #c5a8ff; }
  .chip.role-video { background: #3d1830; color: #ff9cc6; }
}

.holdbar { position: sticky; top: 8px; z-index: 20; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--brand); color: var(--brand-ink); padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; box-shadow: var(--shadow); }
.holdbar .btn { color: var(--ink); }

.pilotrow { padding: 0 14px 8px; }
.crew { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.zone { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 8px; border: 1.5px dashed var(--line); border-radius: 8px; background: var(--panel); font-size: 0.85rem; transition: background 0.1s, border-color 0.1s; }
.zone.filled { border-style: solid; background: var(--brand-soft); border-color: transparent; }
.zone.static { border-style: solid; background: var(--panel-2); }
.zone.required:not(.filled) { border-color: var(--warn); background: var(--warn-soft); }
.zone .zl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.zone.required:not(.filled) .zl, .zone.required:not(.filled) .zn { color: var(--warn); }
.zone .zn { font-weight: 600; }
.zone .zempty { display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; padding: 0; cursor: pointer; }
.zone .zx { border: 0; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted); padding: 0 2px; }
.zone .zx:hover { color: var(--bad); }
.zone.pilot { min-width: 170px; }
.crew-issues { margin: 0 14px 8px; padding: 6px 10px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; font-size: 0.85rem; }

/* while something is being dragged or held: show where it can go */
.board.dragging-any .zone.ok, .board.holding .zone.ok, .board.dragging-any .load.ok, .board.holding .load.ok { outline: 2px solid var(--good); outline-offset: 1px; background: var(--good-soft); }
.board.dragging-any .zone.warn, .board.holding .zone.warn, .board.dragging-any .load.warn, .board.holding .load.warn { outline: 2px solid var(--warn); outline-offset: 1px; background: var(--warn-soft); }
.board.dragging-any .zone.no, .board.holding .zone.no, .board.dragging-any .load.no, .board.holding .load.no { opacity: 0.4; outline: 2px solid var(--bad); outline-offset: 1px; cursor: not-allowed; }
.zone.over.ok, .load.over.ok { outline-width: 4px !important; }
.zone.over.no, .load.over.no { background: var(--bad-soft); }
.place { display: none !important; }
.board.holding .load.ok .place, .board.holding .load.warn .place { display: inline-flex !important; }
.slot[draggable="true"] { cursor: grab; }
.slot.dragging { opacity: 0.4; }
.choose { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choose li { display: flex; flex-direction: column; gap: 2px; }
.choose .btn { width: 100%; justify-content: space-between; }
.choose .btn.dim { opacity: 0.45; }
@media (max-width: 1100px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .dock { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .dock-sec { flex: 1 1 280px; }
}

/* ---------- bookings calendar ---------- */
.cal-controls { margin-bottom: 8px; }
.cal-controls select { width: auto; min-width: 150px; }
.cal-controls input[type="date"] { width: auto; }
.cal-legend { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); }
.cal-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); margin-left: 8px; }
.cal-title { margin: 6px 0 10px; font-size: 1.4rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal-dow { background: var(--brand-soft); font-weight: 700; text-align: center; padding: 8px 4px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.cal-dow:nth-child(7n) { border-right: 0; }
.cal-day { --cell: #c9f5b4; position: relative; min-height: 118px; padding: 8px 10px 26px; background: var(--cell); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; color: #14202e; }
.cal-day:nth-child(7n + 14) { border-right: 0; }
.cal-day:hover { filter: brightness(0.96); }
.cal-day.closed, .cal-day.past { --cell: #d3d6da; }
.cal-day.full { --cell: #ffe2a8; }
.cal-day.other-month { opacity: 0.6; }
.cal-day.today { outline: 3px solid var(--brand); outline-offset: -3px; }
.cd-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 8px; align-items: flex-start; }
.cd-sum { display: flex; flex-direction: column; gap: 2px; font-size: 0.95rem; flex: 1 1 96px; }
.cd-full { font-weight: 700; color: #8a5300; }
.cd-add { margin-top: 6px; background: rgba(255, 255, 255, 0.85); color: #14202e; border-color: rgba(0, 0, 0, 0.2); align-self: flex-start; }
.cd-slots { list-style: none; margin: 0; padding: 4px 6px; font-size: 0.8rem; background: rgba(255, 255, 255, 0.55); border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cd-slots li.full { font-weight: 700; color: #8a5300; }
.cd-slots li.over { font-weight: 700; color: #b3261e; }
.cd-date { position: absolute; right: 8px; bottom: 4px; font-size: 0.95rem; }
.cd-date .dow { display: none; }
@media (prefers-color-scheme: dark) {
  .cal-day { --cell: #1d4a2a; color: #e6edf5; }
  .cal-day.closed, .cal-day.past { --cell: #2a3340; }
  .cal-day.full { --cell: #5a4313; }
  .cd-add { background: rgba(0, 0, 0, 0.35); color: #e6edf5; border-color: rgba(255, 255, 255, 0.25); }
  .cd-slots { background: rgba(0, 0, 0, 0.3); }
  .cd-slots li.full, .cd-full { color: #f0b24a; }
  .cd-slots li.over { color: #ff8a80; }
}
.cal-legend .sw.open { background: #c9f5b4; } .cal-legend .sw.full { background: #ffe2a8; } .cal-legend .sw.closed { background: #d3d6da; }
@media (max-width: 860px) {
  .cal { grid-template-columns: 1fr; }
  .cal-dow { display: none; }
  .cal-day { min-height: 0; border-right: 0; }
  .cal-day.other-month { display: none; }
  .cd-date .dow { display: inline; }
}

/* day view */
.day-slot { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ds-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.ds-head h3 { min-width: 64px; }
.ds-head .seatbar { margin: 0; min-width: 80px; }
.ds-empty { padding: 10px 12px; }
.bk-row { display: grid; grid-template-columns: minmax(160px, 1.1fr) minmax(200px, 1.6fr) auto; gap: 8px 14px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; cursor: pointer; }
.ds-head + .bk-row { border-top: 0; }
.bk-row:hover { background: var(--panel-2); }
.bk-row.dim { opacity: 0.55; }
.bk-meta { display: flex; flex-direction: column; gap: 4px; }
.bk-notes { color: var(--muted); }
.ds-foot { padding-top: 4px; }
@media (max-width: 860px) { .bk-row { grid-template-columns: 1fr; } }

/* time-slot editor */
.sched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sched-day { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.slot-editor { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.slot-head, .slot-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 6px; width: 100%; align-items: center; }
.slot-rows { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.empty-note { display: none; }
.slot-rows.is-empty + .empty-note { display: block; }
