/* ===== OmadaPay brand theme =====
   Master palette per the Omada Brand Guide (Colors & Logo Standards, 2026-07-08):
   Deep Navy #06152E (primary bg) · Gunmetal #2D343C (secondary) · Silver #D1D5DB
   (support) · Soft White #F8FAFC (primary text) · Blaze Orange #F97316 (accent/CTA).
   Note: this restores the full Blaze Orange the brand guide mandates, superseding the
   2026-07-02 muted rev (Slate Navy #0B1524 / Ember Orange #D97706).
   Surface roles are taken verbatim from the guide: Deep Navy #06152E = primary
   background; Gunmetal #2D343C = secondary/base (all chrome — sidebar, topbar, cards,
   panels). The --navy-800/700/panel tokens keep their historical names but now hold
   Gunmetal + one lighter elevation, so consumers stay unchanged while the palette is
   exactly the five guide colors. */
:root {
    --navy-900: #06152E;   /* Deep Navy — primary background */
    --navy-800: #2D343C;   /* Gunmetal — secondary/base chrome */
    --navy-700: #363F49;   /* Gunmetal, +1 elevation (hover / nested) */
    --panel: #2D343C;      /* Gunmetal — cards & panels */
    --panel-2: #363F49;    /* Gunmetal elevated */
    --orange: #F97316;
    --orange-600: #EA580C;
    --soft-white: #F8FAFC;
    --silver: #D1D5DB;
    --gunmetal: #2D343C;
    --muted: #93A3B8;
    --green: #22C55E;
    --red: #EF4444;
    --border: rgba(255, 255, 255, 0.07);
    /* Form fields read as interactive surfaces: a darker recessed fill (below the
       Gunmetal panel) plus a border stronger than the hairline --border on panels. */
    --field-bg: #1F252B;
    --field-border: rgba(255, 255, 255, 0.16);
    --field-border-hover: rgba(255, 255, 255, 0.28);
    --focus-ring: rgba(249, 115, 22, 0.25);
    --sidebar-w: 240px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--navy-900);
    color: var(--soft-white);
    font-size: 14px;
}

a, .btn-link { color: var(--orange); text-decoration: none; }
h1, h2, h3 { color: var(--soft-white); margin: 0; }

.text-muted2 { color: var(--muted) !important; }
.text-up { color: var(--green); }
.text-down { color: var(--red); }
.accent { color: var(--orange); }

/* ── Tier theming ─────────────────────────────────────────────────────────────
   Each console re-scopes the accent so staff can tell the tier apart at a glance:
   Merchant = orange, Global = violet, ISV = teal, ISO = blue. Anything keyed off
   var(--orange) (links, .accent, .btn-omada, avatar, active nav) adopts the tier hue
   automatically, and a 3px rail is pinned to the top of every shell. A single knob per
   tier keeps every downstream accent in sync. */
.tier-merchant { --orange: #F97316; --orange-600: #EA580C; --tier-name: "Merchant"; }
.tier-global   { --orange: #8B5CF6; --orange-600: #7C3AED; --tier-name: "Global"; }
.tier-isv      { --orange: #14B8A6; --orange-600: #0D9488; --tier-name: "ISV"; }
.tier-iso      { --orange: #3B82F6; --orange-600: #2563EB; --tier-name: "ISO"; }

.tier-merchant, .tier-global, .tier-isv, .tier-iso { position: relative; }
.tier-merchant::before, .tier-global::before,
.tier-isv::before, .tier-iso::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;   /* top rail, full width */
    height: 3px;
    background: var(--orange);
    z-index: 200;
    pointer-events: none;
}

/* Tier badge — a small pill naming the current console, tinted with the tier accent. */
.tier-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--orange);
    background: color-mix(in srgb, var(--orange) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent);
}

/* Page header — title/subtitle on the left, primary action on the right.
   Shared by every page's `<div class="dash-head">`; keep it global so action
   buttons don't collapse onto the subtitle when a page has no isolated CSS. */
.dash-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}
.dash-head h1 { font-size: 26px; }

/* Buttons — used as both <button> and <a>, so lay them out as inline-flex
   (inline padding alone doesn't reserve vertical space and bleeds over
   neighbouring content). */
.btn-omada, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn-omada {
    background: var(--orange);
    color: #fff;
    border: none;
}
.btn-omada:hover { background: var(--orange-600); }
/* Secondary action: must read as a BUTTON, not text — a transparent fill with the 7%
   hairline border blends into panels (Doug, 2026-07-11). Visible gunmetal fill + the
   stronger field border keep it clearly clickable while staying subordinate to orange. */
