/* Mintwoods Cal - light theme only: white background, black text. */

:root {
    --bg: #ffffff;
    --fg: #111111;
    --muted: #6b7280;
    --line: #e5e7eb;
    --panel: #fafafa;
    --accent: #111111;
    --ok-bg: #e7f6ec; --ok-fg: #1a7f37;
    --err-bg: #fdecec; --err-fg: #b42318;
    --info-bg: #eef4ff; --info-fg: #1d4ed8;
    --warn-bg: #fff7e6; --warn-fg: #b25e00;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--fg); }
h1 { font-size: 20px; margin: 18px 0 8px; }
h2 { font-size: 16px; margin: 22px 0 8px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

/* ---- Top bar ---- */
.topbar {
    display: flex; align-items: center; gap: 10px 20px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    position: sticky; top: 0; z-index: 20;
}
.topbar .brand { font-weight: 700; letter-spacing: .2px; white-space: nowrap; color: var(--fg); text-decoration: none; }
.topnav { display: flex; gap: 4px; }
.topnav a {
    text-decoration: none; color: var(--muted);
    padding: 6px 10px; border-radius: 6px;
    border-bottom: 2px solid transparent;
}
.topnav a.on { color: var(--fg); border-color: var(--fg); }

.topnav-dd { position: relative; }
.topnav-dd summary {
    list-style: none; cursor: pointer; user-select: none;
    color: var(--muted); padding: 6px 10px; border-radius: 6px;
    border-bottom: 2px solid transparent;
}
.topnav-dd summary::-webkit-details-marker { display: none; }
.topnav-dd summary::after { content: ' \25BE'; font-size: 10px; }
.topnav-dd summary.on { color: var(--fg); border-color: var(--fg); }
.topnav-dd-menu {
    position: absolute; top: 100%; left: 0; margin-top: 4px;
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08); padding: 4px; min-width: 140px; z-index: 30;
}
.topnav-dd-menu a {
    display: block; padding: 8px 10px; border-radius: 6px;
    text-decoration: none; color: var(--fg); font-size: 13px;
}
.topnav-dd-menu a:hover { background: var(--panel); }
.topnav-dd-menu a.on { background: var(--panel); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-right .who { color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 18px 60px; }

/* ---- Mobile top bar: brand + actions on row 1, nav as a full-width tab bar ---- */
@media (max-width: 720px) {
    .topbar {
        flex-wrap: wrap;
        gap: 8px 10px;
        padding: 8px 12px 0;
    }
    .topbar .brand { font-size: 15px; }
    .topbar-right { gap: 10px; }
    .topbar-right span.who { display: none; }             /* hide username, keep Logout link */
    .topnav {
        order: 3;
        width: 100%;
        gap: 0;
        border-top: 1px solid var(--line);
        margin: 0 -12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    .topnav a {
        flex: 0 0 auto;
        text-align: center;
        padding: 12px 14px 10px;
        border-radius: 0;
        white-space: nowrap;
    }
    .topnav-dd { flex: 0 0 auto; }
    .topnav-dd summary {
        text-align: center;
        padding: 12px 14px 10px;
        border-radius: 0;
        white-space: nowrap;
    }
}

/* ---- Buttons ---- */
.btn {
    display: inline-block; cursor: pointer;
    background: var(--accent); color: #fff;
    border: 1px solid var(--accent); border-radius: 6px;
    padding: 8px 14px; font-size: 13px; text-decoration: none;
}
.btn:hover { opacity: .9; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { background: #fff; color: var(--fg); }
.btn-danger { background: var(--err-fg); border-color: var(--err-fg); }
button.btn { line-height: 1; }

/* ---- Banners / notes ---- */
.banner { padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.banner.info { background: var(--info-bg); color: var(--info-fg); }
.banner.warn { background: var(--warn-bg); color: var(--warn-fg); }
.note { padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.note.ok  { background: var(--ok-bg);  color: var(--ok-fg); }
.note.err { background: var(--err-bg); color: var(--err-fg); }

.sync-status {
    max-width: 1180px; margin: 8px auto 0; padding: 8px 14px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
    font-size: 13px;
}

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; }
.stat-n { font-size: 26px; font-weight: 700; }
.stat-l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-clickable { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.stat-clickable:hover, .stat-clickable:focus-visible {
    border-color: var(--fg); box-shadow: 0 1px 6px rgba(0,0,0,.08); outline: none;
}
.stat-more { color: var(--fg); font-weight: 600; white-space: nowrap; }

/* month payout breakdown popup - flex rows so it never scrolls sideways */
#statModalBody { font-size: 1rem; line-height: 1.45; overflow-x: hidden; }
#statModalBody h2 { font-size: 1rem; margin: 0 0 10px; }
.mw-brk { display: flex; flex-direction: column; }
.mw-brk-row {
    display: flex; align-items: baseline; gap: 10px;
    padding: 7px 0; border-bottom: 1px solid var(--line);
}
.mw-brk-date { flex: 0 0 auto; color: var(--muted); white-space: nowrap; }
.mw-brk-guest { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mw-brk-amt {
    flex: 0 0 auto; margin-left: auto; white-space: nowrap;
    text-align: right; font-variant-numeric: tabular-nums;
}
.mw-brk-tag {
    display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px;
    background: var(--panel); border: 1px solid var(--line);
    font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
    vertical-align: 1px;
}
.mw-brk-total { border-bottom: none; border-top: 2px solid var(--fg); font-weight: 700; margin-top: 2px; padding-top: 9px; }
.mw-brk-total > span:first-child { flex: 1 1 auto; }

/* ---- Toolbar / legend ---- */
.toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    margin: 12px 0; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.legend { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* primary action - keep it obvious, pinned to the right of the toolbar */
#addOrderBtn { font-size: 14px; font-weight: 600; padding: 10px 18px; order: 1; margin-left: auto; }

/* secondary calendar controls (legend, platform filter, show-cancelled, last sync).
   Desktop: flow inline in the toolbar. Mobile: one collapsible panel, collapsed. */
.cal-extra { display: contents; }
.cal-extra > summary { display: none; }
.cal-extra > .cal-extra-body { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.chip i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chip b { color: var(--fg); }
.filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
select, input[type=text], input[type=url], input[type=password], input[type=date],
input[type=tel], input[type=number], input[type=email] {
    font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--fg);
}

/* ---- Calendar ---- */
#calendar { margin-top: 8px; }
.fc { --fc-border-color: var(--line); --fc-today-bg-color: #00cec9; }
.fc .fc-daygrid-day-frame { min-height: 100px; }
.fc .fc-toolbar-title { font-size: 18px; }
.fc .fc-button {
    background: #fff; border: 1px solid var(--line); color: var(--fg);
    box-shadow: none; text-transform: capitalize;
}
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--fg); color: #fff; border-color: var(--fg); }
.fc-event { cursor: pointer; font-size: 12px; }

/* Tap the toolbar title to jump to a month/year */
.fc .fc-toolbar-title { cursor: pointer; border-radius: 6px; padding: 2px 6px; user-select: none; }
.fc .fc-toolbar-title:hover { background: var(--panel); }
.fc .fc-toolbar-title::after { content: " \25BE"; font-size: .7em; color: var(--muted); vertical-align: middle; }

.mw-monthpop {
    position: fixed; z-index: 60; width: 232px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16); padding: 10px;
}
.mw-mp-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mw-mp-ylabel { font-weight: 600; font-size: 14px; }
.mw-mp-nav {
    border: 1px solid var(--line); background: #fff; border-radius: 6px;
    width: 28px; height: 28px; cursor: pointer; font-size: 15px; line-height: 1; color: var(--fg);
}
.mw-mp-nav:hover { background: var(--panel); }
.mw-mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mw-mp-m {
    border: 1px solid var(--line); background: #fff; border-radius: 6px;
    padding: 8px 0; cursor: pointer; font-size: 13px; color: var(--fg);
}
.mw-mp-m:hover { background: var(--panel); }
.mw-mp-m.on { background: var(--fg); color: #fff; border-color: var(--fg); }
.mw-mp-today {
    width: 100%; margin-top: 8px; border: 1px solid var(--line); background: #fff;
    border-radius: 6px; padding: 7px 0; cursor: pointer; font-size: 12px; color: var(--muted);
}
.mw-mp-today:hover { background: var(--panel); color: var(--fg); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
table.grid th { color: var(--muted); font-weight: 600; }
table.grid tr.is-cancelled td { color: var(--muted); text-decoration: line-through; }

/* Door records - a real table at every width (not the as-cards stack), sized
   for a quick glance: fixed columns + ellipsis on Event/Who so a long
   passcode name never pushes the row wider than the screen. */
.door-grid { table-layout: fixed; }
.door-grid th:nth-child(1), .door-grid td:nth-child(1) { width: 22%; }
.door-grid th:nth-child(2), .door-grid td:nth-child(2) { width: 38%; }
.door-grid th:nth-child(3), .door-grid td:nth-child(3) { width: 40%; }
/* Event stays fully visible (wraps) - it's the thing you actually need to
   read. Only Who/passcode truncates, since a passcode name is decorative
   once you've seen it once. */
.door-grid td:nth-child(2) { word-break: break-word; }
.door-grid td:nth-child(3) {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.door-grid tr.is-fail td { color: var(--err-fg); }

/* A wide comparison table (e.g. "By platform") - stays a real table at every
   width instead of collapsing to as-cards, since stacking rows into separate
   cards makes it impossible to compare a number across platforms at a
   glance. min-width forces genuine horizontal scroll on mobile (via the
   .table-wrap it sits in) rather than squeezing columns unreadably thin, and
   the first column stays pinned so you always know which row you're on. */
.sticky-col { min-width: 640px; }
.sticky-col th:first-child, .sticky-col td:first-child {
    position: sticky; left: 0; background: #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, .06);
}
.sticky-col tr.is-cancelled td:first-child { background: #fff; }

.mobile-only { display: none; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.tag { font-size: 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.pill { font-size: 11px; border-radius: 999px; padding: 2px 8px; background: var(--panel); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill.off { background: var(--err-bg); color: var(--err-fg); }
.row-actions { white-space: nowrap; display: flex; gap: 6px; }

/* ---- Toggle switch ---- */
.switch { display: inline-flex; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    width: 44px; height: 24px; border-radius: 999px;
    background: var(--line); position: relative; transition: background .15s;
}
.switch-thumb {
    position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--ok-fg); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---- Analytics charts ---- */
.chart-card {
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    padding: 14px 16px; margin: 14px 0;
}
.chart-card h2 { margin: 0 0 4px; font-size: 15px; }
.chart-card .muted.small { display: block; margin-bottom: 10px; }
.chart-box { position: relative; height: 320px; }
.chart-box.tall { height: 380px; }
.chart-2up { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-2up .chart-card { margin: 0; }
@media (max-width: 720px) {
    .chart-2up { grid-template-columns: 1fr; }
    .chart-box { height: 260px; }
}

/* ---- Settings grid ---- */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); row-gap: 16px; column-gap: 16px; max-width: 900px; margin: 14px 0; }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; }

/* ---- Forms ---- */
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 10px 0; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.inline-form label.grow { flex: 1 1 320px; }
.inline-form label.grow input { width: 100%; }
.inline-form .filter { flex-direction: row; align-items: center; }

/* ---- Auth pages ---- */
.auth-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.card { width: 360px; max-width: 92vw; border: 1px solid var(--line); border-radius: 10px; padding: 24px; background: #fff; }
.card h1 { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.stack input { padding: 8px 10px; }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box {
    background: #fff; border-radius: 10px; padding: 20px 22px;
    width: 420px; max-width: 92vw; position: relative;
    max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
/* while a modal is open, lock the page behind it */
html.mw-modal-open, html.mw-modal-open body { overflow: hidden; }
.modal-x { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 12px 0 0; }
.modal dt { color: var(--muted); }
.modal dd { margin: 0; }

.foot { border-top: 1px solid var(--line); padding: 14px 18px; text-align: center; }

/* ---- TTLock passcode: calendar dot + modal section ---- */
.mw-lock-host { position: relative; }
.fc-event-main-frame.mw-lock-host { padding-left: 12px; }
.mw-lock-dot {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #e02424;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95);
    pointer-events: none;
    z-index: 3;
}
.mw-lock-dot-ok { background: #1a7f37; }
.fc-list-event-title .mw-lock-dot {
    position: static; display: inline-block;
    width: 10px; height: 10px; margin-right: 7px;
    vertical-align: middle; box-shadow: 0 0 0 1.5px rgba(0,0,0,.12);
}

/* highlighted payout block in the event popup */
.mw-payout {
    margin-top: 16px; padding: 12px 14px; border-radius: 8px;
    background: var(--ok-bg); border: 1px solid #cfe8d8;
}
.mw-payout-h { font-size: 12px; font-weight: 700; color: var(--ok-fg); text-transform: uppercase; letter-spacing: .03em; }
.mw-payout-amt { font-size: 24px; font-weight: 800; color: var(--ok-fg); line-height: 1.15; margin-top: 2px; }
.mw-payout-note { font-size: 12px; color: var(--muted); margin-top: 5px; }
.mw-payout-est .mw-payout-amt { color: var(--fg); }

.mw-pass { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.mw-pass-none { color: var(--muted); font-size: 13px; }
.mw-pass-h, .mw-sec-h {
    font-size: 15px; font-weight: 700; line-height: 1.3;
    border-left: 3px solid var(--fg); padding-left: 8px;
}
.mw-pass-h { margin: 0 0 10px; }
.mw-pass-code {
    display: inline-block; margin-bottom: 14px; padding: 8px 14px;
    font: 600 20px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
}
.mw-pass-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mw-copy-btn {
    font: 12px/1 inherit; cursor: pointer; color: var(--fg);
    background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px;
}
.mw-copy-btn:hover { background: var(--panel); }
.mw-copy-btn:disabled { opacity: .5; cursor: default; }

/* add-order form */
#orderForm input[type=text],
#orderForm input[type=date],
#orderForm input[type=number],
#orderForm input[type=tel] {
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
    font: inherit; background: #fff; color: var(--fg); width: 100%;
}
.mw-order-actions { display: flex; gap: 8px; margin-top: 4px; }
.mw-order-msg { font-size: 13px; margin: 6px 0 0; }
.mw-order-msg.ok  { color: var(--ok-fg); }
.mw-order-msg.err { color: var(--err-fg); }

/* Add-order: Referral / Extend toggle + the extend picker */
.mw-order-type { display: flex; gap: 16px; margin: 0 0 14px; font-size: 13px; }
.mw-order-type label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.mw-extend-results {
    border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
    max-height: 220px; overflow-y: auto;
}
.mw-extend-row {
    display: flex; flex-direction: column; gap: 2px; width: 100%;
    text-align: left; padding: 8px 10px; background: #fff; border: 0;
    border-bottom: 1px solid var(--line); cursor: pointer; font: inherit;
}
.mw-extend-row:last-child { border-bottom: 0; }
.mw-extend-row:hover, .mw-extend-row:focus-visible { background: var(--panel); outline: none; }
.mw-extend-g { font-weight: 600; }
.mw-extend-empty { padding: 10px; }
.mw-extend-picked {
    border: 1px solid var(--line); border-radius: 8px; padding: 12px;
    background: var(--ok-bg); display: flex; flex-direction: column; gap: 12px;
}

/* passcode: copy-message + checklist sections */
.mw-sec-h { margin: 20px 0 8px; }
.mw-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 5px; }
.mw-conf-msg { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.mw-conf-msg.ok  { color: var(--ok-fg); }
.mw-conf-msg.err { color: var(--err-fg); }

.mw-chk-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.mw-chk-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.mw-chk-row input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; }
.mw-chk-done { font-style: normal; font-size: 11px; color: var(--ok-fg); margin-left: auto; text-align: right; }
.mw-chk-submit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mw-chk-submit input[type=text] {
    flex: 1 1 150px; padding: 8px 10px; font: inherit;
    border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--fg);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .wrap { padding: 12px 12px 44px; }
    .sync-status { margin: 8px 12px 0; }
    .banner { margin: 10px 0; }

    .stat { padding: 12px; }
    .stat-n { font-size: 22px; }

    .mobile-only { display: block; }

    /* toolbar: only "Add order" on mobile - filters & legend are hidden */
    .toolbar { gap: 10px; }
    #addOrderBtn { width: 100%; }
    .cal-extra { display: none; }
    .filters { gap: 10px 14px; width: 100%; }
    .filters label { flex: 1 1 46%; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
    .filters label.filter { flex-direction: row; align-items: center; flex-basis: 100%; }
    .filters select { width: 100%; }

    .settings-grid { grid-template-columns: 1fr; }

    /* FullCalendar compact */
    .fc .fc-toolbar.fc-header-toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
    .fc .fc-toolbar-title { font-size: 16px; }
    .fc .fc-button { padding: 5px 9px; font-size: 12px; }
    .fc .fc-daygrid-day-number { font-size: 12px; }
    .fc-event { font-size: 11px; }

    /* inline forms go single-column */
    .inline-form { gap: 8px; padding: 12px; }
    .inline-form label, .inline-form label.grow { flex: 1 1 100%; }
    .inline-form label.grow input, .inline-form input, .inline-form select { width: 100%; }

    .modal-box { padding: 18px 16px; }
    .modal dl { grid-template-columns: 92px 1fr; }

    /* data table -> stacked cards (opt-in via .as-cards) */
    table.grid.as-cards,
    table.grid.as-cards tbody,
    table.grid.as-cards tr,
    table.grid.as-cards td { display: block; width: 100%; }
    table.grid.as-cards thead { display: none; }
    table.grid.as-cards tr {
        border: 1px solid var(--line); border-radius: 8px;
        padding: 6px 12px; margin-bottom: 10px; background: #fff;
    }
    table.grid.as-cards td {
        border: 0; padding: 6px 0;
        display: flex; justify-content: space-between; gap: 16px;
        text-align: right;
    }
    table.grid.as-cards td::before {
        content: attr(data-label);
        color: var(--muted); font-weight: 600;
        text-align: left; flex: 0 0 42%;
    }
    table.grid.as-cards td:empty { display: none; }
    table.grid.as-cards tr.is-cancelled td { text-decoration: none; opacity: .65; }

    /* Door records stays a real table on mobile - just tighter, so a quick
       glance shows several rows at once instead of one big card each. */
    .door-grid { font-size: 12px; }
    .door-grid th, .door-grid td { padding: 7px 5px; }
    .door-grid th:nth-child(1), .door-grid td:nth-child(1) { width: 26%; }
    .door-grid th:nth-child(2), .door-grid td:nth-child(2) { width: 36%; }
    .door-grid th:nth-child(3), .door-grid td:nth-child(3) { width: 38%; }
}
