/* ─── Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --ve-navy: #1a2744;
    --ve-navy-dark: #111b36;
    --ve-accent: #e63946;
    --ve-accent-hover: #c1121f;
    --ve-bg: #f4f6fb;
    --ve-surface: #ffffff;
    --ve-border: #e0e4ef;
    --ve-text: #1e2a3a;
    --ve-muted: #6b7b94;
    --ve-nav-width: 220px;
    /* Single knob for the minimal margin that pins every section to the device
       L/R edges (mobile). Combined with env(safe-area-inset-*) at the edges so
       the layout is anchored to the real screen, not to content width. */
    --ve-gutter: 8px;
}

/* Hard horizontal lockdown: the document can never be wider than the visible
   viewport. Without this, a single stray-wide descendant (or an iOS WebKit
   width quirk that Chrome doesn't show) lets the layout exceed the screen and
   the right edge gets clipped. overflow-x:hidden here clips it at the root;
   overflow-y stays scrollable so the auth compact-fit fallback still works. */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--ve-bg);
    color: var(--ve-text);
}

/* ─── Shell layout ─── */
.ve-shell {
    display: flex;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh; /* lock the frame to the *visible* viewport (handles mobile browser chrome) */
    overflow: hidden; /* only .ve-content scrolls — header + nav stay fixed */
}

.ve-main {
    flex: 1;
    margin-left: var(--ve-nav-width);
    min-width: 0; /* prevent flex child from overflowing */
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

.ve-content {
    flex: 1 1 auto;
    min-width: 0;     /* a flex child must be allowed to shrink below its content width */
    min-height: 0;
    overflow-y: auto; /* the single scrolling "window"; the header above it does not scroll */
    overflow-x: hidden; /* last-resort net; the grid track below is the real fix */
    overscroll-behavior: contain; /* don't chain/rubber-band the content scroll out to the page (iOS) */
    padding: 1rem 1.25rem;
    /* WIDTH AUTHORITY (the method change). A single-column grid track of
       minmax(0, 1fr) clamps EVERY child to the track width: the `0` minimum
       defeats the flex/grid/min-content "blowout" that lets a stubborn
       descendant force the page wider than the screen — the real cause of the
       iOS right-edge truncation. This makes content REFLOW to fit instead of
       relying on overflow:hidden to CLIP it (clipping hid the symptom in Chrome
       but still truncated on WebKit). `100%` (not `100vw`) ties the cap to the
       true parent width; `100vw` is a foot-gun under viewport-fit=cover and
       sub-pixel rounding. See docs/responsive-layout-cheatsheet.md. */
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    max-width: min(1200px, 100%);
    width: 100%;
}

/* Belt-and-suspenders: no direct child of the content track may impose a
   min-content floor wider than the track, and none may exceed it. */
.ve-content > * { min-width: 0; max-width: 100%; }

/* ─── Navigation ─── */
.ve-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--ve-nav-width);
    height: 100vh;
    height: 100dvh; /* fit the visible viewport exactly, not the chrome-inflated 100vh */
    background: var(--ve-navy);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden; /* the nav itself never scrolls — only .ve-nav-links can */
    z-index: 100;
}

.ve-nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.ve-nav-phone {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
}
.ve-nav-phone:hover { color: #fff; }

.ve-nav-logo {
    background: var(--ve-accent);
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.ve-nav-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ve-nav-links {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0 0.75rem;
    flex: 1 1 auto;   /* take the slack so the footer pins to the bottom */
    min-height: 0;
    overflow-y: auto; /* only if the links can't all fit does THIS list scroll */
    overscroll-behavior: contain; /* the drawer's own scroll doesn't chain to the page behind */
}

.ve-nav-links li { margin-bottom: 0.25rem; }

.ve-nav-links a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    min-height: 44px;
}

.ve-nav-links a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.ve-nav-links a.active {
    background: var(--ve-accent);
    color: white;
}

.nav-icon { font-size: 1rem; }

.ve-nav-footer {
    flex-shrink: 0; /* always visible — never scrolls off the bottom */
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,0.08);
}

