/* ═══════════════════════════════════════════════════════════════════════════
   NIMBUS × APPLE — Global Design System v3 (May 2026)
   "Photography-first; UI recedes so the product can speak."

   v3 swaps the v2 sky-blue / glass system for the VetOS × Apple pass:
   parchment canvas, white cards with a single hairline + single shadow,
   flat #0066cc primary, an Open Sans type ladder. Legacy v2 token names are
   preserved but rebound to the new values so existing consumers (`.razor.css`
   files referencing `var(--bg-page)`, `var(--accent-500)`, `var(--shadow-card)`,
   nim-* aliases, etc.) reflow automatically.
═══════════════════════════════════════════════════════════════════════════ */

/* Open Sans — primary UI face (swapped in for licensing; SF Pro OTFs removed).
   Also the canonical face for the certificate + billing-document editor / preview / PDF.
   Matched 1:1 with the Open Sans baked into the headless-Chromium PDF sidecar
   image (docker/playwright-pdf/Dockerfile) so the issued PDF looks identical to
   the in-editor preview. OFL — bundled under /fonts/open-sans/. */
@font-face {
    font-family: "Open Sans";
    src: url("/fonts/open-sans/OpenSans-Regular.ttf") format("truetype");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Open Sans";
    src: url("/fonts/open-sans/OpenSans-Bold.ttf") format("truetype");
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Open Sans";
    src: url("/fonts/open-sans/OpenSans-Italic.ttf") format("truetype");
    font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
    font-family: "Open Sans";
    src: url("/fonts/open-sans/OpenSans-BoldItalic.ttf") format("truetype");
    font-weight: 700; font-style: italic; font-display: swap;
}

:root {
    /* ───── Apple tokens (canonical) ───── */
    --color-primary:         #0066cc;
    --color-primary-hover:   #0058b3;
    --color-primary-focus:   #0071e3;
    --color-primary-on-dark: #2997ff;

    --color-canvas:           #ffffff;
    --color-canvas-parchment: #f5f5f7;
    --color-surface-pearl:    #fafafc;
    --color-surface-tile-1:   #272729;
    --color-surface-tile-2:   #2a2a2c;
    --color-surface-tile-3:   #252527;
    --color-surface-black:    #000000;
    --color-surface-chip-translucent: rgba(210, 210, 215, 0.64);

    --color-ink:           #1d1d1f;
    --color-body:          #1d1d1f;
    --color-body-on-dark:  #ffffff;
    --color-body-muted:    #cccccc;
    --color-ink-muted-80:  #333333;
    --color-ink-muted-48:  #7a7a7a;

    --color-divider-soft: #f0f0f0;
    --color-hairline:     #e0e0e0;

    --color-success:      #1f8a5b;
    --color-success-tint: rgba(31, 138, 91, 0.12);
    --color-warning:      #b25d00;
    --color-warning-tint: rgba(178, 93, 0, 0.12);
    --color-danger:       #c1121f;
    --color-danger-tint:  rgba(193, 18, 31, 0.12);
    --color-info:         #0066cc;
    --color-info-tint:    rgba(0, 102, 204, 0.10);

    --shadow-product: 3px 5px 30px 0 rgba(0, 0, 0, 0.22);
    --shadow-none:    none;

    --blur-frost: saturate(180%) blur(20px);

    /* ───── Typography stacks ───── */
    --font-display: "Open Sans", -apple-system, BlinkMacSystemFont, system-ui, "Inter", sans-serif;
    --font-text:    "Open Sans", -apple-system, BlinkMacSystemFont, system-ui, "Inter", sans-serif;
    --font-mono:    "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
    --font-sans: var(--font-text); /* legacy alias */

    /* ───── Radii ───── */
    --radius-none: 0;
    --radius-xs:   5px;
    --radius-sm:   8px;
    --radius-md:   11px;
    --radius-lg:   18px;
    --radius-pill: 9999px;

    /* ───── Spacing tokens (8px-derived) ───── */
    --space-xxs: 4px;
    --space-xs:  8px;
    --space-sm:  12px;
    --space-md:  17px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;
    --space-section: 80px;

    /* ───── Form spacing tokens — single source of truth for OwnerForm /
       PetForm / Registration / settings forms. `.grid-2`, `.grid-3`,
       `.grid-4` consume `--form-grid-gap`; `.form-stack` consumes
       `--form-card-gap`. `--form-field-gap` is the documented label-to-input
       gap (kept here so a future audit can find one canonical knob). */
    --form-grid-gap:  24px;
    --form-card-gap:  28px;
    --form-field-gap: 8px;

    /* ───── App-shell topnav height (referenced by scoped components) ───── */
    --app-topnav-height: 52px;

    /* ─────────────────────────────────────────────────────────────────────
       LEGACY v2 ALIASES — every var that scoped CSS still references is
       remapped to the Apple palette so old consumers reflow without edits.
       These names are now deprecated; new code should use the Apple tokens
       above. They are NOT to be expanded.
    ───────────────────────────────────────────────────────────────────── */
    --fg1:        var(--color-ink);
    --fg2:        var(--color-ink-muted-80);
    --fg-muted:   var(--color-ink-muted-48);
    --fg-brand:   var(--color-ink);
    --fg-accent:  var(--color-primary);

    --accent-500: var(--color-primary);
    --accent-600: var(--color-primary-hover);
    --accent-700: var(--color-primary);
    --accent-grad: var(--color-primary); /* gradients are retired — flat blue */
    --accent-faint-04: rgba(0, 102, 204, 0.04);
    --accent-faint-08: rgba(0, 102, 204, 0.08);
    --accent-faint-12: rgba(0, 102, 204, 0.10);

    --bg-page:        var(--color-canvas-parchment);
    --bg-nav:         rgba(245, 245, 247, 0.85);
    --bg-sidebar:     #ffffff;
    --bg-card:        #ffffff;
    --bg-input:       #ffffff;
    --bg-input-focus: #ffffff;
    --bg-footer:      var(--color-canvas-parchment);

    --border-card:        var(--color-hairline);
    --border-input:       var(--color-hairline);
    --border-input-focus: var(--color-primary);
    --border-row:         var(--color-divider-soft);
    --border-section:     var(--color-divider-soft);

    /* Single shadow only — the v2 4-layer recipe is retired. Cards now lean
       on the 1px hairline border for definition; the shadow appears on
       elevated surfaces (modals, popovers, slide-overs) sparingly. */
    --shadow-card:         none;
    --shadow-card-elevated: var(--shadow-product);
    --shadow-button:       none;
    --shadow-button-hover: none;
    --shadow-focus:        0 0 0 3px rgba(0, 102, 204, 0.12);
    --shadow-focus-ring:   0 0 0 2px var(--color-primary-focus);
    --shadow-nav:          none;
    --shadow-popover:      0 10px 40px rgba(0, 0, 0, 0.12);

    --r-card:  var(--radius-lg);
    --r-btn:   var(--radius-pill);
    --r-input: var(--radius-sm);
    --r-pill:  var(--radius-pill);

    --fs-xs:   10px;
    --fs-sm:   12px;
    --fs-body: 13px;
    --fs-md:   15px;
    --fs-lg:   17px;

    /* Status — v2 names rebound to Apple tints */
    --st-success-bg:     var(--color-success-tint);
    --st-success-fg:     var(--color-success);
    --st-success-border: rgba(31, 138, 91, 0.22);
    --st-danger-bg:      var(--color-danger-tint);
    --st-danger-fg:      var(--color-danger);
    --st-danger-border:  rgba(193, 18, 31, 0.24);
    --st-warning-bg:     var(--color-warning-tint);
    --st-warning-fg:     var(--color-warning);
    --st-warning-border: rgba(178, 93, 0, 0.24);
    --st-info-bg:        var(--color-info-tint);
    --st-info-fg:        var(--color-primary);
    --st-info-border:    rgba(0, 102, 204, 0.22);
    --st-slate-bg:       rgba(122, 122, 122, 0.10);
    --st-slate-fg:       var(--color-ink-muted-48);
    --st-slate-border:   rgba(0, 0, 0, 0.10);
    --st-purple-bg:      rgba(111, 66, 150, 0.10);
    --st-purple-fg:      #6f4296;
    --st-purple-border:  rgba(111, 66, 150, 0.22);
}

/* ───── Page reset ───── */
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0; min-height: 100vh;
    font-family: var(--font-text);
    color: var(--color-ink);
    background: var(--color-canvas-parchment);
    font-size: 14px;
    line-height: 1.43;
    letter-spacing: -0.1px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ───── Orbs are retired — animated gradient blobs no longer fit the system.
   Legacy `.app-orbs` / `.app-orb` markers are kept as no-ops so MainLayout
   markup (still referencing them) renders cleanly. */
.app-orbs, .app-orb, .app-orb-a, .app-orb-b { display: none !important; }
@keyframes app-float { 0%, 100% { transform: none; } 50% { transform: none; } }

