.form-control-opt {
    display: block;
    width: 100%;
    padding: 0.3125rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--falcon-gray-900);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--falcon-quaternary-bg);
    background-clip: padding-box;
    border: var(--falcon-border-width) solid var(--falcon-gray-300);
    border-radius: var(--falcon-border-radius);
    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
    -webkit-transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
    transition: border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
    -o-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .form-control-opt {
        -webkit-transition: none;
        -o-transition: none;
        transition: none;
    }
}

.form-control-opt[type=file] {
    overflow: hidden;
}

    .form-control-opt[type=file]:not(:disabled):not([readonly]) {
        cursor: pointer;
    }

.form-control-opt:focus {
    color: var(--falcon-gray-900);
    background-color: var(--falcon-quaternary-bg);
    border-color: var(--falcon-input-focus-border-color-global);
    outline: 0;
    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 0 0.25rem rgba(44, 123, 229, 0.25);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 0 0.25rem rgba(44, 123, 229, 0.25);
}

.form-control-opt::-webkit-date-and-time-value {
    min-width: 85px;
    height: 1.5em;
    margin: 0;
}

.form-control-opt::-webkit-datetime-edit {
    display: block;
    padding: 0;
}

.form-control-opt::-webkit-input-placeholder {
    color: var(--falcon-input-placeholder-color-global);
    opacity: 1;
}

.form-control-opt::-moz-placeholder {
    color: var(--falcon-input-placeholder-color-global);
    opacity: 1;
}

.form-control-opt:-ms-input-placeholder {
    color: var(--falcon-input-placeholder-color-global);
    opacity: 1;
}

.form-control-opt::-ms-input-placeholder {
    color: var(--falcon-input-placeholder-color-global);
    opacity: 1;
}

.form-control-opt::placeholder {
    color: var(--falcon-input-placeholder-color-global);
    opacity: 1;
}

.form-control-opt:disabled {
    background-color: var(--falcon-gray-200);
    opacity: 1;
}

.form-control-opt::file-selector-button {
    padding: 0.3125rem 1rem;
    margin: -0.3125rem -1rem;
    -webkit-margin-end: 1rem;
    margin-inline-end: 1rem;
    color: #d8e2ef;
    background-color: #344050;
    pointer-events: none;
    border-color: inherit;
    border-style: solid;
    border-width: 0;
    border-inline-end-width: var(--falcon-border-width);
    border-radius: 0;
    -webkit-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
    -o-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .form-control-opt::file-selector-button {
        -webkit-transition: none;
        -o-transition: none;
        transition: none;
    }
}

.form-control-opt:hover:not(:disabled):not([readonly])::file-selector-button {
    background-color: #344050;
}

.form-control-opt-plaintext {
    display: block;
    width: 100%;
    padding: 0.3125rem 0;
    margin-bottom: 0;
    line-height: 1.5;
    color: #5e6e82;
    background-color: transparent;
    border: solid transparent;
    border-width: var(--falcon-border-width) 0;
}

    .form-control-opt-plaintext:focus {
        outline: 0;
    }

    .form-control-opt-plaintext.form-control-opt-sm, .form-control-opt-plaintext.form-control-opt-lg {
        padding-right: 0;
        padding-left: 0;
    }

.form-control-opt-sm {
    min-height: calc(1.5em + 0.375rem + calc(var(--falcon-border-width) * 2));
    padding: 0.1875rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--falcon-border-radius-sm);
}

    .form-control-opt-sm::file-selector-button {
        padding: 0.1875rem 0.75rem;
        margin: -0.1875rem -0.75rem;
        -webkit-margin-end: 0.75rem;
        margin-inline-end: 0.75rem;
    }

.form-control-opt-lg {
    min-height: calc(1.5em + 0.75rem + calc(var(--falcon-border-width) * 2));
    padding: 0.375rem 1.25rem;
    font-size: 1.2rem;
    border-radius: var(--falcon-border-radius-lg);
}

    .form-control-opt-lg::file-selector-button {
        padding: 0.375rem 1.25rem;
        margin: -0.375rem -1.25rem;
        -webkit-margin-end: 1.25rem;
        margin-inline-end: 1.25rem;
    }

textarea.form-control-opt {
    min-height: calc(1.5em + 0.625rem + calc(var(--falcon-border-width) * 2));
}

textarea.form-control-opt-sm {
    min-height: calc(1.5em + 0.375rem + calc(var(--falcon-border-width) * 2));
}

textarea.form-control-opt-lg {
    min-height: calc(1.5em + 0.75rem + calc(var(--falcon-border-width) * 2));
}

.form-control-opt-color {
    width: 3rem;
    height: calc(1.5em + 0.625rem + calc(var(--falcon-border-width) * 2));
    padding: 0.3125rem;
}

    .form-control-opt-color:not(:disabled):not([readonly]) {
        cursor: pointer;
    }

    .form-control-opt-color::-moz-color-swatch {
        border: 0 !important;
        border-radius: var(--falcon-border-radius);
    }

    .form-control-opt-color::-webkit-color-swatch {
        border: 0 !important;
        border-radius: var(--falcon-border-radius);
    }

    .form-control-opt-color.form-control-opt-sm {
        height: calc(1.5em + 0.375rem + calc(var(--falcon-border-width) * 2));
    }

    .form-control-opt-color.form-control-opt-lg {
        height: calc(1.5em + 0.75rem + calc(var(--falcon-border-width) * 2));
    }

/* ── Stat card avatar icon centering fix ──
   Overrides Falcon theme's absolute-positioning on .avatar-name > span
   so icons sit centred in the circle on all stat/summary cards.        */
.stat-card-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.stat-card-icon > span {
    position: static !important;
    transform: none !important;
}


/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION ENHANCEMENTS
   Smooth collapse, active highlighting, hover effects, icon animations.
   ═══════════════════════════════════════════════════════════════════════ */

/* Smooth collapse transition (Falcon default is instant) */
.navbar-vertical-content .nav.collapse {
    transition: max-height 0.3s ease, opacity 0.25s ease;
}
.navbar-vertical-content .nav.collapsing {
    transition: height 0.3s ease;
}

/* Top-level nav link hover */
.navbar-vertical .nav-link {
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 1px 8px;
    position: relative;
}
.navbar-vertical .nav-link:hover {
    background: rgba(var(--falcon-primary-rgb), 0.06);
}

/* Active page link (17 Nov 2026): the page's name in brand ink and weight. No coloured bar and no tinted band - the
   generated look the owner ruled out; hover keeps its faint background (a state change, not a marker). */
.navbar-vertical .nav-link.active {
    font-weight: 600;
    color: var(--falcon-primary) !important;
}
.navbar-vertical .nav-link.active .nav-link-text {
    color: var(--falcon-primary);
}

/* Expanded parent link highlight */
.navbar-vertical .nav-link.dropdown-indicator[aria-expanded="true"] {
    color: var(--falcon-primary);
    font-weight: 600;
}
.navbar-vertical .nav-link.dropdown-indicator[aria-expanded="true"] .nav-link-icon {
    color: var(--falcon-primary);
}

/* Smooth chevron rotation (Falcon uses border-based chevron: 45deg=down, 225deg=up) */
.navbar-vertical .nav-link.dropdown-indicator::after {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

/* Nav link icon subtle animation on hover */
.navbar-vertical .nav-link-icon {
    transition: transform 0.2s ease, color 0.2s ease;
}
.navbar-vertical .nav-link:hover .nav-link-icon {
    color: var(--falcon-primary);
}

/* Sub-menu indent with subtle left border */
.navbar-vertical .nav .nav {
    border-left: 1px solid rgba(0,0,0,0.06);
    margin-left: 1.2rem;
    padding-left: 0;
}

/* Sub-menu item hover */
.navbar-vertical .nav .nav .nav-link {
    font-size: 0.83rem;
    padding: 0.35rem 0.75rem;
    margin: 0 4px;
}
.navbar-vertical .nav .nav .nav-link:hover {
    background: rgba(var(--falcon-primary-rgb), 0.04);
    padding-left: calc(0.75rem + 3px);
}

/* A group inside a group (Integrations > Portals > Parents (fees)) is a section label with its links at the label's own
   indent, never a further indented level (v2026.11.15). The selectors out-rank theme.css's per-depth padding. */
.navbar-vertical .navbar-nav .nav .nav .nav-item .nav-link.nav-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--falcon-gray-600, #748194);
    padding-top: 0.6rem;
    padding-bottom: 0.2rem;
    cursor: default;
    background: none;
}
.navbar-vertical .navbar-nav .nav .nav .nav-item .nav-link.nav-group-label:hover { background: none; }
.navbar-vertical .nav .nav .nav.nav-group-items {
    border-left: 0;
    margin-left: 0;
}
.navbar-vertical .navbar-nav .nav .nav .nav.nav-group-items .nav-item .nav-link {
    padding-left: 2.625rem;
}
.navbar-vertical .navbar-nav .nav .nav .nav.nav-group-items .nav-item .nav-link:hover {
    padding-left: calc(2.625rem + 3px);
}

/* Section divider between menu groups */
#navbarVerticalNav > li.nav-item + li.nav-item {
    border-top: 1px solid rgba(0,0,0,0.04);
    margin-top: 2px;
    padding-top: 2px;
}

/* Scrollbar styling for sidebar */
.navbar-vertical-content.scrollbar::-webkit-scrollbar {
    width: 4px;
}
.navbar-vertical-content.scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 4px;
}
.navbar-vertical-content.scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.2);
}

/* Wider sidebar so menu titles like "Package Upgrades" fit on one line */
@media (min-width: 1200px) {
    .navbar-vertical.navbar-expand-xl {
        max-width: 14.625rem;
    }
    .navbar-vertical.navbar-expand-xl .navbar-collapse,
    .navbar-vertical.navbar-expand-xl .navbar-vertical-content {
        width: 14.625rem;
    }
    .navbar-vertical.navbar-expand-xl + .content {
        margin-left: 17.625rem;
    }
    .navbar-vertical-collapsed-hover .navbar-vertical.navbar-expand-xl {
        width: 14.625rem;
    }
    .navbar-vertical-collapsed-hover .navbar-vertical.navbar-expand-xl .navbar-collapse {
        width: 14.625rem !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   PHONE MENU AS AN OVERLAY  (v2026.09.28)
   Below 1200px Falcon turns the sidebar into a collapse panel fixed under the
   top bar - with no backdrop, no way to dismiss it by tapping outside, and the
   page still scrolling underneath (measured: 300px of page scroll behind an
   open 656px menu). initMobileNavOverlay() in site.js adds the backdrop and
   sets html.crm-nav-open while the panel is open; these rules do the rest.
   The panel scrolls itself, because a locked page would otherwise leave an
   expanded group taller than the screen unreachable (the panel is
   overflow:hidden in theme.css).
   ═══════════════════════════════════════════════════════════════════════ */
.crm-nav-backdrop {
    display: none;
}
@media (max-width: 1199.98px) {
    #navbarVerticalCollapse.show,
    #navbarVerticalCollapse.collapsing {
        /* 4rem short of the bottom, so however far the groups are expanded there
           is always a strip of backdrop left to tap. */
        max-height: calc(100vh - var(--falcon-top-nav-height) - 4rem);
        max-height: calc(100dvh - var(--falcon-top-nav-height) - 4rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        /* Solid, in the page's own colour. Falcon's glass is 96% opaque with no blur
           on this panel, so the page's headings ghosted through the menu items. */
        background-color: var(--falcon-body-bg);
    }
    html.crm-nav-open,
    html.crm-nav-open body {
        overflow: hidden;
    }
    /* A soft brand-navy scrim, not a neutral grey: neutral black at 35% turned the
       page a dull grey and made the bright menu look pasted on. */
    html.crm-nav-open .crm-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: var(--z-mobile-nav-backdrop);
        background: rgba(var(--crm-brand-rgb), 0.18);
    }
    /* The bar spans the full screen, like the menu under it. Inset by the content
       padding, it left 12px strips at each side that the backdrop dimmed, so an
       open menu showed the bar framed in grey: a demarcation between bar and page.
       calc(50% - 50vw) reaches the viewport edge from the centred content column.
       100vw includes a classic (non-overlay) vertical scrollbar, so the bar was that much
       wider than the page and every page scrolled sideways by ~8px in a narrow desktop window;
       --crm-scrollbar-w (site.js, initScrollbarWidthVar) takes it back out. */
    .navbar-top {
        margin-left: calc(50% - 50vw + var(--crm-scrollbar-w, 0px) / 2);
        margin-right: calc(50% - 50vw + var(--crm-scrollbar-w, 0px) / 2);
        padding-left: 1rem;
        padding-right: 1rem;
    }
    /* The brand never gives up width to its neighbours: squeezed, "CSM" overflowed
       its own link and the search button sat on its last letter. */
    .navbar-top .navbar-brand {
        flex-shrink: 0;
    }
}
@media (max-width: 1199.98px) and (prefers-reduced-motion: no-preference) {
    html.crm-nav-open .crm-nav-backdrop {
        animation: crmNavBackdropIn 0.2s ease;
    }
}
@keyframes crmNavBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════
   SHARED PAGE COMPONENT STYLES
   Reusable CSS for list pages, log pages, detail modals, stat cards,
   filter sections, table styles, status badges, and actions menus.
   Supports crm-*, log-*, and sms-* prefixed class aliases.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Keyframe Animations ──
   Wrapped behaviour in `@media (prefers-reduced-motion: no-preference)`
   blocks further down so users that opt out (OS-level setting) don't
   see any of the entrance / shake / glow animations. */
/* @keyframes fadeInUp is defined ONCE, further down this file. A second,
   DIFFERENT copy used to sit here: duplicate @keyframes of the same name do not
   merge, the last one wins outright, so this copy rendered nowhere while looking
   authoritative. Removed 2026-09-18; the surviving definition is the one the app
   has actually been animating with, so nothing changes visually. */

/* @keyframes fadeInScale is defined ONCE, further down this file. A second,
   DIFFERENT copy used to sit here: duplicate @keyframes of the same name do not
   merge, the last one wins outright, so this copy rendered nowhere while looking
   authoritative. Removed 2026-09-18; the surviving definition is the one the app
   has actually been animating with, so nothing changes visually. */

/* @keyframes slideInRight is defined ONCE, further down this file. A second,
   DIFFERENT copy used to sit here: duplicate @keyframes of the same name do not
   merge, the last one wins outright, so this copy rendered nowhere while looking
   authoritative. Removed 2026-09-18; the surviving definition is the one the app
   has actually been animating with, so nothing changes visually. */

/* @keyframes pulseGlow is defined ONCE, further down this file. A second,
   DIFFERENT copy used to sit here: duplicate @keyframes of the same name do not
   merge, the last one wins outright, so this copy rendered nowhere while looking
   authoritative. Removed 2026-09-18; the surviving definition is the one the app
   has actually been animating with, so nothing changes visually. */

@keyframes headShake {
    0%   { transform: translateX(0); }
    6%   { transform: translateX(-6px) rotateY(-9deg); }
    18%  { transform: translateX(5px) rotateY(7deg); }
    30%  { transform: translateX(-3px) rotateY(-5deg); }
    42%  { transform: translateX(2px) rotateY(3deg); }
    54%  { transform: translateX(-1px) rotateY(-1deg); }
    66%  { transform: translateX(0); }
}
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
@keyframes paletteScaleIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes paletteFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Reduced-motion: kill all entrance animations and transitions over a
   threshold. Element opacity is reset to 1 so nothing stays invisible
   when its `opacity: 0` starting state would have animated to 1. */
@media (prefers-reduced-motion: reduce) {
    .crm-stat-card,
    .log-stat-card,
    .sms-stat-card,
    .crm-filter-section,
    .log-filter-section,
    .sms-filter-section,
    .crm-table-wrap,
    .log-table-wrap,
    .sms-table-wrap,
    .detail-row,
    .content-bubble,
    .narrative-bubble,
    .sms-text-bubble,
    .description-bubble,
    .section-card,
    .page-header-bar,
    .saved-views-bar {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .crm-modal-status .status-dot,
    .modal-status-pill .status-dot,
    .sms-modal-status .status-dot {
        animation: none !important;
    }
}

/* Same-session animation suppression: pages tagged with `data-session-warm`
   on <html> (set by site.js the second time a page loads in the session)
   skip entrance animations. First load = animated, subsequent loads in
   the same session = instant. Stops the "every page bounces" feeling. */
html[data-session-warm="true"] .crm-stat-card,
html[data-session-warm="true"] .log-stat-card,
html[data-session-warm="true"] .sms-stat-card,
html[data-session-warm="true"] .crm-filter-section,
html[data-session-warm="true"] .log-filter-section,
html[data-session-warm="true"] .sms-filter-section,
html[data-session-warm="true"] .crm-table-wrap,
html[data-session-warm="true"] .log-table-wrap,
html[data-session-warm="true"] .sms-table-wrap,
html[data-session-warm="true"] .page-header-bar,
html[data-session-warm="true"] .saved-views-bar,
html[data-session-warm="true"] .section-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* ── Stat Cards ── */
.crm-stat-card,
.log-stat-card,
.sms-stat-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    overflow: hidden;
    position: relative;
}
.crm-stat-card::after,
.log-stat-card::after,
.sms-stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}
.crm-stat-card:hover::after,
.log-stat-card:hover::after,
.sms-stat-card:hover::after { left: 100%; }
.crm-stat-card:hover,
.log-stat-card:hover,
.sms-stat-card:hover {
    border-color: var(--falcon-primary);
}
.crm-stat-card:nth-child(1), .log-stat-card:nth-child(1), .sms-stat-card:nth-child(1) { animation-delay: 0.05s; }
.crm-stat-card:nth-child(2), .log-stat-card:nth-child(2), .sms-stat-card:nth-child(2) { animation-delay: 0.10s; }
.crm-stat-card:nth-child(3), .log-stat-card:nth-child(3), .sms-stat-card:nth-child(3) { animation-delay: 0.15s; }
.crm-stat-card:nth-child(4), .log-stat-card:nth-child(4), .sms-stat-card:nth-child(4) { animation-delay: 0.20s; }
.crm-stat-card:nth-child(5), .log-stat-card:nth-child(5), .sms-stat-card:nth-child(5) { animation-delay: 0.25s; }
.crm-stat-card:nth-child(6), .log-stat-card:nth-child(6), .sms-stat-card:nth-child(6) { animation-delay: 0.30s; }
.crm-stat-card .avatar-name, .crm-stat-card .rounded-circle,
.log-stat-card .avatar-name, .log-stat-card .rounded-circle,
.sms-stat-card .avatar-name, .sms-stat-card .rounded-circle { transition: transform 0.3s ease; }
.crm-stat-card:hover .avatar-name, .crm-stat-card:hover .rounded-circle,
.log-stat-card:hover .avatar-name, .log-stat-card:hover .rounded-circle,
.sms-stat-card:hover .avatar-name, .sms-stat-card:hover .rounded-circle { }

/* ── Filter / Table Entrance Animations ── */
.crm-filter-section,
.log-filter-section,
.sms-filter-section {
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.35s forwards;
    position: relative;
    z-index: var(--z-raised);
}

/* Choices.js dropdown must render above tables, sticky headers and siblings */
.choices .choices__list--dropdown,
.choices .choices__list[aria-expanded] { z-index: var(--z-dropdown); }

/* ── Searchable select (.js-choice) = a .form-select, in every respect ──
   The theme's Choices skin ignored the size of the <select> it replaced: always 34.5px
   (a .form-select-sm next to it is 28.3px, a .form-control-sm 29px), a different arrow,
   the selected text in the faded placeholder colour, no focus ring, and the vendor's
   24px bottom margin. A filter row of mixed controls therefore never lined up, and a
   long option wrapped the box to two lines. These rules give the control the exact
   metrics of .form-select / -sm / -lg, read from theme.css, so a page may mix native and
   searchable selects and get one appearance. Size follows the class on the <select>:
   write .form-select-sm on it exactly as on a native select. */
.choices {
    margin-bottom: 0;
    /* theme.css's .form-select chevron (the same in both themes); defined here because the
       theme scopes it to .form-select, which the Choices wrapper is not. */
    --crm-select-chevron: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234d5969' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.choices[data-type*=select-one]::after { display: none; }          /* the chevron is the background below */
.choices[data-type*=select-one] .choices__inner {
    min-height: calc(1.5em + 0.625rem + 2 * var(--falcon-border-width));
    padding: 0.3125rem 2.5rem 0.3125rem 1rem !important;
    font-size: 1rem;
    line-height: 1.5 !important;
    color: var(--falcon-gray-900);
    background-image: var(--crm-select-chevron);
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    border-radius: var(--falcon-border-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.choices[data-type*=select-one] .choices__list--single { display: block; }
.choices[data-type*=select-one] .choices__list--single .choices__item {
    white-space: nowrap;                /* one line, like a native select: never wrap the box taller */
    overflow: hidden;
    text-overflow: ellipsis;
}
/* "All customers" / "-- Select --" is the selected value, not a hint: native selects show it in ink. */
.choices[data-type*=select-one] .choices__list--single .choices__placeholder { opacity: 1; }
.choices[data-type*=select-one].is-focused .choices__inner,
.choices[data-type*=select-one].is-open .choices__inner {
    border-color: var(--falcon-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--falcon-primary-rgb), 0.15);
}
.choices.is-open .choices__list--dropdown .choices__input { font-size: inherit; }
.choices .choices__list--dropdown .choices__item { word-break: normal; }

.choices[data-type*=select-one]:has(select.form-select-sm) { font-size: 0.875rem; }
.choices[data-type*=select-one]:has(select.form-select-sm) .choices__inner {
    min-height: calc(1.5em + 0.375rem + 2 * var(--falcon-border-width));
    padding: 0.1875rem 2.5rem 0.1875rem 0.75rem !important;
    font-size: 0.875rem;
    border-radius: var(--falcon-border-radius-sm);
}
.choices:has(select.form-select-sm) .choices__list--dropdown .choices__item,
.choices:has(select.form-select-sm) .choices__input { font-size: 0.875rem !important; }

.choices[data-type*=select-one]:has(select.form-select-lg) { font-size: 1.2rem; }
.choices[data-type*=select-one]:has(select.form-select-lg) .choices__inner {
    min-height: calc(1.5em + 0.75rem + 2 * var(--falcon-border-width));
    padding: 0.375rem 2.5rem 0.375rem 1.25rem !important;
    font-size: 1.2rem;
    border-radius: var(--falcon-border-radius-lg);
}
/* Validated: keep the chevron AND show the state icon left of it, as a native .form-select does. */
.was-validated .choices[data-type=select-one].valid .choices__inner,
.was-validated .choices[data-type=select-one].invalid .choices__inner {
    padding-right: 4.25rem !important;
    background-position: right 1rem center, right 2.25rem center !important;
    background-size: 16px 12px, calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
}
.was-validated .choices[data-type=select-one].valid .choices__inner {
    background-image: var(--crm-select-chevron), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2300d27a' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") !important;
}
.was-validated .choices[data-type=select-one].invalid .choices__inner {
    background-image: var(--crm-select-chevron), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23e63757'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23e63757' stroke='none'/%3e%3c/svg%3e") !important;
}
/* Native selects reserve the same 2.5rem as the searchable ones: the 16px chevron sits 1rem from
   the edge, so 2.5rem leaves a gap, while the theme's 3rem cut "Information" in a 4-column field. */
.form-select:not([multiple]):not([size]), .form-select[size="1"] { padding-right: 2.5rem; }

/* ── Date range filter (<crm-date-range>, Common/Components/DateRangeTagHelper.cs) ──
   From | to | To in one input group, two equal boxes. flatpickr's altInput leaves the real
   (hidden) input FIRST in the group, so Bootstrap's :first-child rules gave the rounded left
   corner and the zero offset to an invisible element: the visible box was square on the left
   and sat 1px outside the group. That applies to every input group holding a flatpickr
   input, so the corner rule is not scoped to the component. */
/* !important: Bootstrap's ".input-group > :not(:first-child):not(...)x5" outweighs any plain
   selector here, and this is precisely the element it gets wrong. */
.input-group > input[type="hidden"]:first-child + .form-control {
    margin-left: 0 !important;
    border-top-left-radius: var(--falcon-border-radius) !important;
    border-bottom-left-radius: var(--falcon-border-radius) !important;
}
.input-group-sm > input[type="hidden"]:first-child + .form-control,
.input-group > input[type="hidden"]:first-child + .form-control-sm {
    border-top-left-radius: var(--falcon-border-radius-sm) !important;
    border-bottom-left-radius: var(--falcon-border-radius-sm) !important;
}
.crm-date-range-group { flex-wrap: nowrap; }
.crm-date-range-group > .form-control:not([type="hidden"]) {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    text-overflow: ellipsis;
}
.crm-date-range-group > .input-group-text { padding: 0 0.5rem; font-size: 0.8125rem; }

/* An open select must paint above everything below it. Its list has --z-dropdown, but that only counts
   inside its own stacking context, and the filter section and cards create one (their entrance
   animation): the SMS Log Status list opened UNDER the results table's sticky header, and "All",
   "Success" and "Failed" could not be clicked. A native select never had this - the browser draws its
   list outside the page - so the searchable one must lift its containers while it is open. */
.crm-filter-section:has(.choices.is-open),
.filter-body:has(.choices.is-open),
.card:has(.choices.is-open),
.card-body:has(.choices.is-open),
.modal-body:has(.choices.is-open) {
    position: relative;
    z-index: var(--z-open-control);
}

/* ── Searchable select: the OPEN list (v2026.10.17) ──
   The closed control was given .form-select's metrics above; the open list never was, and kept the
   theme's vendor skin: the search box was borderless text on white, so "PAYE" read as the first
   option; the list sat on a second, grey background with a full-width navy bar for the highlight;
   the browser's own scrollbar; long labels cut mid-word; and "Choose..." offered as a value on a
   required field. The open list now looks like every other menu in the CRM (.dropdown-menu: the
   Actions kebab, the header overflow): one surface, a border, the theme radius and shadow, and
   rows with a tinted highlight. Tokens only, so the dark theme follows. */
.choices .choices__list--dropdown,
.choices .choices__list[aria-expanded] {
    margin-top: 0.25rem;
    padding: 0.375rem;
    background-color: var(--falcon-dropdown-bg-global) !important;
    border: var(--falcon-border-width) solid var(--falcon-border-color) !important;
    border-radius: var(--falcon-border-radius) !important;
    box-shadow: var(--falcon-box-shadow) !important;
    overflow: hidden;
}
/* The search box is a field, with a search icon - not a row of the list. */
.choices[data-type*=select-one] .choices__list--dropdown .choices__input,
.choices[data-type*=select-one] .choices__list[aria-expanded] .choices__input {
    display: block;
    width: 100% !important;
    margin: 0 0 0.375rem !important;
    padding: 0.375rem 0.75rem 0.375rem 2.125rem !important;
    color: var(--falcon-gray-900);
    background-color: var(--falcon-input-bg, var(--falcon-dropdown-bg-global)) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234d5969' stroke-linecap='round' stroke-width='1.8' d='m11 11 3.5 3.5M7 12.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 14px 14px;
    border: var(--falcon-border-width) solid var(--falcon-border-color) !important;
    border-radius: var(--falcon-border-radius-sm);
}
.choices[data-type*=select-one] .choices__list--dropdown .choices__input:focus {
    /* One ring, not two: the field's own border turns brand-coloured and the glow stays faint. */
    border-color: rgba(var(--falcon-primary-rgb), 0.6) !important;
    box-shadow: 0 0 0 0.125rem rgba(var(--falcon-primary-rgb), 0.1);
    outline: 0;
}
/* The rows: one surface, rounded, a tint for the highlighted row (mouse or keyboard), the current
   value in the brand colour. A long label wraps instead of being cut. */
.choices .choices__list--dropdown .choices__list {
    max-height: 18rem;
    scrollbar-width: thin;
    scrollbar-color: var(--falcon-gray-400) transparent;
}
.choices .choices__list--dropdown .choices__item--selectable,
.choices .choices__list--dropdown .choices__item--disabled,
.choices .choices__list--dropdown .has-no-choices,
.choices .choices__list--dropdown .has-no-results {
    padding: 0.375rem 0.75rem !important;
    background-color: transparent !important;
    color: var(--falcon-gray-900);
    border-radius: var(--falcon-border-radius-sm);
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}
.choices .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: rgba(var(--falcon-primary-rgb), 0.1) !important;
    color: var(--falcon-primary);
}
.choices .choices__list--dropdown .choices__item--selectable.is-selected {
    color: var(--falcon-primary);
    font-weight: 600;
}
.choices .choices__list--dropdown .has-no-choices,
.choices .choices__list--dropdown .has-no-results { color: var(--falcon-gray-600); }
/* "Choose..." is not a value of a required field: the empty option is not offered. */
.choices:has(select[required]) .choices__list--dropdown .choices__item--choice[data-value=""] { display: none; }

/* A removable value's clear (x) sits left of the chevron, not on it. */
.choices[data-type*=select-one] .choices__button { margin-right: 2.25rem !important; }
/* ...and the text stops before it, so a long value is cut with an ellipsis, not drawn under the x. */
.choices[data-type*=select-one] .choices__list--single .choices__item[data-deletable]:not([data-value=""]) { padding-right: 1.25rem; }
/* Visual container styling (pages with standalone filter blocks) */
.crm-filter-section {
    background: #f9fafd;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: var(--z-raised);
}

/* ── Data Table Wrapper ── */
.crm-table-wrap,
.log-table-wrap,
.sms-table-wrap {
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.4s forwards;
}

/* ── Table Row Styles ── */
.crm-table tbody tr,
.log-table tbody tr,
.sms-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}
.crm-table tbody tr:hover,
.log-table tbody tr:hover,
.sms-table tbody tr:hover {
    background-color: rgba(22, 83, 126, 0.04) !important;
}
.crm-table tbody tr:active,
.log-table tbody tr:active,
.sms-table tbody tr:active { transform: scale(0.998); }

/* ── Text Preview (truncated with eye icon on hover) ── */
.crm-table .text-preview,
/* Second line in a two-line log cell (client code + customer name). The cap is what
   makes .text-truncate work at all — without a width there is nothing to truncate. */
.log-table .client-name {
    max-width: 230px;
}

.log-table .text-preview,
.sms-table .text-preview {
    max-width: 220px;
    cursor: pointer;
    position: relative;
    color: var(--falcon-primary);
    font-weight: 500;
    transition: color 0.2s ease;
}
.crm-table .text-preview:hover,
.log-table .text-preview:hover,
.sms-table .text-preview:hover { color: var(--falcon-info); }
/* Eye icon on text-preview — inline <i> tag instead of ::after pseudo-element
   because Font Awesome SVG/JS mode doesn't support pseudo-element glyphs. */
.text-preview .text-preview-icon {
    font-size: 0.65rem;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: var(--falcon-primary);
}
.crm-table tbody tr:hover .text-preview .text-preview-icon,
.log-table tbody tr:hover .text-preview .text-preview-icon,
.sms-table tbody tr:hover .text-preview .text-preview-icon { opacity: 1; }

/* ── View Button (circular eye icon) ── */
.crm-view-btn,
.log-view-btn,
.sms-view-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--falcon-primary);
    color: var(--falcon-primary);
    background: transparent;
    font-size: 0.7rem;
    transition: all 0.25s ease;
    opacity: 0.5;
}
.crm-table tbody tr:hover .crm-view-btn,
.log-table tbody tr:hover .log-view-btn,
.sms-table tbody tr:hover .sms-view-btn { opacity: 1; }
.crm-view-btn:hover,
.log-view-btn:hover,
.sms-view-btn:hover {
    background: var(--falcon-primary);
    color: #fff;
}

