/*
 * LW Admin Panel visual system.
 * Aligned to the LoganWeb brand (www.loganweb.co.uk): navy navigation, cool
 * workspace, crisp white surfaces, LoganWeb blue (#0049AD) actions, an
 * orange (#FF8800) accent for emphasis, and restrained depth.
 */
:root {
    --lw-navy-950: #0a1526;
    --lw-navy-900: #0f2038;
    --lw-navy-800: #163156;
    --lw-ink: #1e232b;
    --lw-muted: #5c6672;
    --lw-line: #dde3ec;
    --lw-canvas: #f5f7fa;
    --lw-blue: #0049ad;
    --lw-blue-soft: #e8effb;
    --lw-accent: #ff8800;
    --lw-surface-shadow: 0 7px 20px -16px rgb(10 21 38 / 0.34);
}

.fi-body {
    background-color: #0523a4;
    background-image: linear-gradient(152deg, #0523a4 0%, #3886f4 51%, #3b6dff 100%) !important;
    background-attachment: fixed;
    color: #fff;
}

.fi-topbar {
    min-height: 4.25rem;
    border-bottom: 1px solid var(--lw-line);
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 2px 12px rgb(15 31 48 / 0.05);
    backdrop-filter: blur(12px);
}

.lw-tenant-context {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.lw-tenant-context-current,
.lw-tenant-context-back {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    border-radius: 0.55rem;
    padding: 0.4rem 0.65rem;
    white-space: nowrap;
}

.lw-tenant-context-current {
    gap: 0.4rem;
    border: 1px solid #cddbf0;
    background: #edf4ff;
    color: #17345d;
    font-size: 0.78rem;
}

.lw-tenant-context-current .fi-icon,
.lw-tenant-context-back .fi-icon {
    width: 1rem;
    height: 1rem;
}

.lw-tenant-context-current .fi-icon {
    color: var(--lw-blue);
}

.lw-tenant-context-label {
    color: #617087;
}

.lw-tenant-context-current strong {
    max-width: 15rem;
    overflow: hidden;
    color: #17243a;
    text-overflow: ellipsis;
}

.lw-tenant-context-back {
    gap: 0.35rem;
    background: var(--lw-blue);
    color: #fff !important;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 120ms ease;
}

.lw-tenant-context-back:hover,
.lw-tenant-context-back:focus-visible {
    background: #003b8d;
}

.lw-tenant-context-back:focus-visible {
    outline: 3px solid rgb(0 73 173 / 0.24);
    outline-offset: 2px;
}

@media (max-width: 800px) {
    .lw-tenant-context-label {
        display: none;
    }

    .lw-tenant-context-current strong {
        max-width: 9rem;
    }
}

@media (max-width: 560px) {
    .lw-tenant-context {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .lw-tenant-context-back span {
        display: none;
    }

    .lw-tenant-context-current strong {
        max-width: 10rem;
    }
}

.fi-sidebar {
    border-inline-end: 1px solid rgb(255 255 255 / 0.14);
    background: linear-gradient(180deg, rgb(7 27 55 / 0.92), rgb(10 38 75 / 0.86)) !important;
    box-shadow: 0.6rem 0 2rem rgb(2 20 52 / 0.16);
    backdrop-filter: blur(14px);
}

/* Filament's desktop sidebar lives inside a layout container that starts below
   the 4rem topbar, so changing `top` cannot fill the area above it. Paint a
   matching extension upward instead, without moving the tenant menu or nav. */
.lw-sidebar-brand {
    display: none;
}

@media (min-width: 64rem) {
    .fi-body-has-topbar .fi-sidebar::before {
        position: absolute;
        inset-inline: 0;
        bottom: 100%;
        height: 4rem;
        border-inline-end: 1px solid rgb(255 255 255 / 0.14);
        background: rgb(7 27 55 / 0.92);
        content: '';
        pointer-events: none;
    }

    .lw-sidebar-brand {
        position: absolute;
        z-index: 1;
        inset-inline: 0;
        bottom: 100%;
        display: flex;
        height: 4rem;
        align-items: center;
        padding-inline: 1rem;
    }

    .lw-sidebar-brand-logo {
        display: block;
        width: auto;
        height: 3.25rem;
        max-width: 7rem;
        border: 1px solid rgb(255 255 255 / 0.22);
        border-radius: 0.55rem;
        background: rgb(255 255 255 / 0.96);
        object-fit: contain;
        padding: 0.3rem;
    }
}

.fi-sidebar-header-ctn,
.fi-sidebar-header {
    display: none;
    background: transparent !important;
}

.fi-sidebar-nav {
    padding: 1.5rem 1rem;
}

.fi-sidebar-nav-groups {
    gap: 1.5rem;
}

.fi-sidebar-group-label,
.fi-sidebar-group-collapse-btn,
.fi-sidebar-group-dropdown-trigger-btn {
    color: #cbd9e8 !important;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.fi-sidebar-item-btn {
    min-height: 2.65rem;
    border-radius: 0.6rem;
    padding-inline: 0.8rem;
}

.fi-sidebar-item-label {
    color: #f4f8fc !important;
    font-weight: 650;
    text-shadow: 0 1px 1px rgb(0 0 0 / 0.2);
}

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

.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: rgb(255 255 255 / 0.13) !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: linear-gradient(90deg, #075cbf, #1e78df) !important;
    box-shadow:
        inset 3px 0 0 var(--lw-accent),
        0 7px 16px -10px rgb(0 0 0 / 0.85);
}

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

.fi-sidebar-footer {
    border-top: 1px solid rgb(255 255 255 / 0.08);
    padding-top: 0.75rem;
}

.fi-main {
    max-width: none;
    padding-inline: clamp(1rem, 2.3vw, 2.5rem);
}

.fi-page {
    padding-block: 1.5rem 2.5rem;
}

.fi-header-heading {
    color: #fff;
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.fi-breadcrumbs-item-label,
.fi-header-subheading {
    color: rgb(255 255 255 / 0.82);
}

/* Page-level copy sits directly on the brand gradient. Components with their
   own white surface keep the normal dark ink rules below for readability. */
.fi-page > p,
.fi-page > .fi-header p,
.fi-page > .fi-header a,
.fi-tabs-item:not(.fi-active) {
    color: #fff;
}

.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border: 1px solid var(--lw-line);
    border-radius: 0.8rem;
    background: #fff;
    box-shadow: var(--lw-surface-shadow);
}

.fi-section-header {
    border-bottom: 1px solid #e8edf3;
}

.fi-section-header-heading,
.fi-ta-header-heading {
    color: var(--lw-ink);
    font-weight: 650;
}

.fi-wi-stats-overview-stat {
    overflow: hidden;
    padding: 1.35rem;
}

.fi-wi-stats-overview-stat-label {
    color: var(--lw-muted);
    font-weight: 600;
}

.fi-wi-stats-overview-stat-value {
    color: var(--lw-ink);
    font-size: 2rem;
    letter-spacing: -0.035em;
}

.fi-ta-header-ctn,
.fi-ta-header-toolbar {
    background: #fff;
}

.fi-ta-table thead {
    background: #f8fafc;
}

.fi-ta-header-cell {
    border-block: 1px solid #e5ebf2;
}

.fi-ta-row {
    transition: background-color 130ms ease;
}

.fi-ta-row:hover {
    background: #f7fbff;
}

/* Clearer form fields: a visible resting border, a stronger focus ring in
   LoganWeb blue, and bolder, higher-contrast labels so fields read as
   distinct, actionable inputs rather than blending into the page. */
.fi-input-wrp {
    border-width: 1.5px;
    border-color: #c3cedb;
    border-radius: 0.55rem;
    background: #fff;
    box-shadow: 0 1px 2px rgb(15 31 48 / 0.04);
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.fi-input-wrp:hover {
    border-color: #9fb1c6;
}

.fi-input-wrp:focus-within {
    border-color: var(--lw-blue) !important;
    box-shadow: 0 0 0 3px rgb(0 73 173 / 0.15);
}

.fi-fo-field-label {
    color: var(--lw-ink);
    font-weight: 600;
}

/* The page canvas uses white foreground text, but light form controls must not
   inherit it. Cover both native controls and Filament's searchable select UI,
   including its typed search value and teleported dropdown options. */
:root:not(.dark) :is(input.fi-input, textarea.fi-textarea-input, select.fi-select-input),
:root:not(.dark) .fi-select-input-btn,
:root:not(.dark) .fi-select-input-value-label {
    color: var(--lw-ink) !important;
    -webkit-text-fill-color: var(--lw-ink);
}

:root:not(.dark) :is(input.fi-input, textarea.fi-textarea-input)::placeholder,
:root:not(.dark) .fi-select-input-placeholder {
    color: #718096 !important;
    -webkit-text-fill-color: #718096;
    opacity: 1;
}

:root:not(.dark) .fi-select-input .fi-dropdown-panel,
:root:not(.dark) .fi-select-input-search-ctn,
:root:not(.dark) .fi-select-input-options-ctn {
    background: #fff !important;
    color: var(--lw-ink) !important;
}

:root:not(.dark) .fi-select-input-option,
:root:not(.dark) select.fi-select-input option,
:root:not(.dark) select.fi-select-input optgroup {
    background: #fff !important;
    color: var(--lw-ink) !important;
}

/* Website create/edit forms live on the blue canvas but are light-surface
   components. Keep every nested piece inside that visual boundary instead of
   inheriting the page's white foreground colour. */
.fi-resource-websites.fi-resource-edit-record-page .fi-section,
.fi-resource-websites.fi-resource-create-record-page .fi-section {
    overflow: hidden;
    border-color: #d7e1ec;
    background: #fff;
    color: var(--lw-ink);
    box-shadow:
        0 18px 42px -30px rgb(5 35 164 / 0.52),
        0 2px 8px rgb(15 31 48 / 0.05);
}

.fi-resource-websites.fi-resource-edit-record-page .fi-section-header,
.fi-resource-websites.fi-resource-create-record-page .fi-section-header {
    border-bottom: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
}

.fi-resource-websites.fi-resource-edit-record-page .fi-section-header-heading,
.fi-resource-websites.fi-resource-create-record-page .fi-section-header-heading {
    color: #17243a;
}

.fi-resource-websites.fi-resource-edit-record-page .fi-section-header-description,
.fi-resource-websites.fi-resource-create-record-page .fi-section-header-description,
.fi-resource-websites.fi-resource-edit-record-page .fi-fo-field-wrp-hint,
.fi-resource-websites.fi-resource-create-record-page .fi-fo-field-wrp-hint,
.fi-resource-websites.fi-resource-edit-record-page .fi-fo-field-wrp-helper-text,
.fi-resource-websites.fi-resource-create-record-page .fi-fo-field-wrp-helper-text {
    color: var(--lw-muted) !important;
}

.fi-resource-websites.fi-resource-edit-record-page .fi-section-header > .fi-icon,
.fi-resource-websites.fi-resource-create-record-page .fi-section-header > .fi-icon {
    color: var(--lw-blue) !important;
}

.fi-resource-websites.fi-resource-edit-record-page .fi-section-content,
.fi-resource-websites.fi-resource-create-record-page .fi-section-content {
    background: #fff;
    color: var(--lw-ink);
}

.fi-resource-websites.fi-resource-edit-record-page :is(.fi-input, .fi-select-input, .fi-textarea-input),
.fi-resource-websites.fi-resource-create-record-page :is(.fi-input, .fi-select-input, .fi-textarea-input) {
    color: var(--lw-ink);
}

.fi-resource-websites.fi-resource-edit-record-page .fi-input-wrp.fi-disabled,
.fi-resource-websites.fi-resource-create-record-page .fi-input-wrp.fi-disabled {
    border-color: #dbe3ec;
    background: #f1f4f8;
    opacity: 0.82;
}

.fi-resource-websites.fi-resource-edit-record-page .fi-fo-checkbox-list-option,
.fi-resource-websites.fi-resource-create-record-page .fi-fo-checkbox-list-option {
    min-height: 3.1rem;
    border: 1px solid #e1e8f0;
    border-radius: 0.55rem;
    background: #f8fafc;
    color: var(--lw-ink);
    padding: 0.7rem 0.8rem;
    transition:
        border-color 120ms ease,
        background-color 120ms ease;
}

.fi-resource-websites.fi-resource-edit-record-page .fi-fo-checkbox-list-option:hover,
.fi-resource-websites.fi-resource-create-record-page .fi-fo-checkbox-list-option:hover {
    border-color: #9fbbe2;
    background: #f0f6ff;
}

.fi-resource-websites.fi-resource-edit-record-page .fi-fo-checkbox-list-option-label,
.fi-resource-websites.fi-resource-create-record-page .fi-fo-checkbox-list-option-label {
    color: #243247;
    font-weight: 600;
}

.fi-resource-websites.fi-resource-edit-record-page .fi-sc-actions,
.fi-resource-websites.fi-resource-create-record-page .fi-sc-actions {
    width: fit-content;
    border: 1px solid rgb(255 255 255 / 0.68);
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.94);
    box-shadow: var(--lw-surface-shadow);
    padding: 0.55rem;
}

/* Website operational navigation is a control surface, not text directly on
   the blue canvas. Keep long module labels usable without a vertical bar. */
.fi-resource-websites .fi-page-sub-navigation-tabs {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgb(255 255 255 / 0.72);
    border-radius: 0.8rem;
    background: rgb(255 255 255 / 0.96);
    box-shadow: var(--lw-surface-shadow);
    padding: 0.3rem;
    scrollbar-width: thin;
}

/* Client organisation forms are light administrative workspaces on the
   gradient canvas. Keep them legible regardless of saved dark-mode state. */
.fi-resource-tenants:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-section {
    overflow: hidden;
    border-color: #d7e1ec !important;
    background: #fff !important;
    color: var(--lw-ink) !important;
}

.fi-resource-tenants:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-section-header {
    border-bottom: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%) !important;
}

.fi-resource-tenants:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) :is(.fi-section-header-heading, .fi-fo-field-label, .fi-fo-checkbox-list-option-label) {
    color: #17243a !important;
}

.fi-resource-tenants:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) :is(.fi-section-header-description, .fi-fo-field-wrp-helper-text, .fi-fo-checkbox-list-option-description) {
    color: var(--lw-muted) !important;
}