.btn-ghost {
    background: var(--navy-700);
    color: var(--soft-white);
    border: 1px solid var(--field-border);
    font-weight: 400;
}
.btn-ghost:hover { border-color: var(--field-border-hover); }
/* One disabled treatment for every brand button — pages must not invent their own. */
.btn-omada:disabled, .btn-ghost:disabled {
    opacity: .55;
    cursor: not-allowed;
}
/* Compact variant for grid-row / modal actions (replaces ad-hoc inline padding). */
.btn-sm {
    padding: 3px 12px;
    font-size: 12px;
}

/* Outbound message preview (invoice communication history) */
.msg-preview {
    width: 100%;
    background: var(--navy-700);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

/* Cards / panels */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}
.panel-title { font-size: 15px; font-weight: 600; }

.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.35);
}

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--green); }
.invalid { outline: 1px solid var(--red); }
.validation-message { color: var(--red); }

/* ============================================================
   Daily Close — accountant reconciliation
   Ledger-inspired: tabular monospace figures, leader dots,
   restrained orange. Reusable classes (no inline styles).
   ============================================================ */
:root { --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace; }

.dc-figure { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Segmented quick-range control */
.seg { display: inline-flex; background: var(--navy-800); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { appearance: none; background: transparent; color: var(--muted); border: none; padding: 7px 15px; font-size: 13px; font-weight: 600; border-radius: 7px; cursor: pointer; transition: color .15s ease, background .15s ease; }
.seg-btn:hover { color: var(--soft-white); }
.seg-btn.is-active { background: var(--orange); color: #fff; }

/* Inline filter row + date fields */
.dc-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; }
.dc-field { display: flex; flex-direction: column; gap: 7px; }

/* ── Form hierarchy ────────────────────────────────────────────────────────
   Label = quiet secondary caption · Field = solid interactive surface.
   The two must never read as the same element. */
.dc-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}
/* Inside a flex .dc-field the column gap already provides the separation. */
.dc-field > .dc-label { margin-bottom: 0; }

.dc-input,
select.dc-input,
textarea.dc-input {
    width: 100%;
    background: var(--field-bg);
    color: var(--soft-white);
    border: 1px solid var(--field-border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea.dc-input { min-height: 84px; resize: vertical; }
.dc-input:hover,
select.dc-input:hover,
textarea.dc-input:hover { border-color: var(--field-border-hover); }
.dc-input::placeholder,
textarea.dc-input::placeholder { color: var(--muted); opacity: .8; }
.dc-input:focus,
select.dc-input:focus,
textarea.dc-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--focus-ring);
    background: var(--navy-800);
}
.dc-input:disabled,
select.dc-input:disabled,
textarea.dc-input:disabled { opacity: .55; cursor: not-allowed; }

.dc-caption { font-size: 12.5px; color: var(--muted); margin: 18px 0 12px; }

/* Reconciliation ledger card */
.ledger { position: relative; max-width: 540px; padding: 0; overflow: hidden; }
.ledger-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); }
.ledger-head { padding: 16px 22px 13px; border-bottom: 1px solid var(--border); }
.ledger-eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ledger-body { padding: 12px 22px 18px; }
.ledger-row { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; }
.ledger-row .lr-label { color: var(--silver); font-size: 13.5px; white-space: nowrap; }
.ledger-row .lr-count { color: var(--muted); font-size: 12px; margin-left: 2px; }
.ledger-row .lr-dots { flex: 1; border-bottom: 1px dotted rgba(255,255,255,.16); transform: translateY(-4px); min-width: 24px; }
.ledger-row .lr-amt { font-size: 14px; }
.ledger-row.is-sub .lr-label { color: var(--muted); font-size: 12.5px; padding-left: 12px; }
.ledger-rule { height: 1px; background: var(--border); margin: 9px 0; }
.ledger-rule.is-strong { height: 2px; background: rgba(255,255,255,.16); }
.ledger-total { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-top: 6px; }
.ledger-total .lt-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft-white); font-weight: 700; }
.ledger-total .lt-amt { font-size: 27px; font-weight: 700; color: var(--soft-white); letter-spacing: -.01em; }
.ledger-foot { padding: 12px 22px; border-top: 1px solid var(--border); background: rgba(255,255,255,.02); font-size: 12.5px; color: var(--muted); }
.ledger-foot strong { color: var(--soft-white); font-weight: 600; }