/* ── Actions Dropdown (kebab menu) ── */
.actions-trigger {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9da9bb;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.crm-table tbody tr:hover .actions-trigger { color: #5e6e82; background: rgba(0,0,0,0.04); }
.actions-trigger:hover { color: var(--falcon-primary) !important; background: rgba(22, 83, 126, 0.08) !important; }
.actions-trigger:focus { box-shadow: none; }

.actions-dropdown {
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 0.4rem 0;
    min-width: 170px;
    background: #fff;
}
/* Row with open dropdown must sit above sibling rows whose hover transform creates stacking contexts */
.crm-table tbody tr:has(.dropdown-menu.show),
.log-table tbody tr:has(.dropdown-menu.show),
.sms-table tbody tr:has(.dropdown-menu.show),
/* ...and the same for an open searchable select in any table row (SettlementBanks' bank picker
   opened BEHIND the rows below it, and the table's scroll area cut its last options off). */
table tbody tr:has(.choices.is-open) {
    position: relative;
    /* The dropdown layer, not --z-raised: a list that opens UPWARD (Choices flips it near the bottom of the
       screen) has to clear the table's own sticky heading (--z-sticky-header). At --z-raised the headings
       were painted over the open list (Payment Providers, VAT and EFRIS services table, 07-Nov-2026). */
    z-index: var(--z-dropdown);
}

/* ── Dropdown clipping fix (root cause, applies to every list page) ──
   Action kebab menus live inside `.table-responsive` (overflow-x:auto) which
   establishes a clipping context: a menu opened on the LAST row — or on the
   only row of a short result set — is cut off by the wrapper/card edge and the
   actions become unreachable. While a menu is open we drop the clip on the
   scroll wrapper and every ancestor that would otherwise cut it. Horizontal
   scroll is only suspended for the moment the menu is open.
   Do NOT patch this per-page with bespoke z-index values — see CLAUDE.md §14.2. */
.table-responsive:has(.dropdown-menu.show),
.crm-table-wrap:has(.dropdown-menu.show),
.log-table-wrap:has(.dropdown-menu.show),
.sms-table-wrap:has(.dropdown-menu.show),
.card:has(.crm-table .dropdown-menu.show),
.card-body:has(.crm-table .dropdown-menu.show),
.table-responsive:has(.choices.is-open),
.crm-table-wrap:has(.choices.is-open),
.log-table-wrap:has(.choices.is-open),
.card:has(table .choices.is-open),
.card-body:has(table .choices.is-open) {
    overflow: visible !important;
}

/* The open menu itself sits on the dropdown layer of the shared z-scale. */
.crm-table .dropdown-menu.show,
.log-table .dropdown-menu.show,
.sms-table .dropdown-menu.show {
    z-index: var(--z-dropdown);
}

/* A short result set leaves no room below the last row; let the menu overhang
   the card instead of forcing the card to grow. */
.crm-table-wrap { overflow: visible; }
.actions-dropdown .dropdown-item {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
    background: #fff;
}
.actions-dropdown .dropdown-item:hover { background: rgba(22, 83, 126, 0.06); }
.actions-dropdown .dropdown-item .fas { width: 18px; text-align: center; }
.actions-dropdown .dropdown-divider { margin: 0.25rem 0; border-color: rgba(0,0,0,0.06); }
.actions-dropdown .dropdown-item.text-danger:hover { background: rgba(230, 55, 87, 0.06); }

/* ── Bulk action toolbar + row selection ──
   Shared by every list page with multi-select (Customers, Licenses,
   Subscriptions). Previously duplicated verbatim in each page's <style> block,
   which is how the three copies drifted apart. Paired with initBulkSelection()
   in site.js — keep the markup contract documented there. */
.bulk-action-bar {
    position: sticky;
    /* Below .navbar-top, never at viewport 0 — see --crm-sticky-offset. */
    top: var(--crm-sticky-offset);
    z-index: var(--z-sticky-header);
    background: var(--crm-gradient-brand);
    color: #fff;
    border-radius: var(--crm-radius);
    padding: 0.55rem 0.9rem;
    margin-bottom: 0.6rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--crm-shadow);
    animation: fadeInUp 0.25s ease;
}
.bulk-action-bar.show { display: flex; }
.bulk-action-bar .bulk-count { font-weight: 600; font-size: 0.82rem; }
.bulk-action-bar .bulk-count .count-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    padding: 1px 10px;
    border-radius: var(--crm-radius-pill);
    margin-right: 6px;
}
.bulk-action-bar .btn { margin-left: 6px; }
.bulk-action-bar .btn-bulk-clear {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
}
.bulk-action-bar .btn-bulk-clear:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .bulk-action-bar { animation: none; }
}

/* Row-selection checkbox column */
.col-select { width: 36px; text-align: center; }
.col-select label, .col-select input { cursor: pointer; }
.crm-row.row-selected { background-color: rgba(var(--crm-brand-rgb), 0.06); }
.crm-row.row-selected td { background: var(--crm-surface-2); }

/* ── Segmented control ──
   Two-or-more mutually exclusive modes (e.g. Single Date / Date Range). Shared
   so pages stop hand-rolling a toggle with their own hover and active states. */
.crm-segmented {
    display: inline-flex;
    background: var(--crm-surface-2);
    border-radius: var(--crm-radius);
    padding: 3px;
    gap: 2px;
}
.crm-segmented > button {
    padding: 6px 16px;
    border: none;
    border-radius: calc(var(--crm-radius) - 3px);
    background: transparent;
    color: var(--crm-ink-muted);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s var(--crm-ease), color 0.2s var(--crm-ease);
}
.crm-segmented > button.active {
    background: var(--crm-surface);
    color: var(--crm-ink-strong);
    box-shadow: var(--crm-shadow-sm);
}
.crm-segmented > button:hover:not(.active) { color: var(--crm-ink-strong); }
.crm-segmented > button:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 1px; }

/* ── Provenance badges (preview tables) ──
   "Is this row already in the system?" — used by the SchoolPay sync preview so
   an operator can see what a create-run would actually do before running it. */
.prov-badge {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--crm-radius-pill);
    white-space: nowrap;
}
.prov-badge.is-new      { background: var(--crm-success-soft); color: var(--crm-success-deep); }
.prov-badge.is-existing { background: var(--crm-surface-tint); color: var(--crm-ink-faint); }
.prov-badge.is-unknown  { background: var(--crm-surface-2);    color: var(--crm-ink-faint); }

/* ── Amount badge (monetary cell emphasis) ── */
.amount-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--crm-radius-sm);
    background: var(--crm-success-soft);
    color: var(--crm-success-deep);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── Subtle status pills (list rows) ──
   Shared by SubscriptionList / PlanList / CustomerList. Lives here rather than
   in a page <style> block so the palette stays consistent and theme-aware. */
.sub-pill {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--crm-radius-pill);
    white-space: nowrap;
}
.sub-pill.success   { background: var(--crm-success-soft); color: var(--crm-success-deep); }
.sub-pill.info      { background: rgba(var(--crm-brand-rgb), 0.12); color: var(--crm-brand); }
.sub-pill.warning   { background: var(--crm-warning-soft); color: var(--crm-warning-deep); }
.sub-pill.danger    { background: var(--crm-danger-soft);  color: var(--crm-danger-deep); }
.sub-pill.secondary { background: var(--crm-surface-tint); color: var(--crm-ink-faint); }

/* ── Days-remaining urgency pill ──
   A bare "341" and a bare "3" read identically, so an expiry that needs action
   today looks the same as one a year out. Encoding urgency as colour makes the
   "Expiring" header chip actionable at a glance. Thresholds mirror the
   ExpiringSoonCount window (14 days) plus a 30-day early warning. */
.days-pill {
    display: inline-block;
    min-width: 46px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 2px 8px;
    border-radius: var(--crm-radius-pill);
    background: var(--crm-surface-tint);
    color: var(--crm-ink-muted);
}
.days-pill.is-soon     { background: var(--crm-warning-soft); color: var(--crm-warning-deep); }
.days-pill.is-urgent   { background: var(--crm-danger-soft);  color: var(--crm-danger-deep); }
.days-pill.is-overdue  { background: var(--crm-grad-danger); color: #fff; }

/* ── Empty search / filter result state (rendered by CrmList) ── */
.crm-no-match-row td { border: none !important; background: transparent !important; }
.crm-no-match {
    text-align: center;
    padding: 2.25rem 1rem 2.5rem;
    color: var(--crm-ink-muted);
}
.crm-no-match-icon {
    display: block;
    font-size: 1.6rem;
    opacity: 0.35;
    margin-bottom: 0.6rem;
}
.crm-no-match-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--crm-ink);
    margin-bottom: 0.2rem;
}
.crm-no-match-hint { font-size: 0.8rem; }

/* ── Danger zone (destructive form actions) ──
   Irreversible actions must not sit in the same visual stack, at the same size,
   as routine ones — "Renew" and "Cancel immediately" reading identically is how
   mis-clicks happen. Collapsed by default; the operator opts in to seeing it. */
.danger-zone { border: 1px solid var(--crm-danger-soft); border-radius: var(--crm-radius); overflow: hidden; }
.danger-zone-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--crm-danger-soft);
    color: var(--crm-danger-deep);
    border: none;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.danger-zone-header .chevron { margin-left: auto; transition: transform 0.2s var(--crm-ease); }