.fi-resource-tenants:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) :is(.fi-input, .fi-select-input, .fi-textarea-input) {
    color: var(--lw-ink) !important;
}

.fi-resource-tenants:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-fo-checkbox-list-option {
    border: 1px solid #e1e8f0;
    border-radius: 0.55rem;
    background: #f8fafc;
    padding: 0.7rem 0.8rem;
}

/* Member create/edit is a focused administrative workflow. Separate identity,
   access, security and status into calm white cards on the brand canvas. */
.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-sc-form {
    margin-inline: auto;
    width: 100%;
    max-width: 74rem;
}

.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-section {
    overflow: hidden;
    border-color: #d7e1ec !important;
    background: #fff !important;
    color: var(--lw-ink) !important;
    box-shadow:
        0 18px 42px -30px rgb(5 35 164 / 0.52),
        0 2px 8px rgb(15 31 48 / 0.05);
}

.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-section-header {
    border-bottom: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%) !important;
}

.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-section-header > .fi-icon {
    color: var(--lw-blue) !important;
}

.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) :is(.fi-section-header-heading, .fi-fo-field-label-content) {
    color: #17243a !important;
}

.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) :is(.fi-section-header-description, .fi-fo-field-wrp-helper-text) {
    color: var(--lw-muted) !important;
}

.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) :is(.fi-input, .fi-select-input) {
    color: var(--lw-ink) !important;
}

.fi-resource-users:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-sc-actions {
    width: fit-content;
    border: 1px solid rgb(255 255 255 / 0.68);
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.94);
    box-shadow: var(--lw-surface-shadow);
    padding: 0.55rem;
}

