/* ============================================================
   FastPulse — design tokens
   Palette: CRM & Client Management (professional blue + deal green)
   Type: Inter (self-hosted, static/vendor/fonts/) — Data-Dense Dashboard density
   ============================================================ */

@font-face {
    font-family: 'Inter';
    src: url('/static/vendor/fonts/inter-var.woff2') format('woff2-variations'),
         url('/static/vendor/fonts/inter-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;

    /* --- Semantic tokens (light) ---
       Primary/ring follow the FastPulse brand violet (same as the login button)
       everywhere in the app — not just the login page. */
    --color-primary: #775ef6;
    --color-primary-hover: #6845f5;
    --color-primary-tint: #f1eefe;
    --color-on-primary-tint: #5b46c9;
    --color-on-primary: #ffffff;
    --color-accent: #059669;
    --color-accent-hover: #047857;
    --color-on-accent: #ffffff;

    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-raised: #ffffff;
    --color-foreground: #0f172a;
    --color-muted: #f1f5fd;
    --color-muted-foreground: #64748b;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;

    --color-destructive: #dc2626;
    --color-destructive-bg: #fef2f2;
    --color-warning: #b45309;
    --color-warning-bg: #fef3c7;
    --color-grace: #b3541e;
    --color-grace-bg: #ffe9d6;
    --color-success: #059669;
    --color-success-bg: #ecfdf5;
    --color-ring: #775ef6;

    /* Dashboard chart palette — validated with the dataviz skill's CVD/contrast
       checker (scripts/validate_palette.js), not reused from the badge tokens
       above: validating those turned up a real bug (--color-warning and
       --color-grace are ΔE 0.9 apart — nearly indistinguishable even with
       normal color vision). Flagged, not fixed here — out of scope for this
       change since it'd touch every badge across the app.
       Categorical triad (violet/blue/gold) passes CVD-safe adjacency in both
       modes; the status quad (good/warning/serious/critical) cannot ALL
       mutually clear the adjacency floor (3 warm hues can't be pairwise ≥15
       ΔE apart), so status counts render as separate labeled stat cards, not
       adjacent chart marks — sidesteps the adjacency requirement entirely
       per the skill's own "is it even a chart" checkpoint. */
    --chart-cat-1: #775ef6;
    --chart-cat-2: #0369a1;
    --chart-cat-3: #a16207;
    /* 4th categorical slice, added 2026-09-06 when Call Outcomes/Lead
       Pipeline grew from 3 to 4 items — Okabe-Ito's "bluish green," a
       peer-reviewed CVD-safe hue distinct from the violet/blue/gold triad
       above and from the red/orange status tokens below (so it never reads
       as a "bad" indicator by association). */
    --chart-cat-4: #009e73;
    --chart-status-good: #15803d;
    --chart-status-warning: #ca8a04;
    --chart-status-serious: #c2410c;
    --chart-status-critical: #dc2626;
    --chart-delta-up: #006300;
    --chart-delta-down: #dc2626;

    /* FastPulse wordmark's trailing dot — fixed brand color, exact match to
       docs/logo.png, not theme-adaptive like the semantic tokens above. */
    --color-brand-dot: #65d0eb;

    /* FastPulse marketing-site palette (the brand site) — sampled from docs/web-*.png.
       Used only for the login page's brand panel, which stays fixed-dark
       regardless of light/dark preference (brand imagery, not a UI surface). */
    --brand-bg: #08080c;
    --brand-surface: #0e0e16;
    --brand-foreground: #ffffff;
    --brand-muted: #9a9ab0;
    --brand-border: rgba(255, 255, 255, 0.08);
    --brand-cyan: var(--color-brand-dot);
    --brand-violet: var(--color-primary);
    --brand-violet-hover: #8b73ff;

    /* --- Legacy aliases (still referenced inline in a few templates) --- */
    --border: var(--color-border);
    --muted: var(--color-muted-foreground);
    --ok: var(--color-success);
    --warn: var(--color-warning);
    --danger: var(--color-destructive);
    --accent: var(--color-primary);
    --text: var(--color-foreground);
    --bg-alt: var(--color-muted);

    /* --- Typography --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;
    --leading-normal: 1.5;
    --leading-tight: 1.25;

    /* --- Spacing (dense-dashboard scale) --- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* --- Radius / shadow / motion --- */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --transition-fast: 140ms ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --color-primary: #8b73ff;
        --color-primary-hover: #a794ff;
        --color-on-primary: #ffffff;
        --color-accent: #10b981;
        --color-accent-hover: #34d399;
        --color-on-accent: #04160f;

        --color-bg: #0b1220;
        --color-surface: #111a2e;
        --color-surface-raised: #16223a;
        --color-foreground: #e2e8f0;
        --color-muted: #182338;
        --color-muted-foreground: #94a3b8;
        --color-border: #24304a;
        --color-border-strong: #33415f;

        --color-destructive: #f87171;
        --color-destructive-bg: #2a1414;
        --color-warning: #fbbf24;
        --color-warning-bg: #2c2410;
        --color-grace: #fb923c;
        --color-grace-bg: #2b1d10;
        --color-success: #34d399;
        --color-success-bg: #0f2a20;
        --color-ring: #8b73ff;

        --chart-cat-1: #8b73ff;
        --chart-cat-2: #0284c7;
        --chart-cat-3: #a16207;
        --chart-cat-4: #2dd4bf;
        --chart-status-good: #22c55e;
        --chart-status-warning: #eab308;
        --chart-status-serious: #f97316;
        --chart-status-critical: #f87171;
        --chart-delta-up: #0ca30c;
        --chart-delta-down: #f87171;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    }
}

/* ============================================================
   Reset & base
   ============================================================ */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-foreground);
    background: var(--color-bg);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: var(--leading-tight); font-weight: 600; margin: 0 0 var(--space-4); }