.danger-zone-header[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.danger-zone-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Status Badges (gradient pills) ── */
.badge-status-active    { background: linear-gradient(135deg, #00d27a, #00b86b) !important; color: #fff !important; font-weight: 600; letter-spacing: 0.3px; }
.badge-status-inactive  { background: linear-gradient(135deg, #e63757, #d02a4a) !important; color: #fff !important; font-weight: 600; letter-spacing: 0.3px; }
.badge-status-success   { background: linear-gradient(135deg, #00d27a, #00b86b) !important; color: #fff !important; font-weight: 600; letter-spacing: 0.3px; }
.badge-status-failed    { background: linear-gradient(135deg, #e63757, #d02a4a) !important; color: #fff !important; font-weight: 600; letter-spacing: 0.3px; }
.badge-status-pending   { background: linear-gradient(135deg, #f5803e, #e8721c) !important; color: #fff !important; font-weight: 600; letter-spacing: 0.3px; }
.badge-status-cancelled { background: linear-gradient(135deg, #748194, #5e6e82) !important; color: #fff !important; font-weight: 600; letter-spacing: 0.3px; }
.badge-status-processed { background: linear-gradient(135deg, #2c7be5, #1a68d1) !important; color: #fff !important; font-weight: 600; letter-spacing: 0.3px; }

/* ── Detail Modal (house style, v2026.11.06) ──────────────────────────────
   ONE definition per selector. The shared detail window reads like a letterhead:
   a white header with the title in Poppins and a 2px brand rule under it, words
   carrying the state, facts as plain label/value pairs. The old navy gradient
   header (white text on a fill, radial glow pseudo-elements), the coloured icon
   tiles, the uppercase letter-spaced labels, the pulsing status dot and the
   spring scale-in were all removed here, so all 24 pages that mount it change
   with no page edit. Do not reintroduce a per-page copy of any of these. */
.crm-detail-modal .modal-content,
#detailModal .modal-content {
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius);
    overflow: hidden;
    background: var(--crm-surface);
    box-shadow: var(--crm-shadow-lg);
}
/* A short fade only. No scale, no spring. */
.crm-detail-modal .modal-dialog,
#detailModal .modal-dialog { transition: opacity 0.15s ease; transform: none; }
.crm-detail-modal.modal.fade .modal-dialog,
#detailModal.modal.fade .modal-dialog { transform: none; opacity: 0; }
.crm-detail-modal.modal.show .modal-dialog,
#detailModal.modal.show .modal-dialog { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .crm-detail-modal .modal-dialog,
    #detailModal .modal-dialog { transition: none; }
}

.detail-modal-header {
    background: var(--crm-surface);
    padding: 1.1rem 1.5rem 0.9rem;
    border-bottom: 2px solid var(--crm-brand);
    position: relative;
}
[data-bs-theme="dark"] .detail-modal-header { border-bottom-color: var(--crm-link); }
.detail-modal-header h5 {
    font-family: Poppins, var(--falcon-font-sans-serif, sans-serif);
    font-weight: 600; font-size: 1.05rem;
    color: var(--crm-ink-strong); margin: 0;
}
/* The one icon colour: the title's own icon is muted, never a second accent. */
.detail-modal-header h5 .fas,
.detail-modal-header h5 .far,
.detail-modal-header h5 .svg-inline--fa { color: var(--crm-ink-faint); }
.detail-modal-header .modal-subtitle { color: var(--crm-ink-muted); font-size: 0.8rem; margin-top: 2px; }
/* A few headers still carry Bootstrap's white utilities from the dark-fill era;
   on the surface header they would be invisible, so they read as ink here. */
.detail-modal-header .text-white { color: var(--crm-ink-strong) !important; }
.detail-modal-header .text-white-50 { color: var(--crm-ink-muted) !important; }
.detail-modal-header .btn-close-modal {
    background: transparent;
    border: none; color: var(--crm-ink-faint);
    width: 32px; height: 32px;
    border-radius: var(--crm-radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.9rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.detail-modal-header .btn-close-modal:hover { color: var(--crm-ink-strong); background: var(--crm-surface-2); }
.detail-modal-header .btn-close-modal:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 2px; }

.detail-modal-body { padding: 1.25rem 1.5rem; }

.detail-row {
    display: flex; align-items: flex-start;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--crm-rule-soft);
}
.detail-row:last-child { border-bottom: none; }

/* No coloured tile: a small muted icon, whatever bg-soft-* / text-* classes the
   page still puts on it (those utilities are !important, so this must be too). */
.detail-icon {
    width: 1.25rem; height: 1.25rem;
    display: flex; align-items: center; justify-content: center;
    margin-right: 0.6rem; margin-top: 0.15rem; flex-shrink: 0; font-size: 0.8rem;
}
.detail-row .detail-icon,
.detail-row .detail-icon[class*="bg-"],
.detail-row .detail-icon[class*="text-"] {
    background: transparent !important;
    color: var(--crm-ink-faint) !important;
    border-radius: 0;
}
.detail-label {
    font-size: 0.8rem; text-transform: none;
    letter-spacing: normal; color: var(--crm-ink-muted); font-weight: 400; margin-bottom: 1px;
}
.detail-value {
    font-size: 0.88rem; color: var(--crm-ink-strong);
    font-weight: 500; word-break: break-word;
    font-variant-numeric: tabular-nums;
}
/* Secondary line under a detail value, e.g. the customer name beneath a client code.
   Quieter than the value it qualifies, so the identifier still leads. */
.detail-subvalue {
    font-size: 0.78rem; color: var(--crm-ink-muted);
    font-weight: 400; margin-top: 1px; word-break: break-word;
}

/* ── Modal Status Pill ── a quiet pill: the word carries the state, the colour
   sits on the text and a small static dot. No glow, no pulse. */
.crm-modal-status,
.modal-status-pill,
.sms-modal-status,
.pmt-modal-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px; border-radius: var(--crm-radius-pill);
    font-size: 0.8rem; font-weight: 500;
    background: var(--crm-surface-2);
    border: 1px solid var(--crm-rule-soft);
    color: var(--crm-ink-muted);
}
.crm-modal-status.active, .modal-status-pill.active,
.crm-modal-status.success, .modal-status-pill.success,
.sms-modal-status.success, .pmt-modal-status.success { color: var(--crm-success-deep); }
.crm-modal-status.inactive, .modal-status-pill.inactive,
.crm-modal-status.failed, .modal-status-pill.failed,
.sms-modal-status.failed, .pmt-modal-status.failed { color: var(--crm-danger-deep); }
.crm-modal-status.pending, .modal-status-pill.pending,
.pmt-modal-status.pending { color: var(--crm-warning-deep); }
.crm-modal-status.cancelled, .modal-status-pill.cancelled,
.crm-modal-status.secondary, .modal-status-pill.secondary,
.pmt-modal-status.other { color: var(--crm-ink-muted); }
.crm-modal-status .status-dot,
.modal-status-pill .status-dot,
.sms-modal-status .status-dot,
.pmt-modal-status .status-dot {
    width: 7px; height: 7px; border-radius: 50%; display: inline-block;
    background: currentColor; animation: none !important; box-shadow: none !important;
}

.detail-modal-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--crm-rule-soft);
    display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.detail-modal-footer .detail-meta,
.detail-modal-footer .sms-meta { font-size: 0.75rem; color: var(--crm-ink-faint); }

/* ── Detail window building blocks (v2026.11.06) ──────────────────────────
   Driven by window.crmDetail in site.js. */

/* The verdict: one sentence saying what happened, with the only colour on the
   small status mark. data-tone = ok | warn | bad | unk. */
.detail-verdict {
    display: flex; align-items: flex-start; gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--crm-rule-soft);
    --detail-tone: var(--crm-ink-faint);
}
.detail-verdict[data-tone="ok"]   { --detail-tone: var(--crm-success-deep); }
.detail-verdict[data-tone="warn"] { --detail-tone: var(--crm-warning-deep); }
.detail-verdict[data-tone="bad"]  { --detail-tone: var(--crm-danger-deep); }
.detail-verdict[data-tone="unk"]  { --detail-tone: var(--crm-ink-faint); }
.detail-verdict-mark { color: var(--detail-tone); font-size: 1.1rem; margin-top: 0.1rem; flex-shrink: 0; }
.detail-verdict-text { color: var(--crm-ink-strong); font-size: 0.95rem; font-weight: 500; margin: 0; }
.detail-verdict-sub  { color: var(--detail-tone); font-size: 0.82rem; margin: 0.15rem 0 0; }
.detail-verdict-sub:empty,
.detail-verdict-sub[hidden] { display: none; }
@media (max-width: 575.98px) { .detail-verdict { padding: 0.85rem 1.1rem; } }

/* Facts: a plain two-column definition list, each fact once, no icons. */
dl.detail-facts {
    display: grid;
    grid-template-columns: 38% 1fr;
    margin: 0;
    font-size: 0.88rem;
}
dl.detail-facts > dt,
dl.detail-facts > dd {
    margin: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--crm-rule-soft);
}
dl.detail-facts > dt { color: var(--crm-ink-muted); font-weight: 400; padding-right: 0.75rem; }
dl.detail-facts > dd {
    color: var(--crm-ink-strong);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    min-width: 0;
}
dl.detail-facts > dt:last-of-type,
dl.detail-facts > dd:last-of-type { border-bottom: none; }
@media (max-width: 420px) {
    dl.detail-facts { grid-template-columns: 1fr; }
    dl.detail-facts > dt { border-bottom: none; padding-bottom: 0; }
    dl.detail-facts > dd { padding-top: 0.1rem; }
}

/* Technical details: gateway/webhook payloads, folded shut by default. */
details.detail-technical {
    margin-top: 1rem;
    border-top: 1px solid var(--crm-rule-soft);
    padding-top: 0.6rem;
}
details.detail-technical > summary {
    color: var(--crm-ink-muted);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--crm-radius-sm);
    padding: 0.2rem 0;
}
details.detail-technical > summary:hover { color: var(--crm-ink-strong); }
details.detail-technical > summary:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 2px; }
details.detail-technical > summary + * { margin-top: 0.6rem; }
details.detail-technical .response-parsed { margin-top: 0.6rem; }
details.detail-technical pre {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    max-height: 240px; overflow: auto;
    white-space: pre-wrap; overflow-wrap: anywhere;
    background: var(--crm-surface-tint);
    color: var(--crm-ink-strong);
    border-radius: var(--crm-radius);
    padding: 0.75rem 0.9rem;
}

/* Footer link buttons (open the record, open the trace, ...). */
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* ── Content Bubble (SMS text, narrative, description) ── a plain surface-tint
   block: no gradient, no thick coloured left border, no scale-in. */
.content-bubble,
.narrative-bubble,
.sms-text-bubble,
.description-bubble {
    background: var(--crm-surface-tint);
    border-radius: var(--crm-radius);
    padding: 0.85rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--crm-ink-strong);
    border: none;
    position: relative;
}

/* ── Bubble Copy Button ── */
.narrative-copy-btn,
.sms-copy-btn,
.bubble-copy-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: #fff;
    border: 1px solid #dde1e6;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.7rem;
    color: #748194;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}
.narrative-copy-btn:hover,
.sms-copy-btn:hover,
.bubble-copy-btn:hover {
    background: var(--falcon-primary);
    color: #fff;
    border-color: var(--falcon-primary);
}
.narrative-copy-btn.copied,
.sms-copy-btn.copied,
.bubble-copy-btn.copied {
    background: #00d27a;
    color: #fff;
    border-color: #00d27a;
}

/* ── Error List ── */
.error-list { max-height: 300px; overflow-y: auto; }
.error-list .error-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.82rem;
}
.error-list .error-item:last-child { border-bottom: none; }

/* ── Field Validation ── */
.field-error .form-select,
.field-error .form-control,
.field-error .choices { border-color: #e63757 !important; }
.field-error .choices__inner { border-color: #e63757 !important; }
.field-shake { animation: headShake 0.6s ease-in-out; }
.validation-msg {
    display: none;
    color: #e63757;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.validation-msg.show { display: block; opacity: 1; transform: translateY(0); }
.validation-msg .fas { margin-right: 4px; }
.form-label .text-danger { font-weight: 700; }

/* ── Copy Button (standalone) ── */
.crm-copy-btn {
    border: none;
    background: rgba(0,0,0,0.06);
    color: #5e6e82;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.crm-copy-btn:hover { background: rgba(0,0,0,0.1); color: #344050; }
.crm-copy-btn.copied { background: rgba(0, 210, 122, 0.15); color: #00b86b; }


/* ═══════════════════════════════════════════════════════════════════════
   COMPACT LIST PAGE OVERRIDES   (2026-05-13)

   The standard list-page chrome — page-header card with countup +
   illustrations, stat-card row, filter-pill row, advanced filter form,
   in-results search — was eating ~590px of vertical space before any data
   row was visible. These overrides compress every shared element so the
   grid starts closer to the top. Targets the existing class families
   (.crm-stat-card / .log-stat-card / .sms-stat-card, .crm-filter-section,
   etc.) so every list page that follows the standard inherits the new
   spacing automatically. No markup changes required on the page side.
   ═══════════════════════════════════════════════════════════════════════ */

/* Header card — the "<count> <entityTitle> List: <Type>" block with
   decorative illustrations and Add/Generate button. The Falcon defaults
   pad it to ~180px tall; tightening gets it under ~85px. */
.card > .card-header {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}
.card > .card-header img[src*="/illustrations/"] {
    max-height: 56px;
    width: auto !important;
}
.card > .card-header .display-0,
.card > .card-header .fs-0 {
    font-size: 1.4rem;
    margin-bottom: 0.15rem !important;
}
.card > .card-header h4 { font-size: 0.95rem; }

/* Stat cards — was ~110px tall, target ~38-44 px.
   Industry pattern (Linear, Notion, Stripe dashboards): every stat fits
   on a single inline row — icon + label + value all horizontal — so the
   whole "summary deck" collapses into one thin strip. We override the
   existing markup in-place: no page-side changes needed. */
.crm-stat-card .card,
.log-stat-card .card,
.sms-stat-card .card {
    /* Was a bare 8px - the only cards in the app not matching Falcon's 0.375rem,
       so List pages carrying a stat deck rendered two different corner radii side
       by side. --crm-radius-sm is 6px, i.e. the same curve as every other card. */
    border-radius: var(--crm-radius-sm);
}
.crm-stat-card .card-body,
.log-stat-card .card-body,
.sms-stat-card .card-body {
    padding: 0.35rem 0.7rem !important;
}
/* Make the avatar + text wrapper render as a single horizontal line.
   The avatar shrinks to a small chip, the h6/h4 stack collapses into
   inline-block siblings separated by a space. */
.crm-stat-card .card-body > .d-flex,
.log-stat-card .card-body > .d-flex,
.sms-stat-card .card-body > .d-flex {
    align-items: center !important;
    gap: 0.4rem;
}
.crm-stat-card .avatar.avatar-xl,
.log-stat-card .avatar.avatar-xl,
.sms-stat-card .avatar.avatar-xl {
    width: 1.7rem !important;
    height: 1.7rem !important;
    min-width: 1.7rem !important;
    min-height: 1.7rem !important;
    margin-right: 0.35rem !important;
    flex-shrink: 0;
}
.crm-stat-card .avatar.avatar-xl .avatar-name,
.log-stat-card .avatar.avatar-xl .avatar-name,
.sms-stat-card .avatar.avatar-xl .avatar-name {
    font-size: 0.72rem !important;
    line-height: 1.7rem !important;
    width: 1.7rem;
    height: 1.7rem;
}
.crm-stat-card .avatar.avatar-xl .fs-0,
.crm-stat-card .avatar.avatar-xl .fs-1,
.log-stat-card .avatar.avatar-xl .fs-0,
.log-stat-card .avatar.avatar-xl .fs-1,
.sms-stat-card .avatar.avatar-xl .fs-0,
.sms-stat-card .avatar.avatar-xl .fs-1 {
    font-size: 0.72rem !important;
}
/* Force the label + value pair to lay out on the same line. The card's
   markup is `<div><h6>Label</h6><h4>Value</h4></div>`; we make the inner
   div a flex row and shrink the headings to inline-friendly sizes. */
.crm-stat-card .card-body > .d-flex > div:last-child,
.log-stat-card .card-body > .d-flex > div:last-child,
.sms-stat-card .card-body > .d-flex > div:last-child {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}
.crm-stat-card h6,
.log-stat-card h6,
.sms-stat-card h6 {
    font-size: 0.7rem !important;
    margin-bottom: 0 !important;
    font-weight: 600;
    white-space: nowrap;
    color: var(--falcon-gray-700, #5e6e82) !important;
}
.crm-stat-card h4,
.log-stat-card h4,
.sms-stat-card h4 {
    font-size: 0.95rem !important;
    line-height: 1.1 !important;
    margin-bottom: 0 !important;
    font-weight: 700;
    white-space: nowrap;
}
/* Tighten the gap between the stat-card row and the next section. */
.card-body.bg-body-tertiary > .row.mb-4:has(.crm-stat-card),
.card-body.bg-body-tertiary > .row.mb-4:has(.log-stat-card),
.card-body.bg-body-tertiary > .row.mb-4:has(.sms-stat-card) {
    margin-bottom: 0.6rem !important;
}
/* Compact gutter between adjacent stat cards. */
.row:has(> .crm-stat-card),
.row:has(> .log-stat-card),
.row:has(> .sms-stat-card) {
    --bs-gutter-y: 0.35rem !important;
    --bs-gutter-x: 0.5rem !important;
}

/* .log-stat-card: label ABOVE the number, number sized by the card (v2026.10.29).
   The one-line layout above (icon + LABEL + number, all nowrap) needs ~230px, and a
   col-lg-2 card is ~155px at 1280 with the sidebar open; .log-stat-card's own
   overflow:hidden then cut the number ("CLEARANCE CARDS 6,4"). Stacking the label over
   the number, sizing the number from the card's width (cqi, like the page header's
   container query) and dropping the icon when the card is too narrow for it keeps every
   number whole at any width. Scoped to the icon + text markup (.card-body > .d-flex), so
   cards built differently (the help desk KPIs) keep their own layout. */
.log-stat-card .card-body {
    container-type: inline-size;
    container-name: statcard;
}
.log-stat-card .card-body > .d-flex > div:last-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}
.log-stat-card .avatar.avatar-xl {
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem !important;
    min-height: 1.5rem !important;
}
.log-stat-card .avatar.avatar-xl .avatar-name {
    font-size: 0.65rem !important;
    line-height: 1.5rem !important;
    width: 1.5rem;
    height: 1.5rem;
}
.log-stat-card .avatar.avatar-xl .fs-0,
.log-stat-card .avatar.avatar-xl .fs-1 {
    font-size: 0.65rem !important;
}
.log-stat-card .card-body > .d-flex h6 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.log-stat-card .card-body > .d-flex h4 {
    font-size: clamp(0.85rem, 8cqi, 1.15rem) !important;
    font-variant-numeric: tabular-nums;
}
@container statcard (max-width: 150px) {
    .log-stat-card .card-body > .d-flex > .avatar { display: none; }
}

/* Filter section — was ~250px (labels stacked over inputs, generous
   padding). Targets ~110px for the same fields, plus pages that adopt
   the .collapsible-filter pattern get to ~50px (header only) by default. */
.crm-filter-section {
    padding: 0.6rem 0.9rem !important;
    margin-bottom: 0.6rem !important;
}
.crm-filter-section .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.74rem;
    color: var(--falcon-gray-700);
    font-weight: 500;
}
.crm-filter-section .row.g-3 {
    --bs-gutter-y: 0.4rem;
    --bs-gutter-x: 0.6rem;
}
.crm-filter-section .row.mt-3 { margin-top: 0.5rem !important; }

/* Filter pill row (customer-type / status pills above the filter card).
   Drop a few px on the wrapping margin and the pill height. */
.filter-pill { padding: 4px 10px; font-size: 0.74rem; }
.filter-pill .pill-count { height: 16px; min-width: 20px; font-size: 0.65rem; }
.d-flex.flex-wrap.align-items-center.gap-2.mb-4 { margin-bottom: 0.6rem !important; }

/* In-results search row — sits between the filter card and the table.
   Tighten the bottom margin so it doesn't add another ~30px of air. */
.crm-table-wrap > .row.justify-content-end > .col-auto.mb-3,
.log-table-wrap > .row.justify-content-end > .col-auto.mb-3,
.sms-table-wrap > .row.justify-content-end > .col-auto.mb-3 {
    margin-bottom: 0.4rem !important;
}

/* Optional opt-in: pages that wrap their filter form inside
   `.crm-filter-section.collapsible-filter` start collapsed and reveal a
   compact header bar with a toggle. The toggle is wired via the standard
   Bootstrap data-bs-toggle="collapse" — no JS required on the page. */
.crm-filter-section.collapsible-filter {
    padding: 0 !important;
    border: 1px solid #e3e6ea;
    background: #f9fafd;
}
.crm-filter-section.collapsible-filter > .filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--falcon-gray-800);
}
.crm-filter-section.collapsible-filter > .filter-header:hover {
    background: rgba(44,123,229,0.04);
}
.crm-filter-section.collapsible-filter > .filter-header .chevron {
    transition: transform 0.2s ease;
}
.crm-filter-section.collapsible-filter > .filter-header[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}
.crm-filter-section.collapsible-filter > .filter-body { padding: 0.4rem 0.85rem 0.6rem; }

/* Small "active filter" badge that the collapsible header can show. */
.crm-filter-section.collapsible-filter .filter-active-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    background: var(--falcon-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 6px;
}


/* ═══════════════════════════════════════════════════════════════════════
   PAGE HEADER BAR  (2026-05-14)
   The 48px single-line header that replaces the old illustration-laden
   page-header card. Rendered by _PageHeader.cshtml. Industry standard
   ergonomics: title + count + inline stat chips + primary action.

   Layout:
   ┌────────────────────────────────────────────────────────────────────┐
   │ [icon] Title · count          ✓ stat  ⊘ stat   [search] [+ New]    │
   └────────────────────────────────────────────────────────────────────┘
   ═══════════════════════════════════════════════════════════════════════ */
.page-header-bar {
    /* v2026.09.18: the bar is its OWN query container. The constraint that truncated the
       title is the width of the CONTENT COLUMN (826px at a 1251px viewport with the
       sidebar open), which a viewport media query cannot see - the palette label was
       keyed on `d-md-inline`, i.e. 768px of VIEWPORT, and so stayed visible in a bar
       that had no room for it. Same class of mistake as CLAUDE.md 8E-bis's fixed
       min-width paired with the wrong breakpoint. Querying the container measures the
       real thing, sidebar state included. */
    container-type: inline-size;
    container-name: phbar;
    display: flex;
    align-items: center;
    /* v2026.09.18: wrap at EVERY width, not only under 768px. Above that breakpoint
       nothing wrapped, so a crowded bar took all its shrink out of .ph-title and the
       page title ellipsised to "Pr..." on Provider health and "Pay..." on the review
       queue - the page's own identity was the first thing sacrificed while decorative
       stat chips kept full width. Same lesson as the form action bar (CLAUDE.md 8E-bis). */
    flex-wrap: wrap;
    row-gap: 0.5rem;
    /* 0.85rem here was 13px more than the bar had to give at an 826px content column
       (needed 806 against 793 available), which forced the page action onto a second row
       and cost ~41px of vertical chrome on all 67 list pages. 0.55rem clears it with room
       to spare and reads the same at a glance. */
    gap: 0.55rem;
    padding: 0.55rem 1rem;
    background: var(--crm-surface);
    border: 1px solid var(--falcon-card-border-color, rgba(0,0,0,0.06));
    border-radius: 10px;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
    min-height: 52px;
}
.page-header-bar > .ph-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    background: rgba(var(--falcon-primary-rgb), 0.1);
    color: var(--falcon-primary);
    transition: transform 0.25s ease;
}
.page-header-bar:hover > .ph-icon { }
.page-header-bar > .ph-title {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
    /* Yield last: the stats row below shrinks 100x faster, so the title keeps its
       width until there is genuinely nothing left to give. The ellipsis on
       .ph-title-text stays as a final fallback rather than the normal case. */
    flex-shrink: 1;
}
.page-header-bar > .ph-title > .ph-title-text {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--falcon-gray-1100, #344050);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-header-bar > .ph-title > .ph-subtitle {
    font-size: 0.78rem;
    color: var(--falcon-gray-600, #748194);
    font-weight: 500;
    white-space: nowrap;
}
.page-header-bar > .ph-title > .ph-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--falcon-primary);
    background: rgba(var(--falcon-primary-rgb), 0.08);
    padding: 1px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Inline stat chips — sit between title and actions. Up to 4 fit
   comfortably on a 1366-wide screen; collapse to a single-line summary
   below 992px. */
.page-header-bar > .ph-stats {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    /* v2026.09.18: was flex-wrap:nowrap + overflow:hidden, which CLIPPED the last chip
       (the "Ar..." stub on Provider health) instead of reflowing it, and still pushed
       the deficit onto the title. Chips can be server-filter LINKS (PageHeaderStat.Href),
       so they must never be hidden or clipped - wrapping keeps every filter reachable. */
    flex-wrap: wrap;
    row-gap: 0.35rem;
    margin-left: 0.5rem;
    min-width: 0;
    flex-shrink: 100;
}
.page-header-bar .ph-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--falcon-gray-700, #5e6e82);
    background: var(--falcon-gray-100, #f9fafd);
    border: 1px solid var(--falcon-gray-200, #edf2f9);
    padding: 3px 9px;
    border-radius: 14px;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}
.page-header-bar .ph-stat:hover { background: var(--falcon-gray-200, #edf2f9); }
.page-header-bar .ph-stat .ph-stat-icon { font-size: 0.65rem; opacity: 0.8; }
.page-header-bar .ph-stat .ph-stat-value { color: var(--falcon-gray-1100, #344050); }
.page-header-bar .ph-stat.ph-stat-success { color: #0e9f6e; }
.page-header-bar .ph-stat.ph-stat-success .ph-stat-value { color: #0e9f6e; }
.page-header-bar .ph-stat.ph-stat-danger  { color: #d02a4a; }
.page-header-bar .ph-stat.ph-stat-warning { color: #c46a17; }
.page-header-bar .ph-stat.ph-stat-info    { color: var(--falcon-primary); }

.page-header-bar > .ph-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    /* v2026.09.18: was flex-shrink:0, so 333px of mostly-secondary chrome (density
       toggle 85 + palette trigger 143 + page action 92) could not yield an inch and the
       whole deficit fell on the title. It yields now; the container queries below drop
       the secondary controls in priority order before that becomes necessary. */
    flex-shrink: 1;
    min-width: 0;
}
.page-header-bar > .ph-actions > .btn { white-space: nowrap; }

/* Open the command palette via the header — discoverable Ctrl+K button. */
.page-header-bar .ph-palette-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--falcon-gray-100, #f9fafd);
    border: 1px solid var(--falcon-gray-300, #d8e2ef);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--falcon-gray-700, #5e6e82);
    cursor: pointer;
    transition: all 0.15s ease;
}
.page-header-bar .ph-palette-trigger:hover {
    background: var(--falcon-gray-200, #edf2f9);
    border-color: var(--falcon-primary);
    color: var(--falcon-primary);
}
.page-header-bar .ph-palette-trigger kbd {
    background: var(--crm-surface);
    border: 1px solid var(--falcon-gray-300, #d8e2ef);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--falcon-gray-700, #5e6e82);
    box-shadow: 0 1px 0 var(--falcon-gray-300, #d8e2ef);
}

/* Overflow menu (kebab) for tertiary actions. */
.page-header-bar .ph-overflow-trigger {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid var(--falcon-gray-200, #edf2f9);
    background: transparent;
    color: var(--falcon-gray-700, #5e6e82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.page-header-bar .ph-overflow-trigger:hover {
    background: var(--falcon-gray-100, #f9fafd);
    color: var(--falcon-primary);
    border-color: var(--falcon-primary);
}

@media (max-width: 991.98px) {
    /* v2026.09.18: was `display: none`, which removed the chips entirely below 992px.
       A chip carrying PageHeaderStat.Href is a LINK to a server-filtered view, and on
       several pages it is the only way to reach that view - so hiding them did not just
       drop decoration, it dropped functionality on every tablet and phone. They now
       scroll sideways instead, the same treatment .saved-views-bar already gets two
       blocks down, so every filter stays reachable without making the bar tall. */
    .page-header-bar > .ph-stats {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
        margin-left: 0;
    }
    .page-header-bar > .ph-stats::-webkit-scrollbar { display: none; }
    /* v2026.10.17: with the scrollbar hidden, a strip that runs off the edge just cut the last
       chip mid-word ("Compliance and policie") and gave no sign that more chips were there.
       site.js (initChipStripHints) marks the side that has more, and that side fades out. */
    .page-header-bar > .ph-stats.has-more-right {
        -webkit-mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent);
        mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent);
    }
    .page-header-bar > .ph-stats.has-more-left {
        -webkit-mask-image: linear-gradient(to left, black calc(100% - 2.5rem), transparent);
        mask-image: linear-gradient(to left, black calc(100% - 2.5rem), transparent);
    }
    .page-header-bar > .ph-stats.has-more-left.has-more-right {
        -webkit-mask-image: linear-gradient(to right, transparent, black 2.5rem, black calc(100% - 2.5rem), transparent);
        mask-image: linear-gradient(to right, transparent, black 2.5rem, black calc(100% - 2.5rem), transparent);
    }
    .page-header-bar .ph-palette-trigger kbd { display: none; }
}
@media (max-width: 575.98px) {
    .page-header-bar > .ph-title > .ph-subtitle { display: none; }
}
/* v2026.10.17: a flex row that wraps decides its lines from each item's CONTENT width before any
   shrinking, so the strip's flex-shrink:100 never got a say: six chips on Document Templates pushed
   the page's own actions onto a second row (an 88px bar). Measured from a basis of 0, the strip takes
   whatever room the title and actions leave and its chips wrap inside it; the actions keep row one. */
@media (min-width: 992px) {
    .page-header-bar > .ph-stats { flex: 1 1 0; }
}


/* ═══════════════════════════════════════════════════════════════════════
   SAVED VIEWS BAR
   Tabs above the table showing user-saved filter combinations. Stored in
   localStorage (per-page, per-user); v1 ships without server persistence.
   ═══════════════════════════════════════════════════════════════════════ */
.saved-views-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin: 0 0 0.5rem 0;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.45s ease 0.05s forwards;
}
.saved-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--falcon-gray-200, #edf2f9);
    border-radius: 8px 8px 0 0;
    border-bottom-color: var(--falcon-gray-300, #d8e2ef);
    font-size: 0.78rem;
    color: var(--falcon-gray-700, #5e6e82);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.saved-view-tab:hover {
    background: var(--falcon-gray-100, #f9fafd);
    color: var(--falcon-primary);
    text-decoration: none;
}
.saved-view-tab.active {
    background: var(--crm-surface);
    color: var(--falcon-primary);
    border-color: var(--falcon-gray-300, #d8e2ef);
    border-bottom-color: var(--crm-surface);
    font-weight: 600;
    position: relative;
    z-index: var(--z-base);
}
.saved-view-tab .sv-delete {
    opacity: 0;
    margin-left: 2px;
    width: 16px; height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.6rem;
    background: rgba(0,0,0,0.05);
    transition: opacity 0.15s ease, background 0.15s ease;
}
.saved-view-tab:hover .sv-delete { opacity: 1; }
.saved-view-tab .sv-delete:hover { background: rgba(230, 55, 87, 0.15); color: #d02a4a; }
.saved-view-save {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 4px 8px;
    background: transparent;
    border: 1px dashed var(--falcon-gray-400, #b6c1d2);
    border-radius: 6px;
    font-size: 0.72rem;
    color: var(--falcon-gray-700, #5e6e82);
    cursor: pointer;
    transition: all 0.15s ease;
}
.saved-view-save:hover {
    border-color: var(--falcon-primary);
    color: var(--falcon-primary);
    background: rgba(var(--falcon-primary-rgb), 0.04);
}


/* ═══════════════════════════════════════════════════════════════════════
   STICKY TABLE HEADER + DENSITY TOGGLE
   Density: data-density on <body> or on a .crm-table-wrap container.
     compact (default in the toolbar)   — rows ~28px high
     cozy                               — rows ~36px high (current default)
     comfortable                        — rows ~46px high
   ═══════════════════════════════════════════════════════════════════════ */
.crm-table thead,
.log-table thead,
.sms-table thead {
    position: sticky;
    /* Below .navbar-top — see --crm-sticky-offset. A table inside a page that
       also has a sticky toolbar above it uses --crm-sticky-offset-2. */
    top: var(--crm-sticky-offset);
    z-index: var(--z-sticky-header);
    background: var(--falcon-gray-200, #edf2f9);
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* A sticky element sticks to its nearest SCROLLPORT, not to the viewport.
   These tables live inside .table-responsive, which Bootstrap gives
   `overflow-x: auto` — and once one axis is non-visible the other computes to
   auto too, so the WRAPPER is the scrollport, not the page.
   --crm-sticky-offset (69px) exists to clear the fixed top navbar when the
   VIEWPORT scrolls. Applied inside a local scrollport it does the opposite of
   what it reads like: it pushes the header 69px DOWN from the top of the
   wrapper, straight over the first rows, and the header is opaque and sits on
   --z-sticky-header.
   Measured on a one-row table: scrollport 98px tall, header pushed to y=376
   while the row sat at its natural y=367 — the row rendered underneath it and
   looked like missing data, with only text taller than the header band poking
   out above and below.
   Inside a scroll wrapper the correct offset is 0: there is no navbar to clear,
   because the navbar is outside this scrollport entirely. */
.table-responsive .crm-table thead,
.table-responsive .log-table thead,
.table-responsive .sms-table thead,
.crm-table-wrap .crm-table thead,
.log-table-wrap .log-table thead,
.sms-table-wrap .sms-table thead {
    top: 0;
}


/* The Falcon sortable-th hover dropdown chevron uses ::after — preserve. */
.crm-table thead th,
.log-table thead th,
.sms-table thead th {
    background: var(--falcon-gray-200, #edf2f9) !important;
}

/* Compact density — Linear / Notion compact mode equivalent */
[data-density="compact"] .crm-table tbody td,
[data-density="compact"] .log-table tbody td,
[data-density="compact"] .sms-table tbody td {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.78rem;
    line-height: 1.25;
}
[data-density="compact"] .crm-table .ct-pill,
[data-density="compact"] .crm-table .badge { font-size: 0.65rem; padding: 1px 6px; }

/* Comfortable density — accessible mode for older users */
[data-density="comfortable"] .crm-table tbody td,
[data-density="comfortable"] .log-table tbody td,
[data-density="comfortable"] .sms-table tbody td {
    padding: 0.85rem 0.75rem !important;
    font-size: 0.9rem;
}

/* Density toggle button group (rendered in _PageHeader actions) */
.density-toggle {
    display: inline-flex;
    border: 1px solid var(--falcon-gray-300, #d8e2ef);
    border-radius: 6px;
    overflow: hidden;
    background: var(--crm-surface);
}
.density-toggle > button {
    background: transparent;
    border: none;
    padding: 3px 8px;
    font-size: 0.75rem;
    color: var(--falcon-gray-600, #748194);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}
.density-toggle > button:hover { background: var(--falcon-gray-100, #f9fafd); color: var(--falcon-primary); }
.density-toggle > button.active {
    background: var(--falcon-primary);
    color: #fff;
}
.density-toggle > button + button { border-left: 1px solid var(--falcon-gray-200, #edf2f9); }


/* ═══════════════════════════════════════════════════════════════════════
   SKELETON LOADING ROWS
   Replace tbody with N shimmer rows during filter submit. JS helper in
   site.js (renderSkeletonRows) drives this.
   ═══════════════════════════════════════════════════════════════════════ */
.skeleton-row td {
    padding: 0.6rem 0.5rem !important;
    border-bottom: 1px solid var(--falcon-gray-200, #edf2f9);
}
.skeleton-pill {
    display: inline-block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg,
        rgba(0,0,0,0.05) 0%,
        rgba(0,0,0,0.1)  50%,
        rgba(0,0,0,0.05) 100%);
    background-size: 800px 100%;
    animation: shimmer 1.4s linear infinite;
    width: 80%;
    min-width: 48px;
    vertical-align: middle;
}
.skeleton-pill.sk-w-30 { width: 30%; }
.skeleton-pill.sk-w-50 { width: 50%; }
.skeleton-pill.sk-w-70 { width: 70%; }
.skeleton-pill.sk-w-90 { width: 90%; }


/* ═══════════════════════════════════════════════════════════════════════
   COMMAND PALETTE (Ctrl+K / Cmd+K)
   Modal overlay, search input, results list, keyboard-driven navigation.
   ═══════════════════════════════════════════════════════════════════════ */
.cmdk-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 17, 35, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: var(--z-command-palette);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    animation: paletteFadeIn 0.18s ease;
}
.cmdk-overlay.show { display: flex; }
.cmdk-panel {
    width: min(640px, calc(100vw - 32px));
    max-height: 70vh;
    background: var(--crm-surface);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: paletteScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cmdk-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--falcon-gray-200, #edf2f9);
}
.cmdk-input-wrap .fa-search { color: var(--falcon-gray-500, #9da9bb); font-size: 0.95rem; }
.cmdk-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--falcon-gray-1100, #344050);
    outline: none;
    padding: 0;
}
.cmdk-input::placeholder { color: var(--falcon-gray-500, #9da9bb); }
.cmdk-esc-hint {
    font-size: 0.72rem;
    color: var(--falcon-gray-500, #9da9bb);
    border: 1px solid var(--falcon-gray-300, #d8e2ef);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cmdk-results {
    overflow-y: auto;
    flex: 1;
    padding: 6px 0 10px;
}
.cmdk-section-label {
    font-size: 0.66rem;
    color: var(--falcon-gray-500, #9da9bb);
    font-weight: 700;
    padding: 8px 18px 4px;
}
.cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    cursor: pointer;
    color: var(--falcon-gray-1100, #344050);
    transition: background 0.12s ease;
    text-decoration: none;
}
.cmdk-item:hover,
.cmdk-item.cmdk-focused {
    background: rgba(var(--falcon-primary-rgb), 0.06);
    color: var(--falcon-gray-1100, #344050);
    text-decoration: none;
}
.cmdk-item .cmdk-icon {
    width: 26px; height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--falcon-gray-100, #f9fafd);
    color: var(--falcon-gray-600, #748194);
    font-size: 0.7rem;
}
.cmdk-item.cmdk-focused .cmdk-icon { background: rgba(var(--falcon-primary-rgb), 0.1); color: var(--falcon-primary); }
.cmdk-item .cmdk-label-wrap { flex: 1; min-width: 0; }
.cmdk-item .cmdk-label {
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmdk-item .cmdk-sub {
    font-size: 0.7rem;
    color: var(--falcon-gray-500, #9da9bb);
    line-height: 1.2;
}
.cmdk-item mark {
    background: rgba(var(--falcon-primary-rgb), 0.18);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
.cmdk-empty {
    padding: 36px 24px;
    text-align: center;
    color: var(--falcon-gray-500, #9da9bb);
    font-size: 0.86rem;
}
.cmdk-footer {
    border-top: 1px solid var(--falcon-gray-200, #edf2f9);
    padding: 7px 18px;
    font-size: 0.7rem;
    color: var(--falcon-gray-500, #9da9bb);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--falcon-gray-100, #f9fafd);
}
.cmdk-footer kbd {
    background: var(--crm-surface);
    border: 1px solid var(--falcon-gray-300, #d8e2ef);
    border-radius: 3px;
    padding: 0 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.66rem;
    box-shadow: 0 1px 0 var(--falcon-gray-300, #d8e2ef);
    margin-right: 3px;
}


/* ═══════════════════════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS OVERLAY  (press ?)
   ═══════════════════════════════════════════════════════════════════════ */
.ks-overlay {
    position: fixed; inset: 0;
    background: rgba(8, 17, 35, 0.55);
    z-index: var(--z-command-palette);
    display: none;
    align-items: center;
    justify-content: center;
    animation: paletteFadeIn 0.18s ease;
}
.ks-overlay.show { display: flex; }
.ks-panel {
    width: min(620px, calc(100vw - 32px));
    background: var(--crm-surface);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.32);
    overflow: hidden;
    animation: paletteScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.ks-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--falcon-gray-200, #edf2f9);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ks-header h6 { margin: 0; font-weight: 700; }

/* Modal close button — circular, soft hover, rotation on hover. Matches
   the .crm-detail-modal close affordance instead of the table-row
   .ph-overflow-trigger style which was visually wrong for a modal corner. */
.ks-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--falcon-gray-100, #f9fafd);
    color: var(--falcon-gray-700, #5e6e82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.25s ease, box-shadow 0.2s ease;
    padding: 0;
    line-height: 1;
}
.ks-close-btn:hover {
    background: rgba(230, 55, 87, 0.1);
    color: #e63757;
    transform: rotate(90deg);
}
.ks-close-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.25);
}
[data-bs-theme="dark"] .ks-close-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--falcon-gray-400);
}
[data-bs-theme="dark"] .ks-close-btn:hover {
    background: rgba(230, 55, 87, 0.18);
    color: #ff6b8a;
}
.ks-body { padding: 12px 18px 18px; }
.ks-group { margin-top: 12px; }
.ks-group h6 {
    font-size: 0.72rem;
    color: var(--falcon-gray-500, #9da9bb);
    margin: 12px 0 6px;
    font-weight: 700;
}
.ks-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--falcon-gray-200, #edf2f9);
}
.ks-row:last-child { border-bottom: none; }
.ks-keys { display: flex; gap: 3px; }
.ks-keys kbd {
    background: var(--falcon-gray-100, #f9fafd);
    border: 1px solid var(--falcon-gray-300, #d8e2ef);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    color: var(--falcon-gray-1100, #344050);
    box-shadow: 0 1px 0 var(--falcon-gray-300, #d8e2ef);
}


/* ═══════════════════════════════════════════════════════════════════════
   ENHANCED EMPTY STATE  (used by _Empty.cshtml v2)
   ═══════════════════════════════════════════════════════════════════════ */
.empty-state-card {
    background: var(--crm-surface);
    border: 1px dashed var(--falcon-gray-300, #d8e2ef);
    border-radius: 14px;
    padding: 3rem 2rem;
    text-align: center;
    margin: 1rem 0;
    animation: fadeInUp 0.5s ease;
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--falcon-primary-rgb), 0.1), rgba(var(--falcon-primary-rgb), 0.04));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--falcon-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.empty-state-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--falcon-gray-1100, #344050);
    margin-bottom: 0.35rem;
}
.empty-state-desc {
    color: var(--falcon-gray-600, #748194);
    font-size: 0.88rem;
    max-width: 380px;
    margin: 0 auto 1.2rem;
}
.empty-state-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════════════════════════
   LOAD-FAILURE STATE  (used by _LoadError.cshtml)

   Deliberately NOT the empty state. "Nothing matched your filter" and
   "the query threw" are different facts; rendering them the same way is
   what let a hard-failing SMS log page read as a quiet period. Danger
   accent + a solid border, so it never reads as a normal empty result.
   ═══════════════════════════════════════════════════════════════════════ */
.load-error-card {
    background: var(--crm-surface);
    border: 1px solid var(--crm-danger);
    border-radius: var(--crm-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    margin: 1rem 0;
    animation: fadeInUp 0.5s ease;
}
.load-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--crm-danger-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--crm-danger);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.load-error-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--crm-ink-strong);
    margin-bottom: 0.35rem;
}
.load-error-desc {
    color: var(--crm-ink-muted);
    font-size: 0.88rem;
    max-width: 460px;
    margin: 0 auto 1.2rem;
}
.load-error-detail {
    display: block;
    max-width: 640px;
    margin: 0 auto 1.2rem;
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: 0.76rem;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--crm-surface-2);
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius-sm);
    color: var(--crm-ink-muted);
}
.load-error-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════════════════════════
   FORM COMPLETION PROGRESS BAR
   Sticky bar across the form showing required-field completion. Wired by
   site.js (initFormCompletion). Required fields get a red asterisk via
   the .required-asterisk class on the label.
   ═══════════════════════════════════════════════════════════════════════ */
.form-completion-bar {
    position: sticky;
    /* Below .navbar-top, never at viewport 0 — see --crm-sticky-offset. */
    top: var(--crm-sticky-offset);
    z-index: var(--z-sticky-header);
    background: var(--crm-surface);
    border: 1px solid var(--falcon-gray-200, #edf2f9);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);

    /* WRAP, NEVER OVERFLOW.
       This bar carries Save and Discard, and it was the one flex bar in this file
       that never got the responsive pass .page-header-bar and .bulk-action-bar
       both got. Without wrapping it pushed its own actions past the right edge on
       a phone: the primary action of the page was reachable only by scrolling
       sideways, which is a functional defect and not a cosmetic one.

       row-gap only applies once it has actually wrapped, so a bar that fits on one
       line looks exactly as it did. */
    flex-wrap: wrap;
    row-gap: 0.5rem;
}
.form-completion-bar .fc-label {
    font-size: 0.76rem;
    color: var(--falcon-gray-700, #5e6e82);
    font-weight: 600;
    white-space: nowrap;
}
.form-completion-bar .fc-counter {
    font-size: 0.76rem;
    color: var(--falcon-gray-1100, #344050);
    font-weight: 700;
    white-space: nowrap;
}
.form-completion-bar .fc-track {
    /* `flex: 1` alone is not enough. A flex item's default min-width is `auto`,
       and the label, counter and status beside it are all `white-space: nowrap`,
       so NOTHING in the row could shrink and the overflow went to the actions.
       `min-width: 0` is what actually lets this absorb the squeeze. */
    flex: 1 1 6rem;
    min-width: 0;
    height: 6px;
    background: var(--falcon-gray-200, #edf2f9);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.form-completion-bar .fc-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d27a, #00b86b);
    border-radius: 3px;
    width: 0%;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.form-completion-bar .fc-fill.fc-warn { background: linear-gradient(90deg, #f5803e, #e8721c); }
.form-completion-bar .fc-fill.fc-err  { background: linear-gradient(90deg, #e63757, #d02a4a); }
.form-completion-bar .fc-status { font-size: 0.76rem; font-weight: 600; }
.form-completion-bar .fc-status.fc-status-ok { color: #0e9f6e; }
.form-completion-bar .fc-status.fc-status-warn { color: #c46a17; }
/* v2026.10.17: a form with no required field keeps its bar (label, Save, Discard) but shows no progress. */
.form-completion-bar.fc-no-required .fc-track,
.form-completion-bar.fc-no-required .fc-counter,
.form-completion-bar.fc-no-required .fc-status { display: none; }

/* Required-field asterisk — apply with: <label>Name <span class="required-asterisk">*</span></label>
   or pre-set globally via initRequiredAsterisks() in site.js. */
.required-asterisk {
    color: #d02a4a;
    font-weight: 700;
    margin-left: 2px;
    cursor: help;
}
.required-asterisk[title]:hover { color: #e63757; }

/* Real-time validation states — applied to .form-control / .form-select. */
.form-control.is-fresh-valid,
.form-select.is-fresh-valid {
    border-color: #00d27a !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%2300d27a' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px 14px;
    padding-right: 32px;
}
.form-control.is-fresh-invalid,
.form-select.is-fresh-invalid {
    border-color: #e63757 !important;
}


/* ═══════════════════════════════════════════════════════════════════════
   TOAST STYLE (used by showToast in site.js)
   Make the Toastify container float above modal overlays.
   ═══════════════════════════════════════════════════════════════════════ */
.toastify {
    z-index: var(--z-toast) !important;
}


/* ═══════════════════════════════════════════════════════════════════════
   DARK MODE SUPPORT  (data-bs-theme="dark")
   Falcon already swaps most tokens; these overrides handle the bespoke
   styles in this file that were hard-coded for light theme.
   ═══════════════════════════════════════════════════════════════════════ */
[data-bs-theme="dark"] .crm-filter-section,
[data-bs-theme="dark"] .crm-filter-section.collapsible-filter {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .page-header-bar {
    background: var(--crm-surface);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
[data-bs-theme="dark"] .page-header-bar .ph-stat {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.06);
}
[data-bs-theme="dark"] .page-header-bar .ph-palette-trigger {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .content-bubble,
[data-bs-theme="dark"] .narrative-bubble,
[data-bs-theme="dark"] .sms-text-bubble,
[data-bs-theme="dark"] .description-bubble {
    background: var(--crm-surface-tint);
    color: var(--crm-ink-strong);
}
[data-bs-theme="dark"] .cmdk-panel,
[data-bs-theme="dark"] .ks-panel {
    background: #16202d;
}
[data-bs-theme="dark"] .cmdk-input-wrap,
[data-bs-theme="dark"] .cmdk-footer {
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .cmdk-footer { background: rgba(255,255,255,0.02); }
[data-bs-theme="dark"] .cmdk-input { color: #f9fafd; }
[data-bs-theme="dark"] .actions-dropdown { background: #16202d; }
[data-bs-theme="dark"] .actions-dropdown .dropdown-item { background: transparent; color: #d8e2ef; }
[data-bs-theme="dark"] .actions-dropdown .dropdown-item:hover { background: rgba(255,255,255,0.05); }


/* ═══════════════════════════════════════════════════════════════════════
   TOP BAR  (v2026.09.28)
   The bar is the PAGE's own glass: --falcon-bg-navbar-glass, the page colour
   at 96% with a blur - the same token the phone menu panel below it uses, and
   defined for dark mode by the theme. It replaces the 2026-05-14 "warmed up"
   white-to-peach gradient: hard-coded hex behind !important (§14.3), lighter
   than the page and tinted at one end, so on a phone the bar read as a
   floating strip, inset by the content padding, instead of part of the page.
   Kept from that pass: the pill icon buttons and the palette trigger below.
   ═══════════════════════════════════════════════════════════════════════ */
.navbar-top.navbar-glass {
    background: var(--falcon-bg-navbar-glass) !important;
    border-bottom: 1px solid var(--crm-rule-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Friendlier brand pill on the left */
.navbar-top .navbar-brand {
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.navbar-top .navbar-brand:hover {
}

/* All top-bar icon buttons get a consistent pill hover treatment. */
.navbar-top .nav-link {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    border-radius: 8px;
    padding: 6px 10px !important;
    position: relative;
}
.navbar-top .nav-link:hover {
    background: rgba(44, 123, 229, 0.08);
    color: var(--falcon-primary);
}
.navbar-top .nav-link:hover .fas,
.navbar-top .nav-link:hover .far {
}
.navbar-top .nav-link .fas,
.navbar-top .nav-link .far {
    transition: transform 0.2s ease;
}
.navbar-top .nav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.2);
}

/* Avatar — soft ring, lifts on hover */
.navbar-top .nav-link img.rounded-circle {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(13, 38, 76, 0.12);
}
.navbar-top .nav-link:hover img.rounded-circle {
}

/* Nine-dots icon — same treatment */
.navbar-top .nine-dots {
    border-radius: 8px;
    padding: 8px !important;
}
.navbar-top .nine-dots:hover {
    background: rgba(44, 123, 229, 0.08);
}

/* Hamburger toggler (mobile / collapsed sidebar) */
.navbar-top .navbar-toggler {
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
.navbar-top .navbar-toggler:hover {
    background: rgba(44, 123, 229, 0.08);
}

/* The Search-anything palette trigger — the centrepiece of the top bar.
   Industry standard (Linear / Notion / Stripe): inviting rounded pill,
   subtle shadow, soft hover lift, generous tap target. */
.navbar-top .ph-palette-trigger,
.ph-palette-trigger.ms-auto {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(44, 123, 229, 0.18);
    border-radius: 999px;
    padding: 6px 14px 6px 14px;
    min-height: 36px;
    font-size: 0.82rem;
    color: var(--falcon-gray-700, #5e6e82);
    box-shadow: 0 1px 3px rgba(13, 38, 76, 0.06);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 220px;
}
.navbar-top .ph-palette-trigger:hover,
.ph-palette-trigger.ms-auto:hover {
    background: #ffffff;
    border-color: var(--falcon-primary);
    color: var(--falcon-primary);
}
.navbar-top .ph-palette-trigger:focus-visible,
.ph-palette-trigger.ms-auto:focus-visible {
    outline: none;
    border-color: var(--falcon-primary);
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.2);
}
.navbar-top .ph-palette-trigger .fa-search,
.ph-palette-trigger.ms-auto .fa-search {
    color: var(--falcon-primary);
    font-size: 0.85rem;
}
.navbar-top .ph-palette-trigger kbd,
.ph-palette-trigger.ms-auto kbd {
    background: rgba(44, 123, 229, 0.08);
    border: none;
    color: var(--falcon-primary);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    box-shadow: none;
    margin-left: auto;
}

[data-bs-theme="dark"] .navbar-top .ph-palette-trigger,
[data-bs-theme="dark"] .ph-palette-trigger.ms-auto {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--falcon-gray-300);
}
[data-bs-theme="dark"] .navbar-top .ph-palette-trigger:hover,
[data-bs-theme="dark"] .ph-palette-trigger.ms-auto:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* In-page header palette trigger keeps a smaller, flatter look so it
   doesn't compete with the top bar's hero pill. */
.page-header-bar .ph-palette-trigger {
    min-width: 0;
    padding: 4px 10px;
    min-height: 30px;
}


/* ═══════════════════════════════════════════════════════════════════════
   PRINT — hide chrome when printing list pages
   ═══════════════════════════════════════════════════════════════════════ */
@media print {
    .page-header-bar > .ph-actions,
    .saved-views-bar,
    .crm-filter-section,
    .bulk-action-bar,
    .density-toggle,
    .ph-palette-trigger,
    .cmdk-overlay,
    .ks-overlay,
    .setting-toggle,
    nav.navbar-vertical,
    nav.navbar-top,
    footer { display: none !important; }
    .content { margin-left: 0 !important; }
}


/* ═══════════════════════════════════════════════════════════════════════
   FILTERABLE STAT CHIPS  (ph-stat-filter)
   Header stats with data-list-filter-key become clickable filter pills.
   ═══════════════════════════════════════════════════════════════════════ */
.ph-stat.ph-stat-filter {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 20px;
    transition: background .15s, border-color .15s, transform .1s;
    user-select: none;
}
.ph-stat.ph-stat-filter:hover { filter: brightness(1.08); }
.ph-stat.ph-stat-filter:active { transform: translateY(0); }
.ph-stat.ph-stat-filter.ph-stat-active {
    /* v2026.10.17: the ring is drawn INSIDE the chip. It was an outline with a 2px offset, which
       reaches 4px outside the chip - and below 992px the chip strip scrolls (overflow-x: auto),
       so the strip clipped it: the active first chip lost its left edge on every list page. */
    box-shadow: inset 0 0 0 2px currentColor;
    font-weight: 700;
}
.ph-stat.ph-stat-filter.ph-stat-active .ph-stat-value { font-weight: 700; }
/* Link variant (server-filtered chips) must not pick up default anchor styling. */
a.ph-stat.ph-stat-filter,
a.ph-stat.ph-stat-filter:hover,
a.ph-stat.ph-stat-filter:focus { text-decoration: none; color: inherit; }


/* ═══════════════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE LAYER  (v2026.07)
   Additive small-screen refinements for the shared chrome. The app is
   historically desktop-first (horizontal-scroll tables, centralized
   breakpoints); this layer reflows the shared components so list / form /
   detail views stay usable on phones WITHOUT overriding any desktop rule.
   Wide data tables keep their horizontal scroll (see .table-responsive) —
   card-stacking needs per-cell data-labels and is tracked as follow-up.
   ═══════════════════════════════════════════════════════════════════════ */

/* Momentum scrolling for every horizontal-scroll table wrapper */
.table-responsive,
.crm-table-wrap,
.log-table-wrap,
.sms-table-wrap { -webkit-overflow-scrolling: touch; }

@media (max-width: 767.98px) {
    /* Tighter content gutters on phones */
    .content { padding-left: 0.75rem; padding-right: 0.75rem; }

    /* Page header wraps into a stacked bar instead of overflowing */
    .page-header-bar {
        flex-wrap: wrap;
        row-gap: 0.5rem;
        padding: 0.55rem 0.75rem;
    }
    /* v2026.10.17: the actions wrap rather than run off the screen. Two page actions with long
       labels (Templates: "Import from Word or PDF" + "New template") pushed the page 55px sideways at 390px. */
    .page-header-bar > .ph-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; row-gap: 0.4rem; }

    /* Filter section: reduce padding, let Bootstrap columns stack */
    .crm-filter-section { padding: 0.75rem 0.85rem; }

    /* Detail modal: reclaim space from heavy desktop padding */
    .detail-modal-header { padding: 1rem 1.1rem; }
    .detail-modal-body { padding: 1rem 1.1rem; }
    .detail-modal-footer { padding: 0.75rem 1.1rem; }

    /* Bulk-action bar wraps rather than overflowing */
    .bulk-action-bar { flex-wrap: wrap; row-gap: 0.4rem; }

    /* Form completion bar: the actions get their own full-width row so Save and
       Discard are always on screen. Same treatment as .page-header-bar above.

       The progress track is sent LAST with `order`, rather than left in DOM
       order, because it is the one part of this bar nobody needs to reach — it
       is a readout. Putting it second would push the buttons down a row for no
       benefit. Source order stays as it is, so the tab order and the screen
       reader still get label → progress → counter → actions. */
    .form-completion-bar { padding: 0.55rem 0.75rem; }
    .form-completion-bar > .ms-auto {
        order: 10;
        width: 100%;
        justify-content: flex-start;
        /* Bootstrap sets margin-left: auto !important, which fights width: 100%. */
        margin-left: 0 !important;
    }
    .form-completion-bar .fc-track { order: 20; flex: 1 1 100%; }

    /* THE COMMAND-PALETTE TRIGGER RESERVES 220px IT CANNOT USE HERE.
       Its label and its Ctrl-K hint are both `d-none d-md-inline`, so below this
       breakpoint the control is an icon in a pill — and the 220px min-width is
       220px of empty space, sitting between the brand and the icon cluster.

       That is what pushed the top-right icons off the screen: on a 390px phone
       the navbar measured 505px, so the avatar was clipped and the whole document
       scrolled sideways. The form bar below it looked like the culprit and was
       only half of it. */
    .navbar-top .ph-palette-trigger,
    .ph-palette-trigger.ms-auto {
        min-width: 0;
        padding: 6px 12px;
    }

    /* The icon cluster is the last thing that should be given away. Keeping it
       from shrinking is not enough on its own — something else has to yield, which
       is what the rule above does — but it stops the icons from being squeezed
       into each other once space is tight. */
    .navbar-top .navbar-nav-icons { flex-shrink: 0; }

    /* ...and the brand yields before either of them. A truncated product name is a
       far smaller loss than an unreachable account menu. */
    .navbar-top .navbar-brand {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    /* Tighter modal margins on the smallest screens */
    .modal-dialog:not(.modal-sm):not(.modal-fullscreen) { margin: 0.5rem; }

    /* Drop the header icon to give the title + count room */
    .page-header-bar > .ph-icon { display: none; }

    /* Saved-views tabs scroll sideways instead of stacking tall */
    .saved-views-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}


/* ═══════════════════════════════════════════════════════════════════════
   CHARACTER COUNTERS  (shared — wired by initCharCounter in site.js)
   For any input/textarea with a maxlength the operator should be able to
   see. Silently hitting maxlength is a dead end: typing just stops with no
   explanation. Used first by the push-notification composer, where the
   platform truncation limit is well below the maxlength.
   ═══════════════════════════════════════════════════════════════════════ */
.char-counter {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--crm-ink-faint);
    text-align: right;
    transition: color 0.15s var(--crm-ease);
}
.char-counter.is-warn   { color: var(--crm-warning); font-weight: 600; }
.char-counter.is-over   { color: var(--crm-danger);  font-weight: 600; }
.char-counter .cc-note  { float: left; font-weight: 400; color: var(--crm-ink-faint); }


/* ═══════════════════════════════════════════════════════════════════════
   FILE SIZE HINT  (shared — wired by initFileSizeHints in site.js)
   A file input shows a truncated name and nothing else, so the operator
   only learns a file was too big after the upload has already run and the
   proxy has thrown the form away. The size is known the moment the file is
   picked; this surfaces it there, and turns red against the ceiling.
   ═══════════════════════════════════════════════════════════════════════ */
.file-size-hint {
    display: none;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    border-radius: var(--crm-radius-sm);
    border: 1px solid var(--crm-rule-soft);
    background: var(--crm-surface-2);
    color: var(--crm-ink-muted);
}
.file-size-hint.is-shown { display: flex; }
.file-size-hint .fsh-icon { color: var(--crm-ink-faint); }
.file-size-hint .fsh-name {
    font-weight: 600;
    color: var(--crm-ink);
    overflow-wrap: anywhere;
}
.file-size-hint .fsh-size {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--crm-ink-strong);
    margin-left: auto;
}
.file-size-hint .fsh-note {
    flex-basis: 100%;
    font-weight: 500;
}
.file-size-hint.is-over {
    border-color: var(--crm-danger);
    background: var(--crm-danger-soft);
    color: var(--crm-danger-deep);
}
.file-size-hint.is-over .fsh-icon,
.file-size-hint.is-over .fsh-name,
.file-size-hint.is-over .fsh-size,
.file-size-hint.is-over .fsh-note { color: var(--crm-danger-deep); }

/* Announcement error text in the App Releases version history - the full message
   is on the title attribute; the cell keeps the table from being pushed sideways
   by a stack trace. */


/* ═══════════════════════════════════════════════════════════════════════
   ERROR PAGES  (_Error.cshtml layout + _ErrorPanel.cshtml)
   Shared by every in-app error surface. Its static twin, for the failures
   that never reach the app at all (an oversized upload rejected by the
   proxy, or the app being down), lives in scripts/nginx/errors/ and must
   be kept visually in step with this block.
   ═══════════════════════════════════════════════════════════════════════ */
.error-page-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--crm-surface-2);
    color: var(--crm-ink);
}
.error-page-main {
    width: 100%;
    max-width: 34rem;
}
.error-page-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.error-page-logo { height: 2rem; width: auto; }
.error-page-brandname {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: var(--crm-brand);
}

.error-panel {
    position: relative;
    overflow: hidden;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    background: var(--crm-surface);
    border: 1px solid var(--crm-surface-border);
    border-radius: var(--crm-radius-lg);
    box-shadow: var(--crm-shadow);
}
/* The status code: a small line a reader can quote to support (17 Nov 2026: no giant faded number behind the panel). */
.error-panel-code {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--crm-ink-muted);
    font-variant-numeric: tabular-nums;
}
.error-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    font-size: 2rem;
}
.error-panel-warning .error-panel-icon { color: var(--crm-warning-deep); }
.error-panel-danger  .error-panel-icon { color: var(--crm-danger-deep); }

.error-panel-reason {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--crm-ink-muted);
}
.error-panel-title {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--crm-ink-strong);
}
.error-panel-message {
    margin: 0 auto 1rem;
    max-width: 30rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--crm-ink-muted);
}
.error-panel-next {
    margin: 0 auto 1.5rem;
    max-width: 30rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--crm-ink);
}
.error-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.error-panel-ref {
    margin: 1.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--crm-rule-soft);
    font-size: 0.75rem;
    color: var(--crm-ink-faint);
}
.error-panel-ref code {
    color: var(--crm-ink-muted);
    background: none;
    word-break: break-all;
}

[data-bs-theme="dark"] .error-page-body { background: var(--crm-surface-2); }


/* ═══════════════════════════════════════════════════════════════════════
   DEVICE NOTIFICATION PREVIEW
   Shows what a composed push actually looks like on a handset. A broadcast
   is irreversible, so "what will they see" has to be answerable BEFORE the
   send, not after. Deliberately neutral chrome — this represents the OS
   notification shade, not our own UI.
   ═══════════════════════════════════════════════════════════════════════ */
.push-preview-shell {
    /* Constant in both themes - this is a device screen, not app chrome. */
    background: var(--crm-device-shell);
    border-radius: var(--crm-radius-lg);
    padding: 1.1rem 0.9rem 1.4rem;
    box-shadow: var(--crm-shadow);
}
.push-preview-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.35rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
}
.push-preview-card {
    background: var(--crm-surface);
    border-radius: var(--crm-radius);
    padding: 0.7rem 0.8rem;
    box-shadow: var(--crm-shadow-sm);
}
.push-preview-app {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--crm-ink-muted);
}
.push-preview-app .fas { color: var(--crm-brand); }
.push-preview-app .pp-time { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.push-preview-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--crm-ink-strong);
    line-height: 1.3;
    margin-bottom: 0.15rem;
    overflow-wrap: anywhere;
}
.push-preview-body {
    font-size: 0.82rem;
    color: var(--crm-ink);
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.push-preview-title:empty::before,
.push-preview-body:empty::before {
    content: attr(data-placeholder);
    color: var(--crm-ink-faint);
    font-weight: 400;
}
/* Mirrors the collapsed-shade truncation the OS applies, so the preview does
   not promise more text than a handset will actually show. */
.push-preview-body {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.push-preview-shell.is-expanded .push-preview-body {
    display: block;
    overflow: visible;
}


/* ═══════════════════════════════════════════════════════════════════════
   ACTIONABLE EMPTY STATE  (shared)
   An empty list must say WHY it is empty and what to do next — otherwise
   "no data" and "the lookup failed" are indistinguishable on screen.
   Pair with .crm-empty-state--error when the cause was a failed load.
   ═══════════════════════════════════════════════════════════════════════ */
.crm-empty-state {
    padding: 1.4rem 1.1rem;
    text-align: center;
    color: var(--crm-ink-muted);
}
.crm-empty-state > .ces-icon {
    width: 42px; height: 42px;
    margin: 0 auto 0.6rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--crm-surface-tint);
    color: var(--crm-ink-faint);
    font-size: 1.05rem;
}
.crm-empty-state > .ces-title {
    font-weight: 600;
    color: var(--crm-ink-strong);
    margin-bottom: 0.2rem;
}
.crm-empty-state > .ces-detail {
    font-size: 0.82rem;
    line-height: 1.5;
    max-width: 34rem;
    margin: 0 auto;
}
.crm-empty-state--error > .ces-icon {
    background: var(--crm-danger-soft);
    color: var(--crm-danger);
}
.crm-empty-state--error > .ces-title { color: var(--crm-danger); }

/* Preview column tracks the composer on wide screens. Offset clears BOTH the
   top nav and the sticky form-completion bar above it — hence -offset-2. */
@media (min-width: 1200px) {
    .push-preview-col {
        position: sticky;
        top: var(--crm-sticky-offset-2);
        z-index: var(--z-base);
    }
}

/* Bootstrap's <kbd> ships a fixed near-black-on-light treatment that does not
   participate in the theme, so the Ctrl+K hint in the page header rendered as a
   bright white chip on every dark page. Tokenised so it follows the theme. */
kbd {
    background-color: var(--crm-surface-3);
    color: var(--crm-ink-strong);
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius-sm);
    padding: 0.1rem 0.35rem;
    font-size: 0.75em;
}


/* ═══════════════════════════════════════════════════════════════════════
   CARD TITLE SCALE
   Card headers were rendering at two sizes across the app - 19.2px from the
   default <h5>, and 16px wherever a page had added .fs-0 - so the same
   heading level looked different from page to page. Pinned here so the size
   is a property of the component, not of who wrote the markup.
   ═══════════════════════════════════════════════════════════════════════ */
.card-header h5,
.card-header .h5 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}


/* ═══════════════════════════════════════════════════════════════════════
   KEYBOARD FOCUS RING  (WCAG 2.4.7)
   Falcon's theme.css suppresses the focus outline in several places and
   site.css did the same, so tabbing through the app moved an INVISIBLE
   cursor - verified by driving real Tab presses and reading the computed
   style: the element matched :focus-visible with `outline: none` and
   `box-shadow: none`.

   :focus-visible (not :focus) means this shows for keyboard users and stays
   out of the way for mouse users, which is why the outline was suppressed in
   the first place. Uses the brand token, and a contrasting offset so the ring
   is legible on both light and dark surfaces.
   ═══════════════════════════════════════════════════════════════════════ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-check-input:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.crm-row:focus-visible {
    outline: 2px solid var(--crm-brand) !important;
    outline-offset: 2px;
    border-radius: var(--crm-radius-sm);
}

[data-bs-theme="dark"] a:focus-visible,
[data-bs-theme="dark"] button:focus-visible,
[data-bs-theme="dark"] input:focus-visible,
[data-bs-theme="dark"] select:focus-visible,
[data-bs-theme="dark"] textarea:focus-visible,
[data-bs-theme="dark"] [tabindex]:focus-visible,
[data-bs-theme="dark"] .btn:focus-visible,
[data-bs-theme="dark"] .form-control:focus-visible,
[data-bs-theme="dark"] .form-check-input:focus-visible,
[data-bs-theme="dark"] .nav-link:focus-visible,
[data-bs-theme="dark"] .dropdown-item:focus-visible,
[data-bs-theme="dark"] .crm-row:focus-visible {
    /* Brand navy is nearly invisible against the dark sidebar/background. */
    outline-color: var(--falcon-info, #27bcfd) !important;
}


/* ======================================================================
   SHARED PAGE COMPONENTS  (hoisted 2026-08-29)
   Declared by more than one page and therefore not page-specific at all.
   Each of these had been copy-pasted and then edited in some copies -
   .payload-bubble had three definitions, .log-view-btn four - which is the
   drift the shared-component rule exists to prevent. One definition now.
   ====================================================================== */
#fieldSchool { position: relative; z-index: var(--z-raised); }
.badge-error { background: var(--crm-danger); color: var(--crm-on-accent); }
.badge-new { background: var(--crm-success); color: var(--crm-on-accent); }
.badge-skip { background: var(--crm-warning); color: var(--crm-on-accent); }
.drop-zone {
        border: 2px dashed var(--crm-rule); border-radius: 12px; padding: 2.5rem 2rem;
        text-align: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: var(--crm-surface-2); cursor: pointer; position: relative; overflow: hidden;
    }
.drop-zone input[type="file"] { position: absolute; width: 0; height: 0; opacity: 0; overflow: hidden; }
.drop-zone-icon { font-size: 2.5rem; transition: all 0.3s ease; position: relative; z-index: var(--z-base); }
.drop-zone-text { position: relative; z-index: var(--z-base); transition: color 0.3s ease; }
.drop-zone.dragover {
        border-color: var(--crm-brand); border-style: solid; background: rgba(var(--crm-brand-rgb), 0.06);
        transform: scale(1.01); box-shadow: 0 0 0 4px rgba(var(--crm-brand-rgb), 0.1);
    }
.drop-zone.dragover .drop-zone-icon { color: var(--crm-brand) !important; transform: scale(1.15); }
.drop-zone.dragover .drop-zone-text { color: var(--crm-brand); }
.drop-zone::before {
        content: ''; position: absolute; inset: 0;
        background: radial-gradient(circle at center, rgba(22, 83, 126, 0.04) 0%, transparent 70%);
        opacity: 0; transition: opacity 0.3s ease;
    }
.drop-zone:hover { border-color: var(--falcon-primary); background: rgba(22, 83, 126, 0.02); }
.drop-zone:hover::before { opacity: 1; }
.faq-a { color: var(--crm-ink-faint); font-size: 0.9rem; }
.faq-item {
        border-bottom: 1px solid rgba(0,0,0,0.06);
        padding: 0.75rem 0;
    }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; color: var(--falcon-gray-900); margin-bottom: 0.25rem; }
.field-error .drop-zone { border-color: var(--crm-danger) !important; background: rgba(230, 55, 87, 0.03); }
.file-check { color: var(--crm-success); }
.file-info {
        display: none; background: linear-gradient(135deg, var(--crm-success-soft) 0%, var(--crm-info-soft) 100%);
        border: 1px solid rgba(var(--crm-success-rgb), 0.30); border-radius: 10px; padding: 0.85rem 1rem; margin-top: 0.75rem;
        animation: fadeInUp 0.3s ease;
    }
.file-info-icon { font-size: 1.5rem; color: var(--crm-success-deep); }
.file-info-name { font-weight: 600; font-size: 0.88rem; color: var(--crm-ink-strong); word-break: break-all; }
.file-info-remove {
        cursor: pointer; color: var(--crm-ink-faint); font-size: 0.9rem; transition: all 0.2s ease;
        border: none; background: none; padding: 4px 8px; border-radius: 6px;
    }
.file-info-remove:hover { color: var(--crm-danger); background: rgba(230, 55, 87, 0.08); }
.file-info-size { font-size: 0.78rem; color: var(--crm-ink-faint); }
.file-info.show { display: flex; }
.filter-pill.active {
        border-color: currentColor;
        box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
        filter: brightness(0.95) saturate(1.2);
    }
.filter-pill.all         { background: rgba(var(--crm-brand-rgb),0.10); color: var(--crm-brand); }
.filter-pill:hover {
        filter: brightness(0.96);
        text-decoration: none;
    }
.health-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.health-dot.ok       { background: var(--crm-success); }
.help-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.78rem; font-weight: 600; color: var(--crm-on-accent); }
.help-card {
        opacity: 0;
        animation: fadeInUp 0.5s ease forwards;
    }
.help-card:nth-child(1) { animation-delay: 0.05s; }
.help-card:nth-child(10) { animation-delay: 0.5s; }
.help-card:nth-child(2) { animation-delay: 0.1s; }
.help-card:nth-child(3) { animation-delay: 0.15s; }
.help-card:nth-child(4) { animation-delay: 0.2s; }
.help-card:nth-child(5) { animation-delay: 0.25s; }
.help-card:nth-child(6) { animation-delay: 0.3s; }
.help-card:nth-child(7) { animation-delay: 0.35s; }
.help-card:nth-child(8) { animation-delay: 0.4s; }
.help-card:nth-child(9) { animation-delay: 0.45s; }
.help-section h5 {
        color: var(--crm-info);
        border-bottom: 2px solid var(--crm-info);
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
.help-step {
        display: flex;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }
.help-step-num {
        width: 32px; height: 32px;
        border-radius: 50%;
        background: var(--crm-info);
        color: var(--crm-on-accent);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
.import-card { opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.import-card:nth-child(1) { animation-delay: 0.05s; }
.import-card:nth-child(2) { animation-delay: 0.15s; }
.log-row td { vertical-align: middle; transition: padding-left 0.25s ease; }
.log-row:hover { }
.log-row:hover .log-view-btn { opacity: 1; }
.log-row:hover td:first-child { padding-left: 1rem; }
.payload-bubble {
        background: var(--crm-surface-tint);
        border-radius: var(--crm-radius);
        padding: 0.85rem 1rem;
        margin-top: 0.5rem;
        font-size: 0.78rem;
        line-height: 1.5;
        color: var(--crm-ink-strong);
        font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
        max-height: 180px;
        overflow-y: auto;
        white-space: pre-wrap;
        word-break: break-all;
        position: relative;
    }
.payload-bubble pre { margin:0; font-size:0.78rem; max-height:200px; overflow:auto; white-space:pre-wrap; word-wrap:break-word; color:var(--crm-ink-strong); }
.payload-copy-btn {
        position: absolute; top: 8px; right: 8px;
        background: var(--crm-surface); border: 1px solid var(--crm-rule);
        border-radius: var(--crm-radius-sm); padding: 3px 10px; font-size: 0.68rem;
        color: var(--crm-ink-muted); cursor: pointer;
        transition: all 0.2s ease; display: flex; align-items: center; gap: 4px;
    }
.payload-copy-btn.copied { background: var(--crm-success); color: var(--crm-on-accent); border-color: var(--crm-success); }
.payload-copy-btn:hover { background: var(--crm-surface-2); color: var(--crm-ink-strong); }
.payload-label {
        font-size: 0.8rem;
        color: var(--crm-ink-muted);
        font-weight: 400;
        margin-top: 0.85rem;
        margin-bottom: 0.35rem;
        cursor: pointer;
        user-select: none;
    }
.pmt-amount-display { font-size: 1.6rem; font-weight: 700; color: var(--crm-danger); line-height: 1; }
.pmt-summary-label { color: var(--falcon-text-muted); }
.pmt-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; border-bottom: 1px dashed var(--falcon-border-color); font-size: 0.82rem; }
.pmt-summary-row:last-child { border-bottom: none; }
.pmt-summary-value { font-weight: 600; }
.preview-filter-btn {
        border: 1px solid var(--crm-rule); background: var(--crm-surface); color: var(--falcon-gray-700);
        font-size: 0.8rem; padding: 0.3rem 0.85rem; border-radius: 20px;
        cursor: pointer; transition: all 0.2s ease; font-weight: 500;
    }
.preview-filter-btn .filter-count {
        display: inline-block; min-width: 18px; text-align: center; font-size: 0.72rem;
        font-weight: 700; padding: 0 4px; border-radius: 10px; background: rgba(0,0,0,0.08); margin-left: 4px;
    }
.preview-filter-btn.active { background: var(--falcon-primary); color: var(--crm-on-accent); border-color: var(--falcon-primary); }
.preview-filter-btn.active .filter-count { background: rgba(255,255,255,0.25); }
.preview-filter-btn:hover { border-color: var(--falcon-primary); color: var(--falcon-primary); }
.preview-filter-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.preview-scroll { max-height: 500px; overflow-y: auto; border: 1px solid var(--crm-rule); border-radius: 8px; }
.preview-scroll::-webkit-scrollbar { width: 6px; }
.preview-scroll::-webkit-scrollbar-thumb { background: var(--crm-ink-faint); border-radius: 3px; }
.preview-search { max-width: 280px; font-size: 0.82rem; border-radius: 20px; padding-left: 2.2rem; }
.preview-search-wrap { position: relative; }
.preview-search-wrap .fa-search { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--crm-ink-faint); font-size: 0.78rem; }
.preview-table { font-size: 0.82rem; }
.preview-table th { white-space: nowrap; }
.result-card { border-radius: 12px; overflow: hidden; }
.result-header { background: var(--crm-gradient-brand); color: var(--crm-on-accent); padding: 1rem 1.5rem; }
.result-stat { text-align: center; padding: 1rem; }
.result-stat h3 { margin: 0; font-weight: 700; }
.result-stat small { font-size: 0.75rem; color: var(--crm-ink-faint); }
.sanitize-note { font-size: 0.75rem; color: var(--crm-brand); }
.slide-up { animation: slideUpFade 0.35s ease both; }
.slide-up:nth-child(1) { animation-delay: 0ms; }
.slide-up:nth-child(2) { animation-delay: 60ms; }
.slide-up:nth-child(3) { animation-delay: 120ms; }
.slide-up:nth-child(4) { animation-delay: 180ms; }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }


/* ═══════════════════════════════════════════════════════════════════════
   PAGE STYLES
   Lifted out of per-page <style> blocks (2026-08-29). They lived in the
   pages because that is where they were written, not because they needed
   to: a <style> in a Razor page is global to that document anyway, so the
   only thing the location bought was 35 places for the same component to
   drift - which is exactly what had happened to the log-page kit.

   Rules whose selector site.css already declared were DELETED rather than
   moved; the canonical definition wins. What remains here is genuinely
   page-specific and fully tokenised.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Pages/Customers/CustomerForm.cshtml ─────────────────────────────── */
	.section-card:nth-child(1) { animation-delay: 0s; }
	.section-card:nth-child(2) { animation-delay: 0.07s; }
	.section-card:nth-child(3) { animation-delay: 0.14s; }
	.section-card:nth-child(4) { animation-delay: 0.21s; }
	.section-card:nth-child(5) { animation-delay: 0.28s; }
	.section-card:nth-child(6) { animation-delay: 0.35s; }
	@keyframes sectionFadeIn { to { opacity: 1; transform: translateY(0); } }

	.section-toggle { cursor: pointer; user-select: none; transition: background-color 0.2s ease; border-radius: 0.375rem 0.375rem 0 0; }
	.section-toggle:hover { background-color: rgba(var(--falcon-primary-rgb), 0.04); }
	.section-toggle .chevron-icon { transition: transform 0.3s ease; }
	.section-toggle.collapsed .chevron-icon { transform: rotate(-90deg); }
	.section-toggle .section-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; transition: transform 0.3s ease, box-shadow 0.3s ease; }
	.section-toggle:hover .section-icon { }

	.config-badge { font-size: 0.7rem; padding: 0.2rem 0.55rem; border-radius: 50px; font-weight: 600; letter-spacing: 0.3px; }
	.config-badge-active { background: var(--crm-grad-success); color: var(--crm-on-accent); }
	.config-badge-inactive { background: rgba(var(--falcon-quaternary-color-rgb), 0.1); color: var(--falcon-quaternary-color); }

	.pwd-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--falcon-quaternary-color); cursor: pointer; padding: 4px 6px; z-index: var(--z-raised); transition: color 0.2s; }
	.pwd-toggle:hover { color: var(--falcon-primary); }

	.form-control:focus, .form-control-opt:focus, .form-select:focus { box-shadow: 0 0 0 0.2rem rgba(var(--falcon-primary-rgb), 0.15); border-color: var(--falcon-primary); transition: box-shadow 0.2s ease, border-color 0.2s ease; }
	.collapse, .collapsing { transition: height 0.3s ease; }

	.auth-type-option { border: 2px solid var(--falcon-border-color); border-radius: 8px; padding: 0.6rem 0.8rem; cursor: pointer; transition: all 0.25s ease; text-align: center; }
	.auth-type-option:hover { border-color: var(--falcon-primary); background-color: rgba(var(--falcon-primary-rgb), 0.03); }
	.auth-type-option.active { border-color: var(--falcon-primary); background-color: rgba(var(--falcon-primary-rgb), 0.06); box-shadow: 0 0 0 1px var(--falcon-primary); }
	.auth-type-option .auth-icon { font-size: 1.2rem; margin-bottom: 0.25rem; }

	.sidebar-card .card-header { padding: 0.75rem 1rem; }
	.sidebar-card .card-body { padding: 0.85rem 1rem; }

/* ── Pages/Customers/CustomerList.cshtml ─────────────────────────────── */
    
    .ct-pill {
        display: inline-block;
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.3px;
        padding: 2px 8px;
        border-radius: 10px;
    }
    .ct-pill.education  { background: rgba(var(--crm-brand-rgb),0.12); color: var(--crm-brand); }
    .ct-pill.higher-education { background: var(--crm-info-soft); color: var(--crm-info); }
    .ct-pill.health     { background: rgba(230,55,87,0.14);  color: var(--crm-danger); }
    .ct-pill.corp       { background: rgba(245,128,62,0.14); color: var(--crm-warning-deep); }
    .ct-pill.business   { background: var(--crm-surface-tint); color: var(--crm-brand); }
    .ct-pill.finance    { background: rgba(0,124,255,0.14);  color: var(--crm-brand); }
    .ct-pill.hospitality{ background: var(--crm-warning-soft); color: var(--crm-warning-deep); }
    .ct-pill.other      { background: rgba(116,129,148,0.10);color: var(--crm-ink-faint); }
    .filter-pill.active .pill-count {
        background: rgba(0,0,0,0.18);
    }
    .filter-pill.education   { background: rgba(var(--crm-brand-rgb),0.12); color: var(--crm-brand); }
    .filter-pill.higher-education { background: var(--crm-info-soft); color: var(--crm-info); }
    .filter-pill.health      { background: rgba(230,55,87,0.14);  color: var(--crm-danger); }
    .filter-pill.corp        { background: rgba(245,128,62,0.14); color: var(--crm-warning-deep); }
    .filter-pill.business    { background: var(--crm-surface-tint); color: var(--crm-brand); }
    .filter-pill.finance     { background: rgba(0,124,255,0.14);  color: var(--crm-brand); }
    .filter-pill.hospitality { background: var(--crm-warning-soft); color: var(--crm-warning-deep); }
    .filter-pill.other       { background: rgba(116,129,148,0.10);color: var(--crm-ink-faint); }

/* ── Pages/Customers/CustomerServices.cshtml ─────────────────────────────── */
    
    @keyframes fadeInUp   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes fadeInScale{ from { opacity: 0; transform: scale(0.96); }     to { opacity: 1; transform: scale(1); } }
    @keyframes slideInRight{ from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
    @keyframes pulseGlow  { 0%,100% { box-shadow: 0 0 0 0 rgba(0,210,122,0.5);} 50% { box-shadow: 0 0 0 8px rgba(0,210,122,0);} }
    @keyframes slideInUp  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

    
    .cs-row { transition: background-color 0.18s ease, transform 0.18s ease; cursor: pointer; }
    .cs-row:hover { background: rgba(var(--crm-brand-rgb),0.05); }
    .cs-row:hover .cs-manage-btn { opacity: 1; }

    .cs-manage-btn {
        opacity: 0;
        transition: opacity 0.2s, transform 0.2s, background 0.2s;
        background: var(--crm-surface); color: var(--crm-brand);
        border: 1px solid var(--crm-brand); border-radius: var(--crm-radius);
        padding: 3px 10px; font-size: 0.75rem; font-weight: 600;
    }
    .cs-manage-btn:hover { background: var(--crm-brand); color: var(--crm-on-accent); }

    
    .health-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.3px; }
    .health-ok        { background: var(--crm-success-soft);  color: var(--crm-success-deep); }
    .health-warning   { background: var(--crm-warning-soft); color: var(--crm-warning-deep); }
    .health-critical  { background: var(--crm-danger-soft);  color: var(--crm-danger-deep); }
    .health-expired   { background: var(--crm-surface-3);color: var(--crm-ink-muted); text-decoration: line-through; }
    .health-zero      { background: var(--crm-danger-soft);  color: var(--crm-danger-deep); }
    .health-none,
    .health-inactive  { background: rgba(116,129,148,0.10);color: var(--crm-ink-faint); font-style: italic; }
    .health-low       { background: var(--crm-warning-soft); color: var(--crm-warning-deep); }
    .health-dot.warning  { background: var(--crm-warning); }
    .health-dot.critical { background: var(--crm-danger); }
    .health-dot.expired  { background: var(--crm-ink-faint); }

    
    #csModal .modal-dialog { max-width: 780px; }

    .cs-tabs { display: flex; border-bottom: 1px solid var(--falcon-gray-300); padding: 0 1.25rem; margin-top: 1rem; }
    .cs-tab  { padding: 0.7rem 1.1rem; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--crm-ink-faint); border-bottom: 3px solid transparent; transition: all 0.2s ease; user-select: none; }
    .cs-tab:hover { color: var(--falcon-primary); }
    .cs-tab.active { color: var(--falcon-primary); border-bottom-color: var(--falcon-primary); }

    .cs-tab-pane { display: none; padding: 1.25rem; opacity: 0; }
    .cs-tab-pane.active { display: block; opacity: 1; }

    .cs-mode-group { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
    .cs-mode-btn {
        flex: 1; min-width: 130px;
        background: var(--falcon-gray-100); border: 2px solid transparent;
        border-radius: 10px; padding: 0.65rem 0.85rem; cursor: pointer;
        font-size: 0.78rem; font-weight: 600; color: var(--crm-ink-muted);
        transition: all 0.2s ease;
        text-align: left;
    }
    .cs-mode-btn:hover  { background: var(--falcon-gray-200); }
    .cs-mode-btn.active { background: rgba(var(--crm-brand-rgb),0.10); border-color: var(--falcon-primary); color: var(--falcon-primary); }
    .cs-mode-btn .mode-title { display: block; font-size: 0.82rem; }
    .cs-mode-btn .mode-hint  { display: block; font-size: 0.7rem; font-weight: 400; opacity: 0.75; margin-top: 2px; }

    .cs-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.85rem; }
    .cs-input-row.single { grid-template-columns: 1fr; }
    .cs-input-row label  { font-size: 0.8rem; color: var(--crm-ink-muted); font-weight: 400; margin-bottom: 4px; display: block; }

    .cs-preview {
        background: var(--crm-surface-2);
        border: 1px solid var(--crm-rule-soft);
        padding: 0.7rem 0.95rem; border-radius: 8px; margin-top: 0.85rem;
        font-size: 0.83rem; opacity: 0; animation: slideInUp 0.3s ease forwards;
    }
    .cs-preview.error {
        background: linear-gradient(135deg, rgba(230,55,87,0.06), rgba(230,55,87,0.10));
        border-color: var(--crm-danger); color: var(--crm-danger-deep);
    }
    .cs-preview .arrow { color: var(--falcon-primary); margin: 0 6px; }

    .cs-apply-btn {
        background: var(--crm-grad-success);
        color: var(--crm-on-accent); border: 0; padding: 0.65rem 1.5rem; border-radius: 8px;
        font-size: 0.82rem; font-weight: 600; cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    }
    .cs-apply-btn:hover:not(:disabled) { }
    .cs-apply-btn:disabled { opacity: 0.5; cursor: not-allowed; }
    .cs-apply-btn .spinner-border { width: 14px; height: 14px; border-width: 2px; vertical-align: middle; margin-right: 6px; }

    
    .cs-sms-history-title { font-size: 0.85rem; font-weight: 600; font-family: var(--falcon-font-sans-serif, Poppins, sans-serif); color: var(--crm-ink-strong); margin-bottom: 0.5rem; }
    /* v2026.10.13: the list is the shared timeline now (renderTimeline); only its scroll box is page-specific. */
    .cs-sms-history #smsHistoryList { max-height: 240px; overflow-y: auto; padding-right: 0.25rem; }

/* ── Pages/Customers/Components/_emailReceiptModal.cshtml ─────────────────────────────── */
    #emailReceiptModal .modal-content {
        border-radius: 12px;
        border: none;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    }

    #emailReceiptModal .form-label {
        font-weight: 600;
        color: var(--crm-brand-deep);
        font-size: 0.875rem;
    }

    #emailReceiptModal .form-control:focus {
        border-color: var(--crm-brand);
        box-shadow: 0 0 0 0.2rem rgba(40, 107, 104, 0.15);
    }

    #emailReceiptModal .btn-primary {
        background: linear-gradient(135deg, var(--crm-brand-deep) 0%, var(--crm-ink-strong) 100%);
        border: none;
        border-bottom: 3px solid var(--crm-brand);
        transition: all 0.3s;
    }

    #emailReceiptModal .btn-primary:hover {
        border-bottom-color: var(--crm-success);
    }

    #emailReceiptModal .modal-footer {
        background-color: var(--crm-surface-2);
        border-top: 1px solid var(--crm-rule);
    }

    #emailReceiptModal .text-primary {
        color: var(--crm-brand) !important;
    }

    #emailReceiptModal h4 {
        color: var(--crm-brand-deep);
    }

    #emailReceiptModal .bg-body-tertiary {
        background-color: var(--crm-surface-2) !important;
    }

/* ── Pages/Dashboards/Index.cshtml ─────────────────────────────── */
        .echart-lead-activity {
            width: 6.625rem;
            height: 6.625rem;
        }

        .echart-bar-monthly-lead {
            width: 8.5rem;
        }

        .echart-bar-monthly-lead-smaller-width {
            width: 6.5rem;
        }

        .echart-line-total-campaign-lead {
            height: 18.7rem;
        }

/* ── Pages/DashboardSlides/DashboardSlideList.cshtml ─────────────────────────────── */
    
    .phone-mockup {
        width: 220px;
        border-radius: 28px;
        background: var(--falcon-gray-900);
        padding: 10px 8px;
        box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .2);
    }

    .phone-mockup-screen {
        position: relative;
        width: 100%;
        height: 420px;
        border-radius: 18px;
        background: var(--falcon-body-bg, var(--crm-on-accent));
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .phone-mockup-statusbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px 6px;
        font-size: .7rem;
        font-weight: 600;
        color: var(--falcon-gray-900);
    }

    .phone-mockup-slider {
        position: relative;
        margin: 0 8px;
        height: 90px;
        border-radius: 10px;
        overflow: hidden;
        background: var(--falcon-gray-200);
    }

    .phone-mockup-slide {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transition: opacity .6s ease-in-out;
    }

    .phone-mockup-slide.active {
        opacity: 1;
    }

    .phone-mockup-empty {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--falcon-gray-500);
        font-size: .65rem;
        text-align: center;
        padding: 0 12px;
    }

    .phone-mockup-empty .fas {
        font-size: 1.25rem;
    }

    .phone-mockup-dots {
        display: flex;
        justify-content: center;
        gap: 4px;
        margin-top: 6px;
    }

    .phone-mockup-dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--falcon-gray-300);
        transition: background-color .3s ease-in-out;
    }

    .phone-mockup-dot.active {
        background: var(--falcon-primary);
    }

    .phone-mockup-tiles {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 14px 10px 0;
    }

    .phone-mockup-tile {
        height: 46px;
        border-radius: 8px;
        background: var(--falcon-gray-200);
    }

/* ── Pages/Integrations/SmsProviders.cshtml ─────────────────────────────── */
.provider-card { transition: transform .15s, box-shadow .15s; }
.provider-card:hover { }
.provider-badge { font-size: .68rem; padding: .22em .55em; border-radius: .25rem; font-weight: 600; }
.failover-banner { background: var(--crm-grad-danger); color:var(--crm-on-accent); border-radius:.375rem; padding:.55rem .85rem; font-size:.8rem; margin-bottom:.5rem; }
.balance-bar { height: 4px; border-radius: 2px; background: var(--crm-rule); margin-top:.35rem; overflow: hidden; }
.balance-fill { height: 100%; border-radius: 2px; transition: width .5s; }
.action-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .75rem; }

/* ── Pages/Licensing/SaccLicenseList.cshtml ─────────────────────────────── */
    
    .pt-pill {
        display: inline-block;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.3px;
        padding: 2px 8px;
        border-radius: 10px;
        margin-right: 6px;
        vertical-align: middle;
    }
    .pt-pill.school { background: rgba(var(--crm-brand-rgb),0.12); color: var(--crm-brand); }
    .pt-pill.erp    { background: rgba(245,128,62,0.14); color: var(--crm-warning-deep); }

/* ── Pages/Logs/ApiLog.cshtml ─────────────────────────────── */
        
        .badge-method-get { background: linear-gradient(135deg, var(--crm-info), var(--crm-brand)) !important; color: var(--crm-on-accent) !important; }
        .badge-method-post { background: var(--crm-grad-success) !important; color: var(--crm-on-accent) !important; }
        .badge-method-put { background: var(--crm-grad-warning) !important; color: var(--crm-on-accent) !important; }
        .badge-method-delete { background: var(--crm-grad-danger) !important; color: var(--crm-on-accent) !important; }
        .badge-method-patch { background: var(--crm-gradient-brand) !important; color: var(--crm-on-accent) !important; }
        .badge-method-mediatr { background: linear-gradient(135deg, var(--crm-ink-faint), var(--crm-ink-muted)) !important; color: var(--crm-on-accent) !important; }
        .badge-status-warning { background: var(--crm-grad-warning) !important; color: var(--crm-on-accent) !important; }
        .badge-status-danger { background: var(--crm-grad-danger) !important; color: var(--crm-on-accent) !important; }
        .badge-status-secondary { background: linear-gradient(135deg, var(--crm-ink-faint), var(--falcon-gray-700)) !important; color: var(--crm-on-accent) !important; }

/* ── Pages/Logs/BrowsingActivityLog.cshtml ─────────────────────────────── */
    .text-preview {
        max-width: 220px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* v2026.11.06: the browse-modal gradient header and staggered rows were replaced by the shared
       letterhead detail window (.crm-detail-modal, "Detail Modal" above). */

    .url-bubble {
        background: var(--crm-surface-tint);
        border-radius: var(--crm-radius); padding: 0.85rem 1rem;
        font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
        font-size: 0.82rem; color: var(--crm-ink-strong);
        word-break: break-all; position: relative;
    }

    .device-badge {
        display: inline-block; padding: 0.25rem 0.65rem;
        border-radius: 20px; font-size: 0.78rem; font-weight: 500;
    }
    .device-desktop { background: rgba(22, 83, 126, 0.1); color: var(--crm-brand); }
    .device-mobile { background: var(--crm-success-soft); color: var(--crm-success-deep); }
    .device-tablet { background: var(--crm-warning-soft); color: var(--crm-warning-deep); }
    .device-other { background: var(--crm-surface-3); color: var(--crm-ink-muted); }

    .copy-btn {
        position: absolute; top: 0.5rem; right: 0.5rem;
        background: rgba(22, 83, 126, 0.08); border: none;
        border-radius: 6px; padding: 0.3rem 0.5rem;
        font-size: 0.72rem; color: var(--falcon-primary);
        cursor: pointer; transition: all 0.2s ease;
    }
    .copy-btn:hover { background: var(--falcon-primary); color: var(--crm-on-accent); }

/* ── Pages/Logs/CollectionLog.cshtml ─────────────────────────────── */
    
    .response-parsed {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
        margin-top: 0.25rem;
    }
    .response-field {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.82rem;
    }
    .response-field .rf-key {
        min-width: 9rem;
        flex: 0 0 38%;
        color: var(--crm-ink-muted);
        font-weight: 400;
        font-size: 0.8rem;
    }
    .response-field .rf-value {
        color: var(--crm-ink-strong);
        overflow-wrap: anywhere;
        font-variant-numeric: tabular-nums;
        flex: 1;
        min-width: 0;
    }
    .response-field .rf-value.mono {
        font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
        font-size: 0.75rem;
    }
    .rf-pill {
        display: inline-flex;
        align-items: center;
        padding: 2px 10px;
        border-radius: 12px;
        font-size: 0.72rem;
        font-weight: 600;
    }
    .rf-pill.ok      { background: rgba(0,210,122,0.12); color: var(--crm-success-deep); }
    .rf-pill.fail    { background: rgba(230,55,87,0.12); color: var(--crm-danger); }
    .rf-pill.pending { background: rgba(245,128,62,0.12); color: var(--crm-warning-deep); }
    .rf-pill.muted   { background: rgba(116,129,148,0.12); color: var(--crm-ink-faint); }
    .payload-label .toggle-icon {
        transition: transform 0.2s ease;
        display: inline-block;
        margin-right: 0.25rem;
    }
    .payload-label.collapsed .toggle-icon { transform: rotate(-90deg); }
    .badge-status-pending .fa-spinner { margin-right: 0.25rem; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .badge-status-pending .fa-spinner { animation: spin 1.5s linear infinite; }

    .pending-meta {
        background: var(--crm-surface-2);
        border: 1px solid var(--crm-rule);
        padding: 0.6rem 0.85rem;
        border-radius: 6px;
        font-size: 0.78rem;
        color: var(--crm-warning-deep);
        margin-top: 0.5rem;
    }
    .pending-meta strong { color: var(--crm-warning-deep); }

/* ── Pages/Logs/ErrorLog.cshtml ─────────────────────────────── */
    
    .error-code-bubble {
        background: var(--crm-surface-tint);
        border-radius: var(--crm-radius);
        padding: 0.85rem 1rem;
        margin-top: 0.5rem;
        font-size: 0.88rem;
        line-height: 1.6;
        color: var(--crm-ink-strong);
        position: relative;
    }
    .error-copy-btn {
        position: absolute; top: 8px; right: 8px;
        background: var(--crm-surface); border: 1px solid var(--crm-danger-soft);
        border-radius: 6px; padding: 4px 10px; font-size: 0.7rem;
        color: var(--crm-danger-deep); cursor: pointer;
        transition: all 0.2s ease; display: flex; align-items: center; gap: 4px;
    }
    .error-copy-btn:hover { background: var(--crm-danger); color: var(--crm-on-accent); border-color: var(--crm-danger); }
    .error-copy-btn.copied { background: var(--crm-success); color: var(--crm-on-accent); border-color: var(--crm-success); }

    .stack-bubble {
        background: var(--crm-surface-tint);
        border-radius: var(--crm-radius);
        padding: 0.85rem 1rem;
        margin-top: 0.35rem;
        font-size: 0.73rem;
        line-height: 1.5;
        color: var(--crm-ink-strong);
        font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
        max-height: 220px;
        overflow-y: auto;
        white-space: pre-wrap;
        word-break: break-all;
        position: relative;
    }
    .stack-copy-btn {
        position: absolute; top: 8px; right: 8px;
        background: var(--crm-surface); border: 1px solid var(--crm-rule);
        border-radius: var(--crm-radius-sm); padding: 3px 10px; font-size: 0.68rem;
        color: var(--crm-ink-muted); cursor: pointer;
        transition: all 0.2s ease; display: flex; align-items: center; gap: 4px;
    }
    .stack-copy-btn:hover { background: var(--crm-surface-2); color: var(--crm-ink-strong); }
    .stack-copy-btn.copied { background: var(--crm-success); color: var(--crm-on-accent); border-color: var(--crm-success); }

    .section-label {
        font-size: 0.7rem;
        color: var(--crm-ink-faint); font-weight: 600; margin-top: 1rem; margin-bottom: 0.35rem;
    }
    .log-table .text-preview::after { color: var(--crm-danger); }

/* ── Pages/Logs/PaymentCallbackLog.cshtml ─────────────────────────────── */
    .mini-badge { padding: 2px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 600; }
    .mini-badge.valid { background: rgba(0,210,122,0.12); color: var(--crm-success-deep); }
    .mini-badge.invalid { background: rgba(230,55,87,0.12); color: var(--crm-danger); }
    .mini-badge.dup { background: rgba(245,128,62,0.12); color: var(--crm-warning-deep); }
    .mini-badge.orig { background: rgba(var(--crm-brand-rgb),0.12); color: var(--crm-brand); }

/* ── Pages/Logs/SessionActivityLog.cshtml ─────────────────────────────── */
    .action-badge {
        display: inline-flex; align-items: center;
        padding: 0.25rem 0.75rem; border-radius: 20px;
        font-size: 0.78rem; font-weight: 600; gap: 0.35rem;
    }
    .action-login {
        background: linear-gradient(135deg, rgba(0, 210, 122, 0.12) 0%, rgba(0, 210, 122, 0.06) 100%);
        color: var(--crm-success-deep); border: 1px solid rgba(0, 210, 122, 0.2);
    }
    .action-logout {
        background: linear-gradient(135deg, rgba(230, 55, 87, 0.12) 0%, rgba(230, 55, 87, 0.06) 100%);
        color: var(--crm-danger); border: 1px solid rgba(230, 55, 87, 0.2);
    }
    .action-other {
        background: linear-gradient(135deg, rgba(108, 117, 125, 0.12) 0%, rgba(108, 117, 125, 0.06) 100%);
        color: var(--crm-ink-muted); border: 1px solid rgba(108, 117, 125, 0.2);
    }

    .action-pill-login { background: var(--crm-grad-success); color: var(--crm-on-accent); }
    .action-pill-logout { background: var(--crm-grad-danger); color: var(--crm-on-accent); }
    .action-pill-other { background: linear-gradient(135deg, var(--crm-ink-muted) 0%, var(--crm-ink-strong) 100%); color: var(--crm-on-accent); }
    .action-pill {
        display: inline-flex; align-items: center;
        padding: 0.3rem 1rem; border-radius: 20px;
        font-size: 0.85rem; font-weight: 600; gap: 0.4rem;
    }

    .session-modal .modal-content {
        border: none; border-radius: 12px; overflow: hidden;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
        animation: fadeInScale 0.3s ease;
    }
    .session-modal-header {
        background: var(--crm-gradient-brand);
        padding: 1.5rem 1.75rem; border: none;
    }
    .session-modal-header .modal-title { color: var(--crm-on-accent); font-weight: 600; font-size: 1.1rem; }
    .session-modal-header .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
        opacity: 0.7; transition: opacity 0.2s ease;
    }
    .session-modal-header .btn-close:hover { opacity: 1; }

    .session-detail-row {
        opacity: 0; animation: slideInRight 0.35s ease forwards;
        padding: 0.75rem 0; border-bottom: 1px solid rgba(0,0,0,0.05);
        transition: background 0.2s ease;
    }
    .session-detail-row:hover { background: rgba(22, 83, 126, 0.03); border-radius: 6px; }
    .session-detail-row:nth-child(1) { animation-delay: 0.05s; }
    .session-detail-row:nth-child(2) { animation-delay: 0.10s; }
    .session-detail-row:nth-child(3) { animation-delay: 0.14s; }
    .session-detail-row:nth-child(4) { animation-delay: 0.18s; }
    .session-detail-row:nth-child(5) { animation-delay: 0.22s; }

    .session-action-hero {
        opacity: 0; animation: fadeInScale 0.4s ease 0.26s forwards;
        text-align: center; padding: 1.25rem; border-radius: 12px;
        background: linear-gradient(135deg, rgba(22, 83, 126, 0.04) 0%, rgba(22, 83, 126, 0.01) 100%);
        border: 1px dashed rgba(22, 83, 126, 0.12);
    }

/* ── Pages/Logs/SmsLog.cshtml ─────────────────────────────── */
.badge-failure-balance  { background: var(--crm-grad-danger)!important; color:var(--crm-on-accent)!important; }
.badge-failure-credit   { background: var(--crm-grad-warning)!important; color:var(--crm-on-accent)!important; }
.badge-failure-network  { background: linear-gradient(135deg,var(--crm-ink-faint),var(--crm-ink-muted))!important; color:var(--crm-on-accent)!important; }
.badge-failure-timeout  { background: linear-gradient(135deg, var(--crm-ink-muted), var(--crm-ink-strong))!important; color:var(--crm-on-accent)!important; }
.badge-failure-ratelimit{ background: var(--crm-gradient-brand)!important; color:var(--crm-on-accent)!important; }
.badge-failure-other    { background: linear-gradient(135deg,var(--crm-ink-faint),var(--crm-ink-muted))!important; color:var(--crm-on-accent)!important; }


.badge-status-credit { background: var(--crm-grad-warning)!important; color:var(--crm-on-accent)!important; }


.sms-row.row-selected { background:rgba(var(--crm-brand-rgb),.07)!important; }
.sms-row.row-selected td { background: var(--crm-surface-2); }


.col-reason { width: 130px; }

/* ── Pages/PaymentDisburses/PaymentDisburseForm.cshtml ─────────────────────────────── */
    .vendor-chip { display: flex; align-items: center; gap: 0.5rem; background: var(--crm-warning-soft); border-radius: 8px; padding: 0.5rem 0.75rem; margin-top: 0.5rem; }
    .vendor-chip-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--crm-warning); color: var(--crm-on-accent); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
    .vendor-chip-name { font-weight: 600; font-size: 0.85rem; }
    .vendor-chip-sub { font-size: 0.75rem; color: var(--falcon-text-muted); }

/* ── Pages/PaymentReceives/PaymentReceiveForm.cshtml ─────────────────────────────── */
    .pmt-status-badge { font-size: 0.75rem; padding: 0.3em 0.65em; border-radius: 20px; }
    .customer-chip { display: flex; align-items: center; gap: 0.5rem; background: var(--crm-surface-tint); border-radius: 8px; padding: 0.5rem 0.75rem; margin-top: 0.5rem; }
    .customer-chip-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--falcon-primary); color: var(--crm-on-accent); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
    .customer-chip-name { font-weight: 600; font-size: 0.85rem; }
    .customer-chip-sub { font-size: 0.75rem; color: var(--falcon-text-muted); }

/* ── Pages/Plans/PlanForm.cshtml ─────────────────────────────── */
    
    .json-editor {
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
        font-size: 0.82rem;
        min-height: 200px;
        background: var(--crm-surface-2);
    }

    
    @keyframes prRowIn {
        from { opacity: 0; transform: translateX(-14px); }
        to   { opacity: 1; transform: translateX(0); }
    }
    @keyframes prRowOut {
        from { opacity: 1; transform: translateX(0) scaleY(1); }
        to   { opacity: 0; transform: translateX(18px) scaleY(0.6); }
    }
    .price-row {
        animation: prRowIn 0.2s ease-out;
        transition: background-color 0.12s;
    }
    .price-row:hover { background-color: rgba(var(--crm-brand-rgb),0.03); }
    .price-row.row-exit {
        animation: prRowOut 0.18s ease-in forwards;
        pointer-events: none;
    }
    .price-row td { vertical-align: middle; }

    
    @keyframes savFlash {
        0%, 100% { background: transparent; }
        35%      { background: rgba(0,134,78,.15); border-radius: 4px; }
    }
    .sav-flash { animation: savFlash 0.55s ease; }

    
    @keyframes starPop {
        0%   { transform: scale(1); }
        40%  { transform: scale(1.75) rotate(-8deg); }
        70%  { transform: scale(0.88); }
        100% { transform: scale(1); }
    }
    .pr-star-btn {
        background: none; border: none; padding: 3px 5px;
        cursor: pointer; line-height: 1;
        transition: transform 0.1s;
    }
    .pr-star-btn:hover { }
    .pr-star-btn.star-pop .fas { animation: starPop 0.38s ease; }

    
    @keyframes btnShake {
        0%,100% { transform: translateX(0); }
        20%     { transform: translateX(-5px); }
        40%     { transform: translateX(5px); }
        60%     { transform: translateX(-3px); }
        80%     { transform: translateX(3px); }
    }
    .btn-shake { animation: btnShake 0.38s ease; }

    
    @keyframes cardPop {
        0%   { opacity: 0; transform: scale(.86) translateY(8px); }
        65%  { transform: scale(1.04) translateY(-2px); }
        100% { opacity: 1; transform: scale(1) translateY(0); }
    }
    .pricing-preview-card {
        border: 2px solid var(--crm-rule);
        border-radius: 10px;
        padding: 10px 12px;
        cursor: pointer;
        animation: cardPop 0.24s ease-out both;
        transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
        user-select: none;
    }
    .pricing-preview-card:hover {
        border-color: var(--crm-surface-border);
    }
    .pricing-preview-card.is-default {
        border-color: var(--crm-brand);
        background: linear-gradient(135deg, rgba(var(--crm-brand-rgb), 0.05) 0%, rgba(var(--crm-brand-rgb), 0.12) 100%);
        box-shadow: 0 3px 10px rgba(var(--crm-brand-rgb),.15);
    }
    .pricing-preview-card .badge-pill {
        font-size: 0.66rem;
        background: var(--crm-brand);
        color: var(--crm-on-accent);
        border-radius: 20px;
        padding: 2px 9px;
        font-weight: 600;
    }
    .pricing-preview-card .savings-tag {
        font-size: 0.72rem;
        color: var(--crm-success-deep);
        font-weight: 600;
    }
    .pricing-preview-card .default-indicator {
        font-size: 0.7rem;
        color: var(--crm-warning);
        font-weight: 700;
        margin-top: 4px;
    }

    
    .pricing-empty {
        text-align: center;
        padding: 34px 24px;
    }
    .pricing-empty-icon {
        width: 52px; height: 52px;
        border-radius: 50%;
        background: rgba(var(--crm-brand-rgb),.08);
        color: var(--crm-brand);
        display: inline-flex; align-items: center; justify-content: center;
        font-size: 22px;
        margin-bottom: 12px;
    }
    .pricing-empty-title {
        font-weight: 600; font-size: 0.9rem; color: var(--crm-ink-strong); margin-bottom: 5px;
    }
    .pricing-empty-sub {
        color: var(--crm-ink-faint); font-size: 0.79rem; line-height: 1.6;
    }

/* ── Pages/Plans/PlanList.cshtml ─────────────────────────────── */
    .plan-pill {
        display: inline-block;
        font-size: 0.7rem;
        font-weight: 600;
        padding: 2px 8px;
        border-radius: 10px;
    }
    .plan-pill.school   { background: rgba(var(--crm-brand-rgb),0.12); color: var(--crm-brand); }
    .plan-pill.erp      { background: rgba(245,128,62,0.14); color: var(--crm-warning-deep); }
    .plan-pill.inactive { background: rgba(116,129,148,0.10); color: var(--crm-ink-faint); }
    .filter-pill.school { background: rgba(var(--crm-brand-rgb),0.12); color: var(--crm-brand); }
    .filter-pill.erp    { background: rgba(245,128,62,0.14); color: var(--crm-warning-deep); }

    
    .tier-chip {
        display: inline-flex; align-items: center; gap: 3px;
        font-size: 0.68rem; font-weight: 600; white-space: nowrap;
        padding: 2px 7px; border-radius: 6px;
        background: rgba(116,129,148,0.10); color: var(--falcon-gray-700);
        border: 1px solid rgba(116,129,148,0.18);
    }
    .tier-chip.is-default {
        background: rgba(var(--crm-brand-rgb),0.10); color: var(--crm-brand);
        border-color: rgba(var(--crm-brand-rgb),0.25);
    }
    .tier-chip .tier-label {
        font-size: 0.62rem; opacity: 0.75; font-weight: 500;
    }

    
    .crm-row[data-href] { cursor: pointer; }
    .crm-row[data-href]:hover td { background-color: rgba(var(--crm-brand-rgb),0.04); }

/* ── Pages/SchoolPay/DeliveryLog.cshtml ─────────────────────────────── */
    .log-stat-card .card:hover { }
    .badge-status-abandoned { background: linear-gradient(135deg, var(--crm-ink-faint), var(--falcon-gray-700)) !important; color: var(--crm-on-accent) !important; }

    .log-row { cursor:pointer; transition: background 0.15s ease; }
    .attempts-bar { height:6px; border-radius:3px; background:var(--crm-rule); overflow:hidden; }
    .attempts-fill { height:100%; border-radius:3px; transition:width 0.3s ease; }

/* ── Pages/SchoolPay/SchoolPayAdhoc.cshtml ─────────────────────────────── */
    @keyframes checkmark {
        0% { transform: scale(0) rotate(-45deg); opacity: 0; }
        50% { transform: scale(1.2) rotate(-45deg); }
        100% { transform: scale(1) rotate(-45deg); opacity: 1; }
    }

    .tab-nav {
        display: flex;
        gap: 0;
        border-bottom: 2px solid var(--crm-rule-soft);
        margin-bottom: 1.5rem;
        animation: fadeInUp 0.5s ease 0.1s both;
    }
    .tab-nav-btn {
        padding: 12px 24px;
        border: none;
        background: transparent;
        color: var(--crm-ink-faint);
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        position: relative;
        transition: all 0.3s ease;
    }
    .tab-nav-btn::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--crm-gradient-brand);
        border-radius: 3px 3px 0 0;
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }
    .tab-nav-btn.active {
        color: var(--crm-brand-deep);
    }
    .tab-nav-btn.active::after {
        transform: scaleX(1);
    }
    .tab-nav-btn:hover:not(.active) {
        color: var(--falcon-gray-700);
    }
    .tab-nav-btn .tab-icon {
        display: inline-block;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        text-align: center;
        line-height: 28px;
        font-size: 0.75rem;
        margin-right: 8px;
    }

    .tab-panel {
        display: none;
        animation: fadeInScale 0.4s ease;
    }
    .tab-panel.active { display: block; }

    .form-card {
        border: none;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        animation: fadeInUp 0.5s ease 0.15s both;
    }
    .form-card .form-label {
        font-weight: 600;
        font-size: 0.85rem;
        color: var(--crm-ink-strong);
    }
    .form-card .form-control:focus, .form-card .form-select:focus {
        border-color: var(--crm-brand);
        box-shadow: 0 0 0 3px rgba(var(--crm-brand-rgb), 0.1);
    }

    .submit-btn {
        padding: 10px 28px;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--crm-on-accent);
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    .submit-btn:hover:not(:disabled) {
    }
    .submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
    .submit-btn .spinner-border { width: 1rem; height: 1rem; border-width: 2px; }

    .btn-register { background: linear-gradient(135deg, var(--crm-brand), var(--crm-brand)); }
    .btn-momo { background: var(--crm-grad-warning); }
    .btn-status { background: var(--crm-gradient-brand); }

    .response-card {
        border: none;
        border-radius: 12px;
        overflow: hidden;
        animation: fadeInScale 0.5s ease;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    }
    .response-header {
        padding: 1rem 1.5rem;
        color: var(--crm-on-accent);
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .response-header.success { background: var(--crm-grad-success); }
    .response-header.error { background: var(--crm-grad-danger); }
    .response-header.pending { background: var(--crm-grad-warning); }
    .response-header .check-icon {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }
    .response-body { padding: 1.25rem 1.5rem; }
    .response-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--crm-surface-2);
        animation: slideInRight 0.3s ease forwards;
        opacity: 0;
    }
    .response-row:last-child { border-bottom: none; }
    .response-label { color: var(--crm-ink-faint); font-size: 0.8rem; font-weight: 600; }
    .response-value { color: var(--crm-ink-strong); font-weight: 600; }

    .copy-ref-btn {
        background: var(--crm-rule-soft);
        border: none;
        padding: 4px 12px;
        border-radius: 6px;
        font-size: 0.8rem;
        color: var(--falcon-gray-700);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    .copy-ref-btn:hover { background: var(--crm-brand); color: var(--crm-on-accent); }
    .copy-ref-btn.copied { background: var(--crm-success); color: var(--crm-on-accent); }

    .status-result {
        text-align: center;
        padding: 2rem;
        animation: fadeInScale 0.5s ease;
    }
    .status-icon-wrap {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    .status-icon-wrap.paid {
        background: linear-gradient(135deg, rgba(var(--crm-success-rgb), 0.10), rgba(var(--crm-success-rgb), 0.26));
        color: var(--crm-success-deep);
        animation: pulseGlow 2s infinite;
    }
    .status-icon-wrap.pending-status {
        background: linear-gradient(135deg, rgba(var(--crm-warning-rgb), 0.10), rgba(var(--crm-warning-rgb), 0.26));
        color: var(--crm-warning-deep);
    }
    .status-icon-wrap.failed-status {
        background: linear-gradient(135deg, rgba(var(--crm-danger-rgb), 0.10), rgba(var(--crm-danger-rgb), 0.26));
        color: var(--crm-danger-deep);
    }

    .toast-container {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: var(--z-toast);
    }
    .adhoc-toast {
        min-width: 320px;
        border-radius: 10px;
        box-shadow: 0 8px 30px rgba(0,0,0,0.12);
        animation: slideInRight 0.4s ease;
        border: none;
    }

    .field-error {
        color: var(--crm-danger);
        font-size: 0.78rem;
        margin-top: 2px;
        display: none;
    }
    .form-control.is-invalid, .form-select.is-invalid {
        border-color: var(--crm-danger);
        animation: shake 0.3s ease;
    }
    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

/* ── Pages/SchoolPay/SchoolPayDiagnostics.cshtml ─────────────────────────────── */
    @keyframes pulseScale { 0%,100% { transform:scale(1); } 50% { transform:scale(1.05); } }

    .diag-header { opacity:0; animation:fadeInUp 0.5s ease forwards; }
    .diag-card { opacity:0; animation:fadeInUp 0.4s ease forwards; }
    .diag-card:nth-child(1) { animation-delay:0.05s; }
    .diag-card:nth-child(2) { animation-delay:0.1s; }
    .diag-card:nth-child(3) { animation-delay:0.15s; }
    .diag-card:nth-child(4) { animation-delay:0.2s; }

    .status-banner { border-radius:12px; padding:1.25rem 1.5rem; animation:fadeInUp 0.5s ease 0.1s forwards; opacity:0; }
    .status-banner.healthy { background:linear-gradient(135deg,rgba(0,210,122,0.08),rgba(0,184,107,0.04)); border:1px solid rgba(0,210,122,0.2); }
    .status-banner.degraded { background:linear-gradient(135deg,rgba(245,128,62,0.08),rgba(232,114,28,0.04)); border:1px solid rgba(245,128,62,0.2); }
    .status-banner.unhealthy { background:linear-gradient(135deg,rgba(230,55,87,0.08),rgba(208,42,74,0.04)); border:1px solid rgba(230,55,87,0.2); }
    .status-icon { font-size:2rem; animation:pulseScale 2s ease infinite; }

    .check-item { display:flex; align-items:flex-start; gap:12px; padding:0.75rem 1rem; border-radius:8px; margin-bottom:0.5rem; transition:background 0.2s ease, transform 0.15s ease; }
    .check-item:hover { background:rgba(var(--falcon-primary-rgb),0.03); }
    .check-dot { width:10px; height:10px; border-radius:50%; margin-top:5px; flex-shrink:0; }
    .check-dot.pass { background:var(--crm-success); }
    .check-dot.warn { background:var(--crm-warning); }
    .check-dot.fail { background:var(--crm-danger); }
    .check-name { font-weight:600; color:var(--crm-ink-strong); font-size:0.88rem; }
    .check-msg { color:var(--crm-ink-faint); font-size:0.82rem; margin-top:2px; }
    .check-category { font-size:0.7rem; color:var(--crm-ink-faint); font-weight:600; }

    .category-group { margin-bottom:1.25rem; }
    .category-title { font-size:0.75rem; color:var(--falcon-gray-700); font-weight:700; padding-bottom:0.5rem; border-bottom:2px solid rgba(var(--falcon-primary-rgb),0.1); margin-bottom:0.5rem; }

/* ── Pages/SchoolPay/SchoolPayHelp.cshtml ─────────────────────────────── */
    .help-card:nth-child(11) { animation-delay: 0.55s; }
    .help-card:nth-child(12) { animation-delay: 0.6s; }
    .help-badge-get { background: var(--crm-brand); }
    .help-badge-post { background: var(--crm-success); }
    .help-badge-teal { background: var(--crm-info); }
    .help-badge-warn { background: var(--crm-warning); }
    .help-badge-danger { background: var(--crm-danger); }

    .flow-diagram {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 1.5rem 0;
    }
    .flow-box {
        padding: 0.6rem 1rem;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        text-align: center;
        min-width: 120px;
    }
    .flow-box-teal { background: var(--crm-info-soft); color: var(--crm-info); border: 2px solid var(--crm-info); }
    .flow-box-blue { background: var(--crm-surface-tint); color: var(--crm-brand); border: 2px solid var(--crm-brand); }
    .flow-box-green { background: var(--crm-success-soft); color: var(--crm-success-deep); border: 2px solid var(--crm-success-deep); }
    .flow-box-orange { background: var(--crm-warning-soft); color: var(--crm-warning-deep); border: 2px solid var(--crm-warning-deep); }
    .flow-arrow {
        font-size: 1.2rem;
        color: var(--crm-ink-faint);
        font-weight: bold;
    }

    .endpoint-table th { background: var(--crm-info-soft); color: var(--crm-info); }
    .endpoint-table td code { font-size: 0.8rem; }

/* ── Pages/SchoolPay/SchoolPayLog.cshtml ─────────────────────────────── */
    .endpoint-badge {
        font-size: 0.72rem;
        font-weight: 600;
        padding: 2px 8px;
        border-radius: 4px;
    }

/* ── Pages/Shared/Admin/Components/_ListPagination.cshtml ─────────────────────────────── */
    .list-pagination-wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding: 0.5rem 0;
    }
    .list-pagination-wrap .page-size-select {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.78rem;
        color: var(--crm-ink-faint);
    }
    .list-pagination-wrap .page-size-select select {
        width: auto;
        min-width: 64px;
        padding: 0.2rem 0.5rem;
        font-size: 0.78rem;
        border-radius: 6px;
    }
    .list-pagination-wrap .pagination-info { font-size: 0.78rem; color: var(--crm-ink-faint); }
    .list-pagination-wrap .pagination-controls { display: flex; align-items: center; gap: 0.25rem; }
    .info-all-badge { font-weight: 600; color: var(--crm-brand); }

    
    .list-pagination-wrap ul.pagination {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .list-pagination-wrap ul.pagination li { list-style: none; }
    .list-pagination-wrap ul.pagination button.page {
        min-width: 32px;
        height: 32px;
        padding: 0 0.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        font-weight: 500;
        line-height: 1;
        color: var(--crm-ink-muted);
        background: var(--crm-surface, var(--crm-on-accent));
        border: 1px solid var(--crm-rule, var(--crm-rule));
        border-radius: 6px;
        cursor: pointer;
        transition: color 0.15s var(--crm-ease, ease),
                    background-color 0.15s var(--crm-ease, ease),
                    border-color 0.15s var(--crm-ease, ease);
    }
    .list-pagination-wrap ul.pagination button.page:hover {
        color: var(--crm-brand);
        border-color: var(--crm-brand);
        background: var(--crm-surface-tint, var(--crm-surface-2));
    }
    .list-pagination-wrap ul.pagination button.page.active {
        color: var(--crm-brand-contrast, var(--crm-on-accent));
        background: var(--crm-brand);
        border-color: var(--crm-brand);
    }
    .list-pagination-wrap ul.pagination li.ellipsis span {
        color: var(--crm-ink-faint);
        font-size: 0.8rem;
        padding: 0 0.15rem;
    }
    
    .list-pagination-wrap .pagination-controls > button[data-list-pagination] {
        height: 32px;
        min-width: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

/* ── Pages/Shared/Admin/Components/_PreviewTablePagination.cshtml ─────────────────────────────── */
    .preview-pagination-wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding: 0.5rem 0;
    }
    .preview-pagination-wrap .page-size-select {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.78rem;
        color: var(--crm-ink-faint);
    }
    .preview-pagination-wrap .page-size-select select {
        width: auto;
        min-width: 64px;
        padding: 0.2rem 0.5rem;
        font-size: 0.78rem;
        border-radius: 6px;
    }
    .preview-pagination-wrap .pagination-info {
        font-size: 0.78rem;
        color: var(--crm-ink-faint);
    }
    .preview-pagination-wrap .pagination-controls {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    .preview-pagination-wrap .pagination-controls .btn.disabled {
        opacity: 0.45;
        pointer-events: none;
    }

/* ── Pages/Students/PaymentList.cshtml ─────────────────────────────── */
    
    .pmt-stat-card {
        opacity: 0;
        animation: fadeInUp 0.5s ease forwards;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: 1px solid transparent;
        overflow: hidden;
        position: relative;
    }
    .pmt-stat-card::after {
        content: '';
        position: absolute;
        top: 0; left: -100%; width: 50%; height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
        transition: left 0.6s ease;
        pointer-events: none;
    }
    .pmt-stat-card:hover::after { left: 100%; }
    .pmt-stat-card:hover {
        border-color: var(--falcon-primary);
    }
    .pmt-stat-card:nth-child(1) { animation-delay: 0.05s; }
    .pmt-stat-card:nth-child(2) { animation-delay: 0.1s; }
    .pmt-stat-card:nth-child(3) { animation-delay: 0.15s; }
    .pmt-stat-card:nth-child(4) { animation-delay: 0.2s; }
    .pmt-stat-card .avatar-name { transition: transform 0.3s ease; }
    .pmt-stat-card:hover .avatar-name { }

    
    .pmt-filter-section {
        opacity: 0;
        animation: fadeInUp 0.5s ease 0.35s forwards;
    }

    
    .pmt-table-wrap {
        opacity: 0;
        animation: fadeInUp 0.5s ease 0.4s forwards;
    }
    .pmt-table tbody tr {
        transition: all 0.2s ease;
        cursor: pointer;
    }
    .pmt-table tbody tr:hover {
        background-color: rgba(22, 83, 126, 0.04) !important;
    }
    .pmt-table tbody tr:active { transform: scale(0.998); }

    .pmt-view-btn {
        width: 28px; height: 28px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid var(--falcon-primary);
        color: var(--falcon-primary);
        background: transparent;
        font-size: 0.7rem;
        transition: all 0.25s ease;
        opacity: 0.5;
    }
    .pmt-table tbody tr:hover .pmt-view-btn { opacity: 1; }
    .pmt-view-btn:hover {
        background: var(--falcon-primary);
        color: var(--crm-on-accent);
    }
    .badge-status-other {
        background: linear-gradient(135deg, var(--crm-ink-faint), var(--falcon-gray-700)) !important;
        color: var(--crm-on-accent) !important;
        font-weight: 600;
        letter-spacing: 0.3px;
    }

    .description-bubble .bubble-label {
        font-size: 0.8rem;
        color: var(--crm-ink-muted);
        font-weight: 400;
        margin-bottom: 4px;
    }
    .description-bubble .bubble-text {
        font-size: 0.88rem;
        color: var(--falcon-gray-900);
        line-height: 1.5;
    }
    .description-copy-btn {
        position: absolute;
        top: 8px; right: 8px;
        background: rgba(255,255,255,0.8);
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 6px;
        padding: 3px 8px;
        font-size: 0.7rem;
        color: var(--crm-ink-faint);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    .description-copy-btn:hover { background: var(--crm-surface); color: var(--falcon-primary); }

    /* .pmt-modal-status lives with the shared quiet status pill (Detail Modal block). */

/* ── Pages/Students/StudentHelp.cshtml ─────────────────────────────── */
    .help-badge-new { background: var(--crm-success); }
    .help-badge-update { background: var(--crm-brand); }
    .help-badge-skip { background: var(--crm-warning); }
    .help-badge-error { background: var(--crm-danger); }

/* ── Pages/Students/StudentImport.cshtml ─────────────────────────────── */
    
    .update-options { background: var(--crm-surface-2); border-radius: 10px; padding: 1rem 1.25rem; border: 1px solid var(--crm-rule); }
    .update-options .form-check { margin-bottom: 0.35rem; }
    .update-options .form-check-label { font-size: 0.85rem; }
    .badge-update { background: var(--crm-brand); color: var(--crm-on-accent); }

/* ── Pages/Subscriptions/Renew.cshtml ─────────────────────────────── */
    .renew-wrap {
        max-width: 640px;
        margin: 32px auto;
        padding: 0 16px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
    .renew-card {
        background: var(--crm-surface);
        border: 1px solid var(--crm-rule);
        border-radius: var(--crm-radius);
        box-shadow: var(--crm-shadow-lg);
        overflow: hidden;
    }
    /* House letterhead (as .detail-modal-header): white header, Poppins title, 2px brand rule. No fill. */
    .renew-header {
        padding: 24px 32px 18px;
        background: var(--crm-surface);
        border-bottom: 2px solid var(--crm-brand);
    }
    [data-bs-theme="dark"] .renew-header { border-bottom-color: var(--crm-link); }
    .renew-header h1 {
        margin: 0 0 4px;
        font-family: Poppins, var(--falcon-font-sans-serif, sans-serif);
        font-weight: 600; font-size: 22px;
        color: var(--crm-ink-strong);
    }
    .renew-header .sub { color: var(--crm-ink-muted); font-size: 14px; }
    .renew-body { padding: 28px 32px; }
    /* v2026.11.11 (WP-E): no fill. The quiet status pill (.crm-modal-status + .status-dot) carries the state;
       this rule only places it. */
    .renew-status { margin-bottom: 20px; }
    .renew-pay { margin: 0 0 8px; }
    .renew-pay-note { font-size: 13px; color: var(--crm-ink-muted); margin-top: 8px; }
    .renew-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px 24px;
        margin-bottom: 24px;
    }
    .renew-meta .lbl { font-size: 12px; color: var(--crm-ink-muted); }
    .renew-meta .val { font-size: 16px; color: var(--crm-ink); font-weight: 600; margin-top: 2px; }
    .renew-instructions {
        background: var(--crm-surface-2);
        border: 1px solid var(--crm-rule-soft);
        padding: 16px 20px;
        border-radius: 6px;
        font-size: 14px;
        line-height: 1.6;
        white-space: pre-wrap;
    }
    .renew-contacts {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 20px;
    }
    .renew-contact {
        flex: 1 1 220px;
        background: var(--crm-surface-2);
        border-radius: 8px;
        padding: 14px 16px;
    }
    .renew-contact .ico {
        display: inline-flex;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        background: var(--crm-brand);
        color: var(--crm-on-accent);
        border-radius: 50%;
        margin-right: 10px;
    }
    .renew-contact a { color: var(--crm-ink-strong); text-decoration: none; font-weight: 600; }
    .renew-footer {
        text-align: center;
        font-size: 12px;
        color: var(--crm-ink-muted);
        margin-top: 24px;
    }
    .renew-notfound {
        text-align: center;
        padding: 40px 24px;
        color: var(--crm-ink-muted);
    }
    .renew-notfound h2 { color: var(--crm-ink); margin-bottom: 8px; }

/* ── Pages/Subscriptions/SubscriptionForm.cshtml ─────────────────────────────── */
    .tier-card {
        border: 2px solid var(--crm-rule);
        border-radius: 10px;
        padding: 12px 16px;
        cursor: pointer;
        min-width: 140px;
        transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
        user-select: none;
    }
    .tier-card:hover {
        border-color: var(--crm-surface-border);
    }
    .tier-card.selected {
        border-color: var(--crm-brand);
        background: linear-gradient(135deg, rgba(var(--crm-brand-rgb), 0.05) 0%, rgba(var(--crm-brand-rgb), 0.12) 100%);
        box-shadow: 0 3px 10px rgba(var(--crm-brand-rgb),.15);
    }
    .tier-card .tier-badge {
        font-size: 0.66rem;
        background: var(--crm-brand);
        color: var(--crm-on-accent);
        border-radius: 20px;
        padding: 2px 9px;
        font-weight: 600;
    }
    .tier-card .tier-savings {
        font-size: 0.72rem;
        color: var(--crm-success-deep);
        font-weight: 600;
    }

/* ── Pages/SystemAdmin/SystemAdmin.cshtml ─────────────────────────────── */
    .sys-card { animation: fadeInUp 0.5s ease forwards; opacity: 0; border: none; transition: all 0.3s; }
    .sys-card:hover { }
    .sys-card:nth-child(1){animation-delay:0s;} .sys-card:nth-child(2){animation-delay:.05s;} .sys-card:nth-child(3){animation-delay:.1s;} .sys-card:nth-child(4){animation-delay:.15s;}
    .metric-icon { width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:1.2rem; }
    .metric-value { font-size:1.5rem;font-weight:700;line-height:1.2; }
    .metric-label { font-size:.75rem;color:var(--falcon-gray-600); }
    .section-title { font-size:.85rem;color:var(--falcon-gray-600);font-weight:700;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:2px solid var(--falcon-gray-300); }
    .section-title .fas { margin-right:6px;color:var(--falcon-primary); }
    .health-dot.bad { background:var(--falcon-danger);box-shadow:0 0 8px rgba(var(--falcon-danger-rgb),.4); }
    .action-card { background:var(--crm-gradient-brand);color:var(--crm-on-accent);border-radius:12px;padding:1.5rem; }
    .action-btn { border:1px solid rgba(255,255,255,.3);color:var(--crm-on-accent);background:rgba(255,255,255,.1);border-radius:8px;padding:10px 20px;transition:all .2s;cursor:pointer; }
    .action-btn:hover { background:rgba(255,255,255,.25);color:var(--crm-on-accent); }
    .gauge-ring { position:relative;width:100px;height:100px;margin:0 auto; }
    .gauge-ring svg { transform:rotate(-90deg); }
    .gauge-ring .gauge-bg { fill:none;stroke:var(--falcon-gray-300);stroke-width:8; }
    .gauge-ring .gauge-fill { fill:none;stroke-width:8;stroke-linecap:round;transition:stroke-dashoffset 1s ease,stroke .5s; }
    .gauge-ring .gauge-text { position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:1.25rem;font-weight:700; }
    .gauge-card { text-align:center; }
    .gauge-card .gauge-label { font-size:.75rem;color:var(--falcon-gray-600);margin-top:8px; }
    .rt-metric { display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:8px;background:var(--falcon-gray-100);margin-bottom:6px;transition:all .2s; }
    .rt-metric:hover { background:var(--falcon-gray-200); }
    .rt-metric .rt-icon { width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:.9rem;flex-shrink:0; }
    .rt-metric .rt-val { font-weight:700;font-size:1rem; }
    .rt-metric .rt-lbl { font-size:.72rem;color:var(--falcon-gray-600); }
    .db-stat-pill { display:flex;flex-direction:column;align-items:center;padding:12px 8px;border-radius:10px;background:var(--falcon-gray-100);transition:all .2s;flex:1; }
    .db-stat-pill:hover { background:var(--falcon-gray-200); }
    .db-stat-pill .pill-val { font-size:1.1rem;font-weight:700; }
    .db-stat-pill .pill-lbl { font-size:.65rem;color:var(--falcon-gray-600);text-align:center; }
    .log-counter { display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:8px;background:var(--falcon-gray-100);margin-bottom:6px;transition:all .2s; }
    .log-counter:hover { background:var(--falcon-gray-200); }
    .log-counter .count { font-weight:700;font-size:1rem;min-width:60px; }
    .log-counter .name { font-size:.8rem;color:var(--falcon-gray-700);flex:1; }
    .entity-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px; }
    .entity-chip { text-align:center;padding:12px 8px;border-radius:10px;background:var(--falcon-gray-100);transition:all .2s; }
    .entity-chip:hover { background:var(--falcon-gray-200); }
    .entity-chip .count { font-size:1.3rem;font-weight:700;display:block; }
    .entity-chip .label { font-size:.7rem;color:var(--falcon-gray-600); }
    .svc-dot { width:10px;height:10px;border-radius:50%;display:inline-block; }
    .svc-dot.up { background:var(--falcon-success); } .svc-dot.down { background:var(--falcon-danger); }
    .collapse-header { cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-radius:8px;transition:background .2s; }
    .collapse-header:hover { background:var(--falcon-gray-100); }
    .collapse-header .collapse-icon { transition:transform .3s;font-size:.7rem;color:var(--falcon-gray-500); }
    .collapse-header[aria-expanded="true"] .collapse-icon { transform:rotate(180deg); }
    .collapse-header h6 { margin:0;font-size:.9rem;font-weight:700; }
    .job-row { font-size:.8rem;padding:6px 0;border-bottom:1px solid var(--falcon-gray-200); }
    .job-row:last-child { border-bottom:none; }
    .crash-item { padding:10px 14px;border-radius:8px;background:var(--falcon-gray-100);margin-bottom:6px; }
    .crash-msg { font-family:Consolas,monospace;font-size:.75rem;color:var(--falcon-danger);word-break:break-all; }
    .dead-ratio-bar { height:6px;border-radius:3px;background:var(--falcon-gray-300);overflow:hidden;min-width:60px; }
    .dead-ratio-fill { height:100%;border-radius:3px; }
    .idx-bar { height:8px;border-radius:4px;background:var(--falcon-gray-300);overflow:hidden;min-width:80px; }
    .idx-fill { height:100%;border-radius:4px; }
    .query-state { display:inline-block;padding:2px 8px;border-radius:4px;font-size:.65rem;font-weight:600; }
    .query-state.active { background:rgba(var(--falcon-success-rgb),.15);color:var(--falcon-success); }
    .query-state.idle { background:rgba(var(--falcon-secondary-rgb),.15);color:var(--falcon-secondary); }
    .terminate-btn { border:none;background:rgba(var(--falcon-danger-rgb),.1);color:var(--falcon-danger);border-radius:6px;padding:3px 8px;font-size:.65rem;cursor:pointer; }
    .terminate-btn:hover { background:var(--falcon-danger);color:var(--crm-on-accent); }
    .refresh-controls { display:flex;align-items:center;gap:12px; }
    .refresh-dot { width:8px;height:8px;border-radius:50%;background:var(--falcon-success);animation:pulse 2s infinite; }
    .refresh-dot.paused { background:var(--falcon-gray-400);animation:none; }
    .disk-bar { height:8px;border-radius:4px;background:var(--falcon-gray-300);overflow:hidden; }
    .disk-fill { height:100%;border-radius:4px;transition:width .5s; }
    
    .alert-banner { border-radius:8px; padding:8px 14px; margin-bottom:4px; display:flex; align-items:center; gap:10px; animation:fadeInUp 0.3s ease; cursor:pointer; text-decoration:none; transition:opacity 0.2s; }
    .alert-banner:hover { opacity:0.85; }
    .alert-banner .alert-icon { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:0.75rem; }
    .alert-banner strong { font-size:0.82rem; }
    .alert-banner small { font-size:0.72rem; }
    .alert-banner-danger { border: 1px solid var(--crm-rule); }
    .alert-banner-danger .alert-icon { background:var(--falcon-danger); color:var(--crm-on-accent); }
    .alert-banner-warning { border: 1px solid var(--crm-rule); }
    .alert-banner-warning .alert-icon { background:var(--falcon-warning); color:var(--crm-on-accent); }
    .alert-banner-info { border: 1px solid var(--crm-rule); }
    .alert-banner-info .alert-icon { background:var(--falcon-info); color:var(--crm-on-accent); }

    @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ── Pages/Users/UserList.cshtml ─────────────────────────────── */
        .echart-application-users {
            min-height: 12.65rem;
        }

/* ── Pages/Webhooks/WebhookDeliveries.cshtml ─────────────────────────────── */
    .delivery-row { cursor: pointer; transition: all 0.2s ease; }
    .delivery-row:hover { background: rgba(var(--falcon-primary-rgb), 0.04) !important; }
    .delivery-row:hover .delivery-view-btn { opacity: 1; }
    .delivery-view-btn { width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(var(--falcon-primary-rgb), 0.1); color: var(--falcon-primary); opacity: 0; transition: opacity 0.2s; display: inline-flex; align-items: center; justify-content: center; }

    .badge-status-delivered { background: var(--crm-grad-success) !important; color: var(--crm-on-accent) !important; }
    .badge-status-retrying { background: var(--crm-grad-warning) !important; color: var(--crm-on-accent) !important; }

/* ═══════════════════════════════════════════════════════════════════════
   APP RELEASES — release history (v2026.10.13)
   The list itself is the shared timeline (_Timeline.cshtml, .tcy-tl*). Only the
   per-release actions and the announcement state sit in its Content slot.
   ═══════════════════════════════════════════════════════════════════════ */
.release-actions { display: flex; align-items: center; gap: 0.25rem; }
.release-annc { display: flex; align-items: center; gap: 0.4rem; min-width: 0; flex: 1 1 12rem; }

/* The announcement reason takes whatever room is left and ellipses, with the
   full text on the title attribute (it forced the old table wide). */
.release-annc-msg {
    font-size: 0.72rem; color: var(--crm-ink-faint);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0; flex: 1 1 auto;
}


/* ═══════════════════════════════════════════════════════════════════════
   PAGE HEADER — shed secondary chrome by the BAR's own width (v2026.09.18)

   Priority, least important first: the keyboard hint, then the subtitle, then the
   palette label (the top nav carries a full search box on the same screen, so this
   one is a convenience), then the density toggle. The page TITLE and the primary
   action button are never dropped - they are the two things the bar exists for.
   flex-wrap on .page-header-bar remains the final safety net, so nothing ever clips.
   ═══════════════════════════════════════════════════════════════════════ */
@container phbar (max-width: 1000px) {
    .page-header-bar .ph-palette-trigger kbd { display: none; }
}
@container phbar (max-width: 920px) {
    .page-header-bar > .ph-title > .ph-subtitle { display: none; }
}
@container phbar (max-width: 860px) {
    .page-header-bar .ph-palette-trigger .ph-palette-label { display: none; }
}
@container phbar (max-width: 900px) {
    /* Tighten before wrapping. Measured: at a bar width of 826px the children come to
       785px, and three 0.85rem gaps add 41px - landing exactly on the limit, so subpixel
       rounding alone pushed the page action onto a second row and cost ~41px of vertical
       chrome on every list page. Flexbox decides wrapping BEFORE it applies flex-shrink,
       so shrink factors cannot rescue this; the gaps and chip padding have to give. */
    /* NOTE: the bar's own `gap` cannot be set from here - @container styles the
       container's DESCENDANTS, never the container element itself, and .page-header-bar
       IS the container. The gap is tightened at its base declaration instead. */
    .page-header-bar .ph-stat { padding-left: 0.4rem; padding-right: 0.4rem; }
    /* The bar has a gap, so this extra left margin is double spacing - and it was the
       last 8px. Measured: content box 794px against 796px needed, over by TWO pixels,
       which is all it takes for flexbox to wrap the page action onto its own row. */
    .page-header-bar > .ph-stats { margin-left: 0; }

    /* 900px is measured, not guessed: with the sidebar open at a 1251px viewport the bar
       is 826px, and icon 32 + title 227 + stats 434 + Export 92 leaves no room for an
       85px density control. Density is a set-once preference held in localStorage, so
       losing the toggle on a narrow column costs far less than wrapping the bar. */
    .page-header-bar > .ph-actions > .density-toggle { display: none; }
}

/* ── Info tips — the shared "more info" balloon (v2026.09.18) ─────────────────
   Contract and rationale: see initInfoTips() in site.js. Tokens only, per
   §14.3 — no raw hex, no raw z-index. */

.crm-infotip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    margin-left: 0.4rem;
    flex: 0 0 auto;              /* never absorbs the title's shrink (§14.6 rule 2) */
    border: 0;
    border-radius: var(--crm-radius-pill);
    background: transparent;
    color: var(--crm-ink-faint);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s var(--crm-ease), background-color 0.15s var(--crm-ease);
}

.crm-infotip:hover,
.crm-infotip:focus-visible,
.crm-infotip[aria-describedby] {
    color: var(--crm-brand);
    background: rgba(var(--crm-brand-rgb), 0.1);
}

.crm-infotip:focus-visible {
    outline: 2px solid var(--crm-brand);
    outline-offset: 1px;
}

/* The content element is authored inline in the page and never rendered there —
   only read out of the DOM when the tip opens. */
.crm-infotip-content { display: none; }

.popover.crm-infotip-pop {
    max-width: min(30rem, calc(100vw - 2rem));   /* readable measure, never wider than the phone */
    z-index: var(--z-popover);
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius);
    box-shadow: var(--crm-shadow-lg);
    background: var(--crm-surface);
    font-size: 0.8rem;
}

.popover.crm-infotip-pop .popover-header {
    background: var(--crm-surface-2);
    border-bottom: 1px solid var(--crm-rule-soft);
    color: var(--crm-ink-strong);
    font-size: 0.8rem;
    font-weight: 600;
}

.popover.crm-infotip-pop .popover-header:empty { display: none; }

.popover.crm-infotip-pop .popover-body {
    color: var(--crm-ink);
    padding: 0.75rem 0.9rem;
    line-height: 1.55;
}

.popover.crm-infotip-pop .popover-body > :last-child { margin-bottom: 0; }

.popover.crm-infotip-pop .popover-arrow::after {
    border-bottom-color: var(--crm-surface-2);
    border-top-color: var(--crm-surface);
}

[data-bs-theme="dark"] .popover.crm-infotip-pop,
[data-bs-theme="dark"] .popover.crm-infotip-pop .popover-header {
    background: var(--crm-surface-2);
}

[data-bs-theme="dark"] .popover.crm-infotip-pop .popover-arrow::after {
    border-bottom-color: var(--crm-surface-2);
    border-top-color: var(--crm-surface-2);
}

/* ==========================================================================
   Shared document viewer (_DocumentViewer.cshtml, openDocumentViewer in site.js)
   docs/document-viewer-and-company-profile-plan.md §7. Tokens only; the toolbar
   wraps (the §8E-bis rule: a bar holding primary actions must wrap); every
   control is at least 32px (WCAG 2.5.8 asks for 24).
   ========================================================================== */
.crm-docviewer-dialog { max-width: min(1200px, 94vw); }
.crm-docviewer .modal-content { height: min(90vh, 1000px); overflow: hidden; background: var(--crm-surface); }
.crm-docviewer-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
    padding: .625rem .875rem; border-bottom: 1px solid var(--crm-rule); background: var(--crm-surface);
}
.crm-docviewer-heading { display: flex; align-items: center; gap: .625rem; min-width: 0; flex: 1 1 16rem; }
.crm-docviewer-icon {
    flex: 0 0 2.25rem; height: 2.25rem; border-radius: var(--crm-radius); display: grid; place-items: center;
    background: var(--crm-surface-tint); color: var(--crm-brand); font-size: 1.05rem;
}
.crm-docviewer-names { min-width: 0; }
.crm-docviewer-title {
    margin: 0; font-size: 1rem; font-weight: 600; color: var(--crm-ink-strong);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crm-docviewer-meta { font-size: .8rem; color: var(--crm-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-docviewer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-left: auto; }
.crm-docviewer-imgtools { display: contents; }
.crm-docviewer-imgtools[hidden] { display: none; }
.crm-docviewer-btn {
    min-width: 2rem; height: 2rem; padding: 0 .5rem; border: 1px solid transparent; border-radius: var(--crm-radius);
    background: transparent; color: var(--crm-ink); display: inline-flex; align-items: center; justify-content: center;
    gap: .25rem; font-size: .875rem; text-decoration: none; cursor: pointer;
}
.crm-docviewer-btn:hover { background: var(--crm-surface-2); color: var(--crm-ink-strong); }
.crm-docviewer-btn:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 1px; }
.crm-docviewer-btn[disabled], .crm-docviewer-btn.is-disabled { opacity: .4; pointer-events: none; }
.crm-docviewer-btn[aria-pressed="true"] { background: var(--crm-surface-tint); color: var(--crm-brand); }
.crm-docviewer-zoom { min-width: 3.25rem; font-variant-numeric: tabular-nums; font-size: .8rem; }
.crm-docviewer-close { margin-left: .25rem; }
.crm-docviewer-sep { width: 1px; height: 1.25rem; background: var(--crm-rule); margin-inline: .25rem; }
.crm-docviewer-pos { font-size: .8rem; color: var(--crm-ink-muted); font-variant-numeric: tabular-nums; margin-right: .25rem; }
.crm-docviewer-body { display: flex; flex: 1 1 auto; min-height: 0; }
.crm-docviewer-stage { position: relative; flex: 1 1 auto; min-width: 0; background: var(--crm-surface-3); display: flex; }
.crm-docviewer-frame { flex: 1 1 auto; width: 100%; height: 100%; border: 0; background: var(--crm-surface); }
.crm-docviewer-imgwrap { flex: 1 1 auto; overflow: auto; display: grid; place-items: center; padding: 1rem; }
.crm-docviewer-img {
    max-width: none; transform: rotate(var(--docv-rotate, 0deg)); transform-origin: center center;
    box-shadow: var(--crm-shadow); background: var(--crm-surface); transition: transform .15s var(--crm-ease);
}
.crm-docviewer-imgwrap.is-fit .crm-docviewer-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.crm-docviewer-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .5rem;
    color: var(--crm-ink-muted); font-size: .9rem;
}
.crm-docviewer-loading[hidden] { display: none; }
.crm-docviewer-card {
    margin: auto; max-width: 28rem; padding: 2rem 1.5rem; text-align: center;
    background: var(--crm-surface); border: 1px solid var(--crm-rule); border-radius: var(--crm-radius-lg); box-shadow: var(--crm-shadow-sm);
}
.crm-docviewer-card-icon {
    display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
    background: var(--crm-surface-tint); color: var(--crm-brand); font-size: 1.5rem; margin-bottom: .75rem;
}
.crm-docviewer-card.is-error .crm-docviewer-card-icon { background: var(--crm-danger-soft); color: var(--crm-danger); }
.crm-docviewer-card-title { font-size: 1.05rem; margin: 0 0 .5rem; color: var(--crm-ink-strong); word-break: break-word; }
.crm-docviewer-card-text { color: var(--crm-ink-muted); font-size: .9rem; margin: 0 0 1.25rem; }
.crm-docviewer-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.crm-docviewer-card-actions a[hidden] { display: none; }
.crm-docviewer-details {
    flex: 0 0 17rem; border-left: 1px solid var(--crm-rule); padding: 1rem; overflow: auto; background: var(--crm-surface);
}
.crm-docviewer-details h3 { font-size: .8rem; color: var(--crm-ink-muted); margin: 0 0 .75rem; }
.crm-docviewer-details dl { margin: 0; display: grid; gap: .625rem; font-size: .85rem; }
.crm-docviewer-details dt { color: var(--crm-ink-muted); font-weight: 400; }
.crm-docviewer-details dd { margin: 0; color: var(--crm-ink-strong); word-break: break-word; }
.crm-docviewer-stage:fullscreen { background: var(--crm-surface-3); }
@media (max-width: 767.98px) {
    .crm-docviewer .modal-content { height: 100%; }
    .crm-docviewer-body { position: relative; }
    .crm-docviewer-details {
        position: absolute; inset: auto 0 0 0; max-height: 50%; border-left: 0;
        border-top: 1px solid var(--crm-rule); z-index: var(--z-raised);
    }
}
/* Printing an image from the viewer prints just the image. */
@media print {
    body.crm-docviewer-printing > *:not(#crmDocViewer) { display: none !important; }
    body.crm-docviewer-printing #crmDocViewer .crm-docviewer-bar,
    body.crm-docviewer-printing #crmDocViewer .crm-docviewer-details { display: none !important; }
    body.crm-docviewer-printing #crmDocViewer,
    body.crm-docviewer-printing #crmDocViewer .modal-dialog,
    body.crm-docviewer-printing #crmDocViewer .modal-content {
        position: static !important; display: block !important; height: auto !important;
        max-width: none !important; box-shadow: none !important; border: 0 !important; transform: none !important;
    }
    body.crm-docviewer-printing .crm-docviewer-img { max-width: 100% !important; box-shadow: none !important; }
}

/* Company documents card: category chips and file rows (Company Profile). */
.crm-doc-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.crm-doc-chip {
    border: 1px solid var(--crm-rule); background: var(--crm-surface); color: var(--crm-ink); border-radius: var(--crm-radius-pill);
    padding: .25rem .75rem; font-size: .8rem; display: inline-flex; gap: .375rem; align-items: center; cursor: pointer;
}
.crm-doc-chip[aria-pressed="true"] { background: var(--crm-brand); border-color: var(--crm-brand); color: var(--crm-on-accent); }
.crm-doc-chip .count { font-variant-numeric: tabular-nums; opacity: .8; }
.crm-doc-search { position: relative; flex: 0 1 16rem; min-width: 0; }
.crm-doc-search .fa-search {
    position: absolute; left: .625rem; top: 50%; transform: translateY(-50%);
    color: var(--crm-ink-faint); font-size: .75rem; pointer-events: none;
}
.crm-doc-search .search { padding-left: 1.875rem; }
@media (max-width: 575.98px) { .crm-doc-search { flex-basis: 100%; } }
.crm-doc-type {
    display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--crm-radius);
    background: var(--crm-surface-tint); color: var(--crm-brand);
}
.crm-doc-type.is-pdf { background: var(--crm-danger-soft); color: var(--crm-danger); }
.crm-doc-type.is-image { background: var(--crm-success-soft); color: var(--crm-success); }
.crm-doc-type.is-office { background: var(--crm-info-soft); color: var(--crm-info); }
.crm-doc-row { cursor: pointer; }
.crm-doc-row:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: -2px; }
.crm-doc-file { font-size: .8rem; color: var(--crm-ink-muted); word-break: break-word; }

/* -- Company file tabs (v2026.10.19). Five tabs do not fit a phone: they scroll sideways inside the
   card instead of wrapping into a second row, and never push the page wider than the screen. -- */
.crm-file-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; border-bottom: 0; }
.crm-file-tabs .nav-item { flex: 0 0 auto; }
/* On a phone the five tabs run past the edge; the side that has more fades, as the header chips do
   (initChipStripHints in site.js marks has-more-left / has-more-right). */
.crm-file-tabs.has-more-right {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent);
}
.crm-file-tabs.has-more-left {
    -webkit-mask-image: linear-gradient(to left, black calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to left, black calc(100% - 2.5rem), transparent);
}
.crm-file-tabs.has-more-left.has-more-right {
    -webkit-mask-image: linear-gradient(to right, transparent, black 2.5rem, black calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, transparent, black 2.5rem, black calc(100% - 2.5rem), transparent);
}
.crm-file-tabs .nav-link { white-space: nowrap; font-size: .875rem; color: var(--crm-ink-muted); }
.crm-file-tabs .nav-link.active { color: var(--crm-brand); border-bottom-color: var(--crm-surface); }
.compliance-file-line { min-width: 0; }
.crm-unsaved-chip {
    font-size: .75rem; padding: .2rem .6rem; border-radius: var(--crm-radius-pill);
    background: var(--crm-warning-soft); color: var(--crm-warning-deep);
}
.crm-unsaved-chip[hidden] { display: none; }
.crm-upload-note { font-size: .8rem; color: var(--crm-ink-muted); margin-top: .375rem; min-height: 1.2em; }
.crm-upload-note.is-invalid { color: var(--crm-danger); }
.crm-cover-img { width: 100%; max-height: 16rem; object-fit: cover; display: block; background: var(--crm-surface-3); }
.crm-logo-img { max-width: 100%; max-height: 10rem; object-fit: contain; display: block; margin-inline: auto; }
.crm-company-img-empty {
    display: grid; place-items: center; min-height: 8rem; color: var(--crm-ink-muted);
    background: var(--crm-surface-2); border-radius: var(--crm-radius); font-size: .85rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   Falcon's "soft" colour classes (v2026.10.13)
   The bundled Falcon theme renamed them to "subtle" (.badge-subtle-*,
   .bg-*-subtle) and defines no .badge-soft-* / .bg-soft-*. 37 files still use
   the old names, so their badges rendered white on white (Webhook Deliveries
   status/HTTP, API keys, payment callbacks) and the coloured circle behind every
   detail-modal icon (.detail-icon.bg-soft-*) never appeared. Mapped once here,
   onto the theme's own variables, so they follow light/dark like the originals.
   ═══════════════════════════════════════════════════════════════════════ */
.badge-soft-primary   { color: var(--falcon-primary-text-emphasis);   background-color: var(--falcon-primary-bg-subtle); }
.badge-soft-secondary { color: var(--falcon-secondary-text-emphasis); background-color: var(--falcon-secondary-bg-subtle); }
.badge-soft-success   { color: var(--falcon-success-text-emphasis);   background-color: var(--falcon-success-bg-subtle); }
.badge-soft-info      { color: var(--falcon-info-text-emphasis);      background-color: var(--falcon-info-bg-subtle); }
.badge-soft-warning   { color: var(--falcon-warning-text-emphasis);   background-color: var(--falcon-warning-bg-subtle); }
.badge-soft-danger    { color: var(--falcon-danger-text-emphasis);    background-color: var(--falcon-danger-bg-subtle); }
.bg-soft-primary   { background-color: var(--falcon-primary-bg-subtle) !important; }
.bg-soft-secondary { background-color: var(--falcon-secondary-bg-subtle) !important; }
.bg-soft-success   { background-color: var(--falcon-success-bg-subtle) !important; }
.bg-soft-info      { background-color: var(--falcon-info-bg-subtle) !important; }
.bg-soft-warning   { background-color: var(--falcon-warning-bg-subtle) !important; }
.bg-soft-danger    { background-color: var(--falcon-danger-bg-subtle) !important; }

/* ═══════════════════════════════════════════════════════════════════════
   Platform timeline (timeline.css) — CRM sizing (v2026.10.13)
   The shared file draws a 30px circle inside a 3px white ring and a 1.5px
   outer ring (~37px in all) for ERP's larger type. Next to the CRM's 12-14px
   text that read as oversized - and a first fix that only shrank the circle to
   24px still drew ~31px with its rings. Sized here to the text line instead:
   a 16px dot (8px glyph) with a 2px + 1px ring, about 22px in all, so the
   marker is no taller than the title it sits beside. The shared file stays
   byte-identical; site.css loads after it. Keep in step: container padding =
   the dot's left offset; the line sits on the dot's centre (8px - 1px).
   ═══════════════════════════════════════════════════════════════════════ */
.tcy-tl { padding-left: 1.6rem; }
.tcy-tl::before { left: 7px; top: 14px; bottom: 14px; }
.tcy-tl__icon {
    left: -1.6rem; top: 11px; width: 16px; height: 16px; font-size: 0.5rem;
    box-shadow: 0 0 0 2px var(--surface-card-bg, var(--crm-surface)), 0 0 0 3px var(--surface-card-border, var(--crm-rule));
}
.tcy-tl__item:first-child .tcy-tl__icon::after { inset: -3px; }
[data-bs-theme="dark"] .tcy-tl__icon {
    box-shadow: 0 0 0 2px var(--surface-card-bg, var(--crm-surface)), 0 0 0 3px var(--surface-card-border, var(--crm-rule));
}

/* ── Problem-report panel (helpdesk v2): source line + key/value tables that never overflow ──────────
   The panel shows values the reporter's product sends verbatim: full user agents, 32-hex trace ids,
   "erp-<32 hex>" client references, page URLs, stack tops. A fixed layout with a fixed label column and
   values that may break anywhere keeps every one of them inside the card at any width (#406 overflow). */
#problemReportPanel { min-width: 0; }
#problemReportPanel .pr-source {
    display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem;
    min-width: 0; overflow-wrap: anywhere;
}
#problemReportPanel .pr-source__sep { color: var(--bs-secondary-color); }
#problemReportPanel .pr-kv { table-layout: fixed; width: 100%; }
#problemReportPanel .pr-kv th { width: 8.5rem; vertical-align: top; }
#problemReportPanel .pr-kv td { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
#problemReportPanel code { white-space: normal; word-break: break-all; overflow-wrap: anywhere; }
#problemReportPanel pre { white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; }
#problemReportPanel .pr-evidence { min-width: 0; overflow-wrap: anywhere; }

/* Product badge for ERP 2.0 (HelpdeskProducts): purple, because Falcon's primary and info subtle badges
   (CashBook ERP is info) are both blue. Label + icon always accompany the colour. AA in both themes. */
.badge-product-erp2 { color: #5a34b8; background-color: #ece6fb; }
[data-bs-theme="dark"] .badge-product-erp2 { color: #cdbcff; background-color: #2a1f4d; }

/* ── Pages/ApiKeys/ApiKeyForm.cshtml ── (moved from an inline <style>, §14.3) */
/* Scope picker (v2026.10.14): presets, search, collapsible categories, granted chips. */
.scope-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; }
.scope-tool-preset { flex: 1 1 11rem; min-width: 0; }
.scope-tool-search { flex: 2 1 14rem; min-width: 0; }
.scope-tool-search .fa-search {
    position: absolute; left: .625rem; top: 50%; transform: translateY(-50%);
    color: var(--crm-ink-faint); font-size: .75rem; pointer-events: none;
}
.scope-tool-search input { padding-left: 1.875rem; }
.scope-cat-toggle { color: var(--crm-brand); font-weight: 700; text-decoration: none; text-align: left; white-space: normal; min-width: 0; }
.scope-cat-toggle:hover { color: var(--crm-brand); text-decoration: underline; }
.scope-cat-toggle:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 2px; }
.scope-cat-toggle .fa-chevron-right { font-size: .7rem; transition: transform .15s; }
.scope-cat-toggle[aria-expanded="true"] .fa-chevron-right { transform: rotate(90deg); }
.scope-cat-count { color: var(--crm-ink-muted); font-weight: 400; }
.scope-item .form-check-label { overflow-wrap: anywhere; }
.scope-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.scope-chip {
    display: inline-flex; align-items: center; gap: .125rem; max-width: 100%;
    border: 1px solid var(--crm-rule); background: var(--crm-surface); color: var(--crm-ink);
    border-radius: var(--crm-radius-pill); padding: .125rem .25rem .125rem .625rem; font-size: .75rem;
}
.scope-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-chip button {
    border: 0; background: transparent; color: var(--crm-ink-muted); line-height: 1;
    padding: .125rem .3rem; border-radius: var(--crm-radius-pill);
}
.scope-chip button:hover { color: var(--crm-danger); }
.scope-chip button:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 1px; }
@media (min-width: 992px) { .scope-chips { max-height: 40vh; overflow-y: auto; } }

/* ==========================================================================================
   Compliance office (v2026.10.17, docs/compliance-office-plan.md): calendar and registers,
   pay register, corporate documents and AI providers. Written per part, merged here once.
   ========================================================================================== */

/* ---- compliance ---- */
/*
 * Compliance office Part A - the compliance calendar, company registers and the Dashboard's
 * compliance alerts (v2026.10.17). Its own file until the four parts land, then merged into
 * site.css (docs/compliance-office-plan.md §0). Tokens only: no raw hex, no raw z-index.
 */

/* A signature image: kept to a signature's proportions on a white card so it reads as on paper,
   whatever the theme. */
.compliance-signature {
    max-height: 7rem;
    padding: 0.5rem;
    background: var(--crm-surface);
    border: 1px solid var(--crm-rule-soft);
    border-radius: var(--crm-radius-sm);
}

/* The Dashboard's compliance alerts: one line per filing, the days pill at the right edge.
   min-width: 0 lets the name ellipsise instead of pushing the pill out of the card (§8E-bis). */
.compliance-alert-list li + li {
    border-top: 1px solid var(--crm-rule-soft);
}

.compliance-alert-item {
    gap: 0.5rem;
    min-width: 0;
    padding: 0.5rem 0.25rem;
    color: var(--crm-ink);
    border-radius: var(--crm-radius-sm);
}

.compliance-alert-item > .compliance-alert-text {
    min-width: 0;
    line-height: 1.35;
}

.compliance-alert-item:hover,
.compliance-alert-item:focus-visible {
    background: var(--crm-surface-2);
}

.compliance-alert-item .days-pill {
    flex-shrink: 0;
}

/* ---- payroll ---- */
/* Pay register (compliance office, Part B; docs/compliance-office-plan.md). Merged into site.css after
   the four parts land. Tokens only: no raw colour, no raw z-index (CLAUDE.md §14.3). */

/* The editable grid on a draft pay run: twelve numeric columns in a card. The table scrolls sideways
   inside .table-responsive; an input never shrinks below a readable width for a seven-figure amount. */
.payroll-grid input[type="number"] {
    min-width: 5.75rem; /* eight digits; 6.5rem pushed LST and Net out of a 1600px screen (v2026.10.17) */
    font-variant-numeric: tabular-nums;
}

.payroll-grid td,
.payroll-grid th {
    vertical-align: middle;
}

.payroll-grid tfoot td {
    border-top: 1px solid var(--crm-rule);
    font-variant-numeric: tabular-nums;
}

/* ---- documents ---- */
/* Corporate documents (compliance office Part C, docs/compliance-office-plan.md).
   Tokens only (CLAUDE.md §14.3). Merged into site.css once all four parts have landed. */

/* The text of a version that can no longer be edited (withdrawn or superseded), shown in place of
   the editor. The body is sanitised HTML; keep its type close to the editor's so the switch is quiet. */
.doc-readonly-text {
    background: var(--crm-surface);
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius-sm);
    color: var(--crm-ink);
    padding: 1rem 1.25rem;
    max-height: 60vh;
    overflow: auto;
}

.doc-readonly-text table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
}

.doc-readonly-text th,
.doc-readonly-text td {
    border-bottom: 1px solid var(--crm-rule-soft);
    padding: 0.25rem 0.5rem;
    vertical-align: top;
}

/* The drafting assistant's progress under the Draft button. */
.doc-draft-progress .progress {
    height: 0.375rem;
}

/* One line of a passage's text under its title in the answer library. */
.doc-snippet-preview {
    max-width: 36rem;
}

/* ---- assistant ---- */
/*
 * Compliance office Part D - Integrations > AI Providers (v2026.10.17).
 * Its own file until the four parts land, then merged into site.css (docs/compliance-office-plan.md §0).
 * Tokens only: no raw hex, no raw z-index.
 */

/* A provider's model list can run to hundreds of ids: keep it inside the card. */
.ai-provider-output .ai-model-list {
    max-height: 12rem;
    overflow-y: auto;
    overflow-wrap: anywhere;
    color: var(--crm-ink-muted);
}

.ai-provider-output:empty {
    display: none;
}

/* Long base URLs and model ids must wrap rather than widen the card at phone width. */
.ai-provider-card .text-break {
    overflow-wrap: anywhere;
}

/* Pay run page (v2026.10.17 design pass). The lines grid has twelve columns, so it takes the full
   width; at two thirds it hid four columns behind a scroller even at 1600px. The side cards (next
   step, notes, filing, danger zone) sit below it in as many columns as fit. The employee column
   stays put while the figures scroll on a narrow screen, so a row never loses its name. */
.payrun-side {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    column-gap: 1rem;
    align-items: start;
}
.payroll-grid td:first-child { white-space: normal; min-width: 10rem; }
.payroll-grid th:first-child,
.payroll-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: var(--z-raised);
    background: var(--crm-surface);
    box-shadow: 1px 0 0 var(--crm-rule-soft);
}
.payroll-grid thead th:first-child { background: var(--crm-surface-3); }

/* A <label> inside a table cell (a row's reference that also ticks its checkbox, as on Bid Pack)
   takes the cell's type. Falcon gives every label Poppins 500, so that one cell read as a heading
   beside its Open Sans neighbours (v2026.10.17). Form labels keep the theme's style. */
.crm-table td label:not(.form-label):not(.form-check-label) {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* AI Providers usage: the month picker is a searchable select; give it room for "September 2026". */
.crm-month-pick { min-width: 11rem; }

/* Dashboard design pass (v2026.10.17). The compliance summary rows are body text at the dashboard's
   size (they inherited 16px and outweighed the card heading); the count chips are quiet subtle badges. */
.compliance-alert-list { font-size: 0.8333333333rem; }
.compliance-alerts .compliance-count { font-size: 0.75rem; font-weight: 600; }

/* An empty chart says so in the middle of its area instead of leaving a blank card. */
.dash-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: var(--z-raised);
}

/* Dashboard hero: the text keeps clear of the illustration drawn in the bottom-right corner, which
   it ran into at every width the illustration shows (v2026.10.17). */
@media (min-width: 768px) { .dash-hero-text { padding-right: 15rem; } }

/* v2026.10.17 dark pass: the header's count and info chips, and its icon, were the brand navy on a
   near-black bar (contrast about 2:1, "2 employees" all but invisible). They take the light brand ink. */
[data-bs-theme="dark"] .page-header-bar > .ph-title > .ph-count { color: var(--crm-brand-link); background: rgba(var(--crm-brand-rgb), 0.35); }
[data-bs-theme="dark"] .page-header-bar .ph-stat.ph-stat-info { color: var(--crm-brand-link); }
[data-bs-theme="dark"] .page-header-bar > .ph-icon { color: var(--crm-brand-link); }
[data-bs-theme="dark"] .dash-hero-text .text-primary { color: var(--crm-brand-link) !important; }

/* Pay run and payroll settings grids: no spin buttons (they took 15px of an eight-digit amount and
   nobody steps a salary by one shilling) and a tighter inner padding, so the figure is never cut. */
.payroll-grid input[type="number"] { -moz-appearance: textfield; appearance: textfield; padding-left: 0.5rem; padding-right: 0.5rem; }
.payroll-grid input[type="number"]::-webkit-outer-spin-button,
.payroll-grid input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* A list's main text column keeps a readable width. On a phone the table already scrolls inside its
   own container; without this the browser squeezed that one column to ~90px and wrapped each
   obligation or title over four lines while the narrow columns stayed wide (v2026.10.17). */
.crm-table th.crm-col-primary { min-width: 13rem; }


/* ==========================================================================
   Sign-in (v2026.10.18)
   --------------------------------------------------------------------------
   Every page a signed-out person sees: _Account.cshtml + Areas/Identity/Pages/Account.
   Form on one side, an information card with what is new and how to reach support on the
   other; one column on a phone with the FORM FIRST. No literal colours: tokens only. Motion only under
   prefers-reduced-motion: no-preference, and the entrance not again in a warm session.
   ========================================================================== */
.signin-body {
    min-height: 100vh;
    margin: 0;
    background: var(--falcon-body-bg);
    color: var(--crm-ink-muted);
}
.signin-skip:focus {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: var(--z-toast);
    padding: 0.5rem 0.75rem;
    border-radius: var(--crm-radius-sm);
    background: var(--crm-surface);
    color: var(--crm-link);
    box-shadow: var(--crm-shadow);
}
.signin-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}
@media (min-width: 992px) {
    .signin-shell { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

/* ---- Form side --------------------------------------------------------- */
.signin-main {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1rem 2rem;
}
@media (min-width: 576px) { .signin-main { padding: 2.5rem 2rem; } }
.signin-main-inner {
    width: 100%;
    max-width: 27rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.signin-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.signin-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: var(--crm-ink);
    text-decoration: none;
    border-radius: var(--crm-radius);
}
.signin-brand-link:hover { color: var(--crm-ink); }
.signin-logo-tile {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-rule-soft);
    background: var(--crm-on-accent); /* the SACC mark is drawn on white */
    box-shadow: var(--crm-shadow-sm);
    overflow: hidden;
}
.signin-logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.signin-brand-name {
    font-family: Poppins, var(--falcon-font-sans-serif, sans-serif);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    color: var(--crm-ink);
}
.signin-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius-pill);
    background: var(--crm-surface);
    color: var(--crm-ink-strong);
    transition: background-color 0.15s var(--crm-ease), border-color 0.15s var(--crm-ease);
}
.signin-icon-btn:hover { background: var(--crm-surface-2); border-color: var(--crm-surface-border); }
.signin-icon-btn.dropdown-toggle::after { display: none; }
.signin-theme .dropdown-menu { min-width: 13rem; }

.signin-card {
    background: var(--crm-surface);
    border: 1px solid var(--crm-rule-soft);
    border-radius: var(--crm-radius-lg);
    box-shadow: var(--crm-shadow);
    padding: 1.5rem 1.25rem;
    outline: none;
}
@media (min-width: 576px) { .signin-card { padding: 2rem; } }
.signin-card-head { margin-bottom: 1.25rem; }
.signin-card-icon {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.875rem;
    border-radius: var(--crm-radius);
    background: var(--crm-surface-tint);
    color: var(--crm-link);
    font-size: 1.125rem;
}
.signin-card-icon--success { background: var(--crm-success-soft); color: var(--falcon-success-text-emphasis); }
.signin-card-icon--warning { background: var(--crm-warning-soft); color: var(--falcon-warning-text-emphasis); }
.signin-title {
    margin: 0 0 0.375rem;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--crm-ink);
}
.signin-lede { margin: 0; font-size: 0.9375rem; line-height: 1.55; color: var(--crm-ink-muted); }
.signin-lede strong { color: var(--crm-ink-strong); }
.signin-text { font-size: 0.9375rem; line-height: 1.55; color: var(--crm-ink-muted); }
.signin-steps { margin: 0 0 1.25rem; padding-left: 1.1rem; font-size: 0.9375rem; line-height: 1.6; color: var(--crm-ink-muted); }

.signin-field { margin-bottom: 1rem; }
.signin-field .form-label { margin-bottom: 0.375rem; font-size: 0.875rem; font-weight: 500; color: var(--crm-ink-strong); }
.signin-optional { font-weight: 400; color: var(--crm-ink-muted); }
.signin-input {
    min-height: 2.75rem;
    font-size: 1rem; /* 16px: no zoom-on-focus on iOS */
    color: var(--crm-ink);
    background-color: var(--crm-surface);
    /* 3:1 against the card in both themes (WCAG 1.4.11): the theme's pale rule is ~1.3:1. */
    border-color: var(--crm-ink-faint);
    transition: border-color 0.15s var(--crm-ease), box-shadow 0.15s var(--crm-ease);
}
.signin-input:focus {
    color: var(--crm-ink);
    background-color: var(--crm-surface);
    border-color: var(--crm-link);
    box-shadow: 0 0 0 1px var(--crm-link);
}
.signin-input[aria-invalid="true"] { border-color: var(--crm-danger); }
.signin-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 0.2rem var(--crm-danger-soft); }
.signin-code { letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }

/* Chrome's autofill paints the field pale yellow and ignores background-color; an inset shadow
   the size of the field is the only paint that wins. The text colour has its own property. */
.signin-body input:-webkit-autofill,
.signin-body input:-webkit-autofill:hover,
.signin-body input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--crm-ink);
    caret-color: var(--crm-ink);
    -webkit-
    transition: background-color 600000s 0s;
}
.signin-body input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100rem var(--crm-surface) inset, 0 0 0 1px var(--crm-link);
    box-shadow: 0 0 0 100rem var(--crm-surface) inset, 0 0 0 1px var(--crm-link);
}

.signin-password { position: relative; }
.signin-password .signin-input { padding-right: 3rem; }
.signin-reveal {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    display: inline-grid;
    place-items: center;
    width: 2.375rem;
    height: 2.375rem;
    border: 0;
    border-radius: var(--crm-radius-sm);
    background: transparent;
    color: var(--crm-ink-muted);
}
.signin-reveal:hover { color: var(--crm-ink); background: var(--crm-surface-tint); }
.signin-reveal[aria-pressed="true"] { color: var(--crm-link); }

.signin-field-error {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--falcon-danger-text-emphasis);
}
.signin-field-error:empty { display: none; }
.signin-hint { margin: 0.375rem 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--crm-ink-muted); }
.signin-capslock {
    display: none;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0;
    padding: 0.3rem 0.6rem;
    width: fit-content;
    border-radius: var(--crm-radius-sm);
    border: 1px solid var(--crm-rule);
    background: var(--crm-surface);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--crm-ink-strong);
}
.signin-capslock.is-on { display: inline-flex; }

.signin-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--crm-ink-strong);
}
.signin-alert-icon { flex: 0 0 auto; margin-top: 0.15rem; }
.signin-alert--danger { }
.signin-alert--danger .signin-alert-icon { color: var(--falcon-danger-text-emphasis); }
.signin-alert--warning { }
.signin-alert--warning .signin-alert-icon { color: var(--falcon-warning-text-emphasis); }
.signin-alert--success { }
.signin-alert--success .signin-alert-icon { color: var(--falcon-success-text-emphasis); }

.signin-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0.25rem 0 1.25rem;
    font-size: 0.875rem;
}
.signin-row .form-check-label { color: var(--crm-ink-strong); }
.signin-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.75rem;
    font-weight: 600;
}
.signin-actions { display: flex; flex-direction: column; gap: 0.625rem; }
.signin-link { color: var(--crm-link); font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.signin-link:hover { color: var(--crm-link); text-decoration-thickness: 2px; }
.signin-alt { margin: 1.25rem 0 0; text-align: center; font-size: 0.875rem; color: var(--crm-ink-muted); }
.signin-alt > * + * { margin-left: 0.25rem; }
.signin-foot { margin: 0; text-align: center; font-size: 0.8125rem; color: var(--crm-ink-muted); }

/* One visible focus style for every control on these pages, in both themes. */
.signin-body a:focus-visible,
.signin-body button:focus-visible,
.signin-body .form-check-input:focus-visible {
    outline: 2px solid var(--crm-link);
    outline-offset: 2px;
    box-shadow: none;
}
.signin-body .btn-primary:focus-visible { outline-color: var(--crm-link); }
[data-bs-theme="dark"] .signin-body .form-check-input { border-color: var(--crm-ink-muted); }

/* ---- Information panel --------------------------------------------------
   A normal CRM card on the page background, the same weight as the form: surface, rule,
   small shadow, ink text. The brand appears only as an accent (icon tile, links, a thin rule). */
.signin-aside {
    display: flex;
    align-items: center;
    padding: 0 1rem 2rem;
}
@media (min-width: 576px) { .signin-aside { padding: 0 2rem 2.5rem; } }
@media (min-width: 992px) {
    .signin-aside {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        padding: 2.5rem clamp(2rem, 5vw, 5rem) 2.5rem 1rem;
    }
}
.signin-aside-inner {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    padding: 1.5rem 1.25rem;
    border: 1px solid var(--crm-rule-soft);
    border-radius: var(--crm-radius-lg);
    background: var(--crm-surface);
    box-shadow: var(--crm-shadow-sm);
}
@media (min-width: 576px) { .signin-aside-inner { padding: 2rem; } }
.signin-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--crm-ink-strong);
}
.signin-eyebrow-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--crm-radius-sm);
    background: var(--crm-surface-tint);
    color: var(--crm-link);
    letter-spacing: 0;
}
.signin-aside-title {
    margin: 0;
    font-size: clamp(1.25rem, 1.8vw, 1.5rem);
    font-weight: 600;
    line-height: 1.35;
    text-wrap: balance;
    color: var(--crm-ink);
}
.signin-news { display: flex; flex-direction: column; gap: 0.875rem; }
.signin-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    margin: 0;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius-pill);
    background: var(--crm-surface-2);
    font-size: 0.875rem;
    color: var(--crm-ink-strong);
}
.signin-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--crm-success);
}
.signin-status--notice .signin-status-dot { background: var(--crm-warning); }
.signin-news-item {
    padding: 0.875rem 1rem;
    border: 1px solid var(--crm-rule-soft);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-2);
}
.signin-news-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--crm-ink-muted);
}
.signin-news-kicker .svg-inline--fa, .signin-news-kicker .fas { color: var(--crm-link); }
.signin-news-title { margin: 0 0 0.25rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--crm-ink); }
.signin-news-body { margin: 0; font-size: 0.875rem; line-height: 1.55; color: var(--crm-ink-muted); overflow-wrap: anywhere; }
.signin-news-link { display: inline-block; margin-top: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--crm-link); }
.signin-news-link:hover { color: var(--crm-link); }
.signin-contact { padding-top: 1rem; border-top: 1px solid var(--crm-rule-soft); }
.signin-contact-label { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--crm-ink-strong); }
.signin-contact-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.signin-contact-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--crm-link);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.signin-contact-list a:hover { text-decoration: underline; color: var(--crm-link); }
/* ---- Motion ------------------------------------------------------------ */
@keyframes signinRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes signinFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
    .signin-main-inner { animation: signinRise 0.5s var(--crm-ease) both; }
    .signin-aside-inner { animation: signinRise 0.6s var(--crm-ease) 0.08s both; }
    .signin-news.is-loaded > * { animation: signinFade 0.35s var(--crm-ease) both; }
    .signin-field-error:not(:empty), .signin-alert:not([hidden]), .signin-capslock.is-on { animation: signinFade 0.25s var(--crm-ease) both; }
    html[data-session-warm="true"] .signin-main-inner,
    html[data-session-warm="true"] .signin-aside-inner { animation: none; }
}