/* Data tables */
.dc-card { padding: 0; overflow: hidden; }
.dc-card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dc-card-title { font-size: 14px; font-weight: 600; }
.dc-card-meta { font-size: 12px; color: var(--muted); }
.dc-table-wrap { overflow-x: auto; }
table.dc-table { width: 100%; border-collapse: collapse; }
.dc-table thead th { text-align: left; padding: 10px 16px; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.015); }
.dc-table thead th.num { text-align: right; }
.dc-table tbody td { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--border); }
.dc-table tbody tr:last-child td { border-bottom: none; }
.dc-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.dc-table td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-table td.strong { font-weight: 600; }
.dc-table .ref { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.dc-empty { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; }

/* Kind tags (replace emoji) */
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); letter-spacing: .02em; }
.tag.k-membership { color: #8FB4D9; border-color: rgba(124,196,255,.28); background: rgba(124,196,255,.08); }
.tag.k-invoice    { color: var(--orange); border-color: rgba(249,115,22,.28); background: rgba(249,115,22,.08); }
.tag.k-onetime    { color: var(--silver); }
.tag.k-manual     { color: var(--muted); }

/* Reconciliation match-status badges */
.tag.k-matched      { color: #4ade80; border-color: rgba(74,222,128,.28);  background: rgba(74,222,128,.08); }
.tag.k-pending-sync { color: var(--orange); border-color: rgba(249,115,22,.28); background: rgba(249,115,22,.08); }
.tag.k-qb-only      { color: #c084fc; border-color: rgba(192,132,252,.28); background: rgba(192,132,252,.08); }
.tag.k-exception    { color: #f87171; border-color: rgba(248,113,113,.28); background: rgba(248,113,113,.08); }

/* ============================================================
   Dashboard KPI drill-down
   ============================================================ */
.kpi-clickable { cursor: pointer; position: relative; transition: border-color .15s ease, transform .08s ease; }
.kpi-clickable:hover { border-color: rgba(249,115,22,.45); }
.kpi-clickable:active { transform: translateY(1px); }
.kpi-clickable:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.kpi-drill { display: block; margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--muted); opacity: 0; transition: opacity .15s ease; }
.kpi-clickable:hover .kpi-drill { opacity: 1; color: var(--orange); }

.drill-overlay { position: fixed; inset: 0; background: rgba(3,9,20,.66); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 1100; }
.drill-modal { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; width: min(860px, 100%); max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.drill-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drill-title { font-size: 17px; font-weight: 700; }
.drill-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.drill-close { background: transparent; border: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.drill-close:hover { color: var(--soft-white); }
.drill-summary { display: flex; flex-wrap: wrap; gap: 22px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.drill-stat { display: flex; flex-direction: column; gap: 3px; }
.drill-stat .text-muted2 { font-size: 11px; }
.drill-stat strong { font-size: 17px; }
.drill-table { overflow: auto; }
.drill-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-top: 1px solid var(--border); font-size: 13px; }

/* ── Native form fields baseline ───────────────────────────────────────────
   Pages that used ad-hoc markup (raw input/select/textarea, no .dc-input)
   still get a themed, clearly-interactive field so labels stay distinct from
   inputs. Scoped to .panel and carefully excluded so it never touches
   buttons, checkboxes/radios, the OmadaGrid .dc-col-filter, or design-system
   .dc-input elements (which own their own rules above). */
.panel input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not(.dc-input):not(.dc-col-filter),
.panel select:not(.dc-input):not(.dc-col-filter),
.panel textarea:not(.dc-input) {
    background: var(--field-bg);
    color: var(--soft-white);
    border: 1px solid var(--field-border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.panel textarea:not(.dc-input) { resize: vertical; }
.panel input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not(.dc-input):not(.dc-col-filter):hover,
.panel select:not(.dc-input):not(.dc-col-filter):hover,
.panel textarea:not(.dc-input):hover { border-color: var(--field-border-hover); }
.panel input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not(.dc-input):not(.dc-col-filter)::placeholder,
.panel textarea:not(.dc-input)::placeholder { color: var(--muted); opacity: .8; }
.panel input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not(.dc-input):not(.dc-col-filter):focus,
.panel select:not(.dc-input):not(.dc-col-filter):focus,
.panel textarea:not(.dc-input):focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--focus-ring);
    background: var(--navy-800);
}
/* Brighten the native date/time picker indicator on the dark fill. */
.panel input[type=date]::-webkit-calendar-picker-indicator,
.panel input[type=time]::-webkit-calendar-picker-indicator,
.panel input[type=datetime-local]::-webkit-calendar-picker-indicator,
.dc-input::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }

/* blazor error UI */
#blazor-error-ui {
    background: var(--gunmetal);
    color: var(--soft-white);
    bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--red); padding: 1rem; color: #fff; border-radius: 8px; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ── OmadaGrid: sortable headers + per-column fuzzy filter ─────────────────── */
.dc-sort-head { display: inline-flex; align-items: center; gap: 4px; }
.dc-sort-head.is-sortable { cursor: pointer; user-select: none; }
.dc-sort-head.is-sortable:hover { color: var(--soft-white); }
.dc-sort-ind { font-size: 10px; opacity: .4; line-height: 1; }
.dc-sort-head.is-sortable:hover .dc-sort-ind { opacity: .8; }
.dc-table thead th.dc-center, .dc-table tbody td.dc-center { text-align: center; }
.dc-table thead tr.dc-filter-row th { padding: 4px 10px 8px; background: rgba(255,255,255,.015); border-bottom: 1px solid var(--border); }
.dc-col-filter { width: 100%; min-width: 70px; background: var(--navy-800); color: var(--soft-white);
    border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12px;
    text-transform: none; letter-spacing: normal; font-weight: 400; }
.dc-col-filter::placeholder { color: var(--muted); opacity: .7; }
.dc-col-filter:focus { outline: none; border-color: var(--orange); }

/* ── Topbar "+ Create" dropdown ───────────────────────────────────────────── */
.create-dd { position: relative; }
.create-dd > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.create-dd > summary::-webkit-details-marker { display: none; }
.create-dd .create-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 192px;
    background: var(--navy-800); border: 1px solid var(--border); border-radius: 12px; padding: 6px;
    display: flex; flex-direction: column; gap: 2px; box-shadow: 0 16px 40px rgba(0,0,0,.45); z-index: 60; }
.create-dd .create-menu a { padding: 9px 12px; border-radius: 8px; color: var(--soft-white);
    text-decoration: none; font-size: 13px; }
.create-dd .create-menu a:hover { background: rgba(255,255,255,.06); }

/* ── Shared modal (cust-modal) — used by CustomerLookup + Member Billing ──── */
.cust-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center; z-index: 100; }
.cust-modal { width: min(520px, 92vw); background: var(--panel, #14161c);
    border: 1px solid var(--border, rgba(255,255,255,0.12)); border-radius: 12px;
    padding: 18px 20px; box-shadow: 0 16px 48px rgba(0,0,0,0.55); }
.cust-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cust-modal-error { margin-bottom: 12px; font-size: 13px; }
.cust-modal-note { margin-bottom: 12px; font-size: 12px; }
.cust-form { display: grid; gap: 12px; }
.cust-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cust-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Scheduling module (salon vertical — ADR 0005 / WT-2) ─────────────────────
   Mobile-first: single column by default, widening at the app's breakpoints
   (560 / 700 / 1100). Touch targets ≥44px; no hover-only interactions. */

.sched-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .sched-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .sched-cards { grid-template-columns: repeat(3, 1fr); } }

.sched-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.sched-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sched-card-title { font-size: 15px; font-weight: 700; }
.sched-card-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sched-card-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }

.sched-form-grid { display: grid; grid-template-columns: 1fr; gap: 14px 20px; }
@media (min-width: 700px) { .sched-form-grid { grid-template-columns: 1fr 1fr; } .sched-form-grid .span-2 { grid-column: 1 / -1; } }
.sched-field { display: flex; flex-direction: column; gap: 5px; }
.sched-field > label { font-size: 12px; color: var(--muted); font-weight: 600; }
.sched-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; cursor: pointer; }
.sched-check input { width: 18px; height: 18px; }

.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip { min-height: 44px; min-width: 84px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--field-bg); color: var(--soft-white); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: border-color .15s ease, background .15s ease; }
.slot-chip:hover { border-color: var(--orange); }
.slot-chip.selected { border-color: var(--orange); background: rgba(249, 115, 22, 0.14); }
.slot-chip .slot-staff { font-size: 11px; color: var(--muted); font-weight: 500; }

.appt-list { display: flex; flex-direction: column; gap: 10px; }
.appt-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--orange); border-radius: 10px; padding: 12px 14px; }
.appt-time { font-family: var(--mono); font-size: 13px; font-weight: 700; white-space: nowrap; }
.appt-body { min-width: 0; }
.appt-body .appt-title { font-weight: 600; font-size: 14px; }
.appt-body .appt-sub { font-size: 12.5px; color: var(--muted); }
.appt-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .appt-row { grid-template-columns: 1fr; } .appt-actions { justify-content: flex-start; } }