h1 { font-size: var(--text-xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-lg); }
h3 {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted-foreground);
    margin-top: var(--space-6);
}

a { color: var(--color-primary); }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--text-sm);
    background: var(--color-muted);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ============================================================
   Top navigation
   ============================================================ */

/* Fixed FastPulse-dark, same as the login page's brand panel — deliberately not
   theme-adaptive, so the brand strip reads identically in light and dark mode. */
.topnav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-3) var(--space-6);
    border-bottom: 1px solid var(--brand-border);
    background:
        radial-gradient(ellipse 480px 220px at 8% 0%, color-mix(in srgb, var(--brand-violet) 26%, transparent), transparent 70%),
        radial-gradient(ellipse 480px 220px at 96% 100%, color-mix(in srgb, var(--brand-cyan) 18%, transparent), transparent 70%),
        var(--brand-bg);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topnav .brand {
    font-weight: 800;
    font-size: var(--text-md);
    letter-spacing: -0.03em;
    color: var(--brand-foreground);
    text-decoration: none;
}

.brand-logo {
    font-weight: 800;
    font-size: var(--text-2xl);
    letter-spacing: -0.03em;
    color: var(--color-foreground);
    text-align: center;
    margin-bottom: var(--space-6);
}

.brand-dot { color: var(--color-brand-dot); }

.nav-links { display: flex; gap: var(--space-1); flex: 1; }

.nav-links a {
    color: var(--brand-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-links a:hover { color: var(--brand-foreground); background: rgba(255, 255, 255, 0.06); }
.nav-links a.active { color: var(--brand-cyan); background: color-mix(in srgb, var(--brand-cyan) 12%, transparent); }

.profile-menu { position: relative; }

.profile-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--brand-border);
    background: color-mix(in srgb, var(--brand-cyan) 18%, transparent);
    color: var(--brand-foreground);
    font-size: var(--text-sm);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.profile-avatar:hover { border-color: rgba(255, 255, 255, 0.3); background: color-mix(in srgb, var(--brand-cyan) 28%, transparent); }

.profile-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 10rem;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    z-index: 50;
}
.profile-dropdown a,
.profile-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-family: inherit;
    color: var(--color-foreground);
    text-decoration: none;
    cursor: pointer;
}
.profile-dropdown a:hover,
.profile-dropdown button:hover { background: var(--color-muted); }
.profile-dropdown form { margin: 0; }

/* ============================================================
   Page layout
   ============================================================ */

.page-content { max-width: 1200px; margin: 0 auto; padding: var(--space-6); }

/* ============================================================
   Tables — dense, row-hover, horizontal-scroll-safe
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    margin-top: var(--space-4);
}

table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table-wrap table { margin-top: 0; }

/* Explicit column widths (via <colgroup>) so columns spread evenly across
   the table's full width instead of auto-layout clustering them to content. */
table.table-fixed { table-layout: fixed; }
table.table-fixed td { overflow: hidden; text-overflow: ellipsis; }

th, td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

th {
    color: var(--color-muted-foreground);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--color-muted);
}

tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--color-muted); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   Badges — status dot + label, semantic color
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.2rem 0.65rem 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-active { background: var(--color-success-bg); color: var(--color-success); }
/* Class names match renewal_status()'s actual values ("expiring_soon",
   "grace_period") run through the templates' badge.replace('_', '-') —
   these were "badge-expiring"/"badge-grace" and never matched, so both
   states rendered unstyled everywhere a renewal-status badge appears. */