/* ── Related-pages strip (v2026.10.28) ──
   Links the logs of one concern side by side (Communications: SMS, email, push, webhooks) and the settings behind
   them. Pills on the surface tint; the current page is the filled one. Scrolls sideways on a phone instead of
   wrapping into a second block of chrome (the .saved-views-bar treatment). Tokens only, so dark mode follows. */
.crm-related-nav {
    display: flex; align-items: center; gap: 0.375rem;
    overflow-x: auto; scrollbar-width: thin;
    margin: 0 0 0.75rem; padding: 0.125rem 0;
    white-space: nowrap;
}
.crm-related-nav .crn-label {
    font-size: 0.72rem; font-weight: 600;
    color: var(--crm-ink-muted); margin-right: 0.125rem; flex-shrink: 0;
}
.crm-related-nav .crn-link {
    display: inline-flex; align-items: center; gap: 0.375rem; flex-shrink: 0;
    padding: 0.25rem 0.75rem; border-radius: var(--crm-radius-pill);
    border: 1px solid var(--crm-rule); background: var(--crm-surface);
    color: var(--crm-ink); font-size: 0.8rem; text-decoration: none;
    transition: border-color 0.15s var(--crm-ease), color 0.15s var(--crm-ease);
}
.crm-related-nav .crn-link .fas { font-size: 0.75rem; color: var(--crm-ink-muted); }
.crm-related-nav .crn-link:hover { border-color: var(--crm-brand); color: var(--crm-brand); }
.crm-related-nav .crn-link:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 1px; }
.crm-related-nav .crn-link.active {
    background: var(--crm-brand); border-color: var(--crm-brand); color: var(--crm-brand-contrast); font-weight: 600;
}
.crm-related-nav .crn-link.active .fas { color: var(--crm-brand-contrast); }
.crm-related-nav .crn-setting { background: transparent; }
.crm-related-nav .crn-sep { width: 1px; align-self: stretch; background: var(--crm-rule); margin: 0 0.25rem; flex-shrink: 0; }

