:root {
    --ink-950: #102a2a;
    --ink-900: #153737;
    --ink-800: #234b4a;
    --ink-700: #365f5e;
    --muted: #6f8382;
    --line: #dce7e5;
    --surface: #ffffff;
    --surface-soft: #f5f9f8;
    --canvas: #edf4f2;
    --brand-700: #0b6b62;
    --brand-600: #0f8277;
    --brand-500: #16a093;
    --brand-100: #d9f2ed;
    --brand-50: #eefaf7;
    --blue: #2563eb;
    --green: #18864b;
    --amber: #b96a08;
    --red: #b83939;
    --radius: 18px;
    --radius-sm: 11px;
    --shadow: 0 18px 50px rgba(18, 55, 53, .10);
    --shadow-soft: 0 8px 24px rgba(18, 55, 53, .06);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--canvas);
    color: var(--ink-950);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { appearance: none; }
p { line-height: 1.6; }
small { color: var(--muted); }

.auth-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 10% 10%, rgba(22, 160, 147, .16), transparent 34%),
        radial-gradient(circle at 90% 90%, rgba(37, 99, 235, .09), transparent 32%),
        #edf4f2;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
    width: min(1050px, 100%);
    min-height: 620px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 0 34px 90px rgba(18, 55, 53, .16);
}

.auth-hero {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
    padding: clamp(38px, 6vw, 76px);
    background:
        linear-gradient(145deg, rgba(11, 107, 98, .96), rgba(18, 55, 53, .97)),
        var(--ink-900);
    color: white;
}

.auth-hero h1 {
    max-width: 560px;
    margin: 8px 0 18px;
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.04;
}

.auth-hero p { max-width: 520px; color: rgba(255, 255, 255, .76); font-size: 17px; }
.auth-hero .eyebrow { color: #9de2d8; }

.auth-card {
    display: grid;
    align-content: center;
    gap: 19px;
    padding: clamp(30px, 5vw, 58px);
    background: var(--surface);
}

.auth-card.wide { width: min(760px, 100%); border-radius: 24px; box-shadow: var(--shadow); }
.auth-card h1, .auth-card h2 { margin: 0; letter-spacing: 0; }
.auth-link { margin: 2px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.auth-link a { color: var(--brand-700); font-weight: 800; }

.brand-mark {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--brand-500), var(--brand-700));
    color: white;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 9px 22px rgba(15, 130, 119, .26);
}

.auth-hero .brand-mark { width: 58px; height: 58px; margin-bottom: 28px; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.12); box-shadow: none; }

.app-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    background: var(--ink-950);
    color: white;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 25px 22px 21px; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 17px; letter-spacing: 0; }