.badge-expiring-soon { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-grace-period { background: var(--color-grace-bg); color: var(--color-grace); }
.badge-suspended { background: var(--color-destructive-bg); color: var(--color-destructive); }

/* ============================================================
   Filter chips
   ============================================================ */

.chip {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-right: var(--space-2);
    margin-bottom: var(--space-2);
    cursor: pointer;
    text-decoration: none;
    color: var(--color-muted-foreground);
    background: var(--color-surface);
    transition: all var(--transition-fast);
}
.chip:hover { border-color: var(--color-border-strong); color: var(--color-foreground); }
.chip.active {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }

.btn.secondary { background: transparent; color: var(--color-primary); border-color: var(--color-border-strong); }
.btn.secondary:hover { background: var(--color-muted); border-color: var(--color-primary); }

.btn.danger { background: var(--color-destructive); border-color: var(--color-destructive); }
.btn.danger:hover { filter: brightness(0.92); }

.btn:disabled, .btn:disabled:hover {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-muted);
    color: var(--color-muted-foreground);
    border-color: var(--color-border);
    filter: none;
}

.btn.sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    min-height: 30px;
}

/* Page title + primary action on one line, title left, action right —
   used at the top of list pages (Organizations, Plans, etc.). */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.page-header h1 { margin: 0; }

/* ============================================================
   Banners
   ============================================================ */

.banner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    color: var(--color-foreground);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}
.banner::before { content: "\26A0"; color: var(--color-warning); font-size: var(--text-md); }
.banner.danger { background: var(--color-destructive-bg); border-color: var(--color-destructive); }
.banner.danger::before { color: var(--color-destructive); }
.banner a { font-weight: 600; }

/* ============================================================
   Stat tiles
   ============================================================ */

.stat-row { display: flex; gap: var(--space-4); margin: var(--space-4) 0; flex-wrap: wrap; }

.stat-tile {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
    min-width: 140px;
    flex: 1 1 140px;
    container-type: inline-size;
}
.stat-tile .value {
    /* Scales down for long values (e.g. "$562,000.00") in a narrow tile
       instead of overflowing the card; caps at --text-2xl for short ones. */
    font-size: clamp(1rem, 9cqi, var(--text-2xl));
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--color-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-tile .label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted-foreground);
    margin-top: var(--space-1);
}

.stat-tile .delta {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    font-size: var(--text-xs);
    font-weight: 600;
    margin-top: var(--space-1);
}
.stat-tile .delta.up { color: var(--chart-delta-up); }
.stat-tile .delta.down { color: var(--chart-delta-down); }
.stat-tile .delta.flat { color: var(--color-muted-foreground); }

/* ============================================================
   Profile page
   ============================================================ */


.profile-hero {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.profile-hero-avatar {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-on-primary);
    background: linear-gradient(135deg, var(--brand-cyan), var(--brand-violet));
}

.profile-hero-name { margin: 0 0 var(--space-2); }

.profile-role-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--color-muted);
    color: var(--color-muted-foreground);
}

.profile-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
}
.profile-card h3 { margin-top: 0; margin-bottom: var(--space-4); }
.profile-card form { margin: 0; }

.profile-info-grid { display: flex; flex-direction: column; }

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}
.profile-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-info-row:first-child { padding-top: 0; }

.profile-info-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted-foreground);
    white-space: nowrap;
}

.profile-info-value {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-foreground);
    text-align: right;
}

/* ============================================================
   Working Hours
   ============================================================ */

.hours-grid { display: flex; flex-direction: column; }

.hours-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}
.hours-row:last-child { border-bottom: none; padding-bottom: 0; }
.hours-row:first-child { padding-top: 0; }

.hours-day-label {
    flex: 0 0 140px;
    font-weight: 600;
    margin-bottom: 0;
}

.hours-input-wrap { flex: 1; }
.hours-input-wrap input { width: 100%; max-width: 320px; }

.hours-error {
    color: var(--color-destructive);
    font-size: var(--text-xs);
    margin: var(--space-1) 0 0;
}

/* ============================================================
   Dashboard — status stat cards + charts
   ============================================================ */

.status-stat-row { display: flex; gap: var(--space-4); margin: var(--space-4) 0; flex-wrap: wrap; }

.status-stat-card {
    flex: 1 1 140px;
    min-width: 140px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
    border-top: 3px solid var(--status-color);
}
.status-stat-card .value {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--color-foreground);
}
.status-stat-card .label {
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted-foreground);
    margin-top: var(--space-1);
}
.status-stat-card .label::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-color);
    flex-shrink: 0;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-4);
    margin: var(--space-4) 0;
}
.chart-grid.chart-grid-thirds { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.chart-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
}
.chart-card h3 { margin: 0 0 var(--space-3); }
.chart-card .chart-canvas-wrap { position: relative; height: 260px; }
.chart-card.chart-card-compact .chart-canvas-wrap { height: 200px; }