/* ── Email preview (Email Log detail, v2026.10.28) ──
   The stored body is shown in a sandboxed iframe (no scripts, no same-origin), the way a provider's activity view
   previews a message: the email's own styles cannot leak into the page and its links cannot act on the CRM. */
.email-preview-frame {
    width: 100%; height: 22rem; border: 1px solid var(--crm-rule); border-radius: var(--crm-radius);
    background: var(--crm-on-accent);
}
.email-body-note {
    border: 1px dashed var(--crm-rule); border-radius: var(--crm-radius);
    padding: 0.75rem 1rem; font-size: 0.82rem; color: var(--crm-ink-muted);
}
.email-recipients { word-break: break-word; }

/* ═══════════════════════════════════════════════════════════════════════
   Parents portal admin (Integrations > Parents portal, 2026-10-29)
   Staff pages under Pages/ParentsPortal. Tokens only (§14): no raw colour, no raw z-index.
   ═══════════════════════════════════════════════════════════════════════ */
.pp-kpi-value { font-variant-numeric: tabular-nums; }
/* Overview cards open the list behind their figure: the whole card is the link (stretched-link); a second link in the
   card (e.g. "N new accounts") sits above it. */
.pp-kpi-link { transition: border-color .15s var(--crm-ease), box-shadow .15s var(--crm-ease); }
.pp-kpi-link:hover { border-color: var(--crm-brand); }
.pp-kpi-sub-link { position: relative; z-index: var(--z-raised); }
.pp-chart { width: 100%; height: 18rem; }
.pp-ref { max-width: 12rem; vertical-align: bottom; }
.pp-features-locked { opacity: 0.55; }