.brand small { color: #8fb6b2; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.nav { display: grid; gap: 5px; padding: 8px 14px 28px; }
.nav a { position: relative; padding: 12px 14px; border-radius: 11px; color: #b9cecc; font-size: 14px; font-weight: 670; transition: .16s ease; }
.nav a:hover { background: rgba(255,255,255,.07); color: white; transform: translateX(2px); }
.nav a.active { background: linear-gradient(135deg, rgba(22,160,147,.32), rgba(22,160,147,.16)); color: #e9fffb; box-shadow: inset 0 0 0 1px rgba(104,218,202,.18); }
.nav a.active::before { position: absolute; top: 11px; bottom: 11px; left: -14px; width: 3px; border-radius: 99px; background: #45cab8; content: ""; }

.main-shell { min-width: 0; background: linear-gradient(180deg, #f5f9f8 0, var(--canvas) 280px); }
.topbar { display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 24px; padding: 24px clamp(22px, 4vw, 42px); }
.topbar > div:first-of-type { min-width: 0; }
.topbar h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(25px, 3vw, 34px); font-weight: 760; letter-spacing: 0; }
.eyebrow { margin: 0 0 6px; color: var(--brand-600); font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }

.user-box { display: flex; align-items: center; gap: 14px; }
.user-box > span { display: grid; text-align: right; }
.user-box strong { font-size: 14px; }
.user-box form { margin: 0; }
.menu-button { display: none; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink-900); cursor: pointer; }

.content { display: grid; gap: 20px; padding: 0 clamp(20px, 4vw, 42px) 48px; }
.grid { display: grid; gap: 20px; }
.content > *, .grid > *, .form-grid > *, .topbar > *, .section-heading > * { min-width: 0; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); }
.role-grid, .package-grid, .program-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 20px; }

.panel, .metric {
    border: 1px solid rgba(188, 207, 203, .72);
    border-radius: var(--radius);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-soft);
}

.panel { padding: clamp(19px, 2.5vw, 27px); }
.panel h2 { margin: 0 0 18px; overflow-wrap: anywhere; font-size: 20px; letter-spacing: 0; }
.panel h3 { margin: 0 0 10px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }

.metric { position: relative; display: grid; min-height: 120px; align-content: space-between; gap: 14px; overflow: hidden; padding: 20px; }
.metric::after { position: absolute; right: -24px; bottom: -36px; width: 94px; height: 94px; border-radius: 50%; background: var(--brand-50); content: ""; }
.metric span { color: var(--muted); font-size: 13px; font-weight: 720; }
.metric strong { position: relative; z-index: 1; overflow-wrap: anywhere; font-size: clamp(27px, 3vw, 36px); letter-spacing: 0; }
.metric.accent { border-color: transparent; background: linear-gradient(145deg, var(--brand-700), var(--ink-900)); color: white; }
.metric.accent span { color: #b9e2dc; }
.metric.accent::after { background: rgba(255,255,255,.07); }
.metric.accent.is-debt { background: linear-gradient(145deg, #8f3d3d, #3f3030); }
.metric.accent.is-debt span { color: #ffe1d9; }
a.metric { transition: border-color .15s, box-shadow .15s, transform .15s; }
a.metric:hover { transform: translateY(-2px); border-color: #acd9d2; box-shadow: var(--shadow); }
a.metric:focus-visible { outline: 3px solid rgba(22,160,147,.24); outline-offset: 2px; }

.welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(26px, 4vw, 42px); border-radius: 23px; background: linear-gradient(135deg, var(--brand-700), var(--ink-900)); color: white; box-shadow: var(--shadow); }
.welcome-card h2 { margin: 0 0 8px; overflow-wrap: anywhere; font-size: clamp(28px, 4vw, 42px); letter-spacing: 0; }
.welcome-card p { max-width: 650px; margin: 0; color: #c9e5e1; }
.welcome-card .eyebrow { color: #87d9cd; }

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; align-items: end; }
.form-grid.single { grid-template-columns: 1fr; align-content: start; }
.form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reservation-filter { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.filter-actions { display: flex; align-items: center; gap: 8px; }
label { display: grid; gap: 7px; color: var(--ink-700); font-size: 12px; font-weight: 790; letter-spacing: .01em; }
label small { font-weight: 600; }

input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfddda;
    border-radius: var(--radius-sm);
    outline: none;
    background: white;
    color: var(--ink-950);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #a1afad; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(22,160,147,.12); }
input:disabled, select:disabled { background: var(--surface-soft); color: var(--muted); }
input[readonly] { background: var(--surface-soft); color: var(--ink-700); font-weight: 720; }

.check-label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.45; }
.check-label input { width: 17px; min-height: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand-600); }
.form-note, .notice { padding: 11px 13px; border-radius: 10px; background: var(--brand-50); color: var(--ink-700); font-size: 13px; }
.form-note { margin: 15px 0 0; }
.notice { margin: 0 0 16px; border: 1px solid var(--brand-100); }

.btn { display: inline-flex; max-width: 100%; min-height: 42px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; background: #e8efed; color: var(--ink-900); cursor: pointer; font-size: 13px; font-weight: 820; white-space: nowrap; transition: transform .14s, box-shadow .14s, background .14s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(18,55,53,.10); }
.btn-primary { background: linear-gradient(145deg, var(--brand-500), var(--brand-700)); color: white; }
.btn-light { background: white; color: var(--brand-700); }
.btn-ghost { border-color: var(--line); background: rgba(255,255,255,.72); }
.btn-danger { background: #fff0f0; color: var(--red); }
.btn-success { background: #e8f8ee; color: var(--green); }
.btn-small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }
.btn-block { width: 100%; }

.flash { margin: 0 clamp(20px, 4vw, 42px) 20px; padding: 13px 16px; border: 1px solid transparent; border-radius: 12px; font-size: 14px; font-weight: 720; }
.auth-card .flash { margin: 0; }
.flash.success { border-color: #bde6ca; background: #eaf9ef; color: #16663a; }
.flash.error { border-color: #f0c6c6; background: #fff0f0; color: #982f2f; }

.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border-radius: 12px; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid #e4ecea; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; }
td { color: var(--ink-800); font-size: 13px; }
td > strong + small, td > small { display: block; margin-top: 4px; }
tbody tr:hover { background: #f8fbfa; }
tbody tr:last-child td { border-bottom: 0; }

.badge { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 9px; border-radius: 99px; background: #eaf0ef; color: var(--ink-700); font-size: 10px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.badge.confirmed, .badge.completed, .badge.paid, .badge.approved, .badge.active { background: #e4f6eb; color: #167143; }
.badge.pending, .badge.awaiting_approval { background: #fff3db; color: #9b5b08; }
.badge.cancelled, .badge.rejected, .badge.no_show, .badge.suspended { background: #ffebeb; color: #a83232; }
.badge.refunded, .badge.passive { background: #e9eff8; color: #4a6384; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form, .inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline-form input, .inline-form select { min-height: 34px; width: 125px; padding: 6px 8px; }
.inline-form input[name="note"] { width: 170px; }
.action-pop { position: relative; }
.action-pop summary { list-style: none; }
.action-pop summary::-webkit-details-marker { display: none; }
.popover { position: absolute; z-index: 10; top: 40px; right: 0; display: grid !important; width: 230px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }

.directory-heading .eyebrow { margin-bottom: 6px; }
.directory-heading .muted { max-width: 720px; margin-top: 8px; }
.user-directory { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.user-table-head, .user-row-summary { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(210px, 1.45fr) minmax(135px, .85fr) minmax(90px, .6fr) 66px; align-items: center; gap: 16px; }
.user-directory.has-wallet .user-table-head, .user-directory.has-wallet .user-row-summary { grid-template-columns: minmax(150px, 1.1fr) minmax(210px, 1.4fr) minmax(130px, .8fr) minmax(125px, .75fr) minmax(90px, .55fr) 66px; }
.user-table-head { padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; }
.user-row { border-bottom: 1px solid var(--line); background: white; }
.user-row:last-child { border-bottom: 0; }
.user-row-summary { min-height: 72px; padding: 13px 16px; list-style: none; }
details.user-row > .user-row-summary { cursor: pointer; }
details.user-row > .user-row-summary::-webkit-details-marker { display: none; }
details.user-row > .user-row-summary:hover { background: #f8fbfa; }
.user-row[open] > .user-row-summary { border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.user-row form { padding: 18px; background: #fbfdfc; }
.user-cell { min-width: 0; color: var(--ink-800); font-size: 13px; }
.user-cell::before { display: none; content: attr(data-label); }
.user-primary, .user-contact { display: grid; gap: 4px; }
.user-primary strong { color: var(--ink-950); font-size: 14px; }
.user-primary small, .user-contact small { color: var(--muted); }
.user-contact strong { overflow-wrap: anywhere; font-weight: 700; }
.role-chip { display: inline-flex; width: fit-content; padding: 6px 9px; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); font-size: 11px; font-weight: 820; }
.wallet-cell { display: grid; gap: 4px; }
.wallet-cell strong { color: var(--ink-900); white-space: nowrap; }
.wallet-cell small { font-size: 10px; line-height: 1.4; }
.user-row-action { color: var(--brand-700); font-size: 11px; font-weight: 850; text-align: right; }

.role-card fieldset { display: grid; gap: 9px; margin: 0 0 17px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.role-card legend { padding: 0 7px; color: var(--brand-700); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.package-card { display: grid; gap: 16px; }
.package-card h2 { margin: 10px 0 3px; }
.credit-ring { display: flex; align-items: baseline; gap: 6px; color: var(--brand-700); }
.credit-ring strong { font-size: 40px; letter-spacing: 0; }
.credit-ring span { color: var(--muted); font-weight: 700; }

.clinical-list { display: grid; gap: 12px; }
.clinical-entry { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfc; }
.clinical-entry header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.clinical-entry header > div { display: grid; gap: 3px; }
.clinical-entry p { margin: 12px 0 0; color: var(--ink-700); }
.program-card { align-content: start; }
.program-card h2 { margin-bottom: 7px; }
.exercise-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.exercise-stats span { display: grid; gap: 2px; padding: 11px; border-radius: 11px; background: var(--surface-soft); color: var(--muted); font-size: 11px; text-align: center; }
.exercise-stats strong { color: var(--ink-900); font-size: 20px; }

.empty, .muted { color: var(--muted); }
.empty { padding: 24px; text-align: center; }
.empty-state { padding: 44px 24px; text-align: center; }
.empty-state h2 { margin-bottom: 5px; }

.status-tabs {
    display: flex;
    gap: 8px;
    margin: -4px 0 20px;
    padding-bottom: 3px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}
.status-tabs a { padding: 9px 13px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--muted); font-size: 12px; font-weight: 820; white-space: nowrap; }
.status-tabs a:hover { color: var(--brand-700); border-color: var(--brand-100); }
.status-tabs a.active { border-color: transparent; background: var(--ink-900); color: white; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pagination span { color: var(--muted); font-size: 12px; font-weight: 800; }
.pagination .is-disabled { pointer-events: none; opacity: .45; }

.wallet-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(25px, 4vw, 38px);
    border-radius: 22px;
    background: linear-gradient(135deg, #123c3a, #0b6b62);
    color: white;
    box-shadow: var(--shadow);
}
.wallet-hero h2 { margin: 2px 0 4px; overflow-wrap: anywhere; font-size: clamp(35px, 5vw, 52px); letter-spacing: 0; }
.wallet-hero p:last-child { margin: 0; color: #c7e8e3; }
.wallet-hero .eyebrow { color: #8ee0d5; }
.wallet-hero.has-debt { background: linear-gradient(135deg, #813b3b, #3e3030); }
.wallet-hero.has-debt .eyebrow { color: #ffd0c5; }
.wallet-hero.has-debt p:last-child { color: #f5d8d2; }
.wallet-amount.is-positive { color: var(--green); }
.wallet-amount.is-negative { color: var(--red); }
.wallet-breakdown { display: flex; gap: 12px; }
.wallet-breakdown span { display: grid; gap: 3px; min-width: 145px; padding: 13px 16px; border: 1px solid rgb(255 255 255 / 16%); border-radius: 13px; background: rgb(255 255 255 / 8%); }
.wallet-breakdown small { color: #a9d8d2; }
.wallet-breakdown strong { font-size: 17px; }
.debt-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; border: 1px solid #efc8b8; border-radius: 12px; background: #fff7f2; color: #744033; }
.debt-notice strong { color: #9b3737; }
.debt-notice span { font-size: 13px; }
.flow-steps { display: grid; gap: 12px; margin-top: 20px; }
.flow-steps span { display: flex; align-items: center; gap: 11px; color: var(--ink-700); }
.flow-steps b { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); }
.purchase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 13px; }
.purchase-card { display: flex; min-height: 175px; flex-direction: column; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.purchase-card h3 { margin: 0 0 6px; color: var(--ink-950); }
.purchase-card p { margin: 0 0 8px; color: var(--muted); }
.purchase-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--line); }
.purchase-card footer strong { color: var(--ink-950); font-size: 18px; }
.feedback-dialog { width: min(430px, calc(100% - 24px)); max-width: none; padding: 0; border: 1px solid var(--line); border-radius: 16px; outline: none; background: white; color: var(--ink-950); box-shadow: 0 28px 80px rgba(18,55,53,.24); }
.feedback-dialog::backdrop { background: rgba(8,31,30,.56); }
.feedback-dialog form { display: grid; gap: 22px; padding: 24px; }
.feedback-dialog h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: 0; }
.feedback-dialog p { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.financial-tabs { margin-top: 2px; }
.financial-ledger .table-wrap table { min-width: 1320px; }
.financial-ledger td small { max-width: 210px; }
.booking-matrix-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 13px; -webkit-overflow-scrolling: touch; }
.booking-matrix { width: max-content; min-width: 760px; table-layout: auto; }
.booking-matrix th, .booking-matrix td { min-width: 180px; padding: 9px; border-right: 1px solid var(--line); text-align: center; }
.booking-matrix th:first-child { position: sticky; z-index: 2; left: 0; width: 145px; min-width: 145px; background: var(--surface-soft); text-align: left; }
.booking-matrix thead th:first-child { z-index: 3; }
.booking-matrix tbody th strong, .booking-matrix tbody th small { display: block; }
.booking-matrix tbody th strong { color: var(--ink-950); font-size: 13px; }
.booking-matrix tbody th small { margin-top: 3px; }
.booking-slot-list { display: grid; gap: 6px; }
.booking-slot-cell { display: grid; width: 100%; min-height: 58px; place-content: center; gap: 4px; padding: 9px; border: 1px solid #bce3dc; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); text-align: center; }
button.booking-slot-cell { cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
button.booking-slot-cell:hover { transform: translateY(-1px); border-color: var(--brand-500); background: var(--brand-100); }
.booking-slot-cell strong { font-size: 12px; }
.booking-slot-cell small { color: var(--brand-700); font-size: 10px; font-weight: 850; }
.booking-slot-cell.is-closed { border-color: #e2e9e7; background: #f6f8f8; color: #91a09e; font-size: 11px; font-weight: 750; }
.scheduler-cell, .scheduler-work-slots { display: grid; gap: 7px; }
.scheduler-work-slots { padding-top: 4px; border-top: 1px dashed var(--line); }
.scheduler-appointment { display: grid; width: 100%; gap: 4px; padding: 10px; border: 1px solid #bfd2f4; border-radius: 10px; background: #edf3ff; color: #234e96; cursor: pointer; text-align: left; }
.scheduler-appointment:hover { border-color: #7299dd; background: #e2ebff; }
.scheduler-appointment strong { font-size: 11px; line-height: 1.4; }
.scheduler-appointment small { color: #5977aa; font-size: 10px; }
.scheduler-appointment.is-readonly { cursor: default; }
.scheduler-editor-grid { align-items: start; }
.scheduler-edit-panel [hidden] { display: none; }
.customer-reservation-list, .change-request-list { display: grid; gap: 11px; }
.customer-reservation-card, .change-request-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfc; }
.customer-reservation-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.customer-reservation-card header > div { display: grid; gap: 4px; }
.customer-reservation-card header > div > strong { font-size: 15px; }
.customer-reservation-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.customer-reservation-meta > span { display: grid; gap: 5px; }
.customer-reservation-meta > span > strong { font-size: 13px; }
.change-request-pending { display: grid; gap: 3px; margin-top: 13px; padding: 10px 12px; border-radius: 10px; background: #fff3db; color: #8a540c; font-size: 12px; }
.customer-reservation-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 13px; }
.customer-reservation-actions form { margin: 0; }
.customer-reservation-actions details { min-width: min(340px, 100%); }
.customer-reservation-actions summary { width: fit-content; list-style: none; }
.customer-reservation-actions summary::-webkit-details-marker { display: none; }
.customer-change-form { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)) auto; align-items: end; gap: 9px; margin-top: 9px !important; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.change-request-card { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(310px, 1.2fr) minmax(320px, 1.2fr); align-items: center; gap: 15px; }
.change-request-card > div:first-child { display: grid; gap: 4px; }
.change-request-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.change-request-dates > span:not(.change-arrow) { display: grid; gap: 3px; }
.change-request-dates strong { font-size: 12px; }
.change-arrow { color: var(--brand-600); font-weight: 900; }
.change-review-form { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; gap: 7px; }
.change-review-form input { min-height: 36px; }
.physio-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.physio-option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; transition: border-color .15s, background .15s, transform .15s; }
.physio-option:hover { transform: translateY(-1px); border-color: #acd9d2; background: var(--brand-50); }
.physio-option.active { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(22,160,147,.09); }
.physio-option > span:last-child { display: grid; gap: 3px; }
.physio-option strong { font-size: 14px; }
.physio-dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 5px var(--brand-100); }
.calendar-filter { margin-bottom: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.calendar-filter { grid-template-columns: 1fr 1fr auto; }
.schedule-grid { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.schedule-grid-head, .schedule-summary { display: grid; grid-template-columns: 125px 115px minmax(230px, 1fr) 90px 65px; align-items: center; gap: 14px; }
.schedule-grid-head { padding: 11px 15px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; }
.schedule-item { border-bottom: 1px solid var(--line); }
.schedule-item:last-child { border-bottom: 0; }
.schedule-summary { min-height: 62px; padding: 12px 15px; cursor: pointer; list-style: none; }
.schedule-summary::-webkit-details-marker { display: none; }
.schedule-summary:hover { background: #f8fbfa; }
.schedule-item[open] .schedule-summary { border-bottom: 1px solid var(--line); background: var(--brand-50); }
.schedule-summary > strong { color: var(--ink-950); font-size: 14px; }
.schedule-summary > span { color: var(--ink-700); font-size: 12px; }
.schedule-hours { font-weight: 760; }
.schedule-item.is-closed .schedule-hours { color: var(--muted); font-weight: 650; }
.schedule-action { color: var(--brand-700) !important; font-size: 11px !important; font-weight: 850; text-align: right; }
.schedule-edit-form { display: grid; grid-template-columns: minmax(180px, .8fr) repeat(2, minmax(230px, 1fr)) auto; align-items: end; gap: 14px; padding: 16px; background: #fbfdfc; }
.schedule-working-toggle { display: flex; align-items: flex-start; gap: 10px; align-self: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.schedule-working-toggle input { width: 18px; min-height: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-600); }
.schedule-working-toggle span { display: grid; gap: 3px; }
.schedule-period { display: grid; grid-template-columns: auto 1fr 1fr; align-items: end; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.schedule-period .check-label { align-self: center; padding-right: 5px; }
.schedule-form-actions { display: grid; gap: 8px; }

hr { width: 100%; height: 1px; margin: 5px 0; border: 0; background: var(--line); }

@media (max-width: 1220px) {
    .cards-5, .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-working-toggle { grid-column: 1 / -1; }
    .change-request-card { grid-template-columns: 1fr 1fr; }
    .change-review-form { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(272px, calc(100vw - 48px)); overscroll-behavior: contain; box-shadow: 24px 0 60px rgba(6,31,30,.32); transition: transform .2s ease; }
    body.menu-open { overflow: hidden; }
    body.menu-open .sidebar { transform: translateX(0); }
    body.menu-open::after { position: fixed; z-index: 20; inset: 0; background: rgba(8,31,30,.48); content: ""; }
    .menu-button { display: inline-grid; place-items: center; }
    .topbar { justify-content: flex-start; gap: 14px; }
    .topbar > div:first-of-type { flex: 1; }
    .user-box { flex: 0 0 auto; }
    .user-box > span { display: none; }
    .auth-shell { grid-template-columns: 1fr; min-height: auto; }
    .auth-hero { min-height: 320px; }
    .cards-4, .cards-3, .two-col { grid-template-columns: 1fr; }
    .calendar-filter { grid-template-columns: 1fr 1fr; }
    .schedule-grid-head { display: none; }
    .schedule-grid { display: grid; gap: 10px; overflow: visible; border: 0; background: transparent; }
    .schedule-item, .schedule-item:last-child { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
    .schedule-summary { grid-template-columns: 1fr 1fr auto; gap: 8px 14px; }
    .schedule-hours { grid-column: 1 / 3; }
    .schedule-action { grid-column: 3; grid-row: 2; }
    .user-table-head { display: none; }
    .user-directory, .user-directory.has-wallet { display: grid; gap: 10px; overflow: visible; border: 0; background: transparent; }
    .user-row, .user-row:last-child { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
    .user-table-head + .user-row { border-top: 1px solid var(--line); }
    .user-row-summary, .user-directory.has-wallet .user-row-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 20px; }
    .user-cell::before { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
    .user-row-action { align-self: end; }
    .change-request-card { grid-template-columns: 1fr; }
    .change-review-form { grid-column: auto; }
}

@media (max-width: 620px) {
    .auth-page { padding: 12px; }
    .auth-shell { border-radius: 20px; }
    .auth-hero { min-height: 255px; padding: 30px; }
    .auth-hero h1 { font-size: 34px; }
    .auth-card { padding: 28px; }
    .topbar { min-height: 92px; gap: 10px; padding: 18px 15px; }
    .topbar h1 { font-size: 24px; }
    .content, .grid { gap: 15px; }
    .content { padding: 0 15px 32px; }
    .flash { margin: 0 15px 17px; }
    .section-heading { flex-direction: column; gap: 13px; }
    .section-heading > .btn { width: 100%; }
    .role-grid, .package-grid, .program-grid, .purchase-grid, .physio-picker { grid-template-columns: minmax(0, 1fr); }
    .calendar-filter, .schedule-edit-form { grid-template-columns: 1fr; }
    .schedule-working-toggle { grid-column: auto; }
    .schedule-period { grid-template-columns: 1fr 1fr; }
    .schedule-period .check-label { grid-column: 1 / -1; }
    .schedule-summary { grid-template-columns: 1fr auto; }
    .schedule-hours { grid-column: 1 / -1; }
    .schedule-action { grid-column: 2; grid-row: 3; }
    .wallet-hero { align-items: flex-start; flex-direction: column; }
    .wallet-breakdown { width: 100%; flex-direction: column; }
    .wallet-breakdown span { min-width: 0; }
    .debt-notice { align-items: flex-start; flex-direction: column; gap: 4px; }
    .cards-5, .cards-4, .cards-3, .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
    .form-grid > .btn, .calendar-filter > .btn, .schedule-form-actions, .schedule-form-actions .btn { width: 100%; }
    .filter-actions, .filter-actions .btn { width: 100%; }
    .filter-actions .btn { flex: 1 1 0; }
    .metric { min-height: 104px; }
    .welcome-card { align-items: flex-start; flex-direction: column; }
    .panel { padding: 17px; border-radius: 15px; }
    .btn { white-space: normal; line-height: 1.35; }
    .btn-small { min-height: 40px; }
    .inline-form { width: 100%; flex-wrap: wrap; }
    .inline-form input, .inline-form select, .inline-form input[name="note"] { width: auto; min-width: min(100%, 135px); flex: 1 1 135px; }
    .inline-form .btn { flex: 1 1 auto; }
    .user-row-summary, .user-directory.has-wallet .user-row-summary { grid-template-columns: 1fr; }
    .user-row-action { text-align: left; }
    .customer-reservation-meta, .customer-change-form, .change-review-form { grid-template-columns: 1fr; }
    .clinical-entry header, .customer-reservation-card header { flex-direction: column; }
    .purchase-card footer { align-items: stretch; flex-direction: column; }
    .purchase-card footer .btn { width: 100%; }
    .dialog-actions { flex-direction: column-reverse; }
    .dialog-actions .btn { width: 100%; }
    .customer-reservation-actions details, .customer-reservation-actions summary, .customer-reservation-actions summary .btn { width: 100%; }
    .booking-matrix th, .booking-matrix td { min-width: 155px; }
    .booking-matrix th:first-child { width: 120px; min-width: 120px; }
    .pagination { justify-content: space-between; }
}

@media (max-width: 380px) {
    .auth-page { align-items: start; padding: 8px; }
    .auth-shell { border-radius: 14px; }
    .auth-hero { min-height: 210px; padding: 22px; }
    .auth-hero .brand-mark { width: 48px; height: 48px; margin-bottom: 18px; }
    .auth-hero h1 { margin-bottom: 12px; font-size: 28px; line-height: 1.08; }
    .auth-hero p { margin: 8px 0 0; font-size: 14px; }
    .auth-card { gap: 16px; padding: 22px 20px; }
    .sidebar { width: min(272px, calc(100vw - 24px)); }
    .topbar { min-height: 82px; padding: 13px 10px; }
    .topbar h1 { font-size: 20px; line-height: 1.18; }
    .topbar .eyebrow { margin-bottom: 4px; font-size: 9px; }
    .menu-button { width: 40px; height: 40px; flex-basis: 40px; }
    .user-box .btn { min-height: 40px; padding: 8px 10px; font-size: 12px; }
    .content, .grid, .role-grid, .package-grid, .program-grid { gap: 12px; }
    .content { padding: 0 10px 24px; }
    .flash { margin: 0 10px 13px; padding: 11px 12px; }
    .panel { padding: 14px; border-radius: 12px; }
    .panel h2 { margin-bottom: 14px; font-size: 18px; }
    .welcome-card, .wallet-hero { gap: 17px; padding: 20px; border-radius: 16px; }
    .welcome-card h2 { font-size: 27px; line-height: 1.12; }
    .wallet-hero h2 { font-size: 32px; line-height: 1.12; }
    .metric { min-height: 96px; padding: 16px; }
    .metric strong { font-size: 28px; }
    .filter-actions { display: grid; grid-template-columns: 1fr; }
    .pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; }
    .pagination .btn { padding-inline: 9px; }
    .schedule-period { grid-template-columns: 1fr; }
    .schedule-period .check-label { grid-column: auto; }
    .schedule-summary { padding: 12px; }
    .change-request-dates { grid-template-columns: 1fr; }
    .change-arrow { justify-self: start; transform: rotate(90deg); }
    .customer-reservation-card, .change-request-card { padding: 13px; }
    .customer-reservation-actions { display: grid; grid-template-columns: 1fr; }
    .customer-reservation-actions form, .customer-reservation-actions .btn { width: 100%; }
    .exercise-stats { gap: 6px; }
    .exercise-stats span { padding: 9px 6px; }
    .exercise-stats strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