/* ============================================================
   Forms
   ============================================================ */

form.inline { display: inline-flex; align-items: center; gap: var(--space-2); }

input, select, textarea {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-family: inherit;
    color: var(--color-foreground);
    background: var(--color-surface);
    min-height: 36px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
textarea { min-height: 72px; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 25%, transparent);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    margin-bottom: var(--space-1);
    color: var(--color-muted-foreground);
}

.field { margin-bottom: var(--space-4); }
.field input, .field select, .field textarea { width: 100%; }

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-6);
    width: 560px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

/* Inline filter bars (Reports/Revenue date-range + dropdown filters) — each
   .field sits label-above-input, side by side, submit button baseline-aligned
   to the inputs rather than the labels. */
.filter-form { display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin: 0; }
.filter-form .field { margin-bottom: 0; }
.filter-form .field input, .filter-form .field select { width: auto; }

.modal-actions { display: flex; gap: var(--space-3); margin-top: var(--space-2); }

.modal-footnote { font-size: var(--text-xs); color: var(--color-muted-foreground); margin: var(--space-4) 0 0; }

/* Secondary org actions (type/status/API key/billing) stacked below the main
   edit form, inside the same modal — each a labeled block with a divider. */
.modal-section { border-top: 1px solid var(--color-border); margin-top: var(--space-6); padding-top: var(--space-2); }
.modal-section h3 { margin-top: 0; }
.modal-section-note { font-size: var(--text-sm); color: var(--color-foreground); margin: 0 0 var(--space-3); }

/* Select2 (timezone field) — light theme overlay to match our tokens instead
   of its default bootstrap-blue look. */
/* !important: select2 sets an inline `style="width: …"` on this element at
   init time, computed from the widest option's rendered text — without
   this, a field with long option text (e.g. the Book Viewing drawer's
   Listing picker: title + full address) visibly grows past its container
   the moment a long option is selected, since an inline style always beats
   a plain stylesheet rule. Forcing 100% here keeps every select2 field
   (Timezone/Country/Listing) at a fixed width regardless of option length —
   direct request 2026-09-11: "the dropdown expends its width which should
   not be happening the width should remain fixed." */
.select2-container { width: 100% !important; font-family: var(--font-sans); }
.select2-container--default .select2-selection--single {
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
    padding-left: var(--space-3);
    padding-right: var(--space-6);
    color: var(--color-foreground);
    font-size: var(--text-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 34px;
    right: var(--space-2);
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--color-muted-foreground) transparent transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--color-muted-foreground) transparent;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 25%, transparent);
    outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--color-muted-foreground);
}
.select2-dropdown {
    border-color: var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-md);
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-foreground);
    font-family: var(--font-sans);
    padding: var(--space-1) var(--space-2);
}
.select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: var(--color-primary);
}
.select2-results__option { color: var(--color-foreground); }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--color-primary);
    color: var(--color-on-primary);
}
.select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--color-muted);
}

[x-cloak] { display: none !important; }

/* ============================================================
   Misc
   ============================================================ */

.error { color: var(--color-destructive); font-size: var(--text-sm); margin-top: var(--space-2); }

/* ============================================================
   Auth layout — split brand panel + form panel (login page)
   ============================================================ */

.auth-layout {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    max-width: none;
}

.auth-brand-panel {
    position: relative;
    flex: 1 1 50%;
    max-width: 640px;
    background: var(--brand-bg);
    color: var(--brand-foreground);
    padding: var(--space-8) var(--space-8) var(--space-6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.auth-brand-glow {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--brand-violet) 28%, transparent), transparent 55%),
        radial-gradient(circle at 75% 75%, color-mix(in srgb, var(--brand-cyan) 18%, transparent), transparent 55%);
    pointer-events: none;
}

.auth-brand-inner { position: relative; max-width: 460px; margin: 0 auto; width: 100%; }

/* The FastPulse mark above the wordmark on the login panel. */
.auth-brand-mark {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
    margin: 0 0 var(--space-4) -10px;
}

.brand-logo-left {
    text-align: center;
    margin-bottom: 0;
}

.brand-logo-left {
    text-align: left;
    color: var(--brand-foreground);
    margin-bottom: var(--space-8);
}

.auth-tagline {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: var(--leading-tight);
    color: var(--brand-foreground);
    margin: 0 0 var(--space-3);
}