/* ═══════════════════════════════════════════════════════════════════════════
   SEMANTIC TYPE SCALE — weight ladder is 300 / 400 / 600 / 700 (no 500).
═══════════════════════════════════════════════════════════════════════════ */
.type-hero-display { font-family: var(--font-display); font-size: 56px; font-weight: 600; line-height: 1.07; letter-spacing: -0.15px; }
h1, .type-display-lg { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.10; letter-spacing: 0; margin: 0 0 12px; }
h2, .type-display-md { font-family: var(--font-text); font-size: 34px; font-weight: 600; line-height: 1.47; letter-spacing: -0.2px; margin: 0 0 12px; }
.type-lead          { font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1.14; letter-spacing: 0.196px; }
.type-lead-airy     { font-family: var(--font-text);    font-size: 24px; font-weight: 300; line-height: 1.5;  letter-spacing: 0; }
h3, .type-tagline   { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.19; letter-spacing: 0.231px; margin: 0 0 8px; }
.type-body-strong, strong { font-family: var(--font-text); font-size: 17px; font-weight: 600; line-height: 1.24; letter-spacing: -0.2px; }
.type-body          { font-family: var(--font-text); font-size: 17px; font-weight: 400; line-height: 1.47; letter-spacing: -0.2px; }
.type-caption       { font-family: var(--font-text); font-size: 14px; font-weight: 400; line-height: 1.43; letter-spacing: -0.1px; }
.type-caption-strong{ font-family: var(--font-text); font-size: 14px; font-weight: 600; line-height: 1.29; letter-spacing: -0.1px; }
.type-fine-print    { font-family: var(--font-text); font-size: 12px; font-weight: 400; line-height: 1.0;  letter-spacing: -0.12px; }
.type-micro-legal   { font-family: var(--font-text); font-size: 10px; font-weight: 400; line-height: 1.3;  letter-spacing: -0.08px; }
.type-nav-link      { font-family: var(--font-text); font-size: 12px; font-weight: 400; line-height: 1.0;  letter-spacing: -0.12px; }

.num-tabular, .num { font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRESS STATE — system-wide micro-interaction
═══════════════════════════════════════════════════════════════════════════ */
.btn, .btn-primary, .btn-secondary, .btn-secondary-pill,
.btn-dark-utility, .btn-pearl-capsule, .btn-store-hero, .btn-icon-circular,
.btn-ghost, .btn-danger, .nim-btn, .nim-btn-primary, .nim-btn-secondary {
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.12s ease,
                border-color 0.12s ease;
}
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-secondary-pill:active,
.btn-dark-utility:active, .btn-pearl-capsule:active, .btn-store-hero:active,
.btn-icon-circular:active, .btn-ghost:active, .btn-danger:active,
.nim-btn:active, .nim-btn-primary:active, .nim-btn-secondary:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS — flat-fill primary (no gradient), pill default radius.
═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-text);
    font-size: 13px; font-weight: 400;
    letter-spacing: -0.2px;
    border: 1px solid var(--color-hairline);
    background: #fff;
    color: var(--color-ink);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--color-canvas-parchment); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--color-primary-focus); outline-offset: 2px; }
.btn svg, .btn i[data-lucide] { width: 14px; height: 14px; stroke-width: 1.75; }

.btn-lg, .btn.lg { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-sm, .btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.icon, .btn-icon { width: 28px; padding: 0; justify-content: center; }

.btn-primary,
.btn.btn-primary,
.btn.primary {
    background: var(--color-primary);
    color: #fff;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-pill);
    padding: 0 18px;
    height: 32px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.2px;
}
.btn-primary:hover,
.btn.btn-primary:hover,
.btn.primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
    text-decoration: none;
}

.btn-secondary,
.btn.btn-secondary,
.btn-secondary-pill {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-pill);
    padding: 0 17px;
    height: 32px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.2px;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover,
.btn.btn-secondary:hover,
.btn-secondary-pill:hover {
    background: rgba(0, 102, 204, 0.06);
    text-decoration: none;
}

.btn-ghost,
.btn.btn-ghost,
.btn.ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-ink);
}
.btn-ghost:hover,
.btn.btn-ghost:hover,
.btn.ghost:hover { background: rgba(0, 0, 0, 0.04); }