/* Service Catalogue authoring uses the same card language as member setup,
   with guaranteed hooks because the resource slug contains nested segments. */
.lw-catalogue-section {
    overflow: hidden;
    border-color: #d7e1ec !important;
    background: #fff !important;
    color: var(--lw-ink) !important;
    box-shadow:
        0 18px 42px -30px rgb(5 35 164 / 0.52),
        0 2px 8px rgb(15 31 48 / 0.05);
}

.lw-catalogue-section .fi-section-header {
    border-bottom: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%) !important;
}

.lw-catalogue-section .fi-section-header > .fi-icon {
    color: var(--lw-blue) !important;
}

.lw-catalogue-section :is(.fi-section-header-heading, .fi-fo-field-label-content) {
    color: #17243a !important;
}

.lw-catalogue-section :is(.fi-section-header-description, .fi-fo-field-wrp-helper-text) {
    color: var(--lw-muted) !important;
}

.lw-catalogue-section :is(.fi-input, .fi-select-input, .fi-textarea-input) {
    color: var(--lw-ink) !important;
}

.fi-resource-service-catalogue-service-catalogues:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-sc-form {
    margin-inline: auto;
    width: 100%;
    max-width: 74rem;
}

.fi-resource-service-catalogue-service-catalogues:is(.fi-resource-edit-record-page, .fi-resource-create-record-page) .fi-sc-actions {
    width: fit-content;
    border: 1px solid rgb(255 255 255 / 0.68);
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.94);
    box-shadow: var(--lw-surface-shadow);
    padding: 0.55rem;
}

.fi-resource-websites .fi-page-sub-navigation-tabs .fi-tabs-item {
    flex: 0 0 auto;
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
}

.fi-resource-websites .fi-page-sub-navigation-tabs .fi-tabs-item:not(.fi-active),
.fi-resource-websites .fi-page-sub-navigation-tabs .fi-tabs-item:not(.fi-active) .fi-tabs-item-label,
.fi-resource-websites .fi-page-sub-navigation-tabs .fi-tabs-item:not(.fi-active) .fi-icon {
    color: var(--lw-muted) !important;
}

.fi-resource-websites .fi-page-sub-navigation-tabs .fi-tabs-item.fi-active::after {
    display: none;
}

/* Global Master Dashboard */
.lw-master-dashboard {
    display: grid;
    gap: 1.1rem;
    color: var(--lw-ink);
}

.lw-master-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.lw-master-stat {
    position: relative;
    overflow: hidden;
    min-height: 7.4rem;
}

.lw-master-stat .fi-section-content {
    display: flex;
    min-height: 7.4rem;
    flex-direction: column;
    justify-content: center;
    padding: 1.15rem 1.35rem 1.15rem 1.55rem;
}

.lw-master-stat::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.28rem;
    background: linear-gradient(180deg, var(--lw-blue), #3886f4);
    content: "";
}

.lw-master-stat-label {
    color: var(--lw-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.lw-master-stat-value {
    margin-top: 0.2rem;
    color: #17243a;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.lw-master-clients {
    overflow: hidden;
}

.lw-master-clients .fi-section-header {
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%);
}

.lw-master-clients .fi-section-header-description {
    color: var(--lw-muted) !important;
}

.lw-master-clients-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e4eaf2;
    padding-bottom: 1rem;
}

.lw-master-client-search {
    width: min(100%, 24rem);
}

.lw-master-client-search label {
    display: block;
    margin-bottom: 0.35rem;
    color: #344256 !important;
    font-size: 0.75rem;
    font-weight: 700;
}

.lw-master-client-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.lw-master-client-toolbar-actions p {
    color: var(--lw-muted) !important;
    font-size: 0.82rem;
}

.lw-client-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.lw-client-card {
    display: block;
    border: 1px solid #dfe6ef;
    border-radius: 0.75rem;
    background: #fbfcfe;
    color: var(--lw-ink) !important;
    color-scheme: light;
    min-width: 0;
    padding: 0.85rem;
    text-decoration: none;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease,
        transform 140ms ease;
}

.lw-client-card:hover,
.lw-client-card:focus-visible {
    border-color: #8eb4e7;
    background: #f5f9ff;
    box-shadow: 0 10px 22px -17px rgb(0 73 173 / 0.7);
    transform: translateY(-1px);
}

.lw-client-card:focus-visible {
    outline: 3px solid rgb(0 73 173 / 0.22);
    outline-offset: 2px;
}

.lw-client-card-row,
.lw-client-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lw-client-card-row {
    justify-content: space-between;
    gap: 0.65rem;
}

.lw-client-identity {
    min-width: 0;
}

.lw-client-logo-ctn {
    display: grid;
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dce5ef;
    border-radius: 0.65rem;
    background-color: #e8edf3;
    background-image:
        linear-gradient(45deg, rgb(255 255 255 / 0.72) 25%, transparent 25%),
        linear-gradient(-45deg, rgb(255 255 255 / 0.72) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgb(255 255 255 / 0.72) 75%),
        linear-gradient(-45deg, transparent 75%, rgb(255 255 255 / 0.72) 75%);
    background-position: 0 0, 0 0, 6px -6px, -6px 6px;
    background-size: 12px 12px;
    color: var(--lw-blue) !important;
    -webkit-text-fill-color: var(--lw-blue);
    font-weight: 700;
}

.lw-client-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.25rem;
    filter: drop-shadow(0 1px 1px rgb(15 31 48 / 0.55));
}

/* The supplied Lawbox asset has a wide transparent canvas with its visible
   mark anchored at the far left. Preserve its natural ratio at full card
   height and clip only the empty canvas so the mark remains legible. */
.lw-client-logo[data-client-logo="lawbox"] {
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    left: 0.25rem;
    width: auto !important;
    max-width: none !important;
    height: calc(100% - 0.5rem) !important;
    max-height: none !important;
    object-position: left center;
    padding: 0;
}

.lw-client-logo-ctn:has(.lw-client-logo[data-client-logo="lawbox"]) {
    position: relative;
    display: block;
}

.lw-client-name {
    overflow: hidden;
    color: #17243a !important;
    -webkit-text-fill-color: #17243a;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lw-client-meta {
    margin-top: 0.15rem;
    color: var(--lw-muted) !important;
    -webkit-text-fill-color: var(--lw-muted);
    font-size: 0.78rem;
}

.lw-master-empty {
    grid-column: 1 / -1;
    border: 1px dashed #cbd6e3;
    border-radius: 0.65rem;
    background: #f8fafc;
    color: var(--lw-muted) !important;
    padding: 1rem;
    text-align: center;
}

/* The Global Master dashboard uses custom statistic and client-grid markup,
   so it needs explicit dark-mode foregrounds in addition to Filament's base
   section theme. */
.dark .lw-master-stat-label {
    color: #aebdd0;
}

.dark .lw-master-stat-value {
    color: #f8fafc;
}

.dark .lw-master-clients .fi-section-header,
.dark .lw-master-clients .fi-section-content {
    border-color: rgb(255 255 255 / 0.1);
    background: #111b2a;
    color: #f1f5f9;
}

.dark .lw-master-clients .fi-section-header-heading {
    color: #f8fafc;
}

.dark .lw-master-clients .fi-section-header-description,
.dark .lw-master-client-toolbar-actions p {
    color: #b8c7da !important;
}

.dark .lw-master-client-search label {
    color: #d8e2ef !important;
}

.dark .lw-master-clients-toolbar {
    border-color: rgb(255 255 255 / 0.1);
}

@media (max-width: 1100px) {
    .lw-client-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .lw-master-stats,
    .lw-client-grid {
        grid-template-columns: 1fr;
    }

    .lw-master-clients-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .lw-master-client-search,
    .lw-master-client-toolbar-actions,
    .lw-master-client-toolbar-actions .fi-btn {
        width: 100%;
    }

    .lw-master-client-toolbar-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    /* Mobile Safari can retain the page canvas foreground on linked grid
       cards. Pin both CSS color channels on the actual landing-page copy. */
    .lw-client-card,
    .lw-client-card:link,
    .lw-client-card:visited,
    .lw-client-card:hover,
    .lw-client-card:active {
        background-color: #fbfcfe !important;
        color: var(--lw-ink) !important;
    }

    .lw-client-card :is(.lw-client-name, .lw-client-meta) {
        opacity: 1;
    }
}