.ve-nav-logout {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.ve-nav-logout:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

/* Ghost button inside the navy nav footer needs light text/border so it
   doesn't disappear into the background. */
.ve-nav-footer .ve-btn-ghost {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.ve-nav-footer .ve-btn-ghost:hover,
.ve-nav-footer .ve-btn-ghost:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
}

/* ─── Modals ─── */
.ve-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ve-modal {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* `.ve-modal-overlay` is an alias for `.ve-modal-backdrop` — some pages
   (PromoCodes, Transactions) reference it; without this they fell back to
   document flow (uncentered, unsized). Keep both names in sync. */
.ve-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ─── Framed modal: pinned header (title + actions) and footer that never
   scroll; only the body scrolls (G4). Structure:
     <div class="ve-modal-backdrop"><div class="ve-modal ve-modal-framed">
        <div class="ve-modal-header"><h2>Title</h2>
            <div class="ve-modal-actions"> …small top buttons… </div></div>
        <div class="ve-modal-body"> …scrolling fields… </div>
        <div class="ve-modal-footer"> …primary / cancel buttons… </div>
     </div></div>
   Use ve-modal-framed when a form is tall enough that Save/Cancel would
   otherwise scroll off. The header/footer stay put at every screen size. */
.ve-modal-framed { padding: 0; display: flex; flex-direction: column; }
.ve-modal-header {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--ve-navy);                 /* distinct, non-scrolling header bar — matches the nav */
    border-radius: 12px 12px 0 0;
}
.ve-modal-header h1, .ve-modal-header h2, .ve-modal-header h3 {
    margin: 0; font-size: 1.05rem; line-height: 1.2; min-width: 0; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Buttons sit on the navy bar — invert them so they stay legible. (A button with its
   own inline background, e.g. the destructive Deactivate, keeps that inline colour.) */
.ve-modal-header .ve-btn-ghost { color: #fff; border-color: rgba(255,255,255,0.45); }
.ve-modal-header .ve-btn-ghost:hover { background: rgba(255,255,255,0.14); }
.ve-modal-header .ve-btn-primary { background: #fff; color: var(--ve-navy); }
.ve-modal-header .ve-btn-primary:hover { background: #eef2ff; }
.ve-modal-header .ve-btn-accent { background: #fff; color: var(--ve-accent); }
.ve-modal-header .ve-btn-accent:hover { background: #fff5f5; }
.ve-modal-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; flex-shrink: 0; }
.ve-modal-actions .ve-btn { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.ve-modal-body { padding: 1.25rem; overflow-y: auto; }
/* The bottom button bar (.ve-modal-footer) was removed — the sticky navy
   .ve-modal-header above is the single, non-scrolling button bar. */

/* Save gating (modalchrome.js sets data-dirty): the Save button — mark it
   class="… ve-modal-save" — is disabled until the user enters/changes data. New
   forms start empty → disabled until something is typed; edit forms start clean →
   disabled until a field changes. Absent attribute = enabled (safe default). */
.ve-modal-framed[data-dirty="false"] .ve-modal-save {
    opacity: 0.5;
    pointer-events: none;
}

/* ─── Definition list (label/value pairs) ─── */
.ve-dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; font-size: 0.9rem; }
.ve-dl dt { font-weight: 600; color: var(--ve-muted); white-space: nowrap; }
.ve-dl dd { margin: 0; }

/* ─── Shared form helper ─── */
.ve-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ve-muted); margin-bottom: 0.3rem; }

/* ─── Cards ─── */
.ve-card {
    background: var(--ve-surface);
    border: 1px solid var(--ve-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* ─── Stat tiles ─── */
.ve-stats {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
}

.ve-stat {
    flex: 1;
    min-width: 0;
    background: var(--ve-surface);
    border: 1px solid var(--ve-border);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.ve-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ve-navy);
    line-height: 1;
}

.ve-stat-label {
    font-size: 0.67rem;
    color: var(--ve-muted);
    margin-top: 0.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Table ─── */
.ve-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ve-table th {
    text-align: left;
    padding: 0.65rem 1rem;
    border-bottom: 2px solid var(--ve-border);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ve-muted);
    white-space: nowrap;
}

.ve-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ve-border);
    vertical-align: middle;
}

.ve-table tbody tr:hover { background: #f8f9fc; }
.ve-table tbody tr:last-child td { border-bottom: none; }

.ve-table th.ve-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.ve-table th.ve-sortable:hover { color: var(--ve-navy); }

.ve-filter-row td {
    padding: 0.3rem 0.5rem;
    border-bottom: 2px solid var(--ve-border);
    background: #f8f9fc;
}
.ve-filter-row input,
.ve-filter-row select {
    width: 100%;
    padding: 0.28rem 0.5rem;
    border: 1px solid var(--ve-border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    outline: none;
    transition: border-color 0.15s;
}
.ve-filter-row input:focus,
.ve-filter-row select:focus { border-color: var(--ve-navy); }

/* ─── Pinned list header + filters (G6) ──────────────────────────────────────
   Wrap any .ve-table in <div class="ve-table-wrap"> so the rows scroll inside a
   bounded box while the column headers AND the .ve-filter-row stay pinned at the
   top. Replaces the ad-hoc inline `overflow-x:auto` wrappers. On phones the
   bound is removed (see mobile @media) so the page scrolls normally — the
   filter row is already kept visible there by the table reflow. */
.ve-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 14rem);
    border: 1px solid var(--ve-border);
    border-radius: 10px;
    background: var(--ve-surface);
}
/* separate borders so the sticky header keeps a visible divider while scrolling
   (border-collapse:collapse drops shared borders out of the sticky layer) */
.ve-table-wrap > .ve-table { border-collapse: separate; border-spacing: 0; }
.ve-table-wrap .ve-table thead { position: sticky; top: 0; z-index: 2; }
.ve-table-wrap .ve-table thead th {
    background: var(--ve-surface);
    box-shadow: inset 0 -2px 0 var(--ve-border);
    border-bottom: none;
}
.ve-table-wrap .ve-filter-row td {
    box-shadow: inset 0 -2px 0 var(--ve-border);
    border-bottom: none;
}
.ve-table-wrap .ve-table tbody td { border-bottom: 1px solid var(--ve-border); }

/* ─── Date-picker filter cell (D1) — a trigger button that opens DatePickerPopup,
   plus a clear (✕). Add class="ve-filter-datecell" to the filter <td>. ─── */
.ve-filter-row td.ve-filter-datecell { display: flex; align-items: center; gap: 0.25rem; }
.ve-filter-trigger {
    flex: 1; min-width: 0; width: 100%; text-align: left;
    padding: 0.28rem 0.5rem;
    border: 1px solid var(--ve-border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    color: var(--ve-text);
    cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ve-filter-trigger:hover { border-color: var(--ve-navy); }
.ve-filter-clear {
    flex: 0 0 auto;
    border: none; background: transparent; cursor: pointer;
    color: var(--ve-muted); font-size: 0.95rem; line-height: 1; padding: 0 0.25rem;
}

/* ─── Sticky filter panel (D2) — a toolbar/card of filter controls above a
   page-scrolling list (Schedule filter card, Reports tab cards, the client
   dashboard calendar header). Pins to the top of the scroll area instead of
   scrolling off. Add class="ve-filter-sticky" to the panel. ─── */
.ve-filter-sticky { position: sticky; top: 0; z-index: 5; background: var(--ve-surface); }

/* ─── Client type-ahead picker (ClientSelect) — filterable client menu ─── */
.ve-clientselect { position: relative; }
.ve-clientselect-control { position: relative; display: flex; align-items: center; }
.ve-clientselect-input { width: 100%; padding-right: 1.8rem; }
.ve-clientselect-clear {
    position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; cursor: pointer;
    color: var(--ve-muted); font-size: 0.95rem; line-height: 1; padding: 0 0.2rem;
}
/* In-flow (not absolute) so a scrolling ancestor like .ve-modal-body can't clip it. */
.ve-clientselect-menu {
    margin-top: 3px;
    max-height: 240px; overflow-y: auto;
    background: white; border: 1px solid var(--ve-border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.ve-clientselect-item {
    display: block; width: 100%; text-align: left;
    padding: 0.55rem 0.7rem; min-height: 40px; border: none; background: transparent;
    cursor: pointer; font-size: 0.9rem; color: var(--ve-text);
}
.ve-clientselect-item:hover { background: #f1f5f9; }
.ve-clientselect-item.is-selected { background: #eef2ff; font-weight: 600; }
.ve-clientselect-none { color: var(--ve-muted); font-style: italic; }
.ve-clientselect-empty { padding: 0.55rem 0.7rem; color: var(--ve-muted); font-size: 0.85rem; }

/* ─── Package cards (issue #20) — replaces .ve-table for member package views.
   Responsive by construction: multiple cards per row on wide screens, a single
   column on phones, never a horizontal scrollbar. ─── */
.ve-pkg-list {
    display: grid;
    /* min(220px,100%) keeps a column from ever being wider than its container,
       so the grid can't overflow and get clipped on narrow screens (issue #20). */
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: 0.6rem;
}
/* min-width:0 lets the grid item shrink below its content's intrinsic width;
   overflow-wrap stops a long package name from forcing the card wider. */
.ve-pkg-card   { border: 1px solid var(--ve-border); border-radius: 10px; padding: 0.7rem 0.8rem; min-width: 0; overflow-wrap: anywhere; }
.ve-pkg-name   { font-weight: 600; color: var(--ve-text); }
.ve-pkg-action { margin-top: 0.55rem; }          /* "Request a Booking", left-aligned under the name */
.ve-pkg-meta   {
    margin: 0.6rem 0 0; padding-top: 0.55rem;
    border-top: 1px solid var(--ve-border);
    display: flex; flex-direction: column; gap: 0.3rem;
}
.ve-pkg-row    { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.88rem; }
.ve-pkg-row dt { color: var(--ve-muted); margin: 0; }
.ve-pkg-row dd { margin: 0; font-weight: 600; color: var(--ve-text); }

/* New-version prompt (issue #55) — non-disruptive replacement for the forced reload.
   Fixed thin bar at the bottom; never covers the nav, never steals focus/input. */
.ve-update-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    gap: 0.75rem; flex-wrap: wrap;
    padding: 0.55rem 1rem;
    background: var(--ve-navy); color: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.18);
    font-size: 0.9rem;
}
.ve-update-banner-text    { font-weight: 600; }
.ve-update-banner-actions { display: flex; align-items: center; gap: 0.5rem; }
.ve-update-banner-refresh {
    background: #fff; color: var(--ve-navy); border: none; border-radius: 8px;
    padding: 0.4rem 1rem; font-weight: 700; cursor: pointer;
    min-height: 44px; min-width: 44px;
}
.ve-update-banner-refresh:hover { background: #eef1f8; }
.ve-update-banner-x {
    background: transparent; border: none; color: #fff;
    font-size: 1.4rem; line-height: 1; cursor: pointer;
    min-height: 44px; min-width: 44px;
}

/* Tappable package card — drill into the classes that used its credits (issue #49). */
.ve-pkg-clickable { cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; }
.ve-pkg-clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.ve-pkg-history-hint { margin-top: 0.5rem; font-size: 0.8rem; font-weight: 600; color: var(--ve-navy); text-align: right; }

/* ─── Private (Personal Training) session badge — issue #23 ───
   Marks a class as a private session wherever a client sees it (calendar events
   + class detail). Private session = ClassDto.IsPublic == false. */
.ve-private-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.2em 0.55em;
    border-radius: 999px;
    background: var(--ve-navy);
    color: #fff;
    letter-spacing: 0.02em;
    white-space: nowrap;
    vertical-align: middle;
}

/* ─── Coach Check-In / Attendance / Confirm panel (issue #2) ─── */
.ve-coach-head {
    border: 1px solid var(--ve-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
}
.ve-checkin-row,
.ve-confirm-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.ve-checkin-row { margin-bottom: 0.85rem; }
.ve-confirm-row { margin-top: 0.85rem; }
.ve-stamp { font-size: 0.82rem; color: var(--ve-text); }
.ve-stamp-muted { color: var(--ve-muted); font-style: italic; }

/* Inline text-button + collapsible section header (issue #26; also used by the
   Dashboard class modal). Global so every surface styles them consistently. */
.ve-link-btn { background:none;border:0;padding:0;color:var(--ve-navy);text-decoration:underline;cursor:pointer;font:inherit; }
.ve-structure-toggle { display:flex;justify-content:space-between;align-items:center;width:100%;background:none;border:0;padding:0 0 0.4rem;cursor:pointer; }

/* Compact roster that fits a phone width without horizontal scroll —
   deliberately NOT .ve-table (which forces min-width:480px on mobile). */
.ve-coach-roster {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--ve-border);
    border-radius: 8px;
    font-size: 0.8rem;
    overflow: hidden;
}
.ve-coach-roster th {
    text-align: left;
    padding: 0.4rem 0.55rem;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ve-muted);
    border-bottom: 1px solid var(--ve-border);
    white-space: nowrap;
}
.ve-coach-roster td {
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid var(--ve-border);
    vertical-align: middle;
    white-space: nowrap;
}
.ve-coach-roster tbody tr:last-child td { border-bottom: none; }
.ve-roster-name    { font-weight: 500; }
.ve-roster-credits { text-align: center; width: 1%; }
.ve-roster-att     { text-align: right; width: 1%; white-space: nowrap; }

/* Narrow Attended / No Show toggle buttons — no wrap, compact, fit a phone row. */
.ve-att-btn {
    display: inline-block;
    min-height: 38px;
    padding: 0.25rem 0.5rem;
    margin-left: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid var(--ve-border);
    border-radius: 6px;
    background: #eef1f7;
    color: var(--ve-navy);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.ve-att-btn:first-child { margin-left: 0; }
.ve-att-btn.is-on {
    background: var(--ve-navy);
    color: #fff;
    border-color: var(--ve-navy);
}
.ve-att-btn:disabled { opacity: 0.55; cursor: default; }

.ve-row-link { cursor: pointer; }

/* ─── Badges ─── */
.badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active   { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-booked   { background: #dbeafe; color: #1e40af; }
.badge-waitlist { background: #f3e8ff; color: #6b21a8; }
.badge-attended { background: #d1fae5; color: #065f46; }

/* ─── Page header ─── */
.ve-page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.ve-page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ─── Search bar ─── */
.ve-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ve-search input {
    flex: 1;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--ve-border);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.ve-search input:focus { border-color: var(--ve-navy); }

/* ─── Buttons ─── */
.ve-btn {
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.ve-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.ve-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Disabled buttons must read as inactive — e.g. "Save Changes" until the form
   is actually edited. Without this a disabled .ve-btn looked fully enabled. */
.ve-btn:disabled,
.ve-btn:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ve-btn-primary {
    background: var(--ve-navy);
    color: white;
}

.ve-btn-primary:hover { background: var(--ve-navy-dark); }

.ve-btn-accent {
    background: var(--ve-accent);
    color: white;
}

.ve-btn-accent:hover { background: var(--ve-accent-hover); }

.ve-btn-ghost {
    background: transparent;
    color: var(--ve-navy);
    border: 1px solid var(--ve-border);
}

.ve-btn-ghost:hover { background: #f0f2f8; }

.ve-btn-signup {
    background: #dc2626;
    color: #fff;
    border: 1px solid #dc2626;
}

.ve-btn-signup:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

/* Compact variant for placement inside the topbar */
.ve-btn-compact {
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
    min-height: 0;
}

/* ─── Loading ─── */
.ve-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--ve-muted);
    font-size: 0.95rem;
}

/* ─── Empty state ─── */
.ve-empty {
    text-align: center;
    padding: 3rem;
    color: var(--ve-muted);
}

/* ─── Stat tile interactions ─── */
.ve-stat-link { cursor: pointer; transition: transform 0.1s, box-shadow 0.15s; }
.ve-stat-link:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.ve-stat-link.ve-stat-active { border-color: #1a2744; box-shadow: 0 0 0 2px #1a2744 inset; }

/* ─── Admin stats bar ─── */
.ve-statsbar { margin-bottom: 0.75rem; }
.ve-statsbar-panel {
    background: var(--ve-surface);
    border: 1px solid var(--ve-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* ─── Grid helper ─── */
.ve-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.ve-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }

/* ─── Mobile nav controls (hidden on desktop) ─── */
.ve-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--ve-navy);
    padding: 0;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.ve-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
    touch-action: none; /* a drag on the dimmer must not scroll-through to the page (iOS) */
}

.ve-nav-close-btn {
    display: none;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.65);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.ve-nav-close-btn:hover { color: white; background: rgba(255,255,255,0.15); }

@media (max-width: 768px) {
    /* ── Nav overlay ── */
    .ve-hamburger     { display: inline-flex; }
    .ve-nav-close-btn { display: inline-flex; }

    .ve-nav {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 200;
    }

    body.nav-open .ve-nav          { transform: translateX(0); }
    body.nav-open .ve-nav-backdrop { display: block; }

    /* Freeze the page behind the open drawer. iOS Safari lets a touch-drag
       scroll-through a fixed overlay (and rubber-band the fixed header) unless
       the content scroller itself is locked while the drawer is open. Desktop
       Chrome's device emulator does not reproduce this, so it must be tested on
       a real iPhone. */
    body.nav-open .ve-content { overflow: hidden; }

    /* Main takes full width; overflow-x hidden prevents body-level horizontal scroll */
    .ve-main { margin-left: 0; overflow-x: hidden; }

    /* ── Grids ── */
    .ve-grid-2, .ve-grid-3 { grid-template-columns: 1fr; }
    .ve-field-row           { grid-template-columns: 1fr; }

    /* Topbar mobile overrides live at the end of the file so they fall
       AFTER the base .ve-topbar* desktop rules in source order. */

    /* ── Page structure ── */
    /* Pin the scroll area to the real screen edges: minimal gutter + the
       device safe-area insets (notch in landscape, home indicator at bottom). */
    .ve-content {
        padding-top: 0.65rem;
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
        padding-left:  calc(var(--ve-gutter) + env(safe-area-inset-left, 0px));
        padding-right: calc(var(--ve-gutter) + env(safe-area-inset-right, 0px));
    }
    .ve-page-header h1 { font-size: 1.2rem; }

    /* ── Stats — wrap to 2-column ── */
    .ve-stats { flex-wrap: wrap; margin-bottom: 0.6rem; }
    .ve-stat  { min-width: calc(50% - 0.25rem); }

    /* Tighter card padding on phones. NO overflow here on purpose: overflow-x:auto
       forces overflow-y to compute to `auto`, turning EVERY card into a scroll
       container — and on WebKit a scroll-container grid item gets clipped to its
       track, which lopped the lower rows off the My Packages card (bottom packages
       cut off). Inherently-wide content scrolls in its OWN wrapper instead
       (.ve-week-scroll for the 770px week grid; the inline overflow-x:auto divs),
       and .ve-content's minmax(0,1fr) grid track + overflow-x:hidden is the
       page-level net — so a blanket card overflow is unnecessary and harmful. */
    .ve-card     { padding: 0.7rem 0.75rem; }

    /* ── Package cards — one column on phones; never wider than the viewport ── */
    .ve-pkg-list { grid-template-columns: 1fr; }

    /* ── Tables reflow to stacked cards on phones (no horizontal scroll) ──
       Every row becomes a bordered card and every cell shows its column name
       from data-label="Col" — add that attribute to each <td>. Cells with no
       data-label (or data-label="") render label-less and left-aligned, which
       suits action/button cells. */
    .ve-table, .ve-table tbody, .ve-table tr, .ve-table td { display: block; }
    .ve-table        { min-width: 0; }

    /* Issue #37 — keep per-column filters usable on phones. Hide only the
       header label row (its labels move to each cell's data-label) and keep
       the .ve-filter-row, reflowed into a stacked, labelled block. Filter
       cells carry their own data-label so each control is captioned; empty
       filter cells (e.g. an actions column) collapse out. */
    .ve-table thead tr:not(.ve-filter-row) { display: none; }
    .ve-filter-row {
        display: block;
        border: 1px solid var(--ve-border);
        border-radius: 10px;
        padding: 0.35rem 0.6rem;
        margin-bottom: 0.6rem;
        background: var(--ve-surface);
    }
    /* G3 — label LEFT, input RIGHT (side by side), not stacked. They fit on one
       line at phone widths, so don't waste vertical space stacking them. */
    .ve-filter-row td {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        padding: 0.1rem 0;
        border: none;
    }
    .ve-filter-row td:empty { display: none; }
    .ve-filter-row td::before {
        content: attr(data-label);
        flex: 0 0 40%;
        font-weight: 600;
        font-size: 0.82rem;
        color: var(--ve-muted);
    }
    /* cells with no caption (e.g. an actions column) let the control fill the row */
    .ve-filter-row td[data-label=""]::before,
    .ve-filter-row td:not([data-label])::before { content: none; }
    .ve-filter-row input,
    .ve-filter-row select,
    .ve-filter-row .ve-filter-trigger {
        flex: 1; min-width: 0; width: 100%; box-sizing: border-box;
        /* Minimum height = font line box + a hair of padding (no 44px tap target).
           0.8rem font × 1.3 line-height + 2×0.15rem padding ≈ 1.34rem ≈ ~21px. */
        min-height: 0;
        line-height: 1.3;
        padding: 0.15rem 0.45rem;
    }
    .ve-table tbody tr {
        border: 1px solid var(--ve-border);
        border-radius: 10px;
        padding: 0.4rem 0.7rem;
        margin-bottom: 0.5rem;
    }
    .ve-table tbody tr:last-child { margin-bottom: 0; }
    .ve-table tbody tr:hover      { background: transparent; }
    .ve-table td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        padding: 0.25rem 0;
        border: none;
        white-space: normal;
        text-align: right;
    }
    .ve-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--ve-muted);
        text-align: left;
        white-space: nowrap;
    }
    .ve-table td[data-label=""],
    .ve-table td:not([data-label])          { justify-content: flex-start; text-align: left; }
    .ve-table td[data-label=""]::before,
    .ve-table td:not([data-label])::before  { content: none; }

    /* ── Touch targets ── */
    .ve-btn        { min-height: 44px; }
    .ve-btn-sm     { min-height: 44px; min-width: 44px; }
    .ve-input,
    .ve-field input { min-height: 44px; }
    /* Filter controls are deliberately EXCLUDED from the 44px tap target: a filter
       row stacks many controls into a compact block, so their height is minimized to
       the font's line box (see the .ve-filter-row input rule above). */

    /* Auth-page/card phone overrides live in the TRAILING @media block (end of
       file). Their base rules are defined later, so an override here loses on
       source order. See the SOURCE-ORDER RULE in the layout cheat-sheet. */

    /* ── Definition lists — stack label above value ── */
    .ve-dl    { grid-template-columns: 1fr; }
    .ve-dl dt { white-space: normal; }

    /* ── …except .ve-dl-inline: keep label left / value right at every size ── */
    .ve-dl-inline    { grid-template-columns: auto 1fr; }
    .ve-dl-inline dt { white-space: nowrap; }

    /* ── Modals — reduce viewport bleed ── */
    .ve-modal-backdrop,
    .ve-modal-overlay  { padding: 0.5rem; }
    .ve-modal          { max-width: 100%; }
    .ve-modal-header   { padding: 0.7rem 0.9rem; }
    .ve-modal-body     { padding: 0.9rem; }
    .ve-modal-footer   { padding: 0.7rem 0.9rem; }

    /* ── List wrapper on phones (G10) — pin the filter row at the top and let the
       data scroll in a WINDOW directly below it: a vertical (y-axis) split, NOT a
       z-index sticky overlay (rows never slide behind a floating filter). The wrap
       is a flex column bounded to the viewport; the reflowed <thead> (the filter
       card) is the fixed top, <tbody> is the scroll region. The 11rem allows for
       the topbar + page header above the list — tune if a page stacks more above. */
    .ve-table-wrap {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 11rem);
        max-height: calc(100dvh - 11rem);
        overflow: hidden;          /* the inner tbody scrolls, not the wrap */
        border: none;
        border-radius: 0;
        background: transparent;
    }
    .ve-table-wrap > .ve-table { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
    .ve-table-wrap > .ve-table > thead { flex: 0 0 auto; }              /* filter card: pinned */
    .ve-table-wrap > .ve-table > tbody {
        flex: 1 1 auto; min-height: 0;
        overflow-y: auto; overflow-x: hidden;       /* the data window */
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 360px) {
    /* Only stack stats to single column on very small phones (< 360px) */
    .ve-stat { min-width: 100%; }
    .ve-page-header h1 { font-size: 1.05rem; }
}

h1:focus { outline: none; }

/* ─── Onboarding header bar (AuthLayout) ─── */
.ve-onboarding-bar {
    flex-shrink: 0;           /* pinned header: never compresses */
    position: sticky;         /* and stays put if the document ever has to scroll */
    top: 0;
    z-index: 50;
    background: var(--ve-navy);
    padding: calc(0.3rem + env(safe-area-inset-top, 0px)) 0.75rem 0.3rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Sign Out rendered as a button on the navy bar — light outline so it reads on dark. */
.ve-onboarding-bar .ve-btn-ghost {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.45);
    padding: 0.35rem 0.95rem;
    font-size: 0.82rem;
}

.ve-onboarding-bar .ve-btn-ghost:hover,
.ve-onboarding-bar .ve-btn-ghost:focus-visible {
    background: rgba(255,255,255,0.12);
    border-color: #fff;
    color: #fff;
}

/* ─── Top bar (MainLayout) ─── */
.ve-topbar {
    background: var(--ve-surface);
    border-bottom: 1px solid var(--ve-border);
    padding: 0.4rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    min-height: 3.25rem;
    flex-shrink: 0; /* fixed header: keep its height; never compress under tall content */
}

.ve-topbar-left {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
}

.ve-topbar-right {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Topbar-native buttons — sized to sit inside the header without crowding each other. */
.ve-topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.ve-topbar-btn-signup {
    background: #dc2626;
    color: #fff;
    border: 1px solid #dc2626;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.25);
}
.ve-topbar-btn-signup:hover,
.ve-topbar-btn-signup:focus-visible {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.ve-topbar-btn-ghost {
    background: transparent;
    color: var(--ve-navy);
    border: 1px solid var(--ve-border);
}
.ve-topbar-btn-ghost:hover,
.ve-topbar-btn-ghost:focus-visible {
    background: #f0f2f8;
    border-color: var(--ve-navy);
}

/* ─── Top-bar account menu (triple-dot / kebab) ─── */
.ve-account {
    position: relative;
    z-index: 150;          /* keep the toggle + menu above the dismiss backdrop */
    flex-shrink: 0;
}

.ve-account-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;           /* min touch target */
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ve-navy);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ve-account-toggle:hover,
.ve-account-toggle:focus-visible,
.ve-account-toggle[aria-expanded="true"] {
    background: #f0f2f8;
    border-color: var(--ve-border);
}

/* Transparent full-viewport catcher: any outside click closes the menu. */
.ve-account-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: transparent;
}

.ve-account-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 230px;
    max-width: calc(100vw - 1.5rem);
    background: var(--ve-surface);
    border: 1px solid var(--ve-border);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(17, 27, 54, 0.18);
    padding: 0.35rem;
    z-index: 150;
}

.ve-account-head {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--ve-border);
    margin-bottom: 0.3rem;
}
.ve-account-name {
    font-weight: 700;
    color: var(--ve-navy);
    font-size: 0.95rem;
    word-break: break-word;
}
.ve-account-email {
    color: var(--ve-muted);
    font-size: 0.82rem;
    word-break: break-all;
}

.ve-account-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;      /* min touch target */
    padding: 0.5rem 0.7rem;
    border-radius: 7px;
    color: var(--ve-text);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.ve-account-item:hover,
.ve-account-item:focus-visible {
    background: #f0f2f8;
    color: var(--ve-navy);
}
.ve-account-item-icon {
    flex-shrink: 0;
    color: var(--ve-muted);
}
.ve-account-item:hover .ve-account-item-icon,
.ve-account-item:focus-visible .ve-account-item-icon {
    color: var(--ve-navy);
}

/* ─── Auth pages ─── */
/* Auth/onboarding frame — compact-fit, NON-scrolling viewport column. The
   Sign-out bar is pinned at top; .ve-auth-page fills the rest. There is NO
   scroll region: the forms are sized to fit, so there are zero scrollbars.
   min-height (not height + overflow:hidden) means a viewport genuinely too short
   for the form grows the document — a single, last-resort scroll, never nested. */
.ve-auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.ve-auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ve-bg);
    padding: 2rem 1rem;
}

.ve-auth-card {
    background: var(--ve-surface);
    border: 1px solid var(--ve-border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.ve-auth-page-wide  { align-items: flex-start; padding-top: 3rem; }
.ve-auth-card-wide  { max-width: 720px; }

.ve-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

.ve-auth-brand h1 { margin: 0; font-size: 1.4rem; }

.ve-auth-phone {
    color: var(--ve-accent);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.ve-auth-phone:hover { text-decoration: underline; }

.ve-field { margin-bottom: 1rem; }
.ve-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--ve-text);
}

.ve-field input, .ve-input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--ve-border);
    border-radius: 8px;
    font-size: 1rem;   /* 16px — under 16px iOS auto-zooms on focus (see trailing @media note) */
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.ve-field input:focus, .ve-input:focus { border-color: var(--ve-navy); }
/* Checkboxes / radios must NOT take the full-width or 44px-tall sizing meant for text
   inputs — otherwise e.g. the "Active (visible to clients)" toggle balloons on phones. */
.ve-field input[type="checkbox"],
.ve-field input[type="radio"] { width: auto; min-height: 0; flex: 0 0 auto; }

.ve-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Password show/hide toggle */
.ve-password-wrap { position: relative; display: block; }
.ve-password-wrap .ve-input,
.ve-password-wrap input { padding-right: 2.75rem; }
.ve-password-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--ve-muted);
    border-radius: 6px;
}
.ve-password-toggle:hover  { color: var(--ve-navy); }
.ve-password-toggle:focus  { outline: 2px solid var(--ve-navy); outline-offset: 1px; color: var(--ve-navy); }
.ve-password-toggle:disabled,
.ve-password-toggle:disabled:hover { color: #cfd4dc; cursor: not-allowed; }
.ve-password-toggle svg    { display: block; }

.ve-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.ve-alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ve-alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.ve-alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.ve-agreement-text {
    background: #f8f9fc;
    border: 1px solid var(--ve-border);
    border-radius: 8px;
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--ve-text);
}
.ve-agreement-text p                  { margin: 0.25rem 0; }
.ve-agreement-text p:empty            { display: none; }
.ve-agreement-text br + br            { display: none; }
.ve-agreement-text h1,
.ve-agreement-text h2,
.ve-agreement-text h3                 { margin: 0.75rem 0 0.25rem; font-size: 1rem; font-weight: 700; }
.ve-agreement-text ul,
.ve-agreement-text ol                 { margin: 0.25rem 0 0.25rem 1.25rem; padding: 0; }
.ve-agreement-text li                 { margin: 0.1rem 0; }

/* ─── Nav logo ─── */
.ve-nav-logo-img {
    display: block;
    width: 100%;
    max-width: 148px;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
    background: white;
    padding: 5px 8px;
}

/* ─── Shared calendar styles ─── */
.ve-view-toggle { display:flex;justify-content:center;gap:0.3rem; }
.ve-day-header { font-size:0.78rem;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:var(--ve-muted);margin-bottom:0.3rem; }
.ve-agenda-booked   { border-left:3px solid #15803d;padding-left:0.5rem; }
.ve-agenda-full     { border-left:3px solid #b91c1c;padding-left:0.5rem; }
.ve-agenda-waitlist { border-left:3px solid #6b21a8;padding-left:0.5rem; }
.ve-agenda-past     { border-left:3px solid #9ca3af;padding-left:0.5rem;opacity:0.6;color:var(--ve-muted); }
.ve-agenda-cancelled { border-left:3px solid #b91c1c;padding-left:0.5rem;color:#b91c1c; }
.ve-public-row.past { opacity:0.6;color:var(--ve-muted); }
.ve-cal-nav { display:flex;align-items:center;justify-content:center;gap:0.75rem;margin-bottom:0.75rem;font-size:0.88rem;font-weight:600; }
.ve-cal-label-btn { background:none;border:0;padding:0.25rem 0.4rem;font:inherit;font-weight:600;color:var(--ve-navy);cursor:pointer;display:inline-flex;align-items:center;gap:0.3rem;border-radius:6px;min-height:44px; }
.ve-cal-label-btn:hover { background:var(--ve-bg); }

/* Two date-label formats inside the date picker button. Long shows by
   default; short kicks in at narrow widths via the mobile media query. */
.ve-cal-label-long  { display: inline; }
.ve-cal-label-short { display: none; }
.ve-dp-backdrop { position:fixed;inset:0;background:rgba(0,0,0,0.4);z-index:1200;display:flex;align-items:center;justify-content:center;padding:1rem; }
.ve-dp-card { background:var(--ve-surface,#fff);border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,0.25);padding:1rem;width:100%;max-width:340px;box-sizing:border-box; }
.ve-dp-head { display:flex;align-items:center;justify-content:space-between;margin-bottom:0.5rem; }
.ve-dp-title { font-weight:700;font-size:1rem;color:var(--ve-navy); }
.ve-dp-grid { display:grid;grid-template-columns:repeat(7,1fr);gap:2px; }
.ve-dp-dow { text-align:center;font-size:0.7rem;font-weight:700;color:var(--ve-muted);text-transform:uppercase;padding:0.25rem 0; }
.ve-dp-day { aspect-ratio:1;border:0;background:none;border-radius:8px;font:inherit;font-size:0.9rem;color:var(--ve-text);cursor:pointer;display:flex;align-items:center;justify-content:center;min-height:40px; }
.ve-dp-day:hover { background:var(--ve-bg); }
.ve-dp-day.other { color:var(--ve-muted);opacity:0.55; }
.ve-dp-day.today { font-weight:700;box-shadow:inset 0 0 0 1px var(--ve-navy); }
.ve-dp-day.sel { background:var(--ve-navy);color:#fff;font-weight:700; }
.ve-dp-foot { display:flex;align-items:center;justify-content:space-between;margin-top:0.75rem; }
.ve-btn-sm { padding:0.25rem 0.7rem;font-size:1.1rem;line-height:1;min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center; }

/* min-width:0 + max-width:100% keep this scroller from imposing the 770px grid's
   width on its parent — the 7-day grid scrolls INSIDE here, never widening the page. */
.ve-week-scroll { overflow-x:auto; min-width:0; max-width:100%; }
.ve-week-grid { display:grid;grid-template-columns:repeat(7,minmax(110px,1fr));min-width:770px;border:1px solid var(--ve-border);border-radius:8px;overflow:hidden; }
.ve-week-col { border-right:1px solid var(--ve-border); }
.ve-week-col:last-child { border-right:none; }
.ve-week-col-today { background:#f8f9ff; }
.ve-week-day-hdr { padding:0.4rem 0.5rem;background:var(--ve-bg);border-bottom:1px solid var(--ve-border);text-align:center;font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--ve-muted); }
.ve-week-day-hdr.today { color:var(--ve-navy); }
.ve-week-day-num { font-size:1rem;font-weight:700;color:var(--ve-muted);line-height:1.2; }
.ve-week-day-num.today { color:var(--ve-accent); }
.ve-week-events { padding:0.4rem;min-height:60px; }
.ve-week-event { background:var(--ve-navy);color:white;border-radius:5px;padding:0.3rem 0.45rem;margin-bottom:0.3rem;font-size:0.72rem;cursor:pointer; }
.ve-week-event.waitlist { background:#6b21a8; }
.ve-week-event.avail { background:#1e40af; }
.ve-week-event.avail.full { background:#b91c1c; }
.ve-week-event.booked { background:#15803d; }
.ve-week-event.past  { background:#9ca3af;color:#f3f4f6;opacity:0.75; }
.ve-week-event.cancelled { background:#9ca3af;color:#f3f4f6;text-decoration:line-through; }
.ve-week-event-time { font-size:0.65rem;opacity:0.8;margin-bottom:0.1rem; }
.ve-week-event-name { font-weight:600;line-height:1.2; }

.ve-month-grid { display:grid;grid-template-columns:repeat(7,minmax(50px,1fr));border:1px solid var(--ve-border);border-radius:8px;overflow:hidden; }
.ve-month-dow { padding:0.3rem;text-align:center;font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.04em;color:var(--ve-muted);background:var(--ve-bg);border-bottom:1px solid var(--ve-border); }
.ve-month-cell { min-height:72px;border-right:1px solid var(--ve-border);border-bottom:1px solid var(--ve-border);padding:0.25rem 0.3rem;background:var(--ve-surface); }
.ve-month-cell.other { background:#f9fafc; }
.ve-month-cell.today { background:#f0f4ff; }
.ve-month-date { font-size:0.78rem;font-weight:600;color:var(--ve-muted);margin-bottom:0.15rem; }
.ve-month-date.today { color:var(--ve-accent);font-weight:800; }
.ve-month-event { font-size:0.67rem;background:var(--ve-navy);color:white;border-radius:3px;padding:0.1rem 0.3rem;margin-bottom:0.1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer; }
.ve-month-event.waitlist { background:#6b21a8; }
.ve-month-event.avail { background:#1e40af; }
.ve-month-event.avail.full { background:#b91c1c; }
.ve-month-event.booked { background:#15803d; }
.ve-month-event.past  { background:#9ca3af;color:#f3f4f6;opacity:0.75; }
.ve-month-event.cancelled { background:#9ca3af;color:#f3f4f6;text-decoration:line-through; }

/* validation messages */
.validation-message { color: #dc2626; font-size: 0.8rem; margin-top: 0.2rem; }

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

/* ─── Mobile topbar overrides — placed at end of file so they win against
       the base .ve-topbar* rules earlier in source order. ─── */
@media (max-width: 768px) {
    .ve-topbar {
        /* Clear the status bar / Dynamic Island, and the L/R notch in landscape. */
        padding: calc(0.4rem + env(safe-area-inset-top, 0px))
                 calc(0.75rem + env(safe-area-inset-right, 0px))
                 0.4rem
                 calc(0.75rem + env(safe-area-inset-left, 0px));
        min-height: 3rem;
        gap: 0.5rem;
    }
    .ve-topbar-left  { flex: 0 0 auto; }
    /* Hamburger left, action buttons right — same row (no date to crowd them). */
    .ve-topbar-right {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 0.5rem;
        font-size: 0.82rem;
    }
    .ve-topbar-btn   { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
}

/* Calendar toolbar (Prev / Date / Next / Today  +  Day / Week / Month / Agenda):
   on phones, let each group wrap and shrink the per-button horizontal padding so
   nothing gets clipped at narrow widths. Vertical touch target stays at 44px. */
@media (max-width: 768px) {
    .ve-cal-nav,
    .ve-view-toggle {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3rem;
    }
    .ve-cal-nav { gap: 0.35rem; }

    .ve-cal-nav .ve-btn,
    .ve-view-toggle .ve-btn {
        padding: 0.5rem 0.55rem;
        font-size: 0.82rem;
    }
    .ve-cal-nav .ve-btn-sm {
        padding: 0.25rem 0.45rem;
        min-width: 36px;
        font-size: 1rem;
    }
    .ve-cal-label-btn {
        padding: 0.25rem 0.3rem;
        font-size: 0.85rem;
    }

    /* Swap long date label for the compact form so Today fits on the same row */
    .ve-cal-label-long  { display: none; }
    .ve-cal-label-short { display: inline; }
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ─── PWA install banner (InstallPrompt) ─── */
/* Mobile-first: full-width bar pinned to the bottom (points toward Safari's
   Share button, which lives at the bottom of the screen on iPhone). */
.ve-install-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--ve-surface);
    border-top: 1px solid var(--ve-border);
    box-shadow: 0 -4px 16px rgba(17, 27, 54, 0.12);
    animation: ve-install-rise 0.25s ease-out;
}

@keyframes ve-install-rise {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.ve-install-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(17, 27, 54, 0.2);
}

.ve-install-icon img { width: 100%; height: 100%; display: block; }

.ve-install-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.1rem;
}

.ve-install-text {
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--ve-text);
}

.ve-install-text strong { color: var(--ve-navy); }

.ve-install-action {
    align-self: flex-start;
    min-height: 44px;
    padding: 0 1.25rem;
    border: none;
    border-radius: 8px;
    background: var(--ve-accent);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}

.ve-install-action:hover { background: var(--ve-accent-hover); }

.ve-install-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: -0.35rem -0.5rem 0 0;
    border: none;
    background: transparent;
    color: var(--ve-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.ve-install-close:hover { color: var(--ve-text); background: var(--ve-bg); }

/* Opt-in install diagnostics chip (?installdebug=1) — a fixed, high-contrast readout of
   what detect() resolved, so on-device install state can be verified without a debugger. */
.ve-install-debug {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
    background: #111; color: #6f6;
    font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 6px 8px; word-break: break-all; white-space: pre-wrap;
}

/* Desktop: a compact card bottom-right instead of a full-width bar. */
@media (min-width: 768px) {
    .ve-install-banner {
        left: auto;
        right: 1.5rem;
        bottom: 1.5rem;
        max-width: 380px;
        border: 1px solid var(--ve-border);
        border-radius: 12px;
    }
}

/* ─── iOS install prompt — react-ios-pwa-prompt style (iOS Safari only) ─── */
.ios-pwa-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1199;
    background: rgba(0, 0, 0, 0.4);
    animation: ios-pwa-fade 0.3s ease both;
}

.ios-pwa-prompt {
    position: fixed;
    z-index: 1200;
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem 1.1rem 0.6rem;
    padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
    background: rgba(250, 250, 252, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
    color: #1c1c1e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    animation: ios-pwa-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ios-pwa-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ios-pwa-rise { from { transform: translateY(115%); } to { transform: translateY(0); } }

.ios-pwa-close {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #8e8e93;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.ios-pwa-head { text-align: center; padding: 0.25rem 1.75rem 0.5rem; }

.ios-pwa-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 13px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
    margin-bottom: 0.5rem;
}

.ios-pwa-title { font-size: 1.12rem; font-weight: 700; }
.ios-pwa-desc { font-size: 0.86rem; color: #6b6b70; margin-top: 0.2rem; line-height: 1.35; }

/* Small section label so the list reads as "do these elsewhere", not as a
   group of tappable controls. */
.ios-pwa-steps-label {
    margin: 0.6rem 0.15rem 0.1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8e8e93;
}

.ios-pwa-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: ios-pwa-step;
}

/* No row dividers and no accent badges: those made each step look like a
   tappable iOS settings row / button. Testers tapped them expecting action.
   The step text is the emphasis; the icon + number are quiet references. */
.ios-pwa-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.4rem 0.15rem;
    counter-increment: ios-pwa-step;
}

.ios-pwa-steps li::before {
    content: counter(ios-pwa-step);
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 0.15rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #6b6b70;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ios-pwa-step-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-top: 0.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9a9aa0;          /* muted: a reference glyph, not a button to press */
}

.ios-pwa-step-text { flex: 1 1 auto; font-size: 1rem; line-height: 1.38; color: #1c1c1e; }
.ios-pwa-step-text strong { font-weight: 700; }
.ios-pwa-step-text em { font-style: normal; color: #007aff; font-weight: 600; }

/* The ONE genuinely tappable control on the redirect sheet — styled like a
   button precisely so it stands apart from the (quiet) instruction steps. */
.ios-pwa-actions { padding: 0.6rem 0.15rem 0.2rem; }
.ios-pwa-copy {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    background: #007aff;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.ios-pwa-copy:active { background: #006fe0; }

.ios-pwa-pointer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    padding: 0.45rem 0.4rem 0 0;
    color: rgba(0, 0, 0, 0.45);
    animation: ios-pwa-bounce 1.4s ease-in-out infinite;
}

.ios-pwa-pointer-text { font-size: 0.78rem; font-weight: 600; }

@keyframes ios-pwa-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

/* Opt-in diagnostics line (?installdebug=1) — never shown to normal users. */
.ios-pwa-debug {
    margin-top: 0.5rem;
    padding: 0.35rem 0.4rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.62rem;
    line-height: 1.35;
    color: rgba(0, 0, 0, 0.45);
    word-break: break-all;
    user-select: text;
    -webkit-user-select: text;
}

/* Dark mode — the prompt follows the system appearance, like the repo. */
@media (prefers-color-scheme: dark) {
    .ios-pwa-prompt { background: rgba(28, 28, 30, 0.92); color: #f2f2f7; }
    .ios-pwa-desc { color: #a1a1a6; }
    .ios-pwa-steps-label { color: #98989d; }
    .ios-pwa-steps li::before { background: rgba(255, 255, 255, 0.14); color: #d1d1d6; }
    .ios-pwa-step-icon { color: #8e8e93; }
    .ios-pwa-step-text { color: #f2f2f7; }
    .ios-pwa-pointer { color: rgba(255, 255, 255, 0.5); }
    .ios-pwa-debug { color: rgba(255, 255, 255, 0.45); }
}
/* ─── Phone overrides that MUST fall after their base rules (source order) ───
   Media queries add no specificity, so an override in the early @media block is
   beaten by any same-selector base rule defined later in this file. The .ve-auth-*
   components are defined late, so their phone overrides live here at the very end,
   giving My Profile / login minimal gutters and tight spacing that actually fit.
   (See SOURCE-ORDER RULE in docs/responsive-layout-cheatsheet.md) */
@media (max-width: 768px) {
    .ve-auth-page     { padding: 0.5rem var(--ve-gutter) calc(0.5rem + env(safe-area-inset-bottom, 0px)); align-items: flex-start; }
    .ve-auth-card     { padding: 0.85rem 0.75rem; border-radius: 12px; }
    .ve-auth-brand    { margin-bottom: 0.9rem; gap: 0.4rem; }
    .ve-auth-brand h1 { font-size: 1.2rem; }
    .ve-field         { margin-bottom: 0.6rem; }

    /* iOS auto-zooms when a focused <input> has font-size < 16px, and that zoom
       STICKS to the next page. Login fields at 0.95rem (15.2px) zoomed 16/15.2 =
       1.0526 — exactly the dashboard's layout-vs-visual viewport ratio (440/418),
       which presented as the right-edge truncation. Pin every text-entry control
       on phones to 16px so iOS never zooms. (Filter-row/table inputs are hidden on
       phones, so their smaller size can't trigger it.) */
    .ve-field input, .ve-input, .ve-search input, select, textarea,
    input[type="text"], input[type="email"], input[type="password"],
    input[type="tel"], input[type="number"], input[type="search"] { font-size: 16px; }
}