.btn-danger,
.btn.btn-danger,
.btn.danger {
    background: var(--color-danger);
    color: #fff;
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-pill);
    padding: 0 18px;
    height: 32px;
}
.btn-danger:hover,
.btn.btn-danger:hover,
.btn.danger:hover { background: #a30e1a; border-color: #a30e1a; color: #fff; }

.btn-dark-utility {
    background: var(--color-ink); color: var(--color-body-on-dark);
    border: none;
    font-family: var(--font-text); font-size: 14px; font-weight: 400; letter-spacing: -0.1px;
    border-radius: var(--radius-sm);
    padding: 8px 15px;
}

.btn-pearl-capsule {
    background: var(--color-surface-pearl);
    color: var(--color-ink-muted-80);
    border: 1px solid var(--color-divider-soft);
    font-family: var(--font-text); font-size: 14px; font-weight: 400;
    border-radius: var(--radius-md);
    padding: 5px 11px;
}

.btn-store-hero {
    background: var(--color-primary); color: #fff; border: none;
    font-family: var(--font-text); font-size: 18px; font-weight: 300;
    border-radius: var(--radius-pill);
    padding: 14px 28px;
}

.btn-icon-circular {
    width: 44px; height: 44px;
    background: var(--color-surface-chip-translucent);
    color: var(--color-ink); border: none;
    border-radius: var(--radius-pill);
    display: inline-flex; align-items: center; justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD — white, 1px hairline, 18px radius. NO shadow at rest. Elevated
   variants (modal, popover, slide-over) opt in via `.card-elevated`.
═══════════════════════════════════════════════════════════════════════════ */
.card,
.card-utility {
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.card-elevated {
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-product);
}
/* Size modifiers — compose with `.card` to tighten the default 20px padding.
   Radius stays --radius-lg; only the inner padding changes. */
.card-compact { padding: 16px; }
.card-tight   { padding: 12px; }
/* Section/group heading inside a card. Deliberately a tier ABOVE .label:
   sentence case + ink + larger, so a card section never reads as just
   another uppercase-muted field label stacked above the inputs it groups. */
.card-title {
    font-size: 13px; font-weight: 600;
    letter-spacing: -0.1px;
    color: var(--color-ink);
    margin-bottom: 14px;
}
.card-h {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600; letter-spacing: -0.2px;
    margin: 0 0 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PILLS / BADGES
═══════════════════════════════════════════════════════════════════════════ */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    height: 20px; padding: 0 8px;
    border-radius: var(--radius-pill);
    font-size: 11px; font-weight: 600;
    letter-spacing: -0.12px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-ink-muted-48);
}
.pill svg { width: 12px; height: 12px; flex-shrink: 0; }

.pill-green, .pill.green, .pill.pill-success { background: var(--color-success-tint); color: var(--color-success); }
.pill-amber, .pill.amber, .pill.pill-warning { background: var(--color-warning-tint); color: var(--color-warning); }
.pill-red,   .pill.red,   .pill.pill-danger  { background: var(--color-danger-tint);  color: var(--color-danger); }
.pill-blue,  .pill.blue,  .pill-sky, .pill.pill-info { background: var(--color-info-tint); color: var(--color-primary); }
.pill-slate, .pill.gray,  .pill.pill-slate   { background: rgba(0, 0, 0, 0.05); color: var(--color-ink-muted-48); }
.pill-purple, .pill.purple                   { background: var(--st-purple-bg); color: var(--st-purple-fg); }
.pill.solid-blue                              { background: var(--color-primary); color: #fff; }
.pill.outline-gray                            { background: #fff; border: 1px solid var(--color-hairline); color: var(--color-ink-muted-80); }
.pill-lg                                      { height: 22px; padding: 0 10px; gap: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   DEMEANOUR BADGES — operationally critical, retain dot-prefix pattern.
═══════════════════════════════════════════════════════════════════════════ */
.dem {
    display: inline-flex; align-items: center; gap: 6px;
    height: 22px; padding: 0 10px;
    border-radius: var(--radius-pill);
    font-size: 11px; font-weight: 600; letter-spacing: -0.12px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.dem::before {
    content: ""; display: inline-block;
    width: 7px; height: 7px; border-radius: 9999px;
    background: currentColor;
    flex-shrink: 0;
}
.dem.sm  { height: 18px; padding: 0 7px;  font-size: 10px; gap: 4px; }
.dem.sm::before { width: 5px; height: 5px; }
.dem.lg  { height: 28px; padding: 0 14px; font-size: 13px; gap: 8px; }
.dem.lg::before { width: 9px; height: 9px; }

.dem.calm       { color: #1f8a5b; background: rgba(31,138,91,0.12);  border-color: rgba(31,138,91,0.22); }
.dem.friendly   { color: #0066cc; background: rgba(0,102,204,0.10);  border-color: rgba(0,102,204,0.22); }
.dem.anxious    { color: #b25d00; background: rgba(178,93,0,0.12);   border-color: rgba(178,93,0,0.24); }
.dem.aggressive { color: #c1121f; background: rgba(193,18,31,0.10);  border-color: rgba(193,18,31,0.24); }
.dem.shy        { color: #6f4296; background: rgba(111,66,150,0.10); border-color: rgba(111,66,150,0.22); }
.dem.fearful    { color: #884221; background: rgba(136,66,33,0.10);  border-color: rgba(136,66,33,0.22); }

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS TONE BADGES — uppercase, small-caps status marker with an optional
   leading icon or `.tone-dot`. Distinct from `.pill` (sentence-case, softer):
   `.tone` is the louder all-caps status chip. Fully driven by the --st-*
   status tokens. Compose: <span class="tone tone-green"><svg/>Active</span>.
═══════════════════════════════════════════════════════════════════════════ */
.tone {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase;
    white-space: nowrap;
}
.tone-sm { padding: 2px 7px; font-size: 9.5px; }
.tone svg { width: 11px; height: 11px; flex-shrink: 0; }
.tone-dot { width: 4px; height: 4px; border-radius: var(--radius-pill); background: currentColor; flex-shrink: 0; }

.tone-sky    { background: var(--st-info-bg);    color: var(--st-info-fg);         border-color: var(--st-info-border); }
.tone-green  { background: var(--st-success-bg); color: var(--st-success-fg);      border-color: var(--st-success-border); }
.tone-amber  { background: var(--st-warning-bg); color: var(--st-warning-fg);      border-color: var(--st-warning-border); }
.tone-red    { background: var(--st-danger-bg);  color: var(--st-danger-fg);       border-color: var(--st-danger-border); }
.tone-purple { background: var(--st-purple-bg);  color: var(--st-purple-fg);       border-color: var(--st-purple-border); }
.tone-slate  { background: var(--st-slate-bg);   color: var(--color-ink-muted-80); border-color: var(--st-slate-border); }

/* ═══════════════════════════════════════════════════════════════════════════
   AVATARS — initial chips, gradient backgrounds preserved (decorative only).
═══════════════════════════════════════════════════════════════════════════ */
.ava {
    width: 28px; height: 28px;
    border-radius: var(--radius-pill);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; letter-spacing: -0.2px;
    flex-shrink: 0;
    /* Data-driven hook: a per-row hex the fixed variants can't express is set via
       style="--ava-bg:#hex; --ava-fg:#fff". Defaults are inert (zero change for
       variant-less or gradient-variant avatars). */
    background: var(--ava-bg, transparent);
    color: var(--ava-fg, inherit);
}
.ava.sm { width: 22px; height: 22px; font-size: 9px; }
.ava.lg { width: 36px; height: 36px; font-size: 13px; }
.ava.xl { width: 56px; height: 56px; font-size: 18px; border-radius: 14px; }
.ava.square { border-radius: var(--radius-sm); }
.ava.tan { background: linear-gradient(135deg, #e0c8fa, #b39ce0); color: #4c2783; }
.ava.lim { background: linear-gradient(135deg, #c8e6fa, #9cc5e0); color: #1c4f7a; }
.ava.ng  { background: linear-gradient(135deg, #fae0c8, #e0a37c); color: #7a3c1c; }
.ava.koh { background: linear-gradient(135deg, #c8fae0, #7ce0a3); color: #1c7a3c; }
.ava.rec { background: linear-gradient(135deg, #faf0c8, #e0c87c); color: #7a5c1c; }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES (.tbl + .table both supported — `.tbl` is v2 alias)
═══════════════════════════════════════════════════════════════════════════ */
.tbl, .table {
    width: 100%;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
.tbl thead th, .table thead th, .table-head > div {
    background: var(--color-canvas-parchment);
    border-bottom: 1px solid var(--color-hairline);
    font-size: 10px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-ink-muted-48);
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
}
.tbl tbody td, .table tbody td, .table-row > div {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-divider-soft);
    font-size: 13px; letter-spacing: -0.2px;
    color: var(--color-ink);
}
.tbl tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr, .table tbody tr { transition: background 0.12s ease; cursor: default; }
.tbl tbody tr:hover, .table tbody tr:hover { background: var(--color-canvas-parchment); }

/* Grid-style table-row container (Apple handoff variant) */
.table-head { display: grid; align-items: center; height: 36px; background: var(--color-canvas-parchment); border-bottom: 1px solid var(--color-hairline); }
.table-row  { display: grid; align-items: center; height: 44px; border-bottom: 1px solid var(--color-divider-soft); transition: background 0.12s ease; }
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: var(--color-canvas-parchment); }
.table-row > div { padding: 0 14px; font-size: 13px; letter-spacing: -0.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-row .muted  { color: var(--color-ink-muted-48); }
.table-row .strong { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER CHIPS — toggleable; active = solid ink.
═══════════════════════════════════════════════════════════════════════════ */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 12px;
    border-radius: var(--radius-pill);
    font-size: 12px; letter-spacing: -0.12px;
    background: #fff;
    border: 1px solid var(--color-hairline);
    color: var(--color-ink-muted-80);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    text-decoration: none;
}
.chip:hover:not(.active):not(.chip-active) { background: var(--color-canvas-parchment); }
.chip:focus-visible { outline: 2px solid var(--color-primary-focus); outline-offset: 2px; }
.chip.active, .chip-active {
    background: var(--color-ink);
    color: #fff;
    border-color: var(--color-ink);
}
/* Selected chip must keep ink fill + white text on hover — never invert
   to white-on-white. Slight lift via a subtle darker shade. */
.chip.active:hover, .chip-active:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}
.chip .count {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-ink-muted-80);
    border-radius: var(--radius-pill);
    padding: 0 6px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.chip.active .count, .chip-active .count { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   INPUTS / SELECTS / TEXTAREAS — flat white, hairline border, 8px radius.
═══════════════════════════════════════════════════════════════════════════ */
.inp, .sel, .input, input.input, select.input, textarea.input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    font-family: var(--font-text);
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.inp:hover, .sel:hover, .input:hover { border-color: #c0c0c0; }
.inp:focus, .sel:focus, .input:focus,
input.input:focus, select.input:focus, textarea.input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}
.inp.lg, .input.lg { height: 42px; font-size: 15px; }
textarea.inp, textarea.input { min-height: 80px; padding: 10px 12px; resize: vertical; height: auto; }

/* Password field with show/hide toggle — used on /Account/Login, Register,
   ChangePassword, SetPassword, ResetPassword. The wrapper positions the
   toggle button to the right of the input; the input gets right-padding so
   the value doesn't slide under the button. */
.password-field { position: relative; }
.password-field > input.input { padding-right: 60px; }
.password-field > .password-field__toggle {
    position: absolute;
    top: 50%; right: 6px;
    transform: translateY(-50%);
    height: 32px;
    padding: 0 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    font-family: var(--font-text);
    font-size: 13px; font-weight: 600;
    letter-spacing: -0.08px;
    cursor: pointer;
}
.password-field > .password-field__toggle:hover { color: var(--color-primary-hover); }
.password-field > .password-field__toggle:focus-visible {
    outline: 2px solid var(--color-primary-focus);
    outline-offset: 2px;
}

/* Helper text below an input. Plain muted prose. */
.field-hint {
    font-size: 12px;
    color: var(--color-ink-muted-48);
    margin: 6px 0 0;
    letter-spacing: -0.08px;
}

/* Inline policy-nudge banner — used on the staff account home when the
   signed-in user's password predates the policy tightening. */
.banner-nudge {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    margin: 0 0 16px;
    background: var(--color-warning-tint);
    border: 1px solid rgba(178, 93, 0, 0.32);
    border-radius: var(--radius-md);
    color: var(--color-ink);
    font-size: 13px;
    letter-spacing: -0.08px;
}
.banner-nudge a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.banner-nudge a:hover { text-decoration: underline; }

.search-input {
    width: 100%; height: 44px;
    padding: 12px 20px;
    background: var(--color-canvas);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-pill);
    font-family: var(--font-text);
    font-size: 17px;
    color: var(--color-ink);
    letter-spacing: -0.2px;
    outline: none;
}
.search-input:focus { border-color: var(--color-primary); }

.label, .field-label {
    display: block;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--color-ink-muted-48);
    margin-bottom: 6px;
}
.field { margin-bottom: 16px; }
.field-row { display: grid; gap: 14px; }

.eyebrow, .section-eyebrow {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--color-primary);
    margin-bottom: 8px;
}
.section-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--color-ink-muted-48);
    margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   KPI TILE — 4-up dashboard stat card.
═══════════════════════════════════════════════════════════════════════════ */
.kpi {
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi .label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--color-ink-muted-48);
    margin-bottom: 14px;
}
.kpi .value {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 600;
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.kpi .delta {
    font-size: 12px; color: var(--color-success);
    margin-top: 6px; letter-spacing: -0.12px;
}
.kpi .delta.down { color: var(--color-danger); }

/* ═══════════════════════════════════════════════════════════════════════════
   STEPPER — multi-step wizard progress.
═══════════════════════════════════════════════════════════════════════════ */
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .step {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--color-ink-muted-48);
}
.stepper .step .num {
    width: 22px; height: 22px;
    border-radius: var(--radius-pill);
    background: var(--color-canvas-parchment);
    border: 1px solid var(--color-hairline);
    color: var(--color-ink-muted-48);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
}
.stepper .step.active { color: var(--color-ink); font-weight: 600; }
.stepper .step.active .num {
    background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.stepper .step.done .num {
    background: var(--color-success); color: #fff; border-color: var(--color-success);
}
.stepper .bar { flex: 0 0 48px; height: 1px; background: var(--color-hairline); }

/* ═══════════════════════════════════════════════════════════════════════════
   POPOVER / MODAL / SLIDE-OVER — elevated surfaces use the single product
   shadow. Modals are reserved for destructive confirms; everything else
   prefers slide-over or inline panel.
═══════════════════════════════════════════════════════════════════════════ */
.popover {
    position: absolute;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-popover);
    overflow: hidden;
    min-width: 240px;
    z-index: 11;
}
.popover-section { padding: 8px; }
.popover-section + .popover-section { border-top: 1px solid var(--color-divider-soft); }
.popover-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px; letter-spacing: -0.2px;
    cursor: pointer;
}
.popover-item:hover { background: var(--color-canvas-parchment); }
.popover-item.danger { color: var(--color-danger); }
.popover-item svg { width: 14px; height: 14px; stroke-width: 1.75; flex-shrink: 0; }

.scrim {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10;
}
.modal {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: calc(100% - 48px);
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-hairline);
    box-shadow: var(--shadow-product);
    z-index: 11;
    overflow: hidden;
}
.modal.lg { width: 640px; }
.modal-head { padding: 20px 24px 12px; }
.modal-h {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 600; letter-spacing: -0.2px;
    margin: 0 0 4px;
}
.modal-sub {
    font-size: 13px; color: var(--color-ink-muted-48);
    letter-spacing: -0.2px; margin: 0;
}
.modal-body { padding: 12px 24px 20px; }
.modal-foot {
    padding: 14px 20px;
    background: var(--color-canvas-parchment);
    border-top: 1px solid var(--color-hairline);
    display: flex; justify-content: flex-end; gap: 8px;
}

.slideover {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 540px;
    background: #fff;
    border-left: 1px solid var(--color-hairline);
    box-shadow: var(--shadow-product);
    z-index: 11;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.slideover-head {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--color-hairline);
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px;
}
.slideover-h {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600; letter-spacing: -0.2px;
    margin: 0 0 2px;
}
.slideover-sub { font-size: 12px; color: var(--color-ink-muted-48); }
.slideover-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.slideover-foot {
    padding: 14px 20px;
    background: var(--color-canvas-parchment);
    border-top: 1px solid var(--color-hairline);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TILE SURFACES — full-bleed dark/light tiles for marketing-style sections.
═══════════════════════════════════════════════════════════════════════════ */
.tile-light     { background: var(--color-canvas);           color: var(--color-ink); }
.tile-parchment { background: var(--color-canvas-parchment); color: var(--color-ink); }
.tile-dark      { background: var(--color-surface-tile-1);   color: var(--color-body-on-dark); }
.tile-dark-2    { background: var(--color-surface-tile-2);   color: var(--color-body-on-dark); }
.tile-dark-3    { background: var(--color-surface-tile-3);   color: var(--color-body-on-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   SKELETON SHIMMER — async loading.
═══════════════════════════════════════════════════════════════════════════ */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.skel {
    background: linear-gradient(90deg, var(--color-divider-soft) 0%, #f8f8f8 50%, var(--color-divider-soft) 100%);
    background-size: 800px 100%;
    animation: shimmer 1.4s linear infinite;
    border-radius: var(--radius-xs);
    display: block;
}
/* Skeleton row helpers — compose with `.skel` for text-line placeholders:
   <span class="skel skel-line"></span>. `-sm` is a thinner sub-line. */
.skel-line { height: 10px; border-radius: var(--radius-xs); }
.skel-line-sm { height: 8px; }

/* Spinner — the single shared in-app loading spinner. Compose:
   <span class="spinner"></span>, or `.spinner-sm` for inline/12px contexts.
   This is the canonical spinner; do not hand-roll per-component border-spinners. */
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--color-hairline);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-pill);
    animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 12px; height: 12px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Accessibility — visually-hidden text that stays available to screen readers. */
.sr-only, .visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════════════════════ */
.pgn { display: flex; align-items: center; gap: 8px; }
.pg-btn {
    height: 30px; min-width: 30px; padding: 0 10px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--color-hairline);
    color: var(--color-ink);
    font-size: 12px; letter-spacing: -0.12px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.pg-btn:hover { background: var(--color-canvas-parchment); }
.pg-btn[aria-current="page"], .pg-btn.active {
    background: var(--color-ink); color: #fff; border-color: var(--color-ink);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOOLBAR / DIVIDER / GRID UTILITIES
═══════════════════════════════════════════════════════════════════════════ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row     { display: flex; align-items: center; gap: 8px; }
.col     { display: flex; flex-direction: column; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.muted   { color: var(--color-ink-muted-48); }
.divider { height: 1px; background: var(--color-hairline); margin: 14px 0; }
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: var(--form-grid-gap); }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--form-grid-gap); }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--form-grid-gap); }

/* Keyboard hint */
.kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border: 1px solid var(--color-hairline);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-ink-muted-48);
    background: var(--color-canvas-parchment);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUCCESS / WARNING / DANGER BANNERS — banner-shaped, hairline border.
═══════════════════════════════════════════════════════════════════════════ */
.banner-success, .nim-banner-success {
    background: var(--color-success-tint);
    border: 1px solid rgba(31, 138, 91, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--color-success);
    font-size: 13px; letter-spacing: -0.2px;
}
.banner-warning {
    background: var(--color-warning-tint);
    border: 1px solid rgba(178, 93, 0, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--color-warning);
}
.banner-danger {
    background: var(--color-danger-tint);
    border: 1px solid rgba(193, 18, 31, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--color-danger);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOCUS RING — system-wide.
═══════════════════════════════════════════════════════════════════════════ */
:focus-visible { outline-color: var(--color-primary-focus); }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
    outline: 2px solid var(--color-primary-focus);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ConfirmDialog modal — staff side. Uses .nim-modal-* prefix because the
   shared component (Components/ConfirmDialog.razor) emits these class names.
═══════════════════════════════════════════════════════════════════════════ */
.nim-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: nim-fade-in 0.18s ease-out;
}
.nim-modal {
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-product);
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: nim-slide-up 0.2s ease-out;
}
.nim-modal.nim-modal-lg { max-width: 640px; }
.nim-modal-header { padding: 20px 24px 12px; }
.nim-modal-icon-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.nim-modal-icon-tile {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nim-modal-icon-tile.nim-modal-icon-danger {
    background: var(--color-danger-tint);
    color: var(--color-danger);
}
.nim-modal-icon-tile.nim-modal-icon-warning {
    background: var(--color-warning-tint);
    color: var(--color-warning);
}
.nim-modal-icon-tile.nim-modal-icon-info {
    background: var(--color-info-tint);
    color: var(--color-primary);
}
.nim-modal-icon-tile.nim-modal-icon-neutral {
    background: rgba(122, 122, 122, 0.10);
    color: var(--color-ink-muted-48);
}
.nim-modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    margin: 0 0 4px;
}
.nim-modal-subtitle {
    font-size: 13px;
    color: var(--color-ink-muted-48);
    letter-spacing: -0.2px;
    line-height: 1.4;
    margin: 0;
}
.nim-modal-body { padding: 12px 24px 20px; }
.nim-modal-message {
    font-size: 13px;
    color: var(--color-ink-muted-48);
    letter-spacing: -0.2px;
    line-height: 1.5;
    margin: 0 0 14px;
}
.nim-modal-message:last-child { margin-bottom: 0; }
.nim-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 20px;
    background: var(--color-canvas-parchment);
    border-top: 1px solid var(--color-hairline);
}
.nim-btn-destructive {
    background: var(--color-danger) !important;
    color: #fff !important;
    border-color: var(--color-danger) !important;
}
.nim-btn-destructive:hover:not(:disabled) {
    background: #a30e1a !important;
    border-color: #a30e1a !important;
}
@keyframes nim-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nim-slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   nim-* LEGACY ALIASES — keep pre-v3 markup rendering. These resolve to
   the new visual but the names are deprecated.
═══════════════════════════════════════════════════════════════════════════ */
.nim-card        { background: var(--color-canvas); border: 1px solid var(--color-hairline); border-radius: var(--radius-lg); padding: 20px; }
.nim-card-elev   { background: var(--color-canvas); border: 1px solid var(--color-hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-product); }
.nim-btn         { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-hairline); background: #fff; color: var(--color-ink); font-size: 13px; cursor: pointer; }
.nim-btn:hover   { background: var(--color-canvas-parchment); }
.nim-btn-primary { background: var(--color-primary); color: #fff; border: 1px solid var(--color-primary); border-radius: var(--radius-pill); padding: 0 18px; height: 32px; font-size: 13px; }
.nim-btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.nim-btn-secondary { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); border-radius: var(--radius-pill); padding: 0 17px; height: 32px; }
.nim-pill        { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.nim-input       { width: 100%; height: 36px; padding: 0 12px; background: #fff; border: 1px solid var(--color-hairline); border-radius: var(--radius-sm); font-size: 13px; color: var(--color-ink); }
.nim-input:focus { border-color: var(--color-primary); box-shadow: var(--shadow-focus); outline: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   BOOTSTRAP COMPATIBILITY LAYER
   Bootstrap is no longer loaded. These rules provide Apple-styled equivalents
   for the Bootstrap classes still present in scaffolded Identity pages
   (Components/Account/**) and a handful of feature pages that use semantic
   Bootstrap markup. New code should not introduce these — use the Apple
   tokens and utility classes above.
═══════════════════════════════════════════════════════════════════════════ */

/* Grid (12-col, 24px gutter) */
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.row > [class*="col-"] { padding: 0 12px; }
[class*="col-"] { box-sizing: border-box; }
.col       { flex: 1 1 0; min-width: 0; }
.col-12,
.col-md-12,
.col-lg-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-6,
.col-lg-6,
.col-xl-6  { flex: 0 0 50%;  max-width: 50%; }
.col-md-4,
.col-lg-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-lg-3  { flex: 0 0 25%;  max-width: 25%; }
.col-lg-9  { flex: 0 0 75%;  max-width: 75%; }
.col-lg-offset-2 { margin-left: 16.666%; }
@media (max-width: 768px) {
    .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
}

/* Display utilities */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-block  { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none   { display: none; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-start   { justify-content: flex-start; }
.justify-content-end     { justify-content: flex-end; }
.justify-content-center  { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-start  { align-items: flex-start; }
.align-items-end    { align-items: flex-end; }
.align-items-center { align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Spacing (rem-based 0–5) */
.m-0 { margin: 0; }      .mt-0 { margin-top: 0; }     .mb-0 { margin-bottom: 0; }    .ms-0 { margin-left: 0; }    .me-0 { margin-right: 0; }
.m-1 { margin: 4px; }    .mt-1 { margin-top: 4px; }   .mb-1 { margin-bottom: 4px; }  .ms-1 { margin-left: 4px; }  .me-1 { margin-right: 4px; }
.m-2 { margin: 8px; }    .mt-2 { margin-top: 8px; }   .mb-2 { margin-bottom: 8px; }  .ms-2 { margin-left: 8px; }  .me-2 { margin-right: 8px; }
.m-3 { margin: 16px; }   .mt-3 { margin-top: 16px; }  .mb-3 { margin-bottom: 16px; } .ms-3 { margin-left: 16px; } .me-3 { margin-right: 16px; }
.m-4 { margin: 24px; }   .mt-4 { margin-top: 24px; }  .mb-4 { margin-bottom: 24px; } .ms-4 { margin-left: 24px; } .me-4 { margin-right: 24px; }
.m-5 { margin: 48px; }   .mt-5 { margin-top: 48px; }  .mb-5 { margin-bottom: 48px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-1 { margin-left: 4px; margin-right: 4px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mx-3 { margin-left: 16px; margin-right: 16px; }
.my-1 { margin-top: 4px; margin-bottom: 4px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-3 { margin-top: 16px; margin-bottom: 16px; }
.p-0 { padding: 0; }     .pt-0 { padding-top: 0; }    .pb-0 { padding-bottom: 0; }
.p-1 { padding: 4px; }   .p-2 { padding: 8px; }       .p-3 { padding: 16px; }        .p-4 { padding: 24px; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

/* Sizing */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.h-100 { height: 100%; }
.mw-100 { max-width: 100%; }
.mh-100 { max-height: 100%; }

/* Text */
.text-start  { text-align: left; }
.text-end    { text-align: right; }
.text-center { text-align: center; }
.text-muted     { color: var(--color-ink-muted-48); }
.text-secondary { color: var(--color-ink-muted-48); }
.text-info      { color: var(--color-primary); }
.text-danger    { color: var(--color-danger); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.fw-normal { font-weight: 400; }
.fw-bold   { font-weight: 600; }
.font-weight-bold { font-weight: 600; }
.fs-6 { font-size: 14px; }
.fs-5 { font-size: 17px; }

/* Headings */
h1, .h1 { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: 0; line-height: 1.10; margin: 0 0 12px; }
h2, .h2 { font-family: var(--font-text);    font-size: 28px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.25; margin: 0 0 12px; }
h3, .h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: 0.231px; line-height: 1.19; margin: 0 0 8px; }
h4, .h4 { font-family: var(--font-text);    font-size: 17px; font-weight: 600; letter-spacing: -0.2px; margin: 0 0 8px; }
h5, .h5 { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; margin: 0 0 6px; }
h6, .h6 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--color-ink-muted-48); margin: 0 0 6px; }

/* Form controls (input, select, textarea) */
.form-control,
.form-select {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    font-family: var(--font-text);
    font-size: 14px;
    letter-spacing: -0.1px;
    color: var(--color-ink);
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
textarea.form-control { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.form-control:hover, .form-select:hover { border-color: #c0c0c0; }
.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}
.form-control::placeholder { color: var(--color-ink-muted-48); }

.form-label, .control-label {
    display: block;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--color-ink-muted-48);
    margin-bottom: 6px;
}

/* Floating-label form group — used heavily by Identity scaffold */
.form-floating { position: relative; }
.form-floating > .form-control {
    height: 56px;
    padding: 18px 14px 6px;
    font-size: 15px;
}
.form-floating > label {
    position: absolute;
    top: 0; left: 14px;
    height: 100%;
    padding: 18px 0;
    pointer-events: none;
    transform-origin: 0 0;
    transition: transform 0.15s ease, color 0.12s ease;
    color: var(--color-ink-muted-48);
    font-size: 15px;
    text-transform: none;
    letter-spacing: -0.1px;
    font-weight: 400;
    margin: 0;
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.78) translateY(-7px);
    color: var(--color-primary);
}
.form-floating > .form-control:not(:focus):not(:placeholder-shown) ~ label {
    color: var(--color-ink-muted-48);
}

/* Form check (checkbox / radio) */
.form-check {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
    padding: 0;
}
.form-check-input {
    width: 16px; height: 16px;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.form-check-input:focus { outline: 2px solid var(--color-primary-focus); outline-offset: 2px; }
.form-check-label {
    font-size: 14px; letter-spacing: -0.1px;
    color: var(--color-ink);
    cursor: pointer;
}
.darker-border-checkbox.form-check-input { border: 1px solid #999; }
.checkbox { display: flex; align-items: center; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM VALIDATION — Nimbus v3 spec
   • Required marker: red asterisk after the label text via `.label .req` or
     `.label.required::after`. Inline error appears below the field, 12px
     danger-coloured, with a tiny dot leader for scannability.
   • Invalid input: red border + soft red focus-ring (matches success/focus
     pattern, no harsh outline).
   • Valid + modified: silent (we don't ship green checkmarks — vets do not
     need celebration micro-feedback).
   • Summary: danger-tinted banner above the form for cross-field errors.
═══════════════════════════════════════════════════════════════════════════ */
.label .req,
.label.required::after {
    color: var(--color-danger);
    font-weight: 600;
    margin-left: 2px;
}
.label.required::after { content: "*"; }

.validation-message,
.field-validation-error,
.text-danger.validation-message {
    display: block;
    color: var(--color-danger);
    font-size: 12px;
    letter-spacing: -0.12px;
    margin-top: 6px;
    line-height: 1.4;
}
.validation-message::before,
.field-validation-error::before {
    content: "•";
    margin-right: 6px;
    opacity: 0.7;
}
.validation-summary-errors {
    background: var(--color-danger-tint);
    border: 1px solid rgba(193, 18, 31, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--color-danger);
    font-size: 13px;
    margin-bottom: 14px;
}
.validation-summary-errors ul { margin: 0; padding-left: 18px; }

/* Valid + modified: no visual treatment — silent success. */
.valid.modified:not([type=checkbox]) { outline: none; }

/* Invalid input — soft red border + matching focus ring instead of the harsh
   1px outline that v2 shipped. Applies to inp / sel / input / textarea. */
.invalid,
.input.invalid,
.inp.invalid,
.sel.invalid,
textarea.input.invalid,
textarea.inp.invalid,
.form-control.invalid {
    border-color: var(--color-danger);
    outline: none;
    box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.12);
}
.invalid:focus,
.input.invalid:focus,
.inp.invalid:focus,
.sel.invalid:focus,
textarea.input.invalid:focus,
.form-control.invalid:focus {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.18);
}

/* Field-level error wrapper — when a chips/sex picker or other custom control
   sits in a `.field`, mark `.field-error` on the wrapper so children inherit
   the danger affordance. */
.field-error .chip { border-color: var(--color-danger); }
.field-error .label { color: var(--color-danger); }

/* Buttons (Bootstrap shape — already covered by .btn / .btn-primary above,
   but Identity templates use the shape `class="btn btn-primary"` which the
   .btn rule above does not flatten to a pill. Force the pill here.) */
.btn.btn-primary, .btn.btn-danger, .btn.btn-secondary {
    border-radius: var(--radius-pill);
    padding: 0 18px;
}
.btn.btn-lg { height: 42px; padding: 0 22px; font-size: 14px; }
.btn-link {
    background: transparent;
    border: none;
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
}
.btn-link:hover { text-decoration: underline; }

/* Alerts */
.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    letter-spacing: -0.2px;
}
.alert-success { background: var(--color-success-tint); border-color: rgba(31,138,91,0.25);  color: var(--color-success); }
.alert-info,
.alert-primary { background: var(--color-info-tint);    border-color: rgba(0,102,204,0.25);  color: var(--color-primary); }
.alert-warning { background: var(--color-warning-tint); border-color: rgba(178,93,0,0.25);   color: var(--color-warning); }
.alert-danger  { background: var(--color-danger-tint);  border-color: rgba(193,18,31,0.25);  color: var(--color-danger); }

/* Modal — components on the client use `.modal-header / .modal-body / .modal-footer`
   inside a scoped wrapper (e.g. `.ndl-drug-modal .modal-header`); these reset
   the Bootstrap defaults so the per-page CSS still works. */
.modal-dialog {
    width: 480px;
    max-width: calc(100% - 48px);
    margin: 5vh auto;
}
.modal-dialog.modal-lg { width: 720px; }
.modal-content {
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-product);
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--color-divider-soft);
}
.modal-title {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600; letter-spacing: -0.2px;
    margin: 0;
}
.modal-body { padding: 16px 22px; }
.modal-footer {
    padding: 14px 22px;
    background: var(--color-canvas-parchment);
    border-top: 1px solid var(--color-hairline);
    display: flex; justify-content: flex-end; gap: 8px;
}
.btn-close {
    width: 28px; height: 28px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 7px;
    color: var(--color-ink-muted-48);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; line-height: 1;
}
.btn-close:hover { background: var(--color-canvas-parchment); border-color: var(--color-hairline); color: var(--color-ink); }
.btn-close::before { content: "\00d7"; font-size: 18px; line-height: 1; }

/* Nav (pills, tabs) */
.nav { display: flex; gap: 4px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.nav-item { list-style: none; }
.nav-pills { gap: 4px; }
.nav-pills.flex-column { flex-direction: column; }
.nav-link {
    display: block;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 13px; font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: var(--color-canvas-parchment); }
.nav-link.active {
    background: rgba(0, 102, 204, 0.08);
    color: var(--color-primary);
}

/* Input group (unify with .form-control style) */
.input-group { display: flex; align-items: stretch; }
.input-group > .form-control { flex: 1 1 auto; min-width: 0; border-radius: 0; }
.input-group > .form-control:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.input-group > .form-control:last-child  { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.input-group > .form-control + .input-group-text,
.input-group > .input-group-text + .form-control { border-left: 0; }
.input-group-text {
    display: inline-flex; align-items: center;
    padding: 0 12px;
    background: var(--color-canvas-parchment);
    border: 1px solid var(--color-hairline);
    color: var(--color-ink-muted-80);
    font-size: 13px;
}
.input-group-append { display: inline-flex; }

/* Bootstrap glyphicon fallback (only used in Identity authenticator page) */
.glyphicon { display: inline-block; width: 14px; height: 14px; }
.glyphicon-warning-sign::before { content: "\26a0"; color: var(--color-warning); }

/* List utility (Identity pages) */
.list { padding-left: 18px; margin: 8px 0; }

/* Bootstrap .table → match Nimbus .tbl styling */
.table {
    width: 100%;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
.table > thead > tr > th {
    background: var(--color-canvas-parchment);
    border-bottom: 1px solid var(--color-hairline);
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--color-ink-muted-48);
    padding: 10px 14px;
    text-align: left;
}
.table > tbody > tr > td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-divider-soft);
    font-size: 13px; letter-spacing: -0.2px;
}
.table > tbody > tr:last-child > td { border-bottom: none; }
.table > tbody > tr:hover { background: var(--color-canvas-parchment); }

/* Form-horizontal — used by ExternalLogin.razor for inline-label layouts */
.form-horizontal .row { align-items: center; }

/* recovery-code (Identity ShowRecoveryCodes.razor) */
.recovery-code {
    display: inline-block;
    padding: 4px 8px;
    margin: 4px;
    background: var(--color-canvas-parchment);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-ink);
    letter-spacing: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADER + HOME LANDING — used by ~all routable pages.
═══════════════════════════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.page-header > div { min-width: 0; }
.page-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.1px;
    color: var(--color-ink);
    margin: 0;
    line-height: 1.15;
}
.page-sub {
    margin: 4px 0 0;
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink-muted-48);
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Tables — common in-row name cell */
.tbl-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-ink);
}

/* Home landing tile grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.home-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    color: var(--color-ink);
    text-decoration: none;
    transition: border-color 0.12s ease, transform 0.12s ease;
}
.home-card:hover {
    border-color: var(--color-primary);
    text-decoration: none;
    transform: translateY(-1px);
}
.home-card-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 6px;
}
.home-card-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-ink);
}
.home-card-desc {
    font-size: 12.5px;
    letter-spacing: -0.12px;
    color: var(--color-ink-muted-48);
    line-height: 1.43;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE LAYOUT UTILITIES — patterns shared by list/detail pages.
═══════════════════════════════════════════════════════════════════════════ */

/* Page header right-side actions (lighter alias for .page-actions) */
.actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── List table actions column ──────────────────────────────── */
.actions-col {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Icon button — small square button used in list row action columns */
.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--color-ink-muted-80);
    background: transparent;
    border: 1px solid var(--color-hairline);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.icon-btn svg { display: block; }
.icon-btn:hover {
    background: rgba(0, 102, 204, 0.07);
    color: var(--color-primary);
    border-color: rgba(0, 102, 204, 0.3);
}
.icon-btn:active { background: rgba(0, 102, 204, 0.14); }
.icon-btn:focus-visible {
    outline: 2px solid var(--color-primary-focus);
    outline-offset: 2px;
}

/* Toolbar overrides for the common card-toolbar pattern */
.card > .toolbar:first-child {
    margin: -4px -4px 16px;
    padding: 4px;
    border-bottom: 1px solid var(--color-divider-soft);
    padding-bottom: 14px;
}

/* Card-internal filter toolbar: search + chips + sort + primary action */
.card-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 16px;
}
.card-toolbar > .search-input { flex: 0 1 280px; min-width: 200px; }
.card-toolbar .chips { display: inline-flex; gap: 6px; }
.card-toolbar .chip { height: 32px; padding: 0 14px; font-size: 12px; }

/* Search-input wrapper — when used as a div containing an svg + input */
.search-input.grow { flex: 1 1 auto; }
.search-input > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--color-ink-muted-48);
    stroke-width: 2;
    pointer-events: none;
}
div.search-input,
span.search-input {
    position: relative;
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--radius-pill);
}
div.search-input > input,
span.search-input > input {
    flex: 1 1 auto;
    height: 36px;
    padding: 0 16px 0 38px;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-pill);
    font-family: var(--font-text);
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
div.search-input > input:focus,
span.search-input > input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

/* Loading + empty state shells */
.loading {
    padding: 48px 16px;
    text-align: center;
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink-muted-48);
}
.empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--color-ink-muted-48);
}
.empty h3, .empty h4 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--color-ink);
    margin: 0 0 6px;
}
.empty p {
    font-size: 13px;
    letter-spacing: -0.2px;
    margin: 0 0 16px;
    color: var(--color-ink-muted-48);
}
/* Empty-state pieces — class-based equivalents of the `.empty h3/p` children
   above, plus a centered glyph tile. Compose:
     <div class="empty">
       <div class="empty-glyph"><svg/></div>
       <div class="empty-title">No invoices yet</div>
       <p class="empty-sub">Create one to get started.</p>
     </div>
   `.empty-inline` switches to a left-aligned, tighter layout for in-card
   placeholders (vs the default centered page/section empty). */
.empty-glyph {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    border-radius: var(--radius-pill);
    background: var(--color-info-tint);
    color: var(--color-primary);
}
.empty-glyph svg { width: 24px; height: 24px; }
.empty-title {
    font-family: var(--font-display);
    font-size: 17px; font-weight: 600;
    color: var(--color-ink);
    margin: 0 0 6px;
}
.empty-sub {
    font-size: 13px; letter-spacing: -0.2px;
    color: var(--color-ink-muted-48);
    margin: 0 0 16px;
}
.empty-inline { padding: 12px 2px; text-align: left; }
.empty-inline .empty-glyph { margin-left: 0; margin-right: 0; }
/* In-card empty modifiers: `.is-centered` centers the muted line; `.is-italic`
   matches the italic prompt-state used by some pickers/legends. Compose:
   <div class="empty-inline is-centered">No matches.</div> */
.empty-inline.is-centered { text-align: center; }
.empty-inline.is-italic { font-style: italic; }

/* Small-input size modifier */
.inp-sm, .sel.inp-sm, .input.inp-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

/* When .toolbar contains a primary action group at the end */
.toolbar > .grow { flex: 1 1 auto; min-width: 0; }
.toolbar > .spacer { flex: 1 1 auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS — field grids used by Owner/Pet/Inventory/Estimate forms.
═══════════════════════════════════════════════════════════════════════════ */
/* Vertical stack of form cards. Canonical container for any OwnerForm /
   PetForm / Registration / settings-form sibling chain of `.card` elements.
   Owns the between-card gap so per-form scoped `*-card-stack` margin shims
   should be retired in favour of wrapping the cards in `.form-stack`. */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--form-card-gap);
}

.fields {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}
.field {
    flex: 1 1 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
}
.field-half     { flex: 1 1 calc(50% - 8px);    max-width: calc(50% - 8px); }
.field-third    { flex: 1 1 calc(33.333% - 11px); max-width: calc(33.333% - 11px); }
.field-quarter  { flex: 1 1 calc(25% - 12px);   max-width: calc(25% - 12px); }
.field-sixth    { flex: 1 1 calc(16.666% - 14px); max-width: calc(16.666% - 14px); }
.field .optional {
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-ink-muted-48);
    margin-left: 6px;
}
@media (max-width: 768px) {
    .field-half,
    .field-third,
    .field-quarter,
    .field-sixth { flex: 1 1 100%; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS — sub-section pieces (footer, section header).
═══════════════════════════════════════════════════════════════════════════ */
.card-section {
    padding: 18px 0;
    border-top: 1px solid var(--color-divider-soft);
}
.card-section:first-child {
    padding-top: 0;
    border-top: 0;
}
.card-section + .card-section { padding-bottom: 0; }
.card-footer {
    margin: 0 -20px -20px;
    padding: 14px 20px;
    background: var(--color-canvas);
    border: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-footer .list-pgn {
    flex: 1;
    padding-top: 0;
    padding-bottom: 0;
}
.range-label {
    font-size: 12px;
    color: var(--color-ink-muted-48);
    letter-spacing: -0.12px;
    white-space: nowrap;
    align-self: flex-end;
    padding-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BANNERS (alias of .banner-success/-warning/-danger above)
═══════════════════════════════════════════════════════════════════════════ */
.banner {
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    background: #fff;
}
.banner-info,
.banner.banner-info {
    background: var(--color-info-tint);
    border-color: rgba(0, 102, 204, 0.22);
    color: var(--color-primary);
}
.banner-danger,
.banner.banner-danger {
    background: var(--color-danger-tint);
    border-color: rgba(193, 18, 31, 0.24);
    color: var(--color-danger);
}
.banner-warning,
.banner.banner-warning {
    background: var(--color-warning-tint);
    border-color: rgba(178, 93, 0, 0.24);
    color: var(--color-warning);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BREADCRUMBS, CLICKABLE ROWS, EXTRA SIZES.
═══════════════════════════════════════════════════════════════════════════ */
/* Breadcrumb. Two placement variants:
   • `.page-crumb` — top-level utility. Use on detail pages that do NOT have
     a `.page-header` (e.g. when an identity card replaces the header).
   • `.crumb` — nested form. Use inside `.page-header > div` on pages that do
     have a header. Visually identical to `.page-crumb`; the extra rule below
     adds breathing room before the page title.
   Either form must come first inside its container so the spacing rules
   compose with surrounding utilities. */
.crumb,
.page-crumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-ink-muted-48);
    letter-spacing: -0.12px;
    margin-bottom: 6px;
}
.page-crumb { margin-bottom: 12px; }
.crumb a,
.page-crumb a {
    color: var(--color-ink-muted-48);
    text-decoration: none;
}
.crumb a:hover,
.page-crumb a:hover { color: var(--color-primary); text-decoration: underline; }
.crumb-sep {
    color: var(--color-ink-muted-48);
    opacity: 0.5;
}

/* Sticky form footer — primary save / cancel pair pinned to the bottom of
   long forms. Mirrors the elevated card surface so it reads as the "what
   happens next" affordance even when the form scrolls. Used by OwnerForm,
   PetForm, and the ConsultationEditor `.ce-footer` (kept as a local alias
   while the editor's two-pane shell still differs). */
.form-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 18px;
    margin: 18px 0 0;
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-product);
}
.form-footer .form-footer-left { margin-right: auto; }

.row-clickable { cursor: pointer; }
.row-clickable:hover { background: var(--color-canvas-parchment); }
.row-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    color: var(--color-ink-muted-48);
}

.btn.btn-xs, .btn-xs { height: 22px; padding: 0 8px; font-size: 11px; }

.pg-lbl {
    font-size: 12px;
    color: var(--color-ink-muted-48);
    letter-spacing: -0.12px;
    padding: 0 8px;
}

/* Stepper — `step-num`/`step-bar`/`step-label` BEM aliases (Registration page) */
.stepper .step-num,
.step-num {
    width: 22px; height: 22px;
    border-radius: var(--radius-pill);
    background: var(--color-canvas-parchment);
    border: 1px solid var(--color-hairline);
    color: var(--color-ink-muted-48);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
}
.step.active .step-num,
.stepper .step.active .step-num {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.step-bar {
    flex: 0 0 48px;
    height: 1px;
    background: var(--color-hairline);
}
.step-label {
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink-muted-48);
}
.step.active .step-label,
.stepper .step.active .step-label {
    color: var(--color-ink);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS BUTTONS + INFO GRID + MODAL BACKDROP
═══════════════════════════════════════════════════════════════════════════ */
.btn-success,
.btn.btn-success {
    background: var(--color-success);
    color: #fff;
    border: 1px solid var(--color-success);
    border-radius: var(--radius-pill);
    padding: 0 18px;
    height: 32px;
    font-size: 13px;
}
.btn-success:hover, .btn.btn-success:hover { background: #176c46; border-color: #176c46; color: #fff; }

.btn-warning,
.btn.btn-warning {
    background: var(--color-warning);
    color: #fff;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-pill);
    padding: 0 18px;
    height: 32px;
    font-size: 13px;
}
.btn-warning:hover, .btn.btn-warning:hover { background: #8c4900; border-color: #8c4900; color: #fff; }

/* Banner alias */
.banner-warn { background: var(--color-warning-tint); border-color: rgba(178,93,0,0.24); color: var(--color-warning); }
.banner-success { background: var(--color-success-tint); border-color: rgba(31,138,91,0.22); color: var(--color-success); }

/* Detail-page info grid (Owner/Pet/Invoice/Estimate detail headers) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-ink-muted-48);
    margin-bottom: 4px;
}
.info-value {
    font-size: 14px;
    letter-spacing: -0.1px;
    color: var(--color-ink);
}

/* Modal backdrop (Bootstrap class) — when client-side modals use this */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
}
.modal-backdrop.show { opacity: 1; }

/* Generic flex utilities */
.grow   { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   x-btn (× close), .ta (textarea alias), .tabs (tab strip)
═══════════════════════════════════════════════════════════════════════════ */
.x-btn {
    width: 28px; height: 28px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 7px;
    color: var(--color-ink-muted-48);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; line-height: 1;
}
.x-btn:hover { background: var(--color-canvas-parchment); border-color: var(--color-hairline); color: var(--color-ink); }
.x-btn:focus-visible { outline: 2px solid var(--color-primary-focus); outline-offset: 2px; }

.ta {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
    font-family: var(--font-text);
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    outline: none;
    resize: vertical;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ta:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--color-hairline);
    margin-bottom: 16px;
}
.tabs .tab,
.tabs > a,
.tabs > button {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-ink-muted-48);
    cursor: pointer;
    text-decoration: none;
    margin-bottom: -1px;
}
.tabs .tab.active,
.tabs > a.active,
.tabs > button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}
.tabs .tab:hover,
.tabs > a:hover,
.tabs > button:hover { color: var(--color-ink); }

/* Segmented control — recessed parchment track with a flat white active pill.
   Interactive; prefer the <SegmentedControl> component. Compose directly as:
   <div class="seg"><button class="seg-item active">Clinical</button>…</div> */
.seg {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px;
    background: var(--color-canvas-parchment);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-sm);
}
.seg-item {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 5px 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 13px; font-weight: 600; letter-spacing: -0.2px;
    color: var(--color-ink-muted-48);
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}
.seg-item:hover:not(.active):not(:disabled) { color: var(--color-ink); }
.seg-item.active { background: var(--color-canvas); color: var(--color-primary); }
.seg-item:disabled { opacity: 0.5; cursor: not-allowed; }
.seg-item svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   LIST FORMATTING — flat grid on parchment (Nimbus v3)
   • Lists no longer sit inside a wrapping white card. The grid flows directly
     on the parchment background. Header row carries a parchment fill with a
     hairline above + below. Body rows are white with a soft divider between
     them and a parchment hover state.
   • Toolbar above the grid: search-input (grow) + filter chips + meta count
     pinned to the right.
   • Pagination footer below the grid: meta on the left, pill numbers + Prev/
     Next on the right.

   Use .list-page (page wrapper) + .list-toolbar + .list-grid + .list-pgn.
═══════════════════════════════════════════════════════════════════════════ */

.list-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0 14px;
}
.list-toolbar > .search-input { flex: 0 1 320px; min-width: 240px; }
.list-toolbar .chips { display: inline-flex; gap: 6px; }
.list-toolbar .chip { height: 32px; padding: 0 14px; font-size: 12px; }
.list-toolbar .chip .count {
    font-weight: 600;
    margin-left: 4px;
}
.list-toolbar .list-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--color-ink-muted-48);
    letter-spacing: -0.12px;
}

