/*
 * Vardeck Filament Theme
 * Navy/steel colour overrides matching marketing pages
 * Pure CSS — no Tailwind import (Filament provides its own)
 */

/* ──────────────────────────────────────────────────────────
   Sidebar — navy background
   ────────────────────────────────────────────────────────── */
.fi-sidebar {
    background-color: #060c33 !important;
}

.fi-body-has-topbar .fi-sidebar-header {
    background-color: #060c33 !important;
}

/* Nav item labels — light text on dark bg */
.fi-sidebar-item-label {
    color: #d1d5db !important;
}

/* Nav item icons — muted on dark bg */
.fi-sidebar-item-btn > .fi-icon {
    color: #9ca3af !important;
}

/* Nav item hover */
.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover,
.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:focus-visible {
    background-color: #0a1628 !important;
}

/* Nav item active state */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: #0a1628 !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: #ffffff !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
    color: #93aeff !important;
}

/* Active grouped border indicators */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-grouped-border > .fi-sidebar-item-grouped-border-part {
    background-color: #93aeff !important;
}

/* Grouped border lines */
.fi-sidebar-item-grouped-border-part-not-first,
.fi-sidebar-item-grouped-border-part-not-last {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* Grouped border dots (inactive) */
.fi-sidebar-item-grouped-border-part {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* Nav group labels */
.fi-sidebar-group-label {
    color: #9ca3af !important;
}

/* Nav group button icon */
.fi-sidebar-group-btn .fi-icon {
    color: #6b7280 !important;
}

/* Nav group collapse chevron — ensure visible and tappable on dark bg */
.fi-sidebar-group-collapse-btn {
    color: #9ca3af !important;
    min-width: 2rem;
    min-height: 2rem;
}

.fi-sidebar-group-collapse-btn:hover,
.fi-sidebar-group-collapse-btn:focus-visible {
    color: #ffffff !important;
    background-color: #0a1628 !important;
}

/* Ensure sidebar group button is tappable on mobile */
.fi-sidebar-group-btn {
    cursor: pointer;
    min-height: 2.5rem;
}

/* Rotate chevron when group is collapsed */
.fi-sidebar-group.fi-collapsed .fi-sidebar-group-collapse-btn .fi-icon {
    transform: rotate(180deg);
}

/* Nav group dropdown trigger hover */
.fi-sidebar-group-dropdown-trigger-btn:hover,
.fi-sidebar-group-dropdown-trigger-btn:focus-visible {
    background-color: #0a1628 !important;
}

/* Database notifications button in sidebar */
.fi-sidebar-database-notifications-btn {
    color: #d1d5db !important;
}

.fi-sidebar-database-notifications-btn:hover,
.fi-sidebar-database-notifications-btn:focus-visible {
    background-color: #0a1628 !important;
}

.fi-sidebar-database-notifications-btn > .fi-icon {
    color: #9ca3af !important;
}

.fi-sidebar-database-notifications-btn > .fi-sidebar-database-notifications-btn-label {
    color: #d1d5db !important;
}

/* Sidebar close overlay */
.fi-sidebar-close-overlay {
    background-color: rgba(6, 12, 51, 0.6) !important;
}

/* User menu trigger in sidebar */
.fi-sidebar .fi-user-menu-trigger .fi-tenant-menu-trigger-text {
    color: #ffffff !important;
}

.fi-sidebar .fi-user-menu-trigger .fi-icon {
    color: #9ca3af !important;
}

.fi-sidebar .fi-user-menu-trigger:hover .fi-icon {
    color: #d1d5db !important;
}

/* ──────────────────────────────────────────────────────────
   Topbar — navy background
   ────────────────────────────────────────────────────────── */
.fi-topbar {
    background-color: #060c33 !important;
    background-image: url('/images/brand/vardeck-hero-wave-alpha.svg');
    background-size: cover;
    background-position: center top;
    box-shadow: none !important;
    --tw-ring-color: rgba(255, 255, 255, 0.1) !important;
}

/* Topbar nav item labels */
.fi-topbar-item-label {
    color: #d1d5db !important;
}

/* Topbar nav item icons */
.fi-topbar-item-btn > .fi-icon {
    color: #9ca3af !important;
}

/* Topbar nav item hover */
.fi-topbar-item-btn:hover,
.fi-topbar-item-btn:focus-visible {
    background-color: #0a1628 !important;
}

/* Topbar active item */
.fi-topbar-item.fi-active .fi-topbar-item-btn {
    background-color: #0a1628 !important;
}

.fi-topbar-item.fi-active .fi-topbar-item-label {
    color: #ffffff !important;
}

.fi-topbar-item.fi-active .fi-topbar-item-btn > .fi-icon {
    color: #93aeff !important;
}

/* Topbar icon buttons (notifications, user menu, etc.) */
.fi-topbar-end .fi-icon-btn {
    color: #d1d5db !important;
}

.fi-topbar-end .fi-icon-btn:hover {
    background-color: #0a1628 !important;
}

/* Global search in topbar: dark field, Sky-blue icon tile, breathing
   room before the placeholder. */
.fi-topbar .fi-global-search-field .fi-input-wrp {
    background-color: #0a1628 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    overflow: hidden;
}

.fi-topbar .fi-global-search-field .fi-input-wrp-prefix {
    background-color: #7FA6FF; /* Sky — the palette's lighter blue */
    padding-inline: 0.625rem;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.fi-topbar .fi-global-search-field .fi-input-wrp-prefix .fi-icon {
    color: #0B1526 !important;
}

.fi-topbar .fi-global-search-field input {
    background-color: transparent !important;
    color: #ffffff !important;
    border-color: transparent !important;
    padding-inline-start: 0.75rem !important;
}

.fi-topbar .fi-global-search-field input::placeholder {
    color: #9ca3af !important;
}

/* Mobile topbar: even breathing room between the icon cluster, the
   search field and the end icons. */
@media (max-width: 768px) {
    .fi-topbar {
        padding-inline: 0.75rem !important;
        column-gap: 0.375rem;
        position: relative;
    }
    .fi-topbar .fi-icon-btn {
        margin-inline: 0.125rem;
    }

    /* Collapsed: the search is just the Sky icon button. */
    .fi-global-search {
        margin-inline: 0.25rem;
        min-width: 0;
    }
    .fi-global-search:not(.vd-search-open) .fi-input-wrp {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        --tw-ring-shadow: 0 0 #0000 !important;
    }
    .fi-global-search:not(.vd-search-open) .fi-input-wrp-prefix {
        border-radius: 0.625rem;
        width: 2.5rem;
        height: 2.5rem;
        justify-content: center;
        cursor: pointer;
        /* A plain icon like the bell beside it, not a filled tile that
           looks switched on. */
        background-color: transparent;
        border: none !important;
        box-shadow: none !important;
    }
    .fi-global-search:not(.vd-search-open) .fi-input-wrp-prefix .fi-icon {
        color: #ffffff !important;
    }
    .fi-global-search:not(.vd-search-open) .fi-input-wrp-prefix:hover {
        background-color: #0a1628;
    }
    .fi-global-search:not(.vd-search-open) .fi-global-search-field input {
        width: 0 !important;
        padding: 0 !important;
        opacity: 0;
        pointer-events: none;
    }

    /* Open: full-width overlay row across the topbar. */
    .fi-global-search.vd-search-open {
        position: absolute;
        inset-inline: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 40;
        background: #060c33;
        border-radius: 0.75rem;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    }
    .fi-global-search.vd-search-open .fi-global-search-field input {
        width: 100% !important;
    }
}

/* ──────────────────────────────────────────────────────────
   Logo — force white text on navy surfaces + size constraints
   ────────────────────────────────────────────────────────── */
.fi-logo {
    color: #ffffff !important;
}

/* Sidebar logo — match marketing page sizing */
.fi-sidebar .fi-logo {
    max-height: 1.75rem;
}

.fi-sidebar .fi-logo img,
.fi-sidebar .fi-logo svg,
.fi-sidebar .fi-logo > div {
    max-height: 1.75rem;
}

/* Topbar logo (mobile) — same sizing */
.fi-topbar .fi-logo {
    max-height: 1.75rem;
}

.fi-topbar .fi-logo img,
.fi-topbar .fi-logo svg,
.fi-topbar .fi-logo > div {
    max-height: 1.75rem;
}

/* ──────────────────────────────────────────────────────────
   Body / content area — subtle steel background
   ────────────────────────────────────────────────────────── */
.fi-body {
    background-color: #f4f6f9 !important;
}

/* Force dark text in content area regardless of dark mode */
.fi-main {
    color: #1f2937 !important;
}

.fi-main .fi-header-heading {
    color: #111827 !important;
}

.fi-main .fi-section-header-heading {
    color: #111827 !important;
}

.fi-main .fi-section-header-description {
    color: #6b7280 !important;
}

/* Table text — ensure readable on light background */
.fi-main .fi-ta-text {
    color: #374151 !important;
}

.fi-main .fi-ta-header-cell-label {
    color: #374151 !important;
}

/* Breadcrumb text */
.fi-main .fi-breadcrumbs li {
    color: #6b7280 !important;
}

.fi-main .fi-breadcrumbs a {
    color: #4b5563 !important;
}

/* ──────────────────────────────────────────────────────────
   Content containers — force white backgrounds to match
   marketing pages (override Filament dark mode defaults)
   ────────────────────────────────────────────────────────── */

/* Sections (cards wrapping content) */
.fi-main .fi-section:not(.fi-section-not-contained) {
    background-color: #ffffff !important;
    --tw-ring-color: rgba(0, 0, 0, 0.05) !important;
}

/* Secondary sections (e.g. aside panels) */
.fi-main .fi-section.fi-secondary {
    background-color: #f9fafb !important;
}

/* Aside section content containers */
.fi-main .fi-section.fi-aside .fi-section-content-ctn {
    background-color: #ffffff !important;
}

/* Section headers */
.fi-main .fi-section-header {
    background-color: transparent !important;
}

/* Section footers — light border */
.fi-main .fi-section-footer {
    border-color: #e5e7eb !important;
}

/* Table containers */
.fi-main .fi-ta-ctn {
    background-color: #ffffff !important;
    --tw-ring-color: rgba(0, 0, 0, 0.05) !important;
}

/* Table header toolbar */
.fi-main .fi-ta-header-toolbar {
    border-color: #e5e7eb !important;
}

/* Table content header (column headers row) */
.fi-main .fi-ta-content-header {
    background-color: #f9fafb !important;
}

/* Table rows */
.fi-main .fi-ta-row {
    background-color: #ffffff !important;
}

/* Table striped rows */
.fi-main .fi-ta-row.fi-striped {
    background-color: #f9fafb !important;
}

/* Table row hover */
.fi-main .fi-ta-row:hover {
    background-color: #f3f4f6 !important;
}

/* Table cells */
.fi-main .fi-ta-cell {
    color: #374151 !important;
}

/* Table empty state */
.fi-main .fi-ta-empty-state {
    background-color: #ffffff !important;
}

/* Table filter sidebar */
.fi-main .fi-ta-filters-before-content-ctn {
    background-color: #ffffff !important;
}

/* Table reorder/selection indicators */
.fi-main .fi-ta-reorder-indicator,
.fi-main .fi-ta-selection-indicator,
.fi-main .fi-ta-filter-indicators {
    background-color: #f9fafb !important;
}

/* Table dividers/borders */
.fi-main .fi-ta-ctn [class*="divide-"] {
    --tw-divide-opacity: 1 !important;
    border-color: rgb(229 231 235 / var(--tw-divide-opacity)) !important;
}

/* Stats overview widget cards */
.fi-main .fi-wi-stats-overview-stat {
    background-color: #ffffff !important;
    --tw-ring-color: rgba(0, 0, 0, 0.05) !important;
}

/* Stats overview stat text colours */
.fi-main .fi-wi-stats-overview-stat-label {
    color: #6b7280 !important;
}

.fi-main .fi-wi-stats-overview-stat-value {
    color: #111827 !important;
}

.fi-main .fi-wi-stats-overview-stat-description {
    color: #6b7280 !important;
}

/* Widget containers */
.fi-main .fi-wi {
    --tw-ring-color: rgba(0, 0, 0, 0.05) !important;
}

/* Form field inputs */
.fi-main .fi-input,
.fi-main .fi-fo-field-wrp input,
.fi-main .fi-fo-field-wrp select,
.fi-main .fi-fo-field-wrp textarea {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: #d1d5db !important;
}

/* Form field labels */
.fi-main .fi-fo-field-wrp label {
    color: #374151 !important;
}

/* Infolist entries */
.fi-main .fi-in-entry-wrp {
    color: #374151 !important;
}

/* Infolist entry labels */
.fi-main .fi-in-entry-wrp-label {
    color: #374151 !important;
}

/* Infolist text entry values */
.fi-main .fi-in-text {
    color: #1f2937 !important;
}

/* Infolist text content */
.fi-main .fi-in-text-item {
    color: #1f2937 !important;
}

/* Infolist key-value entries */
.fi-main .fi-in-key-value {
    color: #374151 !important;
}

/* Relation manager containers */
.fi-main .fi-re {
    background-color: #ffffff !important;
    color: #374151 !important;
}

/* Relation manager header */
.fi-main .fi-re-header {
    color: #111827 !important;
}

/* Relation manager heading text */
.fi-main .fi-re-header-heading {
    color: #111827 !important;
}

/* Modal content backgrounds */
.fi-modal .fi-modal-content {
    background-color: #ffffff !important;
}

/* Dropdown menus */
.fi-dropdown-panel {
    background-color: #ffffff !important;
    --tw-ring-color: rgba(0, 0, 0, 0.05) !important;
}

.fi-dropdown-list-item-label {
    color: #374151 !important;
}

/* Tabs */
.fi-main .fi-tabs-tab {
    color: #6b7280 !important;
}

.fi-main .fi-tabs-tab.fi-active {
    color: #111827 !important;
}

/* Action buttons — keep consistent text on light bg */
.fi-main .fi-link {
    color: #2a47c9 !important;
}

/* Badge text colours — keep readable */
.fi-main .fi-badge {
    --tw-ring-color: rgba(0, 0, 0, 0.05) !important;
}

/* Pagination */
.fi-main .fi-pagination {
    color: #374151 !important;
}

/* General ring/border overrides for content area */
.fi-main [class*="ring-white\\/10"],
.fi-main [class*="ring-white/10"] {
    --tw-ring-color: rgba(0, 0, 0, 0.05) !important;
}

.fi-main [class*="border-white\\/10"],
.fi-main [class*="border-white/10"] {
    border-color: #e5e7eb !important;
}

/* Icon colours in content area — ensure visibility on white */
.fi-main .fi-icon {
    color: inherit !important;
}

/* ──────────────────────────────────────────────────────────
   Auth / simple layout pages (login, register, etc.)
   ────────────────────────────────────────────────────────── */
.fi-simple-layout {
    background-color: #060c33 !important;
    /* Ghost chevron mark bleeding off the top-right (as in the nav
       texture) layered over the wave lines. */
    background-image: url('/images/brand/vardeck-mark-ghost.svg'), url('/images/brand/vardeck-hero-wave-alpha.svg');
    background-size: 26rem auto, cover;
    background-position: right -6rem top -7rem, center top;
    background-repeat: no-repeat, no-repeat;
}

.fi-simple-main-ctn {
    background: transparent !important;
}

/* The form becomes a centered card on the textured navy ground. */
.fi-simple-main {
    background: #ffffff !important;
    border-radius: 1rem;
    box-shadow: 0 18px 50px rgba(3, 7, 30, 0.45);
    max-width: 28rem !important;
    width: 100%;
    margin-inline: auto;
}

/* Auth page brand logo — constrain sizing */
.fi-simple-layout .fi-logo {
    max-height: 2.5rem;
}

.fi-simple-layout .fi-logo img,
.fi-simple-layout .fi-logo svg,
.fi-simple-layout .fi-logo > div {
    max-height: 2.5rem;
}

/* Auth page icons — prevent oversized icons in form fields */
.fi-simple-layout .fi-icon {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

/* Auth page icon buttons (e.g., password visibility toggle) */
.fi-simple-layout .fi-icon-btn .fi-icon {
    width: 1rem !important;
    height: 1rem !important;
}

/* ──────────────────────────────────────────────────────────
   Sidebar collapse/expand toggle buttons on navy
   ────────────────────────────────────────────────────────── */
.fi-sidebar .fi-icon-btn {
    color: #d1d5db !important;
}

.fi-sidebar .fi-icon-btn:hover {
    background-color: #0a1628 !important;
}

.fi-topbar .fi-topbar-open-sidebar-btn,
.fi-topbar .fi-topbar-close-sidebar-btn,
.fi-topbar .fi-topbar-open-collapse-sidebar-btn,
.fi-topbar .fi-topbar-close-collapse-sidebar-btn {
    color: #d1d5db !important;
}

/* ──────────────────────────────────────────────────────────
   Mobile table scroll hints — horizontal fade on overflow
   ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .fi-ta-content {
        position: relative;
    }

    /* Right-side scroll fade indicator */
    .fi-ta-content::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
        pointer-events: none;
        z-index: 5;
        opacity: 1;
        transition: opacity 0.2s;
    }

    /* Hide the fade when scrolled to the end */
    .fi-ta-content:has(> table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ══════════════════════════════════════════════════════════════════
   Option A content-area & table treatment (2026-08-05)
   Sidebar/menu untouched. Quiet table headers (light surface, 2px
   brand underline), navy-tinted content ground, softer cards, pill
   pagination footer. Approved from the design preview mockup.
   ══════════════════════════════════════════════════════════════════ */

/* Content ground: cool navy-tinted instead of flat grey. fi-body is
   the page ground; fi-main-ctn can carry its own bg, so both are set. */
body.fi-body,
.fi-main-ctn {
    background-color: #f4f6fb;
}
.dark body.fi-body,
.dark .fi-main-ctn {
    background-color: #0b1020;
}

/* Cards / table containers: slightly larger radius, navy-biased hairline. */
.fi-section,
.fi-ta-ctn,
.fi-wi-widget > .fi-section {
    border-radius: 14px;
    --tw-ring-color: #e3e7f2;
}
.dark .fi-section,
.dark .fi-ta-ctn {
    --tw-ring-color: rgba(227, 231, 242, 0.12);
}

/* Quiet table header: light surface, uppercase micro-labels,
   2px brand underline carrying the accent. */
.fi-ta-header-cell,
.fi-ta-actions-header-cell,
.fi-ta-empty-header-cell,
.fi-ta-selection-cell.fi-ta-header-cell,
.fi-ta-table thead th {
    background-color: #f7f8fc;
    border-bottom: 2px solid #3b5de6;
}
.fi-ta-header-cell,
.fi-ta-header-cell .fi-ta-header-cell-sort-btn {
    font-size: 10.5px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #5a6382;
    font-weight: 600;
}
.dark .fi-ta-header-cell,
.dark .fi-ta-actions-header-cell,
.dark .fi-ta-empty-header-cell,
.dark .fi-ta-table thead th {
    background-color: #111731;
    border-bottom-color: #3b5de6;
}
.dark .fi-ta-header-cell,
.dark .fi-ta-header-cell .fi-ta-header-cell-sort-btn {
    color: #9aa3c0;
}

/* Row hover: soft primary tint instead of neutral grey. */
.fi-ta-row:hover > .fi-ta-cell {
    background-color: #f6f8ff;
}
.dark .fi-ta-row:hover > .fi-ta-cell {
    background-color: rgba(59, 93, 230, 0.10);
}

/* Numbers align as numbers wherever they stack. */
.fi-ta-cell {
    font-variant-numeric: tabular-nums;
}

/* Pagination footer reads as a quiet summary strip. */
.fi-ta-ctn .fi-pagination {
    background-color: #fafbfe;
    border-top: 1px solid #e3e7f2;
    padding-top: 10px;
    padding-bottom: 10px;
}
.dark .fi-ta-ctn .fi-pagination {
    background-color: #0e142b;
    border-top-color: rgba(227, 231, 242, 0.12);
}

/* List-page tab pills (ListRecords tabs): match the mockup. */
.fi-tabs .fi-tabs-item {
    border-radius: 9999px;
}
.fi-tabs .fi-tabs-item.fi-active {
    background-color: #3b5de6;
}
.fi-tabs .fi-tabs-item.fi-active .fi-tabs-item-label,
.fi-tabs .fi-tabs-item.fi-active .fi-badge {
    color: #ffffff;
}
/* The count on the blue (active) tab: white on its pale badge was
   unreadable, so the badge goes see-through white. */
.fi-tabs .fi-tabs-item.fi-active .fi-badge {
    background-color: rgba(255, 255, 255, 0.22);
    --tw-ring-color: rgba(255, 255, 255, 0.35) !important;
}

/* ──────────────────────────────────────────────────────────
   Pinned favourites — sidebar block + page-header pin toggle
   Items reuse fi-sidebar-item classes so the navy overrides
   above apply; these rules add layout + the unpin affordance.
   ────────────────────────────────────────────────────────── */
.vardeck-pinned-nav {
    margin-bottom: 0.5rem;
}

/* Hide when the desktop sidebar is collapsed to icon rail —
   the block is label-driven and has no icon-only mode. */
.fi-sidebar:not(.fi-sidebar-open) .vardeck-pinned-nav {
    display: none;
}

.vardeck-pinned-label {
    padding: 0.5rem 0.75rem 0.25rem;
}

.vardeck-pinned-label .fi-sidebar-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vardeck-pinned-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.vardeck-pinned-item {
    position: relative;
}

.vardeck-pinned-item > .fi-sidebar-item-btn {
    padding-right: 2rem; /* room for the unpin button */
}

.vardeck-pinned-item .vardeck-pin-glyph {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: #6b7280;
}

/* Unpin '×' — invisible until the row is hovered or it receives
   keyboard focus; always in the tab order for accessibility. */
.vardeck-unpin-btn {
    position: absolute;
    top: 50%;
    right: 0.375rem;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.vardeck-pinned-item:hover .vardeck-unpin-btn,
.vardeck-unpin-btn:hover,
.vardeck-unpin-btn:focus-visible {
    opacity: 1;
}

.vardeck-unpin-btn:hover,
.vardeck-unpin-btn:focus-visible {
    color: #ffffff;
    background-color: #0a1628;
}

.vardeck-unpin-btn:focus-visible {
    outline: 2px solid #93aeff;
    outline-offset: 1px;
}

/* Page-header pin toggle — quiet secondary button that matches
   Filament's header action sizing. */
.vardeck-pin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.vardeck-pin-btn:hover {
    color: #374151;
    background-color: #f9fafb;
}

.vardeck-pin-btn:focus-visible {
    outline: 2px solid #3b5de6;
    outline-offset: 1px;
}

.vardeck-pin-btn.vardeck-pin-btn-active {
    color: #2a47c9;
    border-color: #b9c8fb;
    background-color: #eef2ff;
}

.vardeck-pin-btn.vardeck-pin-btn-active:hover {
    background-color: #dce4fd;
}

.vardeck-pin-btn-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Dark mode (App panel currently ships light-only, but stay
   correct if darkMode is ever enabled). */
.dark .vardeck-pin-btn {
    border-color: #374151;
    background-color: #1f2937;
    color: #9ca3af;
}

.dark .vardeck-pin-btn:hover {
    color: #e5e7eb;
    background-color: #111827;
}

.dark .vardeck-pin-btn.vardeck-pin-btn-active {
    color: #93aeff;
    border-color: #1e3399;
    background-color: rgba(59, 93, 230, 0.15);
}

/* ══════════════════════════════════════════════════════════════════
   View pages that fall back to the disabled FORM (no infolist):
   fields should read as CONTENT, not greyed-out controls. Scoped to
   the view-record page so create/edit forms are untouched. Filament
   v5 renders custom selects as .fi-select-input-btn (no native
   <select>), and marks every disabled field wrapper .fi-disabled —
   all rules key off that class, never :disabled attributes.
   ══════════════════════════════════════════════════════════════════ */

.fi-resource-view-record-page .fi-input-wrp.fi-disabled {
    background-color: #f7f8fc;
    --tw-ring-color: transparent;
    box-shadow: none;
    border: 1px solid #eef0f7;
}
.dark .fi-resource-view-record-page .fi-input-wrp.fi-disabled {
    background-color: #101527;
    border-color: rgba(227, 231, 242, 0.08);
}

/* Full-strength text (browsers grey disabled controls). */
.fi-resource-view-record-page .fi-input-wrp.fi-disabled input,
.fi-resource-view-record-page .fi-input-wrp.fi-disabled textarea,
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-btn,
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-value-label {
    color: #0b1230;
    opacity: 1;
    -webkit-text-fill-color: #0b1230;
}
.dark .fi-resource-view-record-page .fi-input-wrp.fi-disabled input,
.dark .fi-resource-view-record-page .fi-input-wrp.fi-disabled textarea,
.dark .fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-btn,
.dark .fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-value-label {
    color: #e5e9f5;
    -webkit-text-fill-color: #e5e9f5;
}

/* Interactive chrome is noise on read-only fields: suffix icons
   (select chevron lives here), suffix actions, any ::after caret,
   and placeholder text in empty fields. */
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-input-wrp-suffix,
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-input-wrp-actions,
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-btn svg {
    display: none !important;
}
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-btn::after {
    content: none;
}
.fi-resource-view-record-page .fi-input-wrp.fi-disabled input::placeholder,
.fi-resource-view-record-page .fi-input-wrp.fi-disabled textarea::placeholder {
    color: transparent;
}
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-placeholder {
    visibility: hidden;
}

.fi-resource-view-record-page .fi-input-wrp.fi-disabled textarea {
    field-sizing: content;
    min-height: 2.4rem;
    resize: none;
}

/* The custom select (select.js) injects its clear-x and chevron at
   runtime. Inside a DISABLED select wrapper every svg is decorative
   (the value is a text span), as is any button other than the value
   button itself — hide them all, plus any injected placeholder span. */
.fi-resource-view-record-page .fi-input-wrp.fi-disabled.fi-fo-select svg,
.fi-resource-view-record-page .fi-input-wrp.fi-disabled.fi-fo-select button:not(.fi-select-input-btn) {
    display: none !important;
}
.fi-resource-view-record-page .fi-input-wrp.fi-disabled [class*='placeholder'] {
    visibility: hidden;
}

/* The chevron is a background-image data-URI on the select button. */
.fi-resource-view-record-page .fi-input-wrp.fi-disabled .fi-select-input-btn {
    background-image: none !important;
}

/* Any placeholder inside a read-only field is noise (the multiselect's
   inline search input carries one outside the ::placeholder rules above). */
.fi-resource-view-record-page .fi-input-wrp.fi-disabled ::placeholder,
.fi-resource-view-record-page .fi-fo-select ::placeholder {
    color: transparent !important;
}

/* ─── Page header: no squashed titles ─────────────────────────────────
   With breadcrumbs present (record sub-pages), the default side-by-side
   header squeezes long titles into a narrow column next to a wide action
   row ("Balance Water Testing — …" wrapped over four lines). Stack it:
   breadcrumbs on one line (ellipsized, never wrapping), the title
   full-width on its own row, actions on a row beneath. */
.fi-header.fi-header-has-breadcrumbs {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.65rem 1.5rem;
}

/* The heading block claims at least ~32rem before actions may share its
   row: short titles keep the actions top-right (no dead corner), long
   titles push them onto their own row instead of being squashed. */
.fi-header-has-breadcrumbs > div:first-child {
    flex: 1 1 auto;
    min-width: min(100%, 32rem);
}

.fi-header-has-breadcrumbs .fi-breadcrumbs-list {
    flex-wrap: nowrap;
    overflow: hidden;
}

.fi-header-has-breadcrumbs .fi-breadcrumbs-item {
    white-space: nowrap;
    min-width: 0;
}

.fi-header-has-breadcrumbs .fi-breadcrumbs-item a,
.fi-header-has-breadcrumbs .fi-breadcrumbs-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 34rem;
    display: inline-block;
    vertical-align: bottom;
}

.fi-header-has-breadcrumbs .fi-header-heading {
    line-height: 1.25;
    text-wrap: balance;
}

/* Actions hug the right edge whether beside the title or wrapped below. */
.fi-header-has-breadcrumbs .fi-header-actions-ctn {
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
}

/* Mobile: tighter page-header rhythm — the stacked header + actions row
   otherwise eats a third of a phone screen before content starts.
   Filament defaults: 2rem page padding-block, 2rem header→content gap,
   1rem title→actions stack gap, 2rem between content sections. */
@media (max-width: 640px) {
    .fi-page-header-main-ctn {
        padding-block: 1rem 1.5rem;
        row-gap: 0.75rem;
    }

    /* Title and actions share a row (short titles keep the action button
       beside them; long ones wrap it below via flex-wrap). */
    .fi-header,
    .fi-header.fi-header-has-breadcrumbs {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem 1rem;
    }

    .fi-header > div:first-child {
        min-width: 0;
    }

    .fi-page-content {
        row-gap: 1rem;
    }

    /* Two or more header buttons, Pin included (an SOP, Lost Property...):
       the default right-aligned wrap left ragged rows with Pin stranded
       on its own. Flow Pin and the actions as one set of buttons that
       fill each row evenly, with Pin moved to the end. */
    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) {
        flex: 1 1 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-left: 0;
        justify-content: stretch;
    }

    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) > .fi-ac {
        display: contents;
    }

    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) > .fi-ac > *,
    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) > .vardeck-pin-toggle {
        flex: 1 1 9rem;
        justify-content: center;
    }

    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) > .vardeck-pin-toggle {
        order: 99;
        display: flex;
    }

    /* Buttons in a row are the same height, and the long two-line ones
       (marked vd-header-lead, e.g. an SOP's Publish and Record paper
       sign-off) go first so they pair up instead of each sitting beside
       a short one-line button. */
    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) {
        align-items: stretch;
    }

    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) > .fi-ac > .vd-header-lead {
        order: -1;
    }

    .fi-header-actions-ctn:is(:has(> .fi-ac > :nth-child(2)), :has(> .fi-ac > *):has(> .vardeck-pin-toggle)) .vardeck-pin-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}