.auth-subtagline {
    font-size: var(--text-sm);
    color: var(--brand-muted);
    line-height: var(--leading-normal);
    margin-bottom: var(--space-8);
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.feature-card {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand-cyan) 15%, transparent);
    color: var(--brand-cyan);
    margin-bottom: var(--space-3);
}
.feature-icon svg { width: 16px; height: 16px; }

.feature-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-cyan);
    margin-bottom: var(--space-2);
}

.feature-heading {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--brand-foreground);
    text-transform: none;
    letter-spacing: normal;
    margin: 0 0 var(--space-1);
}

.feature-sub { font-size: var(--text-xs); color: var(--brand-muted); line-height: var(--leading-normal); margin: 0; }

.auth-form-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    padding: var(--space-6);
}

.auth-form-card { width: 100%; max-width: 380px; }
.auth-form-card h1 { margin-bottom: var(--space-2); }
.auth-form-subtitle { color: var(--color-muted-foreground); font-size: var(--text-sm); margin: 0 0 var(--space-6); }

/* Brand-matched focus ring for the login form specifically — violet, same
   accent as the Sign In button and brand panel, instead of the dashboard's
   generic blue ring used everywhere else. */
.password-input { position: relative; }
.password-input input { padding-right: 2.5rem; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: var(--space-2);
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: var(--space-1);
    color: var(--color-muted-foreground);
    cursor: pointer;
    display: flex;
    border-radius: var(--radius-sm);
}
.password-toggle:hover { color: var(--color-foreground); }
.password-toggle svg { width: 18px; height: 18px; }

.auth-submit { width: 100%; justify-content: center; margin-top: var(--space-2); }

/* Narrow screens: the whole page takes the dark brand background and glow.
   The white logo and the name sit at the top, centred, and the form is a
   white card below them. The tagline and the feature cards are left out. */
@media (max-width: 900px) {
    .auth-layout {
        flex-direction: column;
        background:
            radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand-violet) 30%, transparent), transparent 55%),
            radial-gradient(circle at 90% 100%, color-mix(in srgb, var(--brand-cyan) 18%, transparent), transparent 55%),
            var(--brand-bg);
    }
    .auth-brand-panel {
        flex: 0 0 auto;
        max-width: none;
        background: transparent;
        padding: var(--space-8) var(--space-4) var(--space-6);
    }
    .auth-brand-glow,
    .auth-tagline,
    .auth-subtagline,
    .auth-feature-grid { display: none; }
    .auth-brand-mark { width: 150px; margin: 0 auto var(--space-2); }
    .brand-logo-left { text-align: center; margin-bottom: 0; }
    .auth-form-panel {
        flex: 1 1 auto;
        align-items: flex-start;
        background: transparent;
        padding: 0 var(--space-4) var(--space-8);
    }
    .auth-form-card {
        max-width: 420px;
        background: var(--color-surface);
        border-radius: 16px;
        padding: var(--space-6);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    }
    /* Forgot and reset password have no brand panel, so the card needs room above it. */
    .auth-form-panel:first-child { padding-top: var(--space-8); }
}

@media (max-width: 640px) {
    .page-content { padding: var(--space-4); }
    .topnav { flex-wrap: wrap; padding: var(--space-3) var(--space-4); }
    .nav-links { order: 3; width: 100%; overflow-x: auto; }
    .auth-form-panel { padding: var(--space-4); }
}

/* ============================================================
   Admin UI Redesign (2026-09-08) — exact-match rebuild against
   qa/Admin-Modren/Admin Panel - Modern.dc.html. Admin screens use literal
   inline styles copied straight from that file (not our shared tokens) so
   the visual result matches precisely; these two classes exist only because
   inline style="" can't express :hover — same colors as the mockup's own
   style-hover attribute for each of these two repeated element types.
   Admin-only, new class names, nothing shared/org-side touched.
   ============================================================ */