/* Self-contained rounded grid — sits directly on parchment (no wrapping
   `.card`). Carries its own white fill, hairline border, and 18px radius
   so the grid edges feel finished instead of bleeding into the page. */
.list-grid {
    width: 100%;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
.list-grid thead th {
    background: var(--color-canvas-parchment);
    border-bottom: 1px solid var(--color-hairline);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-ink-muted-48);
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}
.list-grid tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-divider-soft);
    font-size: 13px;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    vertical-align: middle;
}
.list-grid tbody tr { transition: background 0.12s ease; }
.list-grid tbody tr:hover td { background: var(--color-canvas-parchment); }
.list-grid tbody tr.row-clickable { cursor: pointer; }
.list-grid tbody tr:last-child td { border-bottom: 0; }

/* CSS-grid row variant — same rounded white surface, hairline-divided rows. */
.list-grid-rows {
    display: block;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.list-grid-rows .table-head {
    background: var(--color-canvas-parchment);
    border-top: 0;
    border-bottom: 1px solid var(--color-hairline);
}
.list-grid-rows .table-row {
    background: transparent;
    border-bottom: 1px solid var(--color-divider-soft);
    transition: background 0.12s ease;
}
.list-grid-rows .table-row:hover { background: var(--color-canvas-parchment); }
.list-grid-rows .table-row:last-child { border-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   NAV LIST — master/detail selectable rows (a clickable pane that drives a
   detail editor). NOT a data grid (use .tbl/.list-grid for tabular data).
   Compose: <div class="nav-list"><button class="nav-list-item active">…</button>…</div>
═══════════════════════════════════════════════════════════════════════════ */
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 13px; letter-spacing: -0.2px;
    color: var(--color-ink);
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}
.nav-list-item:hover:not(.active) { background: var(--color-canvas-parchment); }
.nav-list-item.active { background: var(--color-info-tint); color: var(--color-primary); }

/* Pagination footer — left (range + size selector) / right (page buttons).
   Replaces the older .pgn / .pg-btn pattern for flat lists. */
.list-pgn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 8px;
    flex-wrap: wrap;
    gap: 12px;
}
.list-pgn-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.list-pgn-range {
    font-size: 12px;
    color: var(--color-ink-muted-48);
    letter-spacing: -0.12px;
    white-space: nowrap;
}
.list-pgn-sep {
    font-size: 12px;
    color: var(--color-ink-muted-48);
}
.list-pgn-pages { display: inline-flex; align-items: center; gap: 6px; }
.list-pgn-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--color-hairline);
    color: var(--color-ink);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.list-pgn-btn:hover:not(:disabled):not(.is-active) {
    background: var(--color-canvas-parchment);
}
.list-pgn-btn.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.list-pgn-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.list-pgn-ellipsis {
    color: var(--color-ink-muted-48);
    padding: 0 4px;
    font-size: 13px;
}
.list-pgn-step { gap: 4px; }
.list-pgn-step .list-pgn-btn { padding: 0 14px; }
.list-pgn-size {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
.list-pgn-size .sel {
    height: 32px;
    padding: 0 28px 0 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-hairline);
    background-color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--color-ink);
    cursor: pointer;
}
/* Badge count inside status filter chips */
.chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.10);
    border-radius: 9999px;
    padding: 0 6px;
    min-width: 20px;
    height: 16px;
    font-size: 11px;
    line-height: 1;
    margin-left: 5px;
    font-variant-numeric: tabular-nums;
}
.chip-active .chip-count {
    background: rgba(255, 255, 255, 0.28);
}

