/*
 * CoachCentral base styles. Notion-inspired warm-neutral palette; see
 * CoachCentralTheme.cs for the canonical token values. This file harmonizes
 * the Bootstrap CSS (still loaded for form controls and the .btn family)
 * with the MudBlazor theme so the two don't fight each other visually.
 */

:root {
    --cc-bg: #F7F6F3;
    --cc-surface: #FFFFFF;
    --cc-surface-2: #F1F1EF;
    --cc-border: #E9E9E7;
    --cc-border-strong: #D9D8D5;
    --cc-text: #37352F;
    --cc-text-muted: #787774;
    --cc-text-faint: #B5B3AE;
    --cc-accent: #2383E2;
    --cc-accent-soft: #E7F2FC;
    /* On-brand text color (computed for the default --cc-accent;
       the BrandedSurface wrapper overrides on public surfaces with
       a luminance-correct value for the chosen brand color). */
    --cc-accent-on: #FFFFFF;
    --cc-accent-tint: #E7F2FC;
    /* Default button radius — public surfaces can override via the
       BrandedSurface wrapper based on Tenant.ButtonStyle. */
    --cc-button-radius: 0.5rem;
    /* App-chrome (TopNav) height. Single source of truth: the sticky sidebar
       pins its top offset + height to this, so a header change can't desync
       them (see MainLayout.razor.css / TopNav.razor.css). */
    --cc-topnav-height: 3.75rem;
    /* Brand: warm rust / terracotta. Used sparingly — wordmark, hero callouts,
       and small accents. Distinct enough from --cc-warning that they don't
       confuse each other in context. */
    --cc-brand: #D97757;
    --cc-brand-soft: #F7E5DC;
    --cc-success: #448361;
    --cc-warning: #C67B5C;
    --cc-error: #B4524A;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--cc-text);
    background-color: var(--cc-bg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--cc-text);
    font-weight: 600;
    letter-spacing: -0.005em;
}

h1 { font-size: 2rem;     line-height: 1.25; }
h2 { font-size: 1.625rem; line-height: 1.3; }
h3 { font-size: 1.35rem;  line-height: 1.35; }
h4 { font-size: 1.175rem; line-height: 1.4; }

a, .btn-link {
    color: var(--cc-accent);
    text-decoration: none;
}

a:hover, .btn-link:hover {
    text-decoration: underline;
}

/* Bootstrap button overrides — warm palette, soft borders, no harsh
   gradient. We aim for "subtle but tactile." */
.btn {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-primary {
    color: #fff;
    background-color: var(--cc-accent);
    border-color: var(--cc-accent);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #1A6FC1;
    border-color: #1A6FC1;
    color: #fff;
}

.btn-outline-primary {
    color: var(--cc-accent);
    border-color: var(--cc-border-strong);
    background-color: var(--cc-surface);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--cc-accent-soft);
    border-color: var(--cc-accent);
    color: var(--cc-accent);
}

.btn-outline-secondary {
    color: var(--cc-text);
    border-color: var(--cc-border-strong);
    background-color: var(--cc-surface);
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: var(--cc-surface-2);
    border-color: var(--cc-border-strong);
    color: var(--cc-text);
}

.btn-outline-danger {
    color: var(--cc-error);
    border-color: var(--cc-border-strong);
    background-color: var(--cc-surface);
}

.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: #FBEEEC;
    border-color: var(--cc-error);
    color: var(--cc-error);
}

.btn-link {
    text-decoration: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.18);
    outline: none;
}

/* Form controls — Notion's input style is flat and quiet, no heavy chrome. */
.form-control, .form-select {
    background-color: var(--cc-surface);
    border-color: var(--cc-border-strong);
    color: var(--cc-text);
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cc-accent);
    background-color: var(--cc-surface);
    color: var(--cc-text);
}

.form-control::placeholder {
    color: var(--cc-text-faint);
}