.adm-seg-btn {
    background: none;
    color: #6c7387;
    border: none;
    border-radius: 7px;
    padding: 5px 11px;
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.adm-seg-btn:hover { color: #101322; }
.adm-seg-btn.active { background: var(--color-primary-tint); color: var(--color-on-primary-tint); font-weight: 600; }
.adm-seg-btn.active:hover { color: var(--color-on-primary-tint); }

.adm-ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #363c50;
    border: 1px solid #e8eaef;
    border-radius: 9px;
    padding: 0 12px;
    height: 34px;
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.adm-ghost-btn:hover { border-color: #d3d7e0; }

/* Mockup's container is 1360px vs our shared .page-content's 1200px — scoped
   to admin/finance sessions only via this body class (added in base.html),
   so org-side page width is untouched. */
body.admin-scope .page-content { max-width: 1360px; }

/* ------------------------------------------------------------
   Admin/finance header — entirely separate markup+CSS from .topnav
   (org-side keeps .topnav unchanged). Literal values from the mockup.
   ------------------------------------------------------------ */
.adm-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #0b0c12;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.adm-header-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    height: 54px;
    display: flex;
    align-items: center;
    gap: 22px;
}
.adm-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; letter-spacing: -0.03em; color: #ffffff; flex-shrink: 0; text-decoration: none; }
/* The FastPulse mark (static/brand/), beside the wordmark. The image is twice this size, for sharp screens. */
.adm-brand-mark { height: 42px; width: auto; display: block; }
.adm-brand-dot { color: var(--color-brand-dot); }
.adm-header-divider { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.1); flex-shrink: 0; }
.adm-nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.adm-nav-link {
    color: #9096a8;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 11px;
    border-radius: 7px;
    white-space: nowrap;
    text-decoration: none;
    transition: color 120ms ease, background 120ms ease;
}
.adm-nav-link:hover { color: #ffffff; background: rgba(255, 255, 255, 0.055); }
.adm-nav-link.active { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.adm-nav-link.active:hover { background: rgba(255, 255, 255, 0.1); }

.adm-icon-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 0 8px 0 10px;
    height: 32px;
    color: #9096a8;
    font-size: 12.5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 120ms ease;
}
.adm-icon-btn:hover { background: rgba(255, 255, 255, 0.11); color: #ffffff; }
.adm-kbd { border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 4px; padding: 1px 5px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; color: #7d8397; }
.adm-bell-btn { position: relative; width: 32px; height: 32px; padding: 0; justify-content: center; background: none; border: none; }
.adm-bell-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* Static on the admin bell (always present, decorative — admin has no
   notification data source). Dynamic on the org bell: hidden by default,
   shown+pulsing only while /org/notifications/badge (polled every 20s,
   see base.html) reports unassigned leads or unread messages — direct
   request, 2026-09-11: "keep changing color animation from current color
   to orange and than come back to current color." */
.adm-bell-dot { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--color-brand-dot); border: 1.5px solid #0b0c12; }
.adm-bell-dot--hidden { display: none; }
.adm-bell-dot--active { animation: adm-bell-pulse 1.6s ease-in-out infinite; }
@keyframes adm-bell-pulse {
    0%, 100% { background: var(--color-brand-dot); }
    50% { background: #d98324; }
}

.adm-notif-dropdown {
    position: absolute;
    top: 42px;
    right: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid #e8eaef;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 19, 34, 0.14);
    overflow: hidden;
    z-index: 60;
}
.adm-notif-head { font-size: 13px; font-weight: 650; padding: 12px 14px; border-bottom: 1px solid #f0f1f5; color: #101322; }
.adm-notif-empty { padding: 20px 14px; text-align: center; color: #8b91a3; font-size: 12.5px; }
.adm-notif-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f4f5f8;
    transition: background 120ms ease;
}
.adm-notif-row:last-child { border-bottom: none; }
.adm-notif-row:hover { background: #fafafc; }
.adm-notif-row-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.adm-notif-row-text { font-size: 12.5px; color: #101322; font-weight: 550; }

.adm-profile { position: relative; }
.adm-profile-trigger { display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; }
.adm-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-brand-dot), var(--color-primary));
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.adm-profile-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.adm-profile-name { color: #ffffff; font-size: 12.5px; font-weight: 600; }
.adm-profile-role { color: #7d8397; font-size: 11px; }
.adm-profile-dropdown {
    position: absolute;
    top: 42px;
    right: 0;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid #e8eaef;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 19, 34, 0.14);
    overflow: hidden;
    z-index: 60;
    padding: 6px;
}
.adm-profile-dropdown a, .adm-profile-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 7px;
    border: none;
    background: none;
    color: #363c50;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.adm-profile-dropdown a:hover, .adm-profile-dropdown button:hover { background: #f4f5f8; }

/* ------------------------------------------------------------
   Org detail / Admin User detail slide-in drawer — distinct from
   .modal-backdrop/.modal (org-side Lead/Booking/Listing detail modals keep
   using those, centered, unchanged). Reuses the generic Alpine modal()
   component (open/show/hide) and the #form-host swap target/id, so every
   existing hx-target="#form-host" fragment keeps working untouched.
   ------------------------------------------------------------ */
.adm-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 50;
    display: flex;
    justify-content: flex-end;
}
.adm-drawer {
    background: #ffffff;
    width: 480px;
    max-width: 92vw;
    height: 100%;
    box-shadow: 0 16px 40px rgba(16, 19, 34, 0.14);
    overflow-y: auto;
    padding: 24px;
    animation: adm-drawer-in 180ms ease;
}
@keyframes adm-drawer-in {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .adm-drawer { animation: none; }
}
.adm-drawer-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #e8eaef;
    margin: 0 0 20px;
}
.adm-drawer-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c7387;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 10px 11px;
    cursor: pointer;
}
.adm-drawer-tab:hover { color: #101322; }
.adm-drawer-tab.active { color: #101322; border-bottom-color: var(--color-primary); }

/* #form-host's content is cleared to blank right before each htmx swap
   (see base.html/dashboard.js callers) — that instant clear-then-pop-in
   read as a flicker. This class, re-triggered on every swap (see
   dashboard.js), gives the new content a short slide instead, matching
   .adm-drawer's own open animation above. */
.adm-drawer-tab-slide-in { animation: adm-drawer-tab-in 160ms ease; }
@keyframes adm-drawer-tab-in {
    from { transform: translateX(10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .adm-drawer-tab-slide-in { animation: none; }
}

/* Organizations list page */
.adm-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    color: #ffffff;
    border: 1px solid var(--color-primary);
    border-radius: 9px;
    padding: 0 13px;
    height: 34px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(119, 94, 246, 0.35);
    text-decoration: none;
    box-sizing: border-box;
}
.adm-primary-btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

.adm-view-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c7387;
    font-size: 13px;
    font-weight: 550;
    padding: 8px 10px 9px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
.adm-view-tab:hover { color: #101322; }
.adm-view-tab.active { border-bottom-color: var(--color-primary); color: #101322; font-weight: 600; }
.adm-view-count {
    font-size: 11px;
    font-weight: 600;
    color: #8b91a3;
    background: #f2f3f6;
    border-radius: 999px;
    padding: 1px 6px;
}
.adm-view-count.active { color: var(--color-on-primary-tint); background: var(--color-primary-tint); }

.adm-select {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e8eaef;
    border-radius: 9px;
    background: #ffffff;
    font-size: 12.5px;
    color: #363c50;
    cursor: pointer;
}

.adm-th-sort {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #eceef3;
    background: #fcfcfd;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
    color: #6c7387;
    cursor: pointer;
    user-select: none;
}
.adm-th-sort:first-child { padding-left: 16px; }
.adm-th-sort:hover { color: #101322; }

.adm-row-clickable { cursor: pointer; background: #ffffff; }
.adm-row-clickable:hover { background: #fafbfd; }

.adm-row-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
}

.adm-page-btn {
    background: #ffffff;
    color: #363c50;
    border: 1px solid #e8eaef;
    border-radius: 8px;
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}
.adm-page-btn:hover { border-color: #d3d7e0; }
.adm-page-btn.disabled { color: #8b91a3; cursor: not-allowed; pointer-events: none; }

/* Org/User detail drawer content (Overview/Billing/Activity tabs) */
.adm-drawer-close {
    background: none;
    border: none;
    color: #8b91a3;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 17px;
    cursor: pointer;
    flex-shrink: 0;
}
.adm-drawer-close:hover { background: #f4f5f8; color: #101322; }

.adm-drawer-stat {
    background: #fafbfc;
    border: 1px solid #f0f1f5;
    border-radius: 11px;
    padding: 12px 14px;
}
.adm-drawer-stat-label { font-size: 11.5px; color: #8b91a3; font-weight: 550; }
.adm-drawer-stat-value { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 3px; }

.adm-drawer-section-label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8b91a3;
    margin-bottom: 10px;
}

/* New Organization drawer's Plan picker — radio-style selectable rows,
   matching qa/Admin-Modren/Admin Panel - Modern.dc.html's own createPlans
   list, using a real <input type="radio"> (native keyboard/label support)
   instead of the mockup's Alpine-style onClick state. */
.adm-plan-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid #e8eaef;
    background: #ffffff;
    cursor: pointer;
}
.adm-plan-option:hover { border-color: #d3d7e0; }
.adm-plan-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}
.adm-plan-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 4.5px solid #d3d7e0;
    background: #ffffff;
    transition: border-color 120ms ease;
}
.adm-plan-option:has(input:checked) { background: #f5f4fe; border-color: #c9bffb; }
.adm-plan-option:has(input:checked) .adm-plan-dot { border-color: var(--color-primary); }

/* Reminder card's status line: reserves space below the Send buttons only
   once it actually has text — empty, it collapses to nothing so the card's
   bottom padding matches its top (14px each), instead of the empty
   placeholder's own margin/min-height adding extra space underneath. */
.adm-reminder-status { margin-top: 8px; min-height: 1.2em; }
.adm-reminder-status:empty { margin-top: 0; min-height: 0; }

.adm-field-label { display: block; font-size: 12px; font-weight: 550; color: #6c7387; margin-bottom: 5px; }
.adm-field-input {
    width: 100%;
    height: 36px;
    padding: 8px 11px;
    border: 1px solid #e8eaef;
    border-radius: 9px;
    background: #ffffff;
    font-size: 13px;
    color: #101322;
    box-sizing: border-box;
}
/* Textareas ignore the fixed 36px height (they're given their own
   min-height inline) but still need the same padding so multi-line text
   doesn't touch the box's edges. */
textarea.adm-field-input { height: auto; }

.adm-mini-btn {
    background: #ffffff;
    color: #363c50;
    border: 1px solid #e8eaef;
    border-radius: 7px;
    height: 27px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
}
.adm-mini-btn:hover { border-color: #d3d7e0; }

.adm-danger-btn {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #f3d6d6;
    border-radius: 9px;
    height: 34px;
    padding: 0 13px;
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
}
.adm-danger-btn:hover { background: #fdf4f4; border-color: #e9b8b8; }

.adm-drawer-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f1f5;
}

/* Billing page's dark pill filter chips (distinct from Organizations' text
   view-tabs — this is the mockup's own visual choice for this one screen). */
.adm-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    color: #4a5064;
    border: 1px solid #e8eaef;
    border-radius: 999px;
    height: 32px;
    padding: 0 13px;
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.adm-chip:hover { border-color: #d3d7e0; color: #101322; }
.adm-chip.active { background: #101322; color: #ffffff; border-color: #101322; font-weight: 600; }
.adm-chip-count {
    font-size: 11px;
    font-weight: 600;
    color: #8b91a3;
    background: #f2f3f6;
    border-radius: 999px;
    padding: 1px 6px;
}
.adm-chip-count.active { background: rgba(255, 255, 255, 0.18); color: #ffffff; }

.adm-th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #eceef3;
    background: #fcfcfd;
    font-size: 11.5px;
    font-weight: 600;
    color: #6c7387;
    white-space: nowrap;
}
.adm-th:first-child { padding-left: 16px; }

/* Global Save/Save-changes toast (direct request 2026-09-12: "display a
   notification bar ... when we click Save or Save changes button any
   drawer on any interface"). Fixed, bottom-centered, above the drawer
   backdrop (z-index: 50) so it's visible even while a drawer is still
   open/closing. Created once by static/dashboard.js and reused for every
   toast — see showToast() there. */
.adm-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #101322;
    color: #ffffff;
    font-size: 13px;
    font-weight: 550;
    padding: 12px 22px;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(16, 19, 34, 0.28);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    white-space: nowrap;
}
.adm-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .adm-toast { transition: none; }
}

/* A problem with a drawer form, shown above its fields. */
.adm-form-error {
    background: #fdeeee;
    color: #c62222;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 550;
    margin-bottom: 14px;
}
/* A confirmation inside a drawer, such as "Payment recorded". */
.adm-form-notice {
    background: #e7f7f0;
    color: #04815a;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 550;
    margin-bottom: 14px;
}

/* Breadcrumb navigation above a detail page's title, e.g. Plans › Growth. */
.adm-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12.5px;
    margin-bottom: 6px;
}
.adm-breadcrumb a {
    color: #6c7387;
    font-weight: 550;
    text-decoration: none;
}
.adm-breadcrumb a:hover { color: var(--color-primary); }
.adm-breadcrumb-sep { color: #c9cdd8; }
.adm-breadcrumb-current { color: #101322; font-weight: 600; }

/* An inline confirmation in a table row, shown in place of its button. */
.adm-confirm-row { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* Organization interface (spec 04) ---------------------------------------- */
.adm-bell-btn { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.adm-bell-count { position: absolute; top: 1px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: var(--color-brand-dot); color: #ffffff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; border: 1.5px solid #0b0c12; }
.adm-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.adm-field-warning { font-size: 11px; color: #a54513; margin: 5px 0 0; line-height: 1.4; }
.adm-stage-bar { height: 8px; border-radius: 999px; background: #f0f1f5; overflow: hidden; }
.adm-stage-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--color-primary); }
@media (max-width: 760px) {
    .adm-dash-row { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Import document popup: the drop zone (spec 05, Asif 2026-10-21). */
.adm-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px 18px; border: 1.5px dashed #d5d8e1; border-radius: 12px; background: #fafbfc; color: #8b91a3; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.adm-dropzone:hover, .adm-dropzone.is-over { border-color: var(--color-primary); background: var(--color-primary-tint); }
.adm-dropzone-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.adm-dropzone:focus-within { outline: 2px solid var(--color-primary); outline-offset: 2px; }