/* ═══════════════════════════════════════════════════════════════════════════
   IDENTITY / ACCOUNT UI — auth card pattern + manage side-nav
   Mirrors the VetOS × Apple design pass for /Account/Login, /Register,
   /ForgotPassword, /ResetPassword, /AccessDenied, /Lockout, and the
   /Account/Manage/* settings hub.
═══════════════════════════════════════════════════════════════════════════ */

/* AuthLayout shell — parchment background, centred card */
.auth-shell {
    min-height: 100vh;
    background: var(--color-canvas-parchment);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.auth-brand-tile {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--color-ink);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.auth-brand-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--color-ink);
}
.auth-brand-tagline {
    font-size: 11px;
    color: var(--color-ink-muted-48);
    margin-top: 2px;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.1px;
    color: var(--color-ink);
    margin: 0 0 6px;
}
.auth-title-sm {
    font-size: 22px;
}
.auth-subtitle {
    font-size: 13px;
    color: var(--color-ink-muted-48);
    margin: 0 0 20px;
    line-height: 1.5;
}
.auth-subtitle-strong { color: var(--color-ink-muted-80); }
.auth-fineprint {
    text-align: center;
    font-size: 11px;
    color: var(--color-ink-muted-48);
    margin-top: 24px;
}
.auth-link-row {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
}
.auth-actions-row {
    display: flex;
    gap: 8px;
}
.auth-actions-row > .btn { flex: 1; justify-content: center; }