.form-label {
    color: var(--cc-text);
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.form-text {
    color: var(--cc-text-muted);
}

.form-check-input {
    border-color: var(--cc-border-strong);
}

.form-check-input:checked {
    background-color: var(--cc-accent);
    border-color: var(--cc-accent);
}

/* MudBlazor Outlined papers default to a darker rgba border. Soften to our
   token so cards don't feel walled-off from the page. */
.mud-paper-outlined {
    border-color: var(--cc-border) !important;
}

.mud-table thead th {
    color: var(--cc-text-muted);
    font-weight: 500;
    background-color: var(--cc-surface);
    border-bottom: 1px solid var(--cc-border) !important;
}

.mud-table-cell {
    border-bottom-color: var(--cc-border) !important;
}

.mud-table-row:hover {
    background-color: var(--cc-bg) !important;
}

/* MudAlert: tone the backgrounds down so they're informational rather than
   shouty. Material's defaults are saturated; we want Notion-like callouts. */
.mud-alert-filled-success { background-color: #E8F1EC !important; color: var(--cc-success) !important; }
.mud-alert-filled-warning { background-color: #F7EBE3 !important; color: var(--cc-warning) !important; }
.mud-alert-filled-error   { background-color: #F7E5E2 !important; color: var(--cc-error) !important; }
.mud-alert-filled-info    { background-color: var(--cc-accent-soft) !important; color: var(--cc-accent) !important; }

.mud-alert-filled-success .mud-alert-icon,
.mud-alert-filled-warning .mud-alert-icon,
.mud-alert-filled-error .mud-alert-icon,
.mud-alert-filled-info .mud-alert-icon {
    color: inherit !important;
}

.content {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--cc-success);
}

.invalid {
    outline: 1px solid var(--cc-error);
}

.validation-message {
    color: var(--cc-error);
}

.blazor-error-boundary {
    background-color: var(--cc-error);
    color: #fff;
    padding: 1rem 1rem 1rem 3.7rem;
}

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

.darker-border-checkbox.form-check-input {
    border-color: var(--cc-border-strong);
}

/* Booking slot button. Plain anchor that looks like a button — used in
   both the public booking flow and the client portal slot picker so the
   two surfaces stay visually consistent. Stacks a small "coach: X" line
   under the primary time when the visitor's TZ differs from the coach's. */
.bk-slot-btn {
    display: inline-flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 0.3rem 0.8rem; min-width: 5rem;
    border: 1px solid var(--cc-accent); border-radius: 4px;
    color: var(--cc-accent); background: transparent;
    font-size: 0.9rem; font-weight: 500; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.bk-slot-btn:hover { background: var(--cc-accent-soft); }
.bk-slot-time { font-weight: 600; }
.bk-slot-coach-time {
    font-size: 0.7rem; font-weight: 400;
    opacity: 0.6; margin-top: 0.15rem;
    white-space: nowrap;
}

/* Subtle, warm scrollbars to match the canvas. */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--cc-border); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--cc-border-strong); }

/* Course-authored content (Lesson.ContentHtml + Course.DescriptionHtml).
   Apply `.course-content` to any container that renders the
   sanitizer-cleaned TipTap output — the editor + the client player
   stay visually consistent. See docs/COURSES.md. */
.course-content :where(h2, h3) { margin-top: 1.25rem; }
.course-content img { max-width: 100%; height: auto; }
.course-content hr {
    border: 0; border-top: 2px solid var(--cc-border);
    margin: 1.5rem 0;
}
.course-content mark {
    background-color: #fff3a3;
    padding: 0.05rem 0.1rem;
    border-radius: 2px;
}
/* Task lists — pointer-events: none on the checkbox label so the
   v3 player renders them as static markers. v2 will wire interactive
   completion via a separate rendering path. */
.course-content ul[data-type="taskList"] {
    list-style: none; padding-left: 0;
}
.course-content ul[data-type="taskList"] li {
    display: flex; align-items: flex-start; gap: 0.5rem;
}
.course-content ul[data-type="taskList"] li > label {
    flex-shrink: 0; margin-top: 0.3rem; pointer-events: none;
}
.course-content ul[data-type="taskList"] li > div { flex-grow: 1; }
.course-content ul[data-type="taskList"] li > div > p { margin: 0; }
/* Tables — match the editor styling. */
.course-content table {
    border-collapse: collapse; margin: 0.75rem 0;
    width: 100%; table-layout: fixed;
}
.course-content table td, .course-content table th {
    border: 1px solid var(--cc-border);
    padding: 0.4rem 0.5rem; vertical-align: top;
}
.course-content table th {
    background: var(--cc-bg);
    font-weight: 600;
}

/* Centered narrow card for the anonymous auth pages (login, forgot /
   reset password). These render inside MainLayout (anon visitors on
   subdomains get the thin Sign-in header bar above); the card keeps the
   form at a readable width instead of letting the inputs stretch the
   full viewport. Shared here so all the auth screens match. */
.auth-shell {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 24rem;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 8px;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.auth-title {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
}
.auth-aux a { color: var(--cc-text-muted); }
.auth-aux a:hover { color: var(--cc-text); }

/* Practice branding carried onto the auth card when the request resolves to a
   tenant host (see AuthShell.razor). Logo/name header + a quiet "Powered by". */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}
.auth-brand-logo {
    height: 3.5rem;
    width: auto;
    max-width: 72%;
    object-fit: contain;
}
.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--cc-accent);
    color: var(--cc-accent-on, #fff);
    font-weight: 700;
    font-size: 1.6rem;
}
.auth-brand-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--cc-text);
}
.auth-poweredby {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--cc-text-muted);
}
.auth-poweredby-name { font-weight: 600; }