/* The school's QR code: a white quiet zone in both themes, so phones can read it. */
.pp-qr-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.pp-qr {
    display: inline-block; padding: 0.5rem; background: var(--crm-on-accent);
    border: 1px solid var(--crm-rule); border-radius: var(--crm-radius);
}
.pp-qr svg { display: block; max-width: 100%; height: auto; }

/* Campaign form: SMS meter and the preview figure. */
.pp-sms-meter { color: var(--crm-ink-muted); }
.pp-sms-meter strong { color: var(--crm-ink-strong); font-variant-numeric: tabular-nums; }
.pp-sms-meter-warn strong { color: var(--crm-warning-deep); }
.pp-preview {
    border: 1px solid var(--crm-rule); border-radius: var(--crm-radius);
    background: var(--crm-surface); padding: 0.75rem 1rem;
}
.pp-preview-count { font-size: 1.75rem; font-weight: 700; color: var(--crm-brand); font-variant-numeric: tabular-nums; }

/* View as parent: a read-only copy, marked so it is never mistaken for the staff view. */
.pp-viewas { border: 1px solid var(--crm-warning); }

/* Printable poster (Pages/ParentsPortal/SchoolPoster): a standalone A4 page, mono first. */
.pp-poster-body { background: var(--crm-surface-2); color: var(--crm-ink); }
.pp-poster-tools { display: flex; gap: 0.5rem; justify-content: center; padding: 1rem; }
.pp-poster {
    max-width: 42rem; margin: 0 auto 2rem; padding: 2.5rem 2rem; text-align: center;
    background: var(--crm-surface); border: 1px solid var(--crm-rule); border-radius: var(--crm-radius);
}
.pp-poster-school { font-family: Poppins, sans-serif; font-weight: 600; font-size: 1.25rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--crm-ink-muted); margin-bottom: 0.5rem; }
.pp-poster-title { font-family: Poppins, sans-serif; font-weight: 700; font-size: 2.25rem; line-height: 1.2; color: var(--crm-ink-strong); }
.pp-poster-lead { font-size: 1.15rem; margin: 0.75rem 0 1.5rem; }
.pp-poster-qr { display: inline-block; padding: 0.75rem; background: var(--crm-on-accent); border: 2px solid var(--crm-ink-strong); border-radius: var(--crm-radius); }
.pp-poster-qr svg { display: block; width: 18rem; height: 18rem; max-width: 70vw; max-height: 70vw; }
.pp-poster-link { font-family: Poppins, sans-serif; font-weight: 700; font-size: 1.6rem; margin: 1rem 0 1.5rem; color: var(--crm-ink-strong); word-break: break-all; }
.pp-poster-steps { text-align: left; display: inline-block; font-size: 1.15rem; margin: 0 auto 1.5rem; padding-left: 1.5rem; }
.pp-poster-steps li { margin-bottom: 0.4rem; }
.pp-poster-note { font-size: 0.95rem; color: var(--crm-ink-muted); }
.pp-poster-foot { font-size: 0.85rem; color: var(--crm-ink-muted); margin: 1.5rem 0 0; }