/* Inline "label · forgot-link" split header inside .field */
.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.label-row .label { margin-bottom: 0; }
.label-row .label-link {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.12px;
    color: var(--color-primary);
}
.label-row .label-link:hover { text-decoration: underline; }

/* Stretched primary action — for full-width auth + manage buttons */
.btn-full {
    width: 100%;
    justify-content: center;
}

/* Decorative icon tile above auth status copy (e.g. mail-check, lock) */
.auth-icon-tile {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.auth-icon-tile svg { width: 24px; height: 24px; stroke-width: 1.75; }
.auth-icon-tile.auth-icon-success { background: var(--color-success-tint); color: var(--color-success); }
.auth-icon-tile.auth-icon-danger  { background: var(--color-danger-tint);  color: var(--color-danger); }
.auth-icon-tile.auth-icon-warning { background: var(--color-warning-tint); color: var(--color-warning); }
.auth-icon-tile.auth-icon-info    { background: var(--color-info-tint);    color: var(--color-primary); }
.auth-icon-tile.auth-icon-neutral { background: rgba(0, 0, 0, 0.04);       color: var(--color-ink-muted-80); }

/* Inline "Invited by admin" pill at the top of Register */
.auth-eyebrow-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-info-tint);
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 16px;
}
.auth-eyebrow-pill svg { width: 12px; height: 12px; stroke-width: 2; }