/* ============================================================================
 * Responsive data patterns — shared mobile primitives for the client portal
 * (and anywhere a wide table has to survive a phone). app.css was previously
 * breakpoint-free; this is the foundation. Two shapes:
 *   .cc-cardlist / .cc-datacard  — a list that IS cards at every width
 *                                  (auto columns on desktop, one-up on phones)
 *   table.cc-rtable              — a real table on desktop that collapses to
 *                                  labeled cards under 640px; cells carry
 *                                  data-label="Column".
 * Both are opt-in (new class names), so existing pages are untouched.
 * ==========================================================================*/

/* ---- Card list ---- */
.cc-cardlist {
    display: grid;
    gap: 0.7rem;
    /* min(100%, 20rem) keeps a track from ever exceeding the container, so a
       narrow phone never gets a horizontal scrollbar. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}
.cc-datacard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 8px;
}
.cc-datacard-title { font-weight: 600; font-size: 1rem; color: var(--cc-text); }
.cc-datacard-meta { color: var(--cc-text-muted); font-size: 0.87rem; }
.cc-datacard-meta strong { color: var(--cc-text); font-weight: 600; }
.cc-datacard-when { font-weight: 600; font-variant-numeric: tabular-nums; }
.cc-datacard-when .sub {
    display: block; font-weight: 400; color: var(--cc-text-muted);
    font-size: 0.82rem; margin-top: 0.1rem;
}
.cc-datacard-statrow {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; flex-wrap: wrap;
}
.cc-datacard-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* Actions grow to comfortable tap targets and wrap rather than cram; a lone
   button (e.g. Book) fills the row. min-width keeps 2–3 from getting tiny. */
.cc-datacard-actions .btn { flex: 1 1 auto; min-width: 6rem; padding: 0.5rem 0.85rem; }
/* A cancel/confirm form styled to sit in the action row like a button. */
.cc-datacard-actions form { display: contents; }

/* ---- Status pill ---- */
.cc-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.82rem; font-weight: 600; white-space: nowrap;
    padding: 0.2rem 0.55rem; border-radius: 999px;
    background: var(--cc-accent-soft); color: #1A6FC1;
}
.cc-pill-muted { background: var(--cc-surface-2); color: var(--cc-text-muted); }
.cc-pill-success { background: #E4F1EA; color: var(--cc-success); }
.cc-pill-warning { background: #F7E9E1; color: var(--cc-warning); }

/* ---- Responsive table: table on desktop, labeled cards under 640px ---- */
@media (max-width: 640px) {
    table.cc-rtable, table.cc-rtable thead, table.cc-rtable tbody,
    table.cc-rtable tr, table.cc-rtable th, table.cc-rtable td { display: block; }
    /* Keep the header row for screen readers but hide it visually. */
    table.cc-rtable thead {
        position: absolute; width: 1px; height: 1px;
        padding: 0; margin: -1px; overflow: hidden;
        clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    table.cc-rtable tr {
        border: 1px solid var(--cc-border); border-radius: 8px;
        margin-bottom: 0.7rem; padding: 0.15rem 0.1rem;
        background: var(--cc-surface);
    }
    table.cc-rtable td {
        display: flex; align-items: baseline; gap: 1rem;
        padding: 0.4rem 0.85rem; border: 0; text-align: right;
        white-space: normal;
    }
    /* Label pulled from the cell's data-label attribute, pinned left; the
       value flows to the right edge. */
    table.cc-rtable td[data-label]::before {
        content: attr(data-label);
        font-weight: 600; color: var(--cc-text-muted);
        text-align: left; margin-right: auto;
    }
    /* Label-less cells (e.g. a lone action button) just right-align. */
    table.cc-rtable td:not([data-label]) { justify-content: flex-end; }
    table.cc-rtable td:empty { display: none; }
}

/* ============================================================================
 * HeroBlock — the composed landing-page hero (background photo or gradient +
 * scrim + live title/badge). CSS lives here rather than inline in the component
 * so a LIST of heroes (e.g. shop cards) doesn't duplicate a <style> per card.
 * Markup: Components/Shared/HeroBlock.razor.
 * ==========================================================================*/
.hb {
    position: relative; overflow: hidden;
    border-radius: 12px; margin-bottom: 1.5rem;
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: clamp(210px, 32vw, 340px);
    /* Solid brand-tinted band as a base so the hero never looks broken with no
       photo; the photo (when set) paints over it. */
    background-color: var(--cc-accent, #2f5062);
    background-size: cover; background-position: center; background-repeat: no-repeat;
}
/* Scrim between the photo and the text so words stay legible on a busy image. */
.hb::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.hb-scrim-dark::before { background: linear-gradient(180deg, rgba(8,15,22,.28) 0%, rgba(8,15,22,.58) 100%); }
.hb-scrim-light::before { background: rgba(255,255,255,.55); }

/* Curated gradient backgrounds — a coach can pick one instead of a photo. */
.hb-bg-dawn   { background-image: linear-gradient(160deg,#f4b183 0%,#e07a5f 34%,#b4526a 66%,#5f4b8b 100%); }
.hb-bg-forest { background-image: linear-gradient(160deg,#3a6b4c 0%,#2f5d43 40%,#24493a 70%,#15302a 100%); }
.hb-bg-ocean  { background-image: linear-gradient(168deg,#3c5f70 0%,#4d818d 34%,#2f5062 60%,#1d3547 100%); }
.hb-bg-sand   { background-image: linear-gradient(160deg,#e6d2ad 0%,#d3ab7c 38%,#b1815a 70%,#856048 100%); }
.hb-bg-slate  { background-image: linear-gradient(160deg,#6b7a8a 0%,#4a5766 42%,#333d49 72%,#1f262e 100%); }
.hb-bg-brand  { background-image: linear-gradient(160deg, var(--cc-accent) 0%, color-mix(in srgb, var(--cc-accent) 55%, #10151b) 100%); }

.hb-inner { position: relative; padding: 2rem 1.4rem; width: 100%; }
.hb-avatar {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(255,255,255,.85); box-shadow: 0 2px 12px rgba(0,0,0,.3);
    margin: 0 auto .8rem; display: block;
}
.hb-subtitle { margin: .6rem auto 0; max-width: 36rem; font-size: 1.02rem; line-height: 1.45; }
.hb-scrim-dark  .hb-eyebrow, .hb-scrim-dark  .hb-title { color: #fff; }
.hb-scrim-light .hb-eyebrow, .hb-scrim-light .hb-title { color: var(--cc-text, #37352F); }
.hb-scrim-dark  .hb-subtitle { color: rgba(255,255,255,.92); }
.hb-scrim-light .hb-subtitle { color: var(--cc-text, #37352F); }
.hb-eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .8rem; font-weight: 600; opacity: .9; margin-bottom: .5rem; }
.hb-title {
    font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; margin: 0;
    font-size: clamp(1.7rem, 5vw, 2.9rem); text-shadow: 0 2px 16px rgba(0,0,0,.28);
}
.hb-scrim-light .hb-title { text-shadow: none; }
.hb-badge {
    display: inline-block; margin-top: 1rem; padding: .5rem 1.15rem;
    /* Always a fully-rounded pill so the badge reads as a tag, not a button. */
    border-radius: 999px; background: var(--cc-accent); color: var(--cc-accent-on);
    font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem;
    box-shadow: 0 2px 14px rgba(0,0,0,.22);
}

/* Compact variant for shop/listing card thumbnails: fills a fixed-aspect
   container and scales the title to the CARD width via container queries — the
   card gives the hero its own `container-type: inline-size` ancestor. */
.hb.hb-compact { min-height: 0; height: 100%; margin-bottom: 0; border-radius: 0; }
.hb-compact .hb-inner { padding: .85rem .8rem; }
.hb-compact .hb-eyebrow { font-size: .58rem; margin-bottom: .2rem; }
.hb-compact .hb-title { font-size: clamp(.9rem, 7.5cqi, 1.5rem); }
.hb-compact .hb-subtitle { display: none; }
.hb-compact .hb-avatar { width: 46px; height: 46px; margin-bottom: .4rem; border-width: 2px; }
.hb-compact .hb-badge { margin-top: .45rem; padding: .24rem .65rem; font-size: .6rem; }

/* ── Contact → Appointments tab: appointment rows + collapsible utilities ── */
.cd-appt-rows { display: flex; flex-direction: column; gap: 8px; }
.cd-appt-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--cc-border);
    border-radius: 10px; background: var(--cc-surface);
}
/* Past rows keep the border (from .cd-appt-row) but a white interior — the
   muted chip + status pill carry the "past" cue, no gray fill needed. */
.cd-appt-row-past { background: var(--cc-surface); }
.cd-appt-chip {
    flex: 0 0 auto; width: 50px; text-align: center;
    background: var(--cc-accent-soft); border-radius: 10px; padding: 6px 0; line-height: 1.05;
}
.cd-appt-chip-muted { background: var(--cc-surface-2); }
.cd-appt-chip-mon { display: block; font-size: .64rem; font-weight: 700; color: var(--cc-accent); letter-spacing: .05em; }
.cd-appt-chip-day { display: block; font-size: 1.3rem; font-weight: 700; color: var(--cc-accent); }
.cd-appt-chip-muted .cd-appt-chip-mon, .cd-appt-chip-muted .cd-appt-chip-day { color: var(--cc-text-muted); }
.cd-appt-main { flex: 1 1 auto; min-width: 0; }
.cd-appt-title { font-weight: 500; font-size: .95rem; }
.cd-appt-mode { font-weight: 400; font-size: .85rem; }
.cd-appt-sub { font-size: .82rem; }
.cd-appt-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cd-appt-actions form { display: inline; margin: 0; }
.cd-appt-migrated {
    display: inline-block; margin-left: .4rem; padding: .05rem .4rem;
    font-size: .68rem; border-radius: 4px; background: var(--cc-surface-2);
    color: var(--cc-text-muted); vertical-align: middle;
}
.cd-appt-past { margin-top: .25rem; }
.cd-appt-past > summary { cursor: pointer; padding: 4px 0; }

/* Collapsible migration + notification settings — quiet disclosure rows. */
.cd-disclosure > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center;
    gap: 8px; padding: 8px 10px; font-size: .9rem; color: var(--cc-text); font-weight: 500;
}
.cd-disclosure > summary::-webkit-details-marker { display: none; }
.cd-disclosure > summary::before {
    content: "\203A"; color: var(--cc-text-muted); transition: transform .15s ease;
    font-size: 1.1rem; line-height: 1;
}
.cd-disclosure[open] > summary::before { transform: rotate(90deg); }
.cd-disclosure-note { margin-left: auto; font-size: .78rem; font-weight: 400; color: var(--cc-text-muted); }
.cd-disclosure-body { padding: 4px 12px 12px; }
.cd-disclosure > summary .cd-ico { color: var(--cc-text-muted); width: 1rem; height: 1rem; }

/* Inline line-icons (SVG). Sized in em so they track the text they sit in. */
.cd-ico { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.14em; }

/* Book / Meet-now card headers: accent icon + title on one row. */
.cd-card-head { display: flex; align-items: center; gap: 8px; }
.cd-card-head .cd-ico { width: 1.05rem; height: 1.05rem; color: var(--cc-accent); }
.cd-card-head strong { font-size: 1rem; }

/* "Appointments" title + count subtitle. */
.cd-appt-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
/* Uppercase group label above the Upcoming rows. */
.cd-appt-grouplabel {
    text-transform: uppercase; letter-spacing: .06em;
    font-size: .7rem; font-weight: 600; color: var(--cc-text-muted); margin: 2px 0 6px;
}

/* Mode tag (Virtual / In person) — middot separator + small icon. */
.cd-appt-title .cd-appt-mode { white-space: nowrap; }
.cd-appt-title .cd-appt-mode::before { content: "·"; margin: 0 .35rem; color: var(--cc-text-muted); }
.cd-appt-mode .cd-ico { width: .9em; height: .9em; margin-right: 3px; }

/* Sub-line chunks (time range, "for <member>") each stay on one line and
   wrap as whole units, so a narrow row never splits "10:50" from "AM". */
.cd-appt-sub > span { white-space: nowrap; }
/* "for <member>" on the sub-line — middot separator + person icon. */
.cd-appt-for { white-space: nowrap; }
.cd-appt-for::before { content: "·"; margin: 0 .35rem; color: var(--cc-text-muted); }
.cd-appt-for .cd-ico { width: .9em; height: .9em; margin-right: 3px; }

/* Settings cards (Record a past session, Notification settings): keep the
   Outlined border but force a white interior so every panel on the tab reads
   as one white-card system. Beats MudPaper's own .mud-paper background. */
.mud-paper.cd-settings-card { background: var(--cc-surface); }

/* Row overflow menu — a native <details> popover (SSR-safe, no JS to open). */
.cd-rowmenu { position: relative; }
.cd-rowmenu > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border: 1px solid var(--cc-border-strong); border-radius: 6px;
    background: var(--cc-surface); color: var(--cc-text-muted);
}
.cd-rowmenu > summary::-webkit-details-marker { display: none; }
.cd-rowmenu > summary:hover { background: var(--cc-surface-2); color: var(--cc-text); }
.cd-rowmenu-pop {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 172px;
    background: var(--cc-surface); border: 1px solid var(--cc-border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 4px; display: flex; flex-direction: column;
}
/* display:contents so the <form> wrapping the Cancel button generates no box —
   the button then stretches + left-aligns as a direct flex child, matching the
   <a> items (a block/inline form wrapper offsets the button otherwise). */
.cd-rowmenu-pop form { display: contents; }
.cd-rowmenu-item {
    /* justify-content:flex-start is load-bearing: MudBlazor ships a global
       `button { justify-content:center }` that would otherwise centre the
       icon+label of the (button) Cancel/Refund items while the <a> items sit
       left. Keep it explicit. */
    display: flex; align-items: center; justify-content: flex-start; gap: 9px; width: 100%; text-align: left;
    padding: 7px 10px; font-size: .85rem; line-height: 1.2; color: var(--cc-text);
    background: none; border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.cd-rowmenu-item:hover { background: var(--cc-surface-2); }
.cd-rowmenu-item .cd-ico { width: 1em; height: 1em; color: var(--cc-text-muted); }
.cd-rowmenu-item-danger { color: var(--cc-error); }
.cd-rowmenu-item-danger .cd-ico { color: var(--cc-error); }

/* ── Contact → Account tab: portal access + sessions/credits + purchases ── */
/* Status pills (login state). Soft fills are light-mode only, matching the
   coach chrome; the coach UI doesn't run in dark mode. */
.cd-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; }
.cd-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cd-pill-ok { background: #E4F0E8; color: var(--cc-success); }
.cd-pill-warn { background: #F6E7DE; color: #9C5C3D; }
.cd-pill-off { background: var(--cc-surface-2); color: var(--cc-text-muted); }
.cd-access-email { font-size: 1rem; margin: .1rem 0 .15rem; }

/* Sessions & credits — balance rows with an emphasized remaining count. The bar
   fills with the *used* proportion (empty = fresh, full = spent). */
.cd-bal-rows { display: flex; flex-direction: column; gap: 8px; }
.cd-bal-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--cc-border); border-radius: 10px; background: var(--cc-surface); }
.cd-bal-main { flex: 1 1 auto; min-width: 0; }
.cd-bal-name { font-weight: 500; font-size: .95rem; }
.cd-bal-for { font-size: .8rem; color: var(--cc-text-muted); display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.cd-bal-for .cd-ico { width: .85em; height: .85em; }
.cd-bal-count { flex: 0 0 auto; width: 104px; text-align: right; }
.cd-bal-num { line-height: 1.05; }
.cd-bal-num .big { font-size: 1.5rem; font-weight: 700; color: var(--cc-accent); }
.cd-bal-num .lbl { font-size: .76rem; color: var(--cc-text-muted); margin-left: 2px; }
.cd-bal-of { font-size: .72rem; color: var(--cc-text-muted); }
.cd-bal-bar { height: 4px; border-radius: 3px; background: var(--cc-surface-2); margin-top: 6px; overflow: hidden; }
.cd-bal-bar > span { display: block; height: 100%; background: var(--cc-accent); }
.cd-bal-tag { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--cc-text-muted); background: var(--cc-surface-2); padding: .1rem .45rem; border-radius: 5px; }
.cd-bal-count.is-empty .big { color: var(--cc-text-muted); }
.cd-bal-count.is-empty .cd-bal-bar > span { background: var(--cc-border-strong); }

/* Purchase history — compact rows + lifetime-value stat in the header. */
.cd-ph-ltv { font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-ph-rows { display: flex; flex-direction: column; }
.cd-ph-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--cc-border); }
.cd-ph-row:last-child { border-bottom: 0; }
.cd-ph-date { flex: 0 0 auto; width: 92px; font-size: .78rem; color: var(--cc-text-muted); }
.cd-ph-main { flex: 1 1 auto; min-width: 0; font-size: .9rem; }
.cd-ph-amt { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 500; font-size: .9rem; }
.cd-ph-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }

@media (max-width: 600px) {
    .cd-appt-row { flex-wrap: wrap; }
    .cd-appt-actions { width: 100%; justify-content: flex-start; }
    .cd-appt-for { white-space: normal; }
    .cd-ph-date { width: 100%; }
    .cd-ph-row { flex-wrap: wrap; }
}

/* ── Booking picker (ClientBook page + dashboard schedule overlay) ───── */
.cc-book-band {
    background: var(--cc-surface-2);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}
.cc-book-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem 1rem; align-items: end; }
@media (min-width: 640px) {
    .cc-book-grid { grid-template-columns: 1fr 1fr; }
    .cc-book-grid .cc-book-full { grid-column: 1 / -1; }
}
.cc-book-band .form-label { margin-bottom: 0.25rem; font-size: 0.82rem; color: var(--cc-text-muted); }

/* Segmented In person / Virtual */
.cc-seg { display: inline-flex; border: 1px solid var(--cc-border-strong); border-radius: 8px; overflow: hidden; }
.cc-seg-label {
    display: inline-flex; align-items: center; margin: 0;
    padding: 7px 16px; font-size: 0.9rem; cursor: pointer;
    color: var(--cc-text-muted); user-select: none; white-space: nowrap;
}
.cc-seg-label + .cc-seg-label { border-left: 1px solid var(--cc-border-strong); }
.cc-seg-radio { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-seg-label:has(.cc-seg-radio:checked) { background: var(--cc-accent); color: var(--cc-accent-on); }
.cc-seg-label:has(.cc-seg-radio:focus-visible) { outline: 2px solid var(--cc-accent); outline-offset: -2px; }

/* Available-times day cards */
.cc-book-daycard {
    display: flex; gap: 14px; align-items: flex-start;
    border: 1px solid var(--cc-border); border-radius: 8px;
    padding: 10px 12px; margin-bottom: 8px;
}
.cc-book-daycard-today { background: var(--cc-surface-2); }
.cc-book-daycard-empty { align-items: center; }
.cc-book-dayname { width: 108px; flex-shrink: 0; }
.cc-book-dayname-main { font-size: 0.85rem; font-weight: 600; }
.cc-book-dayname-today { font-size: 0.75rem; color: var(--cc-accent); }
.cc-book-daychips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-book-noslots { font-size: 0.8rem; color: var(--cc-text-muted); }
.cc-book-slot {
    background: var(--cc-surface); border: 1px solid var(--cc-border-strong);
    border-radius: 6px; padding: 6px 11px; font-size: 0.82rem;
    font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap;
}
.cc-book-slot:hover { background: var(--cc-accent-soft); border-color: var(--cc-accent); }

/* Custom time — one line */
.cc-book-customtime {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--cc-surface-2); border-radius: 8px; padding: 10px 12px;
}
.cc-book-ct-label { font-size: 0.85rem; color: var(--cc-text-muted); }
.cc-book-ct-date { width: 170px; }
.cc-book-ct-time { width: 150px; }
.cc-book-ct-tz { font-size: 0.78rem; color: var(--cc-text-faint); }

@media (max-width: 560px) {
    .cc-book-daycard { flex-direction: column; gap: 6px; }
    .cc-book-dayname { width: auto; }
}

/* ── Flatpickr theme ────────────────────────────────────────────────────
   Skins the vendored Flatpickr popup (wwwroot/lib/flatpickr, mounted by
   flatpickr-init.js on [data-cc-flatpickr] inputs) to the app's warm-neutral
   palette + blue accent, so the date/time picker matches the rest of the UI in
   every browser. flatpickr.min.css is linked BEFORE app.css (see App.razor),
   so these token-based rules win. The visible field is a copied .form-control,
   already themed; these rules cover the popup. */
.flatpickr-calendar {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-button-radius);
    box-shadow: 0 6px 24px rgba(15, 15, 15, 0.12);
    font-family: 'Inter', system-ui, sans-serif;
}
/* the little pointer triangle: :after is the fill, :before the border edge */
.flatpickr-calendar.arrowTop:after { border-bottom-color: var(--cc-surface); }
.flatpickr-calendar.arrowTop:before { border-bottom-color: var(--cc-border); }
.flatpickr-calendar.arrowBottom:after { border-top-color: var(--cc-surface); }
.flatpickr-calendar.arrowBottom:before { border-top-color: var(--cc-border); }

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: var(--cc-text); fill: var(--cc-text); }
.flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: var(--cc-surface); }
span.flatpickr-weekday { color: var(--cc-text-muted); font-weight: 600; }

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: var(--cc-text-muted); }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--cc-accent); }

.flatpickr-day { color: var(--cc-text); border-radius: 6px; }
.flatpickr-day:hover,
.flatpickr-day:focus { background: var(--cc-surface-2); border-color: var(--cc-surface-2); }
.flatpickr-day.today { border-color: var(--cc-accent); }
.flatpickr-day.today:hover { background: var(--cc-accent-soft); border-color: var(--cc-accent); color: var(--cc-text); }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: var(--cc-accent);
    border-color: var(--cc-accent);
    color: var(--cc-accent-on);
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: var(--cc-text-faint); }

/* time picker (hour / minute / AM-PM) — also the whole popup in time-only mode */
.flatpickr-calendar.hasTime .flatpickr-time { border-top: 1px solid var(--cc-border); }
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm { color: var(--cc-text); }
.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus { background: var(--cc-surface-2); }
