/* BM 2026-10-02 The Pickle Pad web app styles. Styled after picklepadleagues.com: navy, pickleball
   yellow and teal; condensed uppercase headings; rounded cards; floating bottom tab bar on phones,
   left rail on tablets and desktops (staff portal is desktop- and tablet-first). */

:root {
    --navy: #0B1F3A;
    --navy-dark: #06152A;
    --navy-soft: #1C3358;
    --pickle: #D9F24A;
    --pickle-dark: #B8D12A;
    --teal: #12A4A4;
    --teal-dark: #0C7C7C;
    --surface: #F5F7FA;
    --card: #FFFFFF;
    --border: #E2E7EE;
    --text: #0B1F3A;
    --muted: #5B6B80;
    --success: #1E9E5A;
    --warning: #B88400;
    --danger: #D64545;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 4px 16px rgba(11, 31, 58, .06);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-head: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--teal-dark); }

h1, h2, h3, .head {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .02em;
    margin: 0;
    line-height: 1.1;
}
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
h1:focus { outline: none; }

.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App frame ---------- */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px;
    background: var(--navy);
    color: #fff;
}
.brand { font-family: var(--font-head); font-weight: 800; font-size: 22px; letter-spacing: .04em; color: var(--pickle); text-decoration: none; }
.whoami { font-size: 12px; text-align: right; line-height: 1.2; opacity: .9; }
.whoami .role { color: var(--pickle); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 16px 110px; }
.page { display: flex; flex-direction: column; gap: 14px; }
.page-narrow { max-width: 640px; }

/* Floating bottom tab bar (phones) */
.tabbar {
    position: fixed; z-index: 30;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex; justify-content: space-around;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 6px 24px rgba(11, 31, 58, .18);
    padding: 6px 4px;
}
.tabbar a {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px;
    border-radius: 14px;
    color: #8A96A8; text-decoration: none;
    font-size: 11px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tabbar a.active { color: var(--navy); background: rgba(217, 242, 74, .45); }
.tabbar svg, .rail svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Left rail (tablets and desktops) */
.rail { display: none; }

@media (min-width: 900px) {
    .app { flex-direction: row; }
    .rail {
        display: flex; flex-direction: column; gap: 4px;
        position: sticky; top: 0; height: 100vh;
        width: 220px; flex: 0 0 220px;
        background: var(--navy); color: #fff;
        padding: 18px 12px;
    }
    .rail .brand { padding: 0 10px 18px; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
    .rail a {
        display: flex; align-items: center; gap: 12px;
        padding: 10px 12px; border-radius: 12px;
        color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 600;
    }
    .rail a:hover { background: var(--navy-soft); color: #fff; }
    .rail a.active { background: var(--pickle); color: var(--navy); }
    .rail .rail-foot { margin-top: auto; font-size: 12px; opacity: .8; padding: 10px; }
    .rail .rail-foot .role { color: var(--pickle); font-weight: 700; text-transform: uppercase; }
    .frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .topbar { display: none; }
    .tabbar { display: none; }
    .main { padding-bottom: 32px; }
}

/* ---------- Cards and blocks ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.card.tight { padding: 12px; }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--teal); }
.card.warn { background: #FFF8E1; border-color: #F1DC9B; }
.card.bad { background: #FFF0F0; border-color: #F2C4C4; }

.hero {
    background: var(--navy); color: #fff;
    border-radius: 20px; padding: 18px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hero .eyebrow { color: var(--pickle); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hero h1 { color: #fff; }
.avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--teal); color: #fff;
    display: grid; place-items: center;
    font-weight: 800; font-size: 20px; flex: 0 0 auto;
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 900px) {
    .grid-auto { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
    .grid-split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
}

.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 800; line-height: 1.15; }
.stat .sub { color: var(--muted); font-size: 12px; }

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    background: var(--border); color: var(--navy);
}
.badge.peak { background: var(--pickle); }
.badge.ok { background: #D6F5C9; color: #17633A; }
.badge.warn { background: #FFF0C2; color: #7A5A00; }
.badge.bad { background: #F9D9D9; color: #8E2323; }

.alert { padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.alert.error { background: #FDECEC; color: #8E2323; }
.alert.info { background: #E6F6F6; color: var(--teal-dark); }

/* ---------- Buttons and inputs ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 20px;
    border: 0; border-radius: 24px;
    background: var(--pickle); color: var(--navy);
    font: 800 14px var(--font); text-transform: uppercase; letter-spacing: .04em;
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--pickle-dark); }
.btn:disabled { background: #E4E7EC; color: #8A96A8; cursor: default; }
.btn.block { width: 100%; }
.btn.secondary { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.secondary:hover { background: rgba(11, 31, 58, .05); }
.btn.teal { background: var(--teal); color: #fff; }
.btn.teal:hover { background: var(--teal-dark); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 12px; }

.chip {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 19px;
    background: var(--card); color: var(--navy);
    font: 600 13px var(--font); cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--pickle); border-color: var(--pickle); }
.chip:disabled { opacity: .5; cursor: default; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 24px; }
.seg button { min-height: 40px; border: 0; border-radius: 20px; background: transparent; color: #fff; font: 700 14px var(--font); cursor: pointer; }
.seg button.active { background: var(--pickle); color: var(--navy); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
/* BM 2026-10-05 Checkbox rows on settings screens */
.toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--teal); flex: 0 0 auto; }
.chips label.chip { display: inline-flex; align-items: center; cursor: pointer; }
.input, select.input, textarea.input {
    width: 100%; min-height: 46px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 12px;
    background: #fff; color: var(--text);
    font: 16px var(--font);
}
.input:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }

.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 18px; cursor: pointer; color: var(--navy); }

/* ---------- Sign-in ---------- */

.signin-wrap { min-height: calc(100vh - 140px); display: grid; place-items: start center; }
.signin { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.signin .panel { background: var(--navy); color: #fff; border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.signin .panel .big { font-family: var(--font-head); font-size: 40px; font-weight: 800; color: var(--pickle); line-height: 1; }

/* ---------- Lists ---------- */

.slot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 16px; border-radius: 14px;
    background: var(--card); border: 1px solid var(--border);
    cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
}
.slot:hover { border-color: var(--teal); }
.slot .time { font-size: 18px; font-weight: 800; }
.strike { text-decoration: line-through; }

.qr { width: 200px; height: 200px; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; }

/* ---------- Check-in ---------- */

.scanner { position: relative; width: 100%; max-width: 480px; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame-guide { position: absolute; inset: 18%; border: 3px solid var(--pickle); border-radius: 16px; pointer-events: none; }
.result { border-width: 3px; }
.result.ok { border-color: var(--success); }
.result.info { border-color: var(--teal); }
.result.warn { border-color: #E0A100; }
.result.bad { border-color: var(--danger); }

/* ---------- Schedule grid ---------- */

.sched-scroll { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); max-height: calc(100vh - 230px); }
.sched {
    display: grid;
    position: relative;
    min-width: max-content;
}
.sched .hdr {
    position: sticky; top: 0; z-index: 3;
    background: #EEF1F5; font-weight: 700; font-size: 13px;
    display: grid; place-items: center; height: 36px; border-bottom: 1px solid var(--border);
}
.sched .hdr.bay { background: #E6F6F6; }
.sched .corner { position: sticky; left: 0; top: 0; z-index: 4; background: #EEF1F5; border-bottom: 1px solid var(--border); }
.sched .tlabel { position: sticky; left: 0; z-index: 2; background: var(--card); font-size: 11px; color: var(--muted); padding: 0 6px; border-top: 1px solid var(--border); }
.sched .cell { border-top: 1px dashed #EEF1F5; border-left: 1px solid #F0F2F5; cursor: pointer; }
.sched .cell.hour { border-top: 1px solid var(--border); }
.sched .cell:hover { background: rgba(18, 164, 164, .08); }
.sched .blk {
    z-index: 1; margin: 1px 2px; padding: 3px 6px;
    border-radius: 8px; border: 1px solid #B8C4D2;
    font-size: 11px; line-height: 1.25; overflow: hidden;
    cursor: pointer; background: #CFEFEF;
}
.sched .blk .who { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched .blk.arrived { background: #D6F5C9; }
.sched .blk.noshow { background: #F9D9D9; }
.sched .blk.held { background: #FFF3C4; }
.sched .blk.hold { background: #E4E7EC; }
.sched .blk.openplay { background: #F4F9D0; cursor: default; }
.sched .blk.buffer {
    border: 0; border-radius: 0; cursor: default; margin: 0 2px;
    background: repeating-linear-gradient(45deg, #F0F2F5, #F0F2F5 4px, #E2E7EE 4px, #E2E7EE 8px);
}
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; background: var(--c); border: 1px solid #B8C4D2; }

/* ---------- Tables ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table tr.total td { font-weight: 800; background: #F7F9FB; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- Dialog ---------- */

.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(6, 21, 42, .55); display: grid; place-items: end center; padding: 16px; }
@media (min-width: 600px) { .modal-back { place-items: center; } }
.modal { width: 100%; max-width: 440px; background: #fff; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.modal p { margin: 0; white-space: pre-line; }

/* ---------- Loading ---------- */

.spinner { width: 28px; height: 28px; border: 3px solid rgba(18, 164, 164, .25); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--navy); }
.boot .spinner { border-color: rgba(217, 242, 74, .25); border-top-color: var(--pickle); }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; padding: 12px 16px; background: #FDECEC; color: #8E2323; }
#blazor-error-ui .reload { margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* BM 2026-10-05 Multi-line inputs (waiver text) */
textarea.input { min-height: 160px; resize: vertical; line-height: 1.45; }