/* "OR" divider used between password sign-in and passkey CTA */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--color-ink-muted-48);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-hairline);
}

/* Remember-me checkbox row */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    cursor: pointer;
    color: var(--color-ink);
}
.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Inline validation message below an .input — matches Nimbus inline-error */
.field-error-text {
    display: block;
    color: var(--color-danger);
    font-size: 12px;
    letter-spacing: -0.12px;
    margin-top: 6px;
    line-height: 1.4;
}

/* Manage-account two-column shell. Pairs with MainLayout's app-content. */
.manage-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 768px) {
    .manage-shell {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Side-nav for the manage hub — pill items, parchment hover, blue active */
.manage-side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.manage-side-nav-item {
    display: block;
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.2px;
    color: var(--color-ink);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.manage-side-nav-item:hover {
    background: var(--color-canvas-parchment);
    text-decoration: none;
    color: var(--color-ink);
}
.manage-side-nav-item.active {
    background: var(--color-info-tint);
    color: var(--color-primary);
    font-weight: 600;
}
@media (max-width: 768px) {
    .manage-side-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 4px;
        scroll-snap-type: x mandatory;
    }
    .manage-side-nav-item {
        flex-shrink: 0;
        scroll-snap-align: start;
    }
}

/* Password strength meter — 4 segments, success when full */
.pwd-strength {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}
.pwd-strength > span {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.1);
}
.pwd-strength > span.on { background: var(--color-success); }
.pwd-strength-label {
    font-size: 11px;
    margin-bottom: 20px;
    color: var(--color-ink-muted-48);
}
.pwd-strength-label.strong { color: var(--color-success); }

/* ---------------------------------------------------------------------------
   Number input spinbuttons — hidden globally.
   Reason: the native up/down arrows on <input type="number"> render
   inconsistently across browsers and clash with the Nimbus input aesthetic.
   Users edit numeric fields via direct typing; arrow-key increment still
   works without the visible chrome.
   --------------------------------------------------------------------------- */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.pwd-strength-label.weak   { color: var(--color-danger); }

/* ---------------------------------------------------------------------------
   Settings hub (sh-*) — shared card grid used by every /settings/* hub page.
   Lives globally because Blazor CSS isolation would otherwise force every
   sub-hub to redefine the same rules; previously the styles lived only in
   SettingsHome.razor.css and the icons rendered at default SVG size on any
   other hub (e.g. /settings/notifications).
   --------------------------------------------------------------------------- */
.sh-section {
    margin: 0 0 32px;
}
.sh-section:last-of-type {
    margin-bottom: 8px;
}
.sh-heading {
    font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "Open Sans", sans-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a7a7a;
    margin: 0 0 12px 4px;
    line-height: 1.2;
}
.sh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.sh-card {
    display: block;
    padding: 22px 22px 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
    min-height: 124px;
}
.sh-card:hover {
    background: var(--color-canvas-parchment);
    border-color: #c2c2c4;
    text-decoration: none;
}
.sh-card:focus-visible {
    outline: 2px solid #0071e3;
    outline-offset: 2px;
}
/* Generic Nimbus icon tile — 28x28 box wrapping a 24x24 SVG.
   Canonical for card/hub icons; used by .sh-card and any page that drops
   an inline SVG icon above a title. Sibling of .nim-modal-icon-tile
   (larger) and .auth-icon-tile (larger still). */
.nim-icon-tile {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d1d1f;
}
.nim-icon-tile svg {
    width: 24px;
    height: 24px;
    display: block;
}
.sh-card .nim-icon-tile {
    margin-bottom: 18px;
}
.sh-card-title {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 15px;
    letter-spacing: -0.1px;
    line-height: 1.3;
    margin-bottom: 4px;
}
.sh-card-desc {
    font-size: 13px;
    color: #7a7a7a;
    letter-spacing: -0.08px;
    line-height: 1.45;
}