@media print {
    .pp-poster-tools { display: none; }
    .pp-poster-body { background: none; }
    .pp-poster { border: 0; max-width: none; margin: 0; padding: 1cm 0; }
}

/* Parents portal catalogue (30 Oct 2026): a bundle marked for deletion stays on the page, dimmed, until the save. */
.card.bundle-deleted { opacity: .6; border: 1px dashed var(--crm-danger); }
.card.bundle-deleted .card-body { pointer-events: none; }

/* ==========================================================================
   Fees portal sign-in: the school line and the showcase panel (v2026.11.03)
   Public pages, so the side panel advertises: an EXAMPLE account the visitor clicks through, the three steps,
   what is offered, and a pointer to SACC. Still a surface card with brand accents only (no brand fill).
   Motion is parents.js [data-showcase]; reduced motion turns every animation and the auto-cycle off.
   ========================================================================== */
.pp-school { display: flex; align-items: center; gap: 0.875rem; }
.pp-school-logo {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0.25rem;
    border: 1px solid var(--crm-rule-soft);
    border-radius: var(--crm-radius-lg);
    background: var(--crm-surface);
    box-shadow: var(--crm-shadow-sm);
    overflow: hidden;
}
.pp-school-logo img { width: 100%; height: 100%; object-fit: contain; }
.pp-school-logo--initials { background: var(--crm-surface-tint); color: var(--crm-link); font-weight: 700; font-size: 1.125rem; }
.pp-school-kicker { margin: 0 0 0.125rem; font-size: 0.75rem; font-weight: 600; color: var(--crm-ink-faint); }
.pp-school-name { margin: 0; overflow-wrap: anywhere; }