/* Proposal review workspace */
.lw-proposal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
    align-items: start;
    gap: 1.15rem;
    color: var(--lw-ink);
}

.lw-proposal-main,
.lw-proposal-sidebar {
    display: grid;
    min-width: 0;
    gap: 1rem;
}

.lw-proposal-layout .fi-section {
    overflow: hidden;
    background: #fff;
    color: var(--lw-ink) !important;
}

.lw-proposal-layout .fi-section-header {
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%);
}

.lw-proposal-layout .fi-section-header-heading {
    color: #17243a !important;
}

.lw-proposal-layout .fi-section-header-description,
.lw-proposal-layout .text-gray-500,
.lw-proposal-layout .text-gray-600,
.lw-proposal-layout .text-gray-700,
.lw-proposal-layout .text-gray-400 {
    color: var(--lw-muted) !important;
}

.lw-proposal-hero {
    border-top: 0.28rem solid var(--lw-blue) !important;
}

.lw-proposal-hero-row,
.lw-proposal-identity {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.lw-proposal-hero-row {
    justify-content: space-between;
}

.lw-proposal-identity {
    min-width: 0;
}

.lw-proposal-hero-aside {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.7rem;
}

.lw-proposal-client-logo-ctn {
    display: grid;
    flex: 0 0 4rem;
    width: 4rem;
    height: 4rem;
    place-items: center;
    border: 1px solid #dfe7f0;
    border-radius: 0.55rem;
    background-color: #e8edf3;
    background-image:
        linear-gradient(45deg, rgb(255 255 255 / 0.72) 25%, transparent 25%),
        linear-gradient(-45deg, rgb(255 255 255 / 0.72) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgb(255 255 255 / 0.72) 75%),
        linear-gradient(-45deg, transparent 75%, rgb(255 255 255 / 0.72) 75%);
    background-position: 0 0, 0 0, 6px -6px, -6px 6px;
    background-size: 12px 12px;
    padding: 0.45rem;
}

.lw-proposal-client-logo {
    display: block;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: scale-down !important;
    filter: drop-shadow(0 1px 1px rgb(15 31 48 / 0.55));
}

/* Uploaded client logos also appear in Filament avatar components outside
   our bespoke cards. A faint outline keeps transparent white artwork visible
   there without recolouring the source asset. */
img[src*="/storage/tenant-logos/"] {
    background-color: #e8edf3;
    filter: drop-shadow(0 1px 1px rgb(15 31 48 / 0.5));
}

.lw-tenant-table-logo {
    border: 1px solid #d7e1ec;
    border-radius: 0.55rem;
    background-color: #e8edf3;
    object-fit: contain;
    padding: 0.25rem;
}

/* Crop only Lawbox's empty right-hand canvas inside the table image frame. */
.lw-tenant-table-logo[data-client-logo="lawbox"] {
    object-fit: cover;
    object-position: left center;
    padding: 0;
}

.lw-proposal-title {
    min-width: 0;
}

.lw-proposal-title p {
    color: var(--lw-muted) !important;
    font-size: 0.8rem;
}

.lw-proposal-title h2 {
    margin-block: 0.2rem 0.35rem;
    color: #17243a !important;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.lw-proposal-content-section .fi-section-content {
    color: #334155 !important;
    line-height: 1.7;
}

.lw-proposal-content-section :is(div, li) {
    color: #334155 !important;
}

.lw-proposal-investment .fi-section-header-description {
    color: var(--lw-muted) !important;
}

.lw-proposal-table-ctn {
    overflow-x: auto;
    border: 1px solid #e1e8f0;
    border-radius: 0.65rem;
}

.lw-proposal-table {
    width: 100%;
    border-collapse: collapse;
    color: #253248 !important;
    font-size: 0.85rem;
}

.lw-proposal-table td {
    border-bottom: 1px solid #e6ecf3 !important;
    padding: 0.8rem;
}

.lw-proposal-table tr:nth-child(even) {
    background: #fbfcfe;
}

.lw-proposal-table tr:last-child {
    background: #edf4ff;
}

.lw-proposal-table tr:last-child td {
    border-bottom: 0 !important;
    color: #17345d !important;
}

.lw-proposal-details dl {
    display: grid;
    gap: 0;
}

.lw-proposal-details dl > div {
    border-bottom: 1px solid #e6ecf3;
    padding-block: 0.7rem;
}

.lw-proposal-details dl > div:first-child {
    padding-top: 0;
}

.lw-proposal-details dl > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.lw-proposal-details dt {
    color: var(--lw-muted) !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.lw-proposal-details dd {
    margin-top: 0.2rem;
    color: #253248 !important;
    font-size: 0.85rem;
    font-weight: 600;
}

.lw-proposal-notes .fi-section-content {
    border-inline-start: 0.22rem solid var(--lw-accent);
    color: #334155 !important;
}

.lw-proposal-history article {
    border-bottom: 1px solid #e6ecf3;
    padding-block: 0.7rem;
}

.lw-proposal-history article:first-child {
    padding-top: 0;
}

.lw-proposal-history article:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.lw-proposal-history strong,
.lw-proposal-history p,
.lw-proposal-history time {
    display: block;
}

.lw-proposal-history strong {
    color: #253248 !important;
    font-size: 0.82rem;
}

.lw-proposal-history p,
.lw-proposal-history time {
    color: var(--lw-muted) !important;
    font-size: 0.75rem;
}

.lw-proposal-history time {
    margin-top: 0.15rem;
    font-size: 0.68rem;
}

.dark .lw-proposal-layout :is(.fi-section, .fi-section-header, .fi-section-content) {
    color-scheme: light;
    color: var(--lw-ink) !important;
}

@media (max-width: 1024px) {
    .lw-proposal-layout {
        grid-template-columns: 1fr;
    }

    .lw-proposal-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .lw-proposal-sidebar {
        grid-template-columns: 1fr;
    }

    .lw-proposal-hero-row {
        flex-direction: column;
    }

    .lw-proposal-hero-aside {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid #e4eaf2;
        padding-top: 0.8rem;
    }
}

/* Lead create/edit forms */
.fi-resource-leads.fi-resource-edit-record-page .fi-sc-form,
.fi-resource-leads.fi-resource-create-record-page .fi-sc-form {
    width: 100%;
    max-width: 78rem;
    margin-inline: auto;
}

.fi-resource-leads.fi-resource-edit-record-page .fi-section,
.fi-resource-leads.fi-resource-create-record-page .fi-section {
    overflow: hidden;
    border: 1px solid #d7e1ec;
    border-radius: 0.85rem;
    background: #fff;
    color: var(--lw-ink);
    box-shadow: 0 16px 38px -30px rgb(5 35 164 / 0.7), 0 2px 7px rgb(15 31 48 / 0.05);
}

.fi-resource-leads.fi-resource-edit-record-page .fi-section-header,
.fi-resource-leads.fi-resource-create-record-page .fi-section-header {
    border-bottom: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
}

.fi-resource-leads.fi-resource-edit-record-page :is(.fi-section-header-heading, .fi-fo-field-label-content),
.fi-resource-leads.fi-resource-create-record-page :is(.fi-section-header-heading, .fi-fo-field-label-content) {
    color: #17243a !important;
}

.fi-resource-leads.fi-resource-edit-record-page :is(.fi-section-header-description, .fi-fo-field-wrp-helper-text),
.fi-resource-leads.fi-resource-create-record-page :is(.fi-section-header-description, .fi-fo-field-wrp-helper-text) {
    color: var(--lw-muted) !important;
}

/* Shared operational dashboards */
.lw-ops-page {
    display: grid;
    width: 100%;
    max-width: 96rem;
    margin-inline: auto;
    gap: 1.25rem;
    color: var(--lw-ink) !important;
}

.lw-ops-page .fi-section {
    overflow: hidden;
    border: 1px solid #d7e1ec !important;
    border-radius: 0.85rem;
    border-color: #d7e1ec !important;
    background: #fff !important;
    color: var(--lw-ink) !important;
    box-shadow: 0 16px 38px -30px rgb(5 35 164 / 0.7), 0 2px 7px rgb(15 31 48 / 0.05);
}

.lw-ops-page .fi-section-header {
    border-bottom: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%) !important;
}

.lw-ops-page :is(.fi-section-header-heading, h2, h3, strong) {
    color: #17243a !important;
}

.lw-ops-page :is(.fi-section-header-description, p, small, .text-gray-400, .text-gray-500, .text-gray-600) {
    color: var(--lw-muted) !important;
}

.lw-ops-page > .grid {
    gap: 1rem;
}

.lw-ops-stats {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.lw-ops-stats > * {
    min-width: 0;
    height: 100%;
}

.lw-ops-page > .lw-ops-stats > .fi-section .fi-section-content {
    display: flex;
    min-height: 7.25rem;
    flex-direction: column;
    justify-content: center;
    padding: 1.1rem 1.2rem;
}

.lw-ops-page > .lw-ops-stats > .fi-section {
    position: relative;
}

.lw-ops-page > .lw-ops-stats > .fi-section::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.24rem;
    background: linear-gradient(180deg, #3886f4, #0523a4);
    content: "";
}

.lw-ops-page > .lw-ops-stats > .fi-section :is(small, .text-sm) {
    color: #64748b !important;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.lw-ops-page > .lw-ops-stats > .fi-section :is(.text-2xl, .font-semibold) {
    margin-top: 0.4rem;
    color: #17243a !important;
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    line-height: 1.1;
}

.lw-ops-page .overflow-x-auto {
    border: 1px solid #e1e8f0;
    border-radius: 0.65rem;
}

.lw-ops-page table {
    width: 100%;
    min-width: 42rem;
    border-collapse: collapse;
    color: #253248 !important;
    font-size: 0.8rem;
    text-align: left;
}

.lw-ops-page thead {
    background: #f4f7fb;
}

.lw-ops-page th {
    color: #526178 !important;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.lw-ops-page th,
.lw-ops-page td {
    border-bottom: 1px solid #e6ecf3 !important;
    padding: 0.7rem !important;
    vertical-align: top;
}

.lw-ops-page td:first-child {
    font-weight: 600;
}

.lw-ops-page tbody tr:last-child td {
    border-bottom: 0 !important;
}

.lw-ops-filter .fi-section-content {
    padding-block: 1rem;
}

.lw-ops-filter form {
    align-items: end;
}

.lw-ops-filter form > .flex {
    grid-column: auto / -1;
    justify-content: flex-end;
}

.lw-performance-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.lw-performance-filter-grid > input[type="date"] {
    grid-column: span 1;
}

.lw-performance-filter-grid > .flex {
    grid-column: span 2 !important;
    align-items: center;
    justify-content: flex-start !important;
}

.lw-performance-filter-grid > .flex .fi-btn {
    min-width: 6.5rem;
    justify-content: center;
}

.lw-ops-detail-grid > div {
    min-width: 0;
    border: 1px solid #e1e8f0;
    border-radius: 0.6rem;
    background: #f8fafc;
    padding: 0.85rem 0.95rem;
}

.lw-ops-detail-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lw-ops-detail-grid small {
    display: block;
    margin-bottom: 0.3rem;
    color: #64748b !important;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.lw-ops-detail-grid > div > div:not(.text-sm) {
    overflow-wrap: anywhere;
    color: #17243a;
    font-weight: 650;
}

.lw-ops-page .lw-ops-feed {
    display: grid;
    gap: 0.7rem;
}

.lw-ops-page .lw-ops-feed > .rounded-lg {
    border-left: 3px solid #3886f4 !important;
    border-radius: 0.55rem;
    padding: 0.85rem 1rem !important;
}

.lw-ops-page .lw-ops-feed > .rounded-lg span {
    flex: 0 0 auto;
    color: #718096;
    font-size: 0.75rem;
}

.lw-ops-page tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.lw-ops-page tbody tr:hover {
    background: #eef6ff;
}

.lw-ops-page table a {
    color: var(--lw-blue) !important;
    font-weight: 650;
}

.lw-ops-page form :is(select, input:not([type="checkbox"]):not([type="radio"]), textarea) {
    min-height: 2.5rem;
    border: 1px solid #c3cedb;
    border-radius: 0.5rem;
    background: #fff !important;
    color: var(--lw-ink) !important;
    padding: 0.55rem 0.65rem;
}

.lw-ops-page form :is(select, input, textarea):focus {
    border-color: var(--lw-blue);
    outline: 3px solid rgb(0 73 173 / 0.15);
    outline-offset: 0;
}

.lw-ops-page .space-y-3 > .rounded-lg {
    border-color: #e1e8f0 !important;
    background: #fbfcfe;
    color: #253248 !important;
}

.dark .lw-ops-page :is(.fi-section, .fi-section-header, .fi-section-content) {
    color-scheme: light;
    color: var(--lw-ink) !important;
}

.lw-planner-page [style*="background: rgba(127,127,127,0.08)"] {
    border: 1px solid #dfe7f0;
    background: #f4f7fb !important;
    color: #253248 !important;
}

.lw-planner-page button[wire\:click*="editTask"] {
    background: #fff !important;
    color: #253248 !important;
}

.lw-planner-toolbar {
    width: min(100%, 28rem);
    border: 1px solid #d7e1ec;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 30px -26px rgb(5 35 164 / 0.75);
    padding: 0.75rem;
}

.lw-planner-board {
    display: grid !important;
    grid-auto-columns: minmax(17rem, 1fr);
    grid-auto-flow: column;
    gap: 1rem !important;
    margin: 0 !important;
    padding-bottom: 0.75rem !important;
}

.lw-planner-bucket {
    width: auto !important;
    min-height: 12rem;
    border-radius: 0.75rem !important;
    padding: 0.9rem !important;
}

@media (max-width: 1100px) {
    .lw-ops-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lw-ops-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lw-performance-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .lw-ops-page > .grid {
        grid-template-columns: 1fr;
    }

    .lw-ops-stats,
    .lw-ops-detail-grid {
        grid-template-columns: 1fr;
    }

    .lw-ops-page {
        gap: 0.85rem;
    }

    .lw-ops-page .fi-section-header,
    .lw-ops-page .fi-section-content {
        padding-inline: 1rem;
    }

    .lw-ops-filter form > .flex {
        grid-column: 1;
        justify-content: stretch;
    }

    .lw-performance-filter-grid {
        grid-template-columns: 1fr;
    }

    .lw-performance-filter-grid > input[type="date"],
    .lw-performance-filter-grid > .flex {
        grid-column: 1 !important;
    }

    .lw-performance-filter-grid > .flex > * {
        flex: 1;
    }
}

/* Remote access is deliberately styled as an operational console: factual
   status first, warnings second, and audit evidence last. */
.lw-remote-management {
    display: grid;
    gap: 1.25rem;
    color: var(--lw-ink);
}

.lw-remote-management .fi-section {
    overflow: hidden;
    border-color: #d7e1ec;
    background: #fff;
    color: var(--lw-ink) !important;
    box-shadow:
        0 18px 42px -30px rgb(5 35 164 / 0.52),
        0 2px 8px rgb(15 31 48 / 0.05);
}

.lw-remote-management .fi-section-header {
    border-bottom: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
}

.lw-remote-management .fi-section-header-heading {
    color: #17243a !important;
}

.lw-remote-management .fi-section-header-description {
    color: var(--lw-muted) !important;
}

.lw-remote-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.lw-remote-summary span {
    border: 1px solid #dce5ef;
    border-radius: 999px;
    background: #f5f8fc;
    color: #405069 !important;
    font-size: 0.75rem;
    font-weight: 650;
    padding: 0.3rem 0.6rem;
}

.lw-remote-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.lw-remote-fact {
    min-width: 0;
    border: 1px solid #e2e9f1;
    border-radius: 0.65rem;
    background: #fbfcfe;
    padding: 0.8rem;
}

.lw-remote-fact dt {
    color: var(--lw-muted) !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.lw-remote-fact dd {
    margin-top: 0.35rem;
    overflow-wrap: anywhere;
    color: #17243a !important;
    font-size: 0.9rem;
    font-weight: 600;
}

.lw-remote-notice {
    margin-top: 1rem;
    border: 1px solid #f0cd79;
    border-radius: 0.6rem;
    background: #fff8e6;
    color: #694b08;
    font-size: 0.85rem;
    padding: 0.75rem 0.9rem;
}

.lw-remote-reconciliation {
    border-color: #edc766 !important;
}

.lw-remote-reconciliation-list {
    display: grid;
    gap: 0.55rem;
}

.lw-remote-reconciliation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #efcf80;
    border-radius: 0.6rem;
    background: #fff8e6;
    color: #5f450d;
    font-size: 0.85rem;
    padding: 0.75rem 0.85rem;
}

.lw-remote-reconciliation-item .text-gray-500 {
    color: #7a5c1c !important;
}

.lw-remote-table-ctn {
    overflow-x: auto;
    border: 1px solid #e1e8f0;
    border-radius: 0.65rem;
}

.lw-remote-table {
    width: 100%;
    min-width: 48rem;
    border-collapse: collapse;
    color: var(--lw-ink) !important;
    font-size: 0.82rem;
}

.lw-remote-table thead {
    background: linear-gradient(180deg, #f8fafd 0%, #f1f5f9 100%);
}

.lw-remote-table th {
    color: #344256 !important;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-align: left;
    text-transform: uppercase;
}

.lw-remote-table td {
    color: #253248 !important;
}

/* Filament's dark-mode text utilities can otherwise remain white while our
   operational sections deliberately stay light, producing white-on-white
   content when the browser or saved panel preference is dark. */
.dark .lw-remote-management .fi-section-content,
.dark .lw-remote-management .fi-section-header {
    color-scheme: light;
    color: var(--lw-ink) !important;
}

.dark .lw-remote-management :is(.lw-remote-summary span, .lw-remote-fact dt, .lw-remote-fact dd, .lw-remote-table th, .lw-remote-table td) {
    -webkit-text-fill-color: currentColor;
}

.lw-remote-table th,
.lw-remote-table td {
    border-bottom: 1px solid #e6ecf3;
    padding: 0.7rem;
    vertical-align: middle;
}

.lw-remote-table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.lw-remote-table tbody tr:hover {
    background: #eef6ff;
}

.lw-remote-table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 1024px) {
    .lw-remote-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .lw-remote-status-grid {
        grid-template-columns: 1fr;
    }

    .lw-remote-reconciliation-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Report records use permanently light operational surfaces, including when
   Filament has restored a dark appearance preference for the signed-in user. */
.lw-site-report {
    display: grid;
    gap: 1rem;
    color: var(--lw-ink) !important;
}

/* Keep the report title readable and the reduced action set aligned as one
   compact toolbar instead of allowing buttons to scatter across the header. */
.fi-resource-reports.fi-resource-view-record-page .fi-header {
    align-items: flex-start;
    gap: 1rem 1.5rem;
}

.fi-resource-reports.fi-resource-view-record-page .fi-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.fi-resource-reports.fi-resource-view-record-page .fi-header-actions .fi-btn {
    min-height: 2.5rem;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .fi-resource-reports.fi-resource-view-record-page .fi-header,
    .fi-resource-reports.fi-resource-view-record-page .fi-header-actions {
        width: 100%;
    }

    .fi-resource-reports.fi-resource-view-record-page .fi-header-actions {
        justify-content: flex-start;
    }
}

.lw-site-report .fi-section {
    overflow: hidden;
    background: #fff;
    color: var(--lw-ink) !important;
}

.lw-site-report .fi-section-header {
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
}

.lw-site-report .fi-section-header-heading {
    color: #17243a !important;
}

.lw-site-report .fi-section-header-description {
    color: var(--lw-muted) !important;
}

.lw-report-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1rem;
}

.lw-report-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.lw-report-facts > div {
    min-width: 0;
    border: 1px solid #e2e9f1;
    border-radius: 0.6rem;
    background: #f8fafc;
    padding: 0.75rem;
}

.lw-report-facts dt {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lw-report-facts dd {
    margin-top: 0.3rem;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    font-weight: 600;
}

.lw-report-status {
    display: inline-flex;
    border-radius: 999px;
    background: var(--lw-blue-soft);
    color: var(--lw-blue) !important;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.lw-report-snapshot pre {
    max-height: 18rem;
}

.lw-report-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.lw-report-section-card {
    min-width: 0;
    border: 1px solid #dfe7f0;
    border-radius: 0.65rem;
    background: #fbfcfe;
    padding: 0.85rem;
}

.lw-report-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.lw-report-section-heading h3 {
    font-weight: 700;
}

.lw-report-section-heading span {
    flex: none;
    border-radius: 999px;
    background: #edf3fa;
    color: #405069 !important;
    padding: 0.18rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.lw-report-section-card > p {
    margin-top: 0.5rem;
    color: var(--lw-muted) !important;
    font-size: 0.8rem;
}

.lw-report-section-card pre {
    max-height: 16rem;
    margin-top: 0.7rem;
}

.lw-report-empty {
    grid-column: 1 / -1;
    border: 1px dashed #c9d5e3;
    border-radius: 0.65rem;
    background: #f8fafc;
    padding: 1rem;
    text-align: center;
}

.lw-site-report :is(.fi-section-content, dl, dt, dd, h3, p, pre, table, tbody, tr, td) {
    color: #253248 !important;
}

.lw-site-report dt,
.lw-site-report th {
    color: #526178 !important;
}

.lw-site-report pre {
    border: 1px solid #e1e8f0;
    border-radius: 0.55rem;
    background: #f8fafc;
    padding: 0.75rem;
}

.lw-site-report table {
    color: #253248 !important;
}

.lw-report-table-ctn {
    overflow-x: auto;
    border: 1px solid #e1e8f0;
    border-radius: 0.65rem;
}

.lw-report-table {
    width: 100%;
    min-width: 48rem;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.lw-site-report thead {
    background: #f4f7fb;
}

.lw-site-report th {
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.lw-site-report td,
.lw-site-report th {
    border-color: #e1e8f0 !important;
    border-bottom-width: 1px;
    padding: 0.7rem;
    vertical-align: top;
}

.lw-report-table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.lw-report-table tbody tr:hover {
    background: #eef6ff;
}

.lw-site-report .text-gray-500,
.lw-site-report .text-gray-600 {
    color: var(--lw-muted) !important;
}

.dark .lw-site-report :is(.fi-section, .fi-section-header, .fi-section-content) {
    color-scheme: light;
    color: var(--lw-ink) !important;
}

@media (max-width: 900px) {
    .lw-report-overview,
    .lw-report-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .lw-report-facts {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lw-client-card {
        transition: none;
    }

    .lw-client-card:hover {
        transform: none;
    }
}

.fi-btn.fi-color-primary {
    box-shadow: 0 6px 14px -9px rgb(0 73 173 / 0.8);
}

.fi-tabs {
    border: 0;
    border-bottom: 1px solid var(--lw-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    gap: 0.35rem;
    padding: 0;
}

.fi-tabs-item {
    position: relative;
    border-radius: 0.45rem 0.45rem 0 0;
    padding: 0.75rem 1rem;
}

.fi-tabs-item.fi-active {
    background: var(--lw-blue-soft);
    color: #003a8c;
}

.fi-tabs-item.fi-active::after {
    position: absolute;
    right: 0.65rem;
    bottom: -1px;
    left: 0.65rem;
    height: 2px;
    border-radius: 999px;
    background: var(--lw-blue);
    content: "";
}

/* Resource list tabs are controls, not page copy. Keep them on a compact
   white surface so busy lists such as Enquiries do not look detached from
   their table or lose contrast against the blue workspace. */
.fi-resource-list-records-page .fi-tabs {
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid rgb(255 255 255 / 0.72);
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.94);
    box-shadow: var(--lw-surface-shadow);
    scrollbar-width: thin;
    padding: 0.3rem;
}

.fi-resource-list-records-page .fi-tabs-item {
    flex: 0 0 auto;
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
}

.fi-resource-list-records-page .fi-tabs-item:not(.fi-active),
.fi-resource-list-records-page .fi-tabs-item:not(.fi-active) .fi-tabs-item-label,
.fi-resource-list-records-page .fi-tabs-item:not(.fi-active) .fi-icon {
    color: var(--lw-muted) !important;
}

.fi-resource-list-records-page .fi-tabs-item.fi-active {
    background: var(--lw-blue-soft);
    color: #003a8c;
}

.fi-resource-list-records-page .fi-tabs-item.fi-active::after {
    display: none;
}

/* Record detail tabs are a contained workspace. The generic page tabs sit on
   the blue canvas, but schema tabs need their own white panel and dark ink. */
.fi-resource-view-record-page .lw-enquiry-details {
    overflow: hidden;
    border: 1px solid rgb(210 220 232 / 0.95);
    border-radius: 0.85rem;
    background: #fff;
    color: var(--lw-ink);
    box-shadow:
        0 18px 42px -30px rgb(5 35 164 / 0.55),
        0 2px 8px rgb(15 31 48 / 0.05);
}

.fi-resource-view-record-page .lw-enquiry-details > .fi-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-bottom: 1px solid #dfe7f0;
    border-radius: 0;
    background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
    gap: 0.25rem;
    padding: 0.5rem 0.65rem 0;
    scrollbar-width: thin;
}

.fi-resource-view-record-page .lw-enquiry-details > .fi-tabs .fi-tabs-item {
    flex: 0 0 auto;
}

.fi-resource-view-record-page .lw-enquiry-details > .fi-tabs .fi-tabs-item:not(.fi-active),
.fi-resource-view-record-page .lw-enquiry-details > .fi-tabs .fi-tabs-item:not(.fi-active) .fi-tabs-item-label,
.fi-resource-view-record-page .lw-enquiry-details > .fi-tabs .fi-tabs-item:not(.fi-active) .fi-icon {
    color: var(--lw-muted) !important;
}

.fi-resource-view-record-page .lw-enquiry-details > .fi-sc-tabs-tab {
    padding: clamp(0.85rem, 1.5vw, 1.25rem);
}

/* Read-only values should still scan like a structured record. */
.fi-resource-view-record-page .lw-enquiry-details .fi-in-entry {
    border: 1px solid #e5ebf2;
    border-radius: 0.65rem;
    background: #fbfcfe;
    padding: 0.65rem 0.8rem;
}

.fi-resource-view-record-page .fi-in-entry-label {
    color: var(--lw-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.fi-resource-view-record-page .fi-in-entry-content {
    color: var(--lw-ink);
}

.fi-resource-view-record-page .lw-enquiry-details .fi-section {
    box-shadow: none;
}

/* Relation manager tabs are a separate navigation strip and should not inherit
   the large contained detail panel above. */
.fi-resource-view-record-page .fi-sc-tabs:not(.fi-contained) > .fi-tabs {
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgb(255 255 255 / 0.72);
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.96);
    box-shadow: var(--lw-surface-shadow);
    padding: 0.3rem;
}

.fi-resource-view-record-page .fi-sc-tabs:not(.fi-contained) > .fi-tabs .fi-tabs-item {
    flex: 0 0 auto;
    border-radius: 0.5rem;
}

.fi-resource-view-record-page .fi-sc-tabs:not(.fi-contained) > .fi-tabs .fi-tabs-item:not(.fi-active),
.fi-resource-view-record-page .fi-sc-tabs:not(.fi-contained) > .fi-tabs .fi-tabs-item:not(.fi-active) .fi-tabs-item-label {
    color: var(--lw-muted) !important;
}

.fi-resource-view-record-page .fi-sc-tabs:not(.fi-contained) > .fi-tabs .fi-tabs-item.fi-active::after {
    display: none;
}

/* Explicit ink colours prevent the page-level white text from leaking into
   an empty table, its toolbar, or pagination controls. */
.fi-ta-ctn,
.fi-ta-content-ctn,
.fi-ta-empty-state,
.fi-ta-header-toolbar,
.fi-pagination {
    color: var(--lw-ink);
}

/* Data grids: a little more structure and depth without making operational
   screens feel heavy. */
.fi-ta-ctn {
    overflow: hidden;
    border-color: rgb(210 220 232 / 0.95);
    box-shadow:
        0 18px 42px -30px rgb(5 35 164 / 0.55),
        0 2px 8px rgb(15 31 48 / 0.05);
}

.fi-ta-header-ctn {
    border-bottom: 1px solid #e3eaf2;
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.fi-ta-header-toolbar {
    padding-block: 0.85rem;
}

.fi-ta-table thead {
    background: linear-gradient(180deg, #f8fafd 0%, #f1f5f9 100%);
}

.fi-ta-header-cell {
    border-block: 0;
    border-bottom: 1px solid #dbe4ee;
}

.fi-ta-header-cell,
.fi-ta-header-cell-sort-btn {
    color: #344256;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.fi-ta-row {
    border-bottom: 1px solid #e9eef4;
}

.fi-ta-row:nth-child(even) {
    background: #fbfcfe;
}

.fi-ta-row:hover {
    background: #eef6ff !important;
    box-shadow: inset 3px 0 0 var(--lw-blue);
}

.fi-ta-cell {
    padding-block: 0.15rem;
}

.fi-ta-cell {
    line-height: 1.45;
}

/* Filament changes table rows into labelled grids on narrow screens. Those
   generated wrappers otherwise inherit the white foreground used by the blue
   page canvas, leaving white values on the table's white cards. Keep all
   ordinary table values readable and give stacked labels a quieter contrast. */
:root:not(.dark) .fi-ta-cell-content,
:root:not(.dark) .fi-ta-col,
:root:not(.dark) .fi-ta-text {
    color: var(--lw-ink);
}

:root:not(.dark) .fi-ta-cell-label {
    color: #526174;
    font-weight: 650;
}

@media (max-width: 640px) {
    :root:not(.dark) .fi-ta-table-stacked-on-mobile .fi-ta-row {
        color: var(--lw-ink);
        background: #fff;
    }

    :root:not(.dark) .fi-ta-table-stacked-on-mobile .fi-ta-cell-content {
        min-width: 0;
    }
}

.fi-ta-row:last-child {
    border-bottom: 0;
}

.fi-pagination {
    border-top: 1px solid #e3eaf2;
    background: #fbfcfe;
}

.fi-ta-record-checkbox:focus-visible,
.fi-ta-row:focus-within {
    outline: 2px solid rgb(0 73 173 / 0.28);
    outline-offset: -2px;
}

.fi-ta-empty-state-description,
.fi-pagination-overview {
    color: var(--lw-muted);
}

@media (max-width: 640px) {
    .fi-resource-list-records-page .fi-tabs {
        width: 100%;
    }
}

/* Subtle affordance for actionable dashboard statistics. */
.fi-wi-stats-overview-stat[href] {
    cursor: pointer;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
    will-change: transform;
}

.fi-wi-stats-overview-stat[href]:hover {
    transform: translateY(-2px);
    background-color: #f8fbff;
    box-shadow:
        0 10px 24px -14px rgb(15 23 42 / 0.35),
        0 0 0 1px rgb(0 73 173 / 0.24);
}

.fi-wi-stats-overview-stat[href]:active {
    transform: translateY(0);
    box-shadow:
        0 4px 12px -8px rgb(15 23 42 / 0.3),
        0 0 0 1px rgb(0 73 173 / 0.2);
}

.fi-wi-stats-overview-stat[href] .fi-wi-stats-overview-stat-value {
    transition: color 160ms ease;
}

.fi-wi-stats-overview-stat[href]:hover .fi-wi-stats-overview-stat-value {
    color: #003a8c;
}

.dark .fi-wi-stats-overview-stat[href]:hover {
    background-color: rgb(41 37 36);
    box-shadow:
        0 12px 28px -16px rgb(0 0 0 / 0.8),
        0 0 0 1px rgb(255 136 0 / 0.28);
}

.dark .fi-wi-stats-overview-stat[href]:hover .fi-wi-stats-overview-stat-value {
    color: rgb(255 168 61);
}

.dark .fi-input-wrp {
    border-color: rgb(255 255 255 / 0.14);
    background: #16233a;
}

.dark .fi-input-wrp:hover {
    border-color: rgb(255 255 255 / 0.24);
}

.dark .fi-input-wrp:focus-within {
    border-color: rgb(96 165 250) !important;
    box-shadow: 0 0 0 3px rgb(96 165 250 / 0.22);
}

.dark .fi-fo-field-label {
    color: #f1f5f9;
}

.dark .fi-body {
    background-color: #0523a4;
    background-image: linear-gradient(152deg, #0523a4 0%, #3886f4 51%, #3b6dff 100%) !important;
}

.dark .fi-topbar,
.dark .fi-section,
.dark .fi-ta-ctn,
.dark .fi-wi-stats-overview-stat,
.dark .fi-ta-header-ctn,
.dark .fi-ta-header-toolbar {
    border-color: rgb(255 255 255 / 0.1);
    background: #111b2a;
}

.dark .fi-ta-table thead {
    background: #142132;
}

.dark .fi-ta-header-cell,
.dark .fi-ta-header-cell-sort-btn {
    border-color: rgb(255 255 255 / 0.12);
    color: #b8c7da;
}

.dark .fi-ta-row {
    border-color: rgb(255 255 255 / 0.08);
    background: #111b2a;
}

.dark .fi-ta-row:nth-child(even) {
    background: #17253a;
}

.dark .fi-ta-row:hover {
    background: #1c3352 !important;
}

.dark .fi-ta-cell-content,
.dark .fi-ta-col,
.dark .fi-ta-text {
    color: #f1f5f9;
}

.dark .fi-ta-cell-label {
    color: #aebdd0;
}

.dark .fi-header-heading,
.dark .fi-section-header-heading,
.dark .fi-ta-header-heading,
.dark .fi-wi-stats-overview-stat-value {
    color: #f8fafc;
}

/* On phones the blue application canvas supplies the dark framing. Keep the
   working panels light even when iOS reports a dark colour preference.
   Desktop dark mode remains unchanged. */
@media (max-width: 700px) {
    .dark :is(.fi-section, .fi-ta-ctn, .fi-wi-stats-overview-stat) {
        color-scheme: light;
        border-color: var(--lw-line);
        background: #fff;
        color: var(--lw-ink);
    }

    .dark :is(.fi-section-header, .fi-section-content, .fi-ta-header-ctn, .fi-ta-header-toolbar, .fi-ta-content-ctn, .fi-ta-empty-state, .fi-pagination) {
        border-color: #e3eaf2;
        background: #fff;
        color: var(--lw-ink);
    }

    .dark :is(.fi-section-header-heading, .fi-ta-header-heading, .fi-wi-stats-overview-stat-value) {
        color: var(--lw-ink);
    }

    .dark :is(.fi-section-header-description, .fi-wi-stats-overview-stat-label, .fi-ta-empty-state-description, .fi-pagination-overview) {
        color: var(--lw-muted);
    }

    .dark .fi-ta-table thead {
        background: #f1f5f9;
    }

    .dark .fi-ta-header-cell,
    .dark .fi-ta-header-cell-sort-btn {
        border-color: #dbe4ee;
        color: #344256;
    }

    .dark .fi-ta-row,
    .dark .fi-ta-row:nth-child(even) {
        border-color: #e9eef4;
        background: #fff;
    }

    .dark .fi-ta-row:nth-child(even) {
        background: #f7f9fc;
    }

    .dark .fi-ta-row:hover {
        background: #eef6ff !important;
    }

    .dark :is(.fi-ta-cell-content, .fi-ta-col, .fi-ta-text) {
        color: var(--lw-ink);
    }

    .dark .fi-ta-cell-label {
        color: #526174;
    }

    .dark .fi-input-wrp {
        border-color: #c3cedb;
        background: #fff;
    }

    .dark :is(input.fi-input, textarea.fi-textarea-input, select.fi-select-input, .fi-select-input-btn, .fi-select-input-value-label) {
        color: var(--lw-ink) !important;
        -webkit-text-fill-color: var(--lw-ink);
    }

    .dark .fi-fo-field-label {
        color: var(--lw-ink);
    }

    .dark .lw-master-stat-label {
        color: var(--lw-muted);
    }

    .dark .lw-master-stat-value {
        color: #17243a;
    }

    .dark .lw-master-clients :is(.fi-section-header, .fi-section-content) {
        border-color: #e3eaf2;
        background: #fff;
        color: var(--lw-ink);
    }

    .dark .lw-master-clients .fi-section-header-heading {
        color: var(--lw-ink);
    }

    .dark .lw-master-clients .fi-section-header-description,
    .dark .lw-master-client-toolbar-actions p {
        color: var(--lw-muted) !important;
    }

    .dark .lw-master-client-search label {
        color: #344256 !important;
    }

    .dark .lw-master-clients-toolbar {
        border-color: #e4eaf2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fi-wi-stats-overview-stat[href] {
        transition: background-color 0.01ms;
    }

    .fi-wi-stats-overview-stat[href]:hover,
    .fi-wi-stats-overview-stat[href]:active {
        transform: none;
    }
}
.fi-logo {
    box-sizing: border-box;
    width: auto;
    height: 4rem;
    max-width: 8rem;
    padding: 0.5rem 0.3rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 0.65rem;
    background: rgb(255 255 255 / 0.96);
    box-shadow: 0 5px 14px -8px rgb(0 0 0 / 0.65);
    object-fit: contain;
}

/* Transparent workspace trial: let the LoganWeb gradient run continuously
   behind the top bar and page shell while preserving solid content cards. */
.fi-topbar,
.dark .fi-topbar {
    border-bottom: 0 !important;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
}

.fi-main-ctn,
.fi-main,
.fi-page,
.fi-layout,
.dark .fi-main-ctn,
.dark .fi-main,
.dark .fi-page,
.dark .fi-layout {
    background: transparent !important;
}

.fi-topbar :is(.fi-icon-btn, .fi-icon-btn .fi-icon) {
    color: #fff !important;
}

.fi-topbar .fi-icon-btn:hover,
.fi-topbar .fi-icon-btn:focus-visible {
    background: rgb(255 255 255 / 0.12) !important;
}

.lw-topbar-logo-link {
    display: inline-flex;
    flex: none;
    align-items: center;
    margin-inline: 0.55rem 0.8rem;
}

.lw-cobrand-divider {
    flex: 0 0 1px;
    width: 1px;
    height: 2rem;
    margin-inline: 1rem;
    background: #d7e1ec;
}

.lw-topbar-partner-logo {
    width: auto;
    max-width: 10rem;
    object-fit: contain;
}

.fi-topbar-start > a:has(.fi-logo),
.fi-topbar-start > .fi-logo {
    display: none !important;
}

.lw-topbar-logo {
    display: block;
    width: auto;
    height: 3.25rem;
    max-width: 7rem;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 0.55rem;
    background: rgb(255 255 255 / 0.95);
    object-fit: contain;
    padding: 0.3rem;
}

@media (max-width: 560px) {
    .lw-cobrand-divider {
        margin-inline: 0.7rem;
    }

    .lw-topbar-logo {
        height: 2.75rem;
        max-width: 5.5rem;
    }
}