/* Pinned-nav placeholder: when the user has no pins the Livewire root
   still renders — drop it from flow so it doesn't add a phantom flex
   gap above the first nav group (visible on the mobile drawer). */
.vardeck-pinned-empty {
    display: none;
}

/* Mobile drawer: the desktop 2rem nav headroom reads as dead space on
   a phone — tighten it. */
@media (max-width: 1024px) {
    .fi-sidebar-nav {
        padding-top: 0.75rem !important;
        /* Clear the fixed bottom quick-nav (~64px) so the last group
           (Settings) is scrollable into view, not trapped behind it. */
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }

    /* The open mobile drawer must sit ABOVE the fixed bottom nav
       (#vardeck-bottom-nav and #vardeck-frontline-bar are z-index 30) — otherwise the bar overlaps
       the drawer and hides its lowest items. */
    .fi-sidebar,
    .fi-sidebar-close-overlay {
        z-index: 50 !important;
    }
}

/* ──────────────────────────────────────────────────────────
   Admin dashboard stat cards: coloured accent bar + tinted value
   ────────────────────────────────────────────────────────── */
.vd-stat {
    border-inline-start: 4px solid transparent !important;
    border-radius: 0.75rem;
}
.vd-stat-primary { border-inline-start-color: #2E6BFF !important; }
.vd-stat-info    { border-inline-start-color: #7FA6FF !important; }
.vd-stat-success { border-inline-start-color: #16a34a !important; }
.vd-stat-warning { border-inline-start-color: #d97706 !important; }
.vd-stat-danger  { border-inline-start-color: #dc2626 !important; }
.vd-stat .fi-wi-stats-overview-stat-value {
    font-variant-numeric: tabular-nums;
}

/* App dashboard: stat cards inherit an accent bar from their own tone
   (description/chart colour). Explicit .vd-stat-* classes still win via
   !important above. Gray-toned stats keep a transparent bar so card
   edges stay aligned. */
.fi-wi-stats-overview-stat {
    border-inline-start: 4px solid transparent;
    border-radius: 0.75rem;
}
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-value {
    font-variant-numeric: tabular-nums;
}
.fi-wi-stats-overview-stat:has(.fi-color-primary) { border-inline-start-color: #2E6BFF; }
.fi-wi-stats-overview-stat:has(.fi-color-info)    { border-inline-start-color: #7FA6FF; }
.fi-wi-stats-overview-stat:has(.fi-color-success) { border-inline-start-color: #16a34a; }
.fi-wi-stats-overview-stat:has(.fi-color-warning) { border-inline-start-color: #d97706; }
.fi-wi-stats-overview-stat:has(.fi-color-danger)  { border-inline-start-color: #dc2626; }

/* Slow phone connections: the decorative wave texture (33 KB SVG) is
   skipped below 768px — the flat navy looks the same at that size
   (QA 2026-10-29, Slow 3G). */
@media (max-width: 767px) {
    .fi-topbar,
    .fi-simple-layout {
        background-image: none !important;
    }
}

/* Table top bar on phones: the search box and the filter / column buttons
   sat on one line that couldn't wrap or shrink, so with larger phone text
   it ran ~18px past the screen and the whole page slid sideways. Let the
   search box shrink and the buttons wrap under it. */
.fi-ta-header-toolbar > * {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}
.fi-ta-header-toolbar .fi-ta-search-field {
    min-width: 0;
    flex: 1 1 10rem;
}
/* The filter button's count bubble hangs ~18px off the button's corner;
   leave room for it at the end of the bar. */
.fi-ta-header-toolbar > :last-child {
    padding-inline-end: 0.5rem;
}

/* Phones: nothing may slide the page sideways. Wide tables and tab bars
   already scroll inside their own box; anything else that pokes out
   (a badge, a long word) is clipped rather than widening the page.
   clip, not hidden, so sticky headers keep working. */
@media (max-width: 767px) {
    .fi-main-ctn {
        overflow-x: clip;
    }

    /* And the page itself: on the root only (it applies to the window),
       so body stays a normal box and the sticky top bar keeps working.
       Stops a phone browser laying the page out wider than the screen. */
    html {
        overflow-x: hidden;
    }

    /* Header buttons may shrink to the row, never push it wider. */
    .fi-header-actions-ctn,
    .fi-header-actions-ctn .fi-ac > *,
    .fi-header-actions-ctn > .vardeck-pin-toggle {
        min-width: 0;
        max-width: 100%;
    }
}

/* A table with no bulk or header actions still renders an empty actions
   box that takes a 36px row above the search on phones (Lost Property).
   Hide it when it holds nothing. */
.fi-ta-header-toolbar > .fi-ta-actions:not(:has(*)) { display: none; }
/* Also when all it holds is the bulk-actions menu, hidden until a row is
   ticked (Tasks): it comes back as soon as one is. */
.fi-ta-header-toolbar > .fi-ta-actions:not(:has(> :not([style*="display: none"]))) { display: none; }

/* Screen-reader-only text is absolutely positioned at the spot it would
   have had in the flow. Inside a wide table that scrolls in its own box
   (with no positioned parent inside that box) it sat far to the right and
   widened the whole page on phones (Qualification Matrix: 4,700px, so the
   browser laid the page out at 1,640px). Pin it to the left edge; it is
   invisible either way, and a focused skip link is not pinned. */
.sr-only:not(:focus):not(:focus-within) { left: 0; }

/* Tasks on a phone: each row is one card (task-card view) that opens the
   task. Tick boxes, the column headings and the row menu go: bulk select
   and the row actions stay on wider screens, and the task's own page has
   every action. */
@media (max-width: 767px) {
    .vd-task-table .fi-ta-selection-cell,
    .vd-task-table .fi-ta-group-selection-cell,
    .vd-task-table thead,
    .vd-task-table .fi-ta-row > td:has(> .fi-ta-actions),
    .vd-task-table .fi-ta-row > td:has(.fi-ta-actions) { display: none; }
    /* One full-width cell, so long titles wrap instead of running off. */
    .vd-task-table .fi-ta-table { table-layout: fixed; width: 100%; }
    .vd-task-table .fi-ta-row > td { width: 100%; }
    .vd-task-table .fi-ta-row > td:not(:has(.vd-task-card)) { display: none; }
}

/* Phones: the search + filter group is pushed to the right (auto margin),
   leaving a gap before a part-width search box (Contaminations). Let it
   fill the bar so the search box runs edge to edge. */
@media (max-width: 767px) {
    .fi-ta-header-toolbar > :last-child:has(.fi-ta-search-field) {
        flex: 1 1 auto;
        margin-inline-start: 0;
    }
}