/* The example account */
.pp-showcase { border: 1px solid var(--crm-rule-soft); border-radius: var(--crm-radius-lg); background: var(--crm-surface-2); overflow: hidden; }
.pp-showcase-tabs { display: flex; gap: 0.25rem; padding: 0.375rem; border-bottom: 1px solid var(--crm-rule-soft); }
.pp-showcase-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    border: 0;
    border-radius: var(--crm-radius);
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--crm-ink-muted);
    cursor: pointer;
    transition: background-color .2s var(--crm-ease), color .2s var(--crm-ease);
}
.pp-showcase-tab:hover { color: var(--crm-link); background: var(--crm-surface-tint); }
.pp-showcase-tab.is-active { background: var(--crm-surface); color: var(--crm-link); box-shadow: var(--crm-shadow-sm); }
.pp-showcase-tab:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 1px; }
.pp-showcase-screen { position: relative; min-height: 11.5rem; padding: 2.125rem 1.125rem 1rem; }
.pp-showcase-sample {
    position: absolute;
    top: 0.625rem;
    right: 0.875rem;
    padding: 0.1rem 0.5rem;
    border: 1px dashed var(--crm-rule);
    border-radius: var(--crm-radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--crm-ink-faint);
}
.pp-showcase-label { margin: 0 0 0.25rem; font-size: 0.8125rem; color: var(--crm-ink-muted); }
.pp-showcase-amount { margin: 0 0 0.75rem; font-size: 1.75rem; font-weight: 700; color: var(--crm-ink); font-variant-numeric: tabular-nums; }
.pp-showcase-bar { height: 0.5rem; border-radius: var(--crm-radius-pill); background: var(--crm-rule-soft); overflow: hidden; }
.pp-showcase-bar span { display: block; width: 70%; height: 100%; border-radius: inherit; background: var(--crm-success); }
.pp-showcase-note { display: flex; align-items: center; gap: 0.4rem; margin: 0.625rem 0 0; font-size: 0.8125rem; color: var(--crm-ink-muted); }
.pp-showcase-note .fas, .pp-showcase-note .svg-inline--fa { color: var(--crm-success); }
.pp-showcase-lines, .pp-showcase-receipts { margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.pp-showcase-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px dashed var(--crm-rule-soft); font-variant-numeric: tabular-nums; color: var(--crm-ink-strong); }
.pp-showcase-lines li.is-credit { color: var(--crm-success); }
.pp-showcase-lines li.is-total { border-bottom: 0; font-weight: 700; color: var(--crm-ink); }
.pp-showcase-receipts li { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--crm-rule-soft); color: var(--crm-ink-strong); }
.pp-showcase-receipts li span:nth-child(2) { flex: 1 1 auto; }
.pp-showcase-receipts strong { font-variant-numeric: tabular-nums; }
.pp-showcase-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--crm-success); }

/* How it works: the current step follows the example */
.pp-steps { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.pp-step { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--crm-ink-muted); transition: color .3s var(--crm-ease); }
.pp-step-num {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--crm-rule);
    border-radius: 50%;
    background: var(--crm-surface);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--crm-ink-muted);
    transition: background-color .3s var(--crm-ease), color .3s var(--crm-ease), border-color .3s var(--crm-ease), transform .3s var(--crm-ease-spring);
}
.pp-step.is-current { color: var(--crm-ink); }
.pp-step.is-current .pp-step-num { border-color: var(--crm-brand); background: var(--crm-brand); color: var(--crm-on-accent); transform: scale(1.08); }

.pp-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.pp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--crm-rule);
    border-radius: var(--crm-radius-pill);
    background: var(--crm-surface);
    font-size: 0.8125rem;
    color: var(--crm-ink-strong);
}
.pp-chip .fas, .pp-chip .svg-inline--fa { color: var(--crm-link); }
.pp-chip.is-free { border-color: rgba(var(--crm-success-rgb), 0.45); background: var(--crm-success-soft); }
.pp-chip.is-free .fas, .pp-chip.is-free .svg-inline--fa { color: var(--crm-success); }

/* The pointer to SACC */
.pp-promo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--crm-surface-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-tint);
    color: var(--crm-ink-muted);
    text-decoration: none;
    transition: border-color .2s var(--crm-ease), box-shadow .2s var(--crm-ease), transform .2s var(--crm-ease);
}
.pp-promo:hover { border-color: var(--crm-brand); color: var(--crm-ink-muted); }
.pp-promo-icon { flex: 0 0 auto; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: var(--crm-radius); background: var(--crm-surface); box-shadow: var(--crm-shadow-sm); }
.pp-promo-text { display: flex; flex-direction: column; gap: 0.125rem; font-size: 0.8125rem; line-height: 1.45; }
.pp-promo-text strong { font-size: 0.9375rem; color: var(--crm-ink); }
.pp-promo-arrow { margin-left: auto; flex: 0 0 auto; color: var(--crm-link); transition: transform .2s var(--crm-ease); }
.pp-promo:hover .pp-promo-arrow { }

@media (prefers-reduced-motion: no-preference) {
    .signin-body .signin-card, .signin-body .signin-aside-inner > * { animation: ppRise .55s var(--crm-ease) both; }
    .signin-body .signin-aside-inner > *:nth-child(2) { animation-delay: .06s; }
    .signin-body .signin-aside-inner > *:nth-child(3) { animation-delay: .12s; }
    .signin-body .signin-aside-inner > *:nth-child(4) { animation-delay: .18s; }
    .signin-body .signin-aside-inner > *:nth-child(5) { animation-delay: .24s; }
    .signin-body .signin-aside-inner > *:nth-child(6) { animation-delay: .30s; }
    .pp-showcase-pane.is-active { animation: ppPane .35s var(--crm-ease) both; }
    .pp-showcase-bar span { animation: ppBar 1.1s var(--crm-ease) both .25s; transform-origin: left center; }
    .pp-promo:hover { }
}
@keyframes ppRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ppPane { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes ppBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* The showcase makes the panel taller than a laptop screen: let the sticky panel scroll, and centre with auto
   margins (a centred flex child that overflows would lose its top). */
@media (min-width: 992px) {
    .signin-aside:has([data-showcase]) { align-items: flex-start; overflow-y: auto; }
    .signin-aside:has([data-showcase]) .signin-aside-inner { margin: auto; }
}

/* ---- Fees portal home (v2026.11.03) ----------------------------------------------------------------------------
   Areas/Parents/Pages/Index.cshtml ("Your students"): cards in a grid, one student = card + side column. Tokens
   only. The amount and the payment code are the two things a parent comes for, so they are the largest text.
   Motion reuses ppRise (sign-in) and is off under reduced motion. */
.pp-home-card { transition: transform .2s var(--crm-ease), box-shadow .2s var(--crm-ease); }
.pp-home-card:hover { }
.pp-home-amount { font-variant-numeric: tabular-nums; }
.pp-home-paycode { letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--crm-ink-strong); }
.pp-home-ribbon .btn { white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
    .pp-home-ribbon, .pp-home-school > .card, .pp-home-col { animation: ppRise .5s var(--crm-ease) both; }
    .pp-home-col:nth-child(2) { animation-delay: .08s; }
    .pp-home-col:nth-child(3) { animation-delay: .16s; }
    .pp-home-col:nth-child(4) { animation-delay: .24s; }
    .pp-home-col:nth-child(n+5) { animation-delay: .32s; }
    .pp-home-card:hover { }
    html[data-session-warm="true"] .pp-home-ribbon,
    html[data-session-warm="true"] .pp-home-school > .card,
    html[data-session-warm="true"] .pp-home-col { animation: none; }
}

/* ---- Fees portal checkout (v2026.11.03) --------------------------------------------------------------------------
   Areas/Parents/Pages/Checkout.cshtml (plan cards, length switch, payer number, number check, sticky Pay bar on
   phones) and CheckoutStatus.cshtml (the payment's stages, the waiting phone, the drawn check mark). Behaviour is
   in parents.js. Tokens only; motion only under prefers-reduced-motion: no-preference. */

/* Plan cards: the chosen one carries the brand border. */
.pp-plans { display: grid; gap: 0.75rem; }
.pp-plan { border: 1px solid var(--crm-rule); box-shadow: none; transition: border-color .2s var(--crm-ease), box-shadow .2s var(--crm-ease); }
.pp-plan.is-selected { border-color: var(--crm-brand); box-shadow: 0 0 0 1px var(--crm-brand), var(--crm-shadow-sm); }
.pp-plan:focus-within { box-shadow: 0 0 0 1px var(--crm-brand); }

/* The length switch: .crm-segmented with labels for radios (the shared control styles buttons). */
.crm-segmented.pp-length { display: flex; flex-wrap: wrap; width: 100%; }
.crm-segmented > .btn-check + label {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    margin: 0;
    padding: 6px 12px;
    border-radius: calc(var(--crm-radius) - 3px);
    color: var(--crm-ink-muted);
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background .2s var(--crm-ease), color .2s var(--crm-ease);
}
.crm-segmented > .btn-check:checked + label { background: var(--crm-surface); color: var(--crm-ink-strong); box-shadow: var(--crm-shadow-sm); }
.crm-segmented > .btn-check + label:hover { color: var(--crm-ink-strong); }
.crm-segmented > .btn-check:focus-visible + label { outline: 2px solid var(--crm-brand); outline-offset: 1px; }
.pp-best {
    display: inline-block;
    margin-top: 2px;
    padding: 0 6px;
    border-radius: var(--crm-radius-pill);
    background: var(--crm-success-soft);
    color: var(--crm-success);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.pp-plan-price { margin-top: 0.75rem; }
.pp-plan-amount { font-size: 1.25rem; font-weight: 700; color: var(--crm-ink-strong); font-variant-numeric: tabular-nums; }
.pp-plan-day { border: 1px dashed var(--crm-rule); border-radius: var(--crm-radius); cursor: pointer; }
.pp-plan-day:has(input:checked) { border-style: solid; border-color: var(--crm-brand); background: var(--crm-surface-tint); }

/* Payer number: "another number" opens its field. Works without script; parents.js only moves `required`. */
.pp-payer:has(#payOwnNumber:checked) .pp-other-number { display: none; }
.pp-number-check:empty { display: none; }
.pp-number-check.is-ok { color: var(--crm-success); }
.pp-number-check.is-warning { color: var(--crm-warning-deep); }
.pp-number-check.is-danger { color: var(--crm-danger); }

/* The summary beside the checkboxes stays visible; the rest is in the info tip. */
.pp-pay-summary dt { font-weight: 600; color: var(--crm-ink-strong); }
.pp-pay-summary dd { margin: 0 0 0.5rem; color: var(--crm-ink); }
.pp-pay-status:empty { display: none; }

/* Phones: total + Pay stick to the bottom of the screen while the form is in view. */
.pp-paybar {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky);
    border-radius: var(--crm-radius) var(--crm-radius) 0 0;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--crm-surface);
    border-top: 1px solid var(--crm-rule);
    box-shadow: var(--crm-shadow-lg);
}
form[aria-busy="true"] [data-pay-button] { cursor: progress; }

/* Waiting screen: the steps, the phone, the check mark. */
.pp-pay-steps { max-width: 22rem; }
.pp-step.is-done { color: var(--crm-ink); }
.pp-step.is-done .pp-step-num { border-color: var(--crm-success); background: var(--crm-success-soft); color: var(--crm-success); }
.pp-elapsed { font-variant-numeric: tabular-nums; }
.pp-phone-pulse {
    position: relative;
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: var(--crm-warning-soft);
    color: var(--crm-warning-deep);
    font-size: 1.75rem;
}
.pp-check { width: 4.5rem; height: 4.5rem; }
.pp-check svg { width: 100%; height: 100%; }
.pp-check-ring { fill: var(--crm-success-soft); stroke: var(--crm-success); stroke-width: 2; }
.pp-check-mark { fill: none; stroke: var(--crm-success); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: no-preference) {
    .pp-phone-pulse::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 2px solid var(--crm-warning);
        animation: ppPhonePulse 1.8s var(--crm-ease) infinite;
    }
    .pp-phone-pulse .fas, .pp-phone-pulse .svg-inline--fa { animation: ppPhoneNudge 1.8s var(--crm-ease) infinite; }
    .pp-check-ring { stroke-dasharray: 151; stroke-dashoffset: 151; animation: ppDraw .6s var(--crm-ease) forwards; }
    .pp-check-mark { stroke-dasharray: 36; stroke-dashoffset: 36; animation: ppDraw .4s var(--crm-ease) .5s forwards; }
    .pp-pay-actions:not([hidden]) { animation: ppRise .4s var(--crm-ease) both; }
}
@keyframes ppPhonePulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.45); opacity: 0; } }
@keyframes ppPhoneNudge { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-8deg); } 85% { transform: rotate(8deg); } }
@keyframes ppDraw { to { stroke-dashoffset: 0; } }

/* ═══════════════════════════════════════════════════════════════════════
   ACCOUNT SETTINGS (v2026.11.04) - the Manage pages under _Profile.cshtml
   Header card, grouped navigation, the two-step summary list, setup steps,
   recovery codes (+ their print view) and the two-step nudge in _Main.
   Tokens only; every surface is a --crm-*/--falcon-* variable, so dark mode
   follows the theme with no override block.
   ═══════════════════════════════════════════════════════════════════════ */

/* Header: avatar, name, email, role badges. Wraps to a column on a phone. */
.acct-header-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.acct-avatar {
    width: 4.5rem;
    height: 4.5rem;
    flex: 0 0 4.5rem;
    object-fit: cover;
    border: 1px solid var(--crm-surface-border);
    background: var(--crm-surface-2);
}
.acct-header-text { min-width: 0; flex: 1 1 14rem; }
.acct-header-name { font-size: 1.125rem; overflow-wrap: anywhere; }
.acct-header-email { font-size: 0.875rem; overflow-wrap: anywhere; }
.acct-header-roles { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.375rem; }

/* Grouped navigation with small group labels. */
.acct-nav-group + .acct-nav-group { margin-top: 1rem; }
.acct-nav-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--crm-ink-muted);
    padding: 0 1rem 0.25rem;
}
.acct-nav .nav-link { padding: 0.375rem 1rem; font-size: 0.875rem; }

/* Summary list (GOV.UK summary-list pattern): key | value | action, one row per fact. */
.acct-summary { margin: 0; border-top: 1px solid var(--crm-rule); }
.acct-summary-row {
    display: grid;
    grid-template-columns: minmax(8rem, 12rem) 1fr auto;
    gap: 0.25rem 1rem;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--crm-rule);
}
.acct-summary-row dt { font-weight: 600; color: var(--crm-ink-strong); }
.acct-summary-row dd { margin: 0; }
.acct-summary-action { text-align: right; white-space: nowrap; }
.acct-summary-action form { display: inline; }
.acct-summary-link { font-size: inherit; vertical-align: baseline; }
@media (max-width: 575.98px) {
    .acct-summary-row { grid-template-columns: 1fr auto; }
    .acct-summary-row dt { grid-column: 1 / -1; }
}

/* The "turned off" call to action: a plain bordered panel, not a coloured slab. */
.acct-callout {
    border: 1px solid var(--crm-surface-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface-2);
    padding: 1rem;
}

/* Setup steps: a numbered list with the number in a small brand-outlined circle. */
.acct-steps { list-style: none; counter-reset: acct-step; padding: 0; margin: 0; }
.acct-steps > li {
    counter-increment: acct-step;
    position: relative;
    padding: 0 0 1.25rem 2.5rem;
}
.acct-steps > li::before {
    content: counter(acct-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 1px solid var(--crm-brand);
    color: var(--crm-brand);
    font-weight: 600;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.acct-key, .acct-verify { max-width: 22rem; }
.acct-qr svg, .acct-qr canvas { max-width: 100%; height: auto; }

/* Recovery codes: a monospace grid, two columns, one on a narrow phone. */
.acct-recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 12rem));
    gap: 0.5rem 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.acct-recovery-codes .recovery-code {
    display: block;
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.9375rem;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--crm-surface-border);
    border-radius: var(--crm-radius-sm);
    background: var(--crm-surface-2);
    color: var(--crm-ink-strong);
}
@media (max-width: 359.98px) {
    .acct-recovery-codes { grid-template-columns: minmax(0, 1fr); }
}

/* Print the recovery codes only (ShowRecoveryCodes sets html.acct-printing-codes). */
@media print {
    html.acct-printing-codes body * { visibility: hidden; }
    html.acct-printing-codes .acct-recovery-print,
    html.acct-printing-codes .acct-recovery-print * { visibility: visible; }
    html.acct-printing-codes .acct-recovery-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    html.acct-printing-codes .acct-recovery-codes .recovery-code {
        background: none;
        color: inherit;
    }
}

/* The two-step nudge (v2026.11.07): the shared alert house style (see ALERTS at the end of this file). */
.acct-nudge {
    font-size: 0.875rem; padding-top: 0.625rem; padding-bottom: 0.625rem;
    --crm-alert-mark: var(--crm-warning); /* surface, rule and ink come from the shared ALERTS block */
}
.acct-nudge .acct-nudge-mark { color: var(--crm-warning); }
.acct-nudge .acct-nudge-link { color: var(--crm-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.acct-nudge .acct-nudge-link:hover { text-decoration-thickness: 2px; }

/* ═══════════════════════════════════════════════════════════════════════
   TASK CHECKLIST (v2026.11.09, docs/plans/consolidation-spec.md §6.1)
   A task's checklist (Pages/ProjectTasks/_TaskChecklist.cshtml, wwwroot/task-checklist.js) and the
   project page lists its tasks grouped by milestone (Pages/Projects/_ProjectTasks.cshtml). Plain rows on hairlines,
   words carry the state ("Ticked by ... on ..."); a ticked item is also struck through, never coloured.
   ═══════════════════════════════════════════════════════════════════════ */
.task-checklist { list-style: none; margin: 0; padding: 0; }
.task-checklist__item { border-top: 1px solid var(--crm-rule-soft); padding: 0.5rem 0; }
.task-checklist__item:first-child { border-top: 0; }
.task-checklist__row { display: flex; align-items: flex-start; gap: 0.5rem; }
.task-checklist__row .form-check-input { flex: none; margin-top: 0.2rem; }
.task-checklist__text { color: var(--crm-ink-strong); overflow-wrap: anywhere; }
.task-checklist__item--done .task-checklist__text { color: var(--crm-ink-muted); text-decoration: line-through; }
.task-checklist__meta,
.task-checklist__note { margin-left: 1.5rem; color: var(--crm-ink-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.task-checklist__actions { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-left: 1.5rem; font-size: 0.8125rem; }
.task-checklist__actions .btn-link { padding: 0; font-size: inherit; text-decoration: none; }
.task-checklist__edit { display: grid; gap: 0.5rem; margin: 0.5rem 0 0 1.5rem; }
.task-checklist__add { margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--crm-rule); }
.task-checklist__add-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.task-checklist__add-row .task-checklist__new-text { flex: 1 1 100%; }
@media (min-width: 768px) {
    .task-checklist__add-row .task-checklist__new-text { flex: 1 1 16rem; }
    .task-checklist__add-row select,
    .task-checklist__add-row input[type="date"] { flex: 0 1 12rem; }
}
.task-group__heading { margin: 0.75rem 0 0.25rem; color: var(--crm-ink-strong); font-size: 0.875rem; font-weight: 600; }
.task-group__heading:first-child { margin-top: 0; }
.task-group__figures { color: var(--crm-ink-muted); font-weight: 400; }
.task-rows { list-style: none; margin: 0; padding: 0; }
.task-rows__item { border-top: 1px solid var(--crm-rule-soft); padding: 0.5rem 0; }
.task-rows__item:first-child { border-top: 0; }
.task-rows__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }
.task-rows__number { color: var(--crm-ink-muted); font-variant-numeric: tabular-nums; }
.task-rows__title { color: var(--crm-ink-strong); font-weight: 600; overflow-wrap: anywhere; }
.task-rows__status { margin-left: auto; color: var(--crm-ink-muted); font-size: 0.8125rem; }
.task-rows__meta { color: var(--crm-ink-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════════════
   ALERTS — house style, not the theme's tinted fills (v2026.11.07)
   The theme filled every .alert-* with a pastel (peach warning, pink danger, blue info) and coloured the words to
   match: the look the owner called "typical of AI-generated boilerplate", on ~112 panels. Same rule as the rest of
   the CRM: a plain surface and the ordinary hairline, the words in ink, and the state carried by words plus ONE small
   mark (a 3px rule on the left edge, in the status colour), so it survives greyscale. Bootstrap drives .alert from
   these variables, so this is the one place it is decided; tokens keep it right in both themes.
   ═══════════════════════════════════════════════════════════════════════ */
.alert[class*="alert-"] {
    --falcon-alert-bg: var(--crm-surface);
    --falcon-alert-color: var(--crm-ink);
    --falcon-alert-border-color: var(--crm-rule);
    --falcon-alert-link-color: var(--crm-brand);
    /* --crm-alert-mark is set by the variant rules below; set here it would outrank them (higher specificity). It colours
       the alert's small icon only (17 Nov 2026: no coloured left bar - the generated look the owner ruled out). */
    box-shadow: none;
}
.alert-warning   { --crm-alert-mark: var(--crm-warning); }
.alert-danger    { --crm-alert-mark: var(--crm-danger); }
.alert-success   { --crm-alert-mark: var(--crm-success); }
.alert-info,
.alert-primary   { --crm-alert-mark: var(--crm-brand); }
.alert[class*="alert-"] .alert-link { color: var(--crm-brand); text-decoration: underline; text-underline-offset: 2px; }
.alert[class*="alert-"] .alert-heading,
.alert[class*="alert-"] strong { color: var(--crm-ink-strong); }
.alert[class*="alert-"] > .fas:first-child,
.alert[class*="alert-"] > .far:first-child,
.alert[class*="alert-"] > svg.svg-inline--fa:first-child { color: var(--crm-alert-mark, var(--crm-ink-muted)); }

/* Part 2, the one sign-in at portal.sacc.ug: every choice a person presses is at least 24px (WCAG 2.2 SC 2.5.8) and
   44px tall on a page; the side panel is a <details> folded below the form on a phone, open beside it on a wide screen. */
.portal-choice { min-height: 44px; min-width: 24px; display: inline-flex; align-items: center; }
.portal-choice.w-100, .btn.portal-choice { justify-content: center; }
.form-check.portal-choice { display: flex; align-items: center; gap: .5rem; padding-left: 1.75rem; }
.portal-fold > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; }
.portal-fold > summary::-webkit-details-marker { display: none; }
.portal-help > summary { cursor: pointer; }
.portal-card { transition: box-shadow .15s ease; }
.portal-card:hover, .portal-card:focus-visible { }

/* ═══════════════════════════════════════════════════════════════════════
   PHONE CARDS FOR A WIDE LIST (v2026.11.17)
   `table.crm-stack-sm`: below 768px each row is a card and each cell a line, its label from the cell's
   `data-label` (a cell without one spans the card). The page then never scrolls sideways, whatever the
   table holds (the Documents list overflowed 231-239px at 390px with the table in .table-responsive).
   Opt-in per table: put `crm-stack-sm` on the <table> and a `data-label` on each <td>.
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    table.crm-stack-sm,
    table.crm-stack-sm tbody { display: block; width: 100%; min-width: 0; }
    table.crm-stack-sm thead { display: none; }
    table.crm-stack-sm tbody tr {
        display: block;
        margin: 0 0 0.6rem;
        padding: 0.5rem 0.75rem;
        border: 1px solid var(--falcon-border-color, #d8e2ef);
        border-radius: 0.375rem;
        background: var(--falcon-card-bg, #fff);
    }
    table.crm-stack-sm tbody td {
        display: flex;
        gap: 0.75rem;
        justify-content: space-between;
        align-items: baseline;
        padding: 0.2rem 0 !important;
        border: 0;
        text-align: right !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        min-width: 0;
    }
    table.crm-stack-sm tbody td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        color: var(--falcon-gray-700, #5e6e82);
        font-weight: 600;
    }
    table.crm-stack-sm tbody td:not([data-label]) { justify-content: flex-end; }
    table.crm-stack-sm tbody td:not([data-label])::before { content: none; }
}

/* ===== Confirm dialog: what the action touches, one per line (v2026.11.30, showConfirm({ items })) ===== */
.confirm-items {
    max-height: 12rem; overflow-y: auto; padding-left: 1.1rem;
    font-size: .78rem; color: var(--crm-ink-strong); overflow-wrap: anywhere;
}
.confirm-items li { padding: .1rem 0; }
.confirm-items .confirm-items-more { list-style: none; margin-left: -1.1rem; color: var(--crm-ink-muted); }