.status-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.status-Booked { background: rgba(147, 163, 184, .18); color: var(--silver); }
.status-Confirmed { background: rgba(74, 163, 224, .18); color: #7cc0ef; }
.status-CheckedIn { background: rgba(34, 197, 94, .16); color: #4ade80; }
.status-Completed { background: rgba(34, 197, 94, .22); color: #4ade80; }
.status-NoShow { background: rgba(239, 68, 68, .16); color: #f87171; }
.status-Cancelled { background: rgba(239, 68, 68, .14); color: #f87171; }

.sched-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sched-toolbar > * { min-height: 40px; }

.hours-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; }
@media (max-width: 560px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row .hours-day { grid-column: 1 / -1; } }

/* ── Multi-tier context switcher (Global → ISV → ISO → Merchant) ──────────────
   Mobile-first: the chip, warning text, and exit button wrap in a full-width strip;
   the expanded panel flows in-document (never absolute), single column on phone and
   three columns from 900px, so nothing can overflow a small viewport.
   Touch targets ≥44px throughout. */

/* Minimum touch-target utility for new interactive surfaces (WCAG 2.5.5 / mobile-first). */
.tap-44 { min-height: 44px; }

.ctx-bar {
    background: var(--navy-800);
    border-bottom: 1px solid var(--border);
    padding: 6px 12px;
}
/* Acting (non-global) sessions get the warning treatment the old impersonation banner had —
   the actor must always know they are inside someone else's console. */
.ctx-bar.is-acting {
    background: rgba(239, 68, 68, .14);
    border-bottom: 1px solid rgba(239, 68, 68, .4);
}

.ctx-switcher > summary { list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctx-switcher > summary::-webkit-details-marker { display: none; }

.ctx-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--field-border);
    background: var(--navy-700);
    color: var(--soft-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    max-width: 100%;
}
.ctx-chip:hover { border-color: var(--field-border-hover); }
.ctx-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-caret { font-size: 11px; opacity: .7; }

.ctx-warn { font-size: 12.5px; color: var(--silver); flex: 1; min-width: 140px; }
.ctx-exit { margin: 0; margin-left: auto; }

.ctx-panel { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 10px 0 12px; }
@media (min-width: 900px) { .ctx-panel { grid-template-columns: repeat(3, 1fr); } }

.ctx-group { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-width: 0; }
.ctx-group-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.ctx-filter { margin-bottom: 8px; min-height: 44px; }

.ctx-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.ctx-item-form { margin: 0; display: flex; }
.ctx-item {
    flex: 1;
    min-height: 44px;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--soft-white);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ctx-item:hover { background: rgba(255, 255, 255, .06); }

.ctx-capped { font-size: 12px; color: var(--orange); margin-top: 6px; }

/* ── Document-template branding: logo + placement + rich-text footer editor ── */
.logo-thumb {
    width: 200px;
    height: 72px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff
        linear-gradient(45deg, #f3f4f6 25%, transparent 25%, transparent 75%, #f3f4f6 75%),
        linear-gradient(45deg, #f3f4f6 25%, transparent 25%, transparent 75%, #f3f4f6 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-empty {
    width: 200px;
    height: 72px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted2, #6b7280);
    font-size: 12px;
}

.placement-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.placement-seg button {
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    padding: 7px 10px;
    font: inherit;
    font-size: 12px;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.placement-seg button:last-child { border-right: none; }
.placement-seg button:hover { background: color-mix(in srgb, var(--orange) 10%, transparent); }
.placement-seg button.active { background: var(--orange); color: #fff; }

.rt-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.rt-btn {
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 13px;
    cursor: pointer;
}
.rt-btn:hover { background: color-mix(in srgb, var(--orange) 10%, transparent); }
.rt-btn b, .rt-btn i, .rt-btn u, .rt-btn s { pointer-events: none; }

.rt-editor {
    min-height: 72px;
    padding: 10px 12px;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 220px;
}
.rt-editor:focus { outline: none; border-color: var(--orange); }
.rt-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted2, #9ca3af); }
.rt-editor ul, .rt-editor ol { margin: 4px 0 4px 22px; }
.rt-editor a { color: var(--orange); }

.rt-linkbar { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
