:root {
    --font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
        'Segoe UI Symbol', 'Noto Color Emoji';

    /* Primary palette tuned to NexLink style */
    --primary-50: 239 246 255;
    --primary-100: 219 234 254;
    --primary-200: 191 219 254;
    --primary-300: 147 197 253;
    --primary-400: 96 165 250;
    --primary-500: 59 130 246;
    --primary-600: 37 99 235;
    --primary-700: 29 78 216;
    --primary-800: 30 64 175;
    --primary-900: 30 58 138;

    /* Slightly cooler grays to match the dashboard aesthetic */
    --gray-50: 248 250 252;
    --gray-100: 241 245 249;
    --gray-200: 226 232 240;
    --gray-300: 203 213 225;
    --gray-400: 148 163 184;
    --gray-500: 100 116 139;
    --gray-600: 71 85 105;
    --gray-700: 51 65 85;
    --gray-800: 30 41 59;
    --gray-900: 15 23 42;
}

.fi-body {
    background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
    color: #0f172a;
}

.dark .fi-body {
    background: linear-gradient(180deg, #0b1220 0%, #101827 100%);
    color: #e2e8f0;
}

.fi-main {
    background: transparent;
}

.fi-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e6ebf2;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dark .fi-topbar {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.6);
}

.fi-topbar .fi-topbar-actions,
.fi-topbar .fi-topbar-item {
    color: #0f172a;
}

.dark .fi-topbar .fi-topbar-actions,
.dark .fi-topbar .fi-topbar-item {
    color: #e2e8f0;
}

.fi-topbar-nav {
    background: #f8fafc;
}

.dark .fi-topbar-nav {
    background: #0f172a;
}

.fi-topbar-left {
    flex: 1 1 auto;
}

.fi-topbar-search {
    position: relative;
    min-width: 640px;
    max-width: 900px;
    width: 100%;
}

.fi-topbar-search-slot {
    flex: 1 1 auto;
    min-width: 640px;
}

.fi-topbar-search-input,
.fi-topbar-search-input .fi-input-wrp,
.fi-topbar-search-input .fi-input-wrapper,
.fi-topbar-search-input .fi-input {
    width: 100%;
}

.fi-topbar-search .fi-input-wrp,
.fi-topbar-search .fi-input-wrapper,
.fi-topbar-search .fi-input {
    background: #f1f5f9;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.fi-topbar-search .fi-input {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.fi-topbar-search .fi-input:focus {
    box-shadow: none !important;
}

.fi-topbar-search input[type='search'] {
    padding-left: 2.25rem;
    padding-right: 1rem;
    height: 42px;
    font-size: 0.95rem;
}

.fi-topbar-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    padding: 0.75rem;
    z-index: 50;
    display: none;
}

.fi-topbar-search-results.is-open {
    display: block;
}

.fi-topbar-search-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 0 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fi-topbar-search-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    transition: background 0.15s ease;
}

.fi-topbar-search-item:hover {
    background: #f1f5f9;
}

.fi-topbar-search-type {
    font-size: 0.7rem;
    font-weight: 700;
    color: #2563eb;
    background: #e0e7ff;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fi-topbar-search-name {
    font-weight: 600;
    color: #0f172a;
    display: block;
}

.fi-topbar-search-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
}

.fi-topbar-search-empty {
    padding: 0.5rem 0.75rem 0.75rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.fi-topbar-icon-group .fi-icon-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #2563eb !important;
}

.fi-topbar-icon-group {
    gap: 1rem;
}

.fi-topbar-icon-group .fi-icon-btn:hover {
    background: #e2e8f0;
}

.fi-topbar-icon-group .fi-icon-btn svg,
.fi-topbar-icon-group .fi-icon-btn path {
    color: #2563eb !important;
    stroke: currentColor;
}

.fi-topbar-icon-group .fi-icon-btn .fi-icon {
    color: #2563eb !important;
}

.fi-sidebar {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem 1.1rem;
    width: 270px;
}

.dark .fi-sidebar {
    background: linear-gradient(180deg, #0b1220 0%, #101827 100%);
    border-right: 1px solid #1e293b;
}

.fi-sidebar .fi-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.fi-sidebar .fi-sidebar-header,
.fi-sidebar .fi-sidebar-header * {
    color: #0f172a;
}

.dark .fi-sidebar .fi-sidebar-header,
.dark .fi-sidebar .fi-sidebar-header * {
    color: #e2e8f0;
}

.fi-sidebar-nav {
    gap: 0.5rem;
}

.fi-sidebar-item-button {
    padding: 0.6rem 0.85rem;
    border-radius: 0.85rem;
}

.fi-sidebar-item-button:hover {
    background: rgba(59, 130, 246, 0.12) !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-button {
    background: rgba(59, 130, 246, 0.2) !important;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.fi-sidebar .fi-sidebar-item {
    color: #334155;
    border-radius: 0.75rem;
}

.fi-sidebar .fi-sidebar-item:hover,
.fi-sidebar .fi-sidebar-item[aria-current='page'] {
    background: rgba(59, 130, 246, 0.18);
    color: #0f172a;
}

.fi-sidebar .fi-sidebar-item svg,
.fi-sidebar .fi-sidebar-item svg path {
    color: inherit;
}

.dark .fi-sidebar .fi-sidebar-item {
    color: rgba(226, 232, 240, 0.85);
}

.dark .fi-sidebar .fi-sidebar-item:hover,
.dark .fi-sidebar .fi-sidebar-item[aria-current='page'] {
    color: #ffffff;
}

.fi-header {
    padding-bottom: 0.5rem;
}

.fi-header-heading {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.fi-header-subheading {
    color: #64748b;
}

.fi-section,
.fi-widget,
.fi-ta,
.fi-fo,
.fi-tabs,
.fi-card,
.fi-section-content {
    background: #ffffff;
    border: 1px solid #e6ebf2;
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.fi-section {
    padding: 1.25rem;
}

.fi-section-header {
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.fi-ta-header,
.fi-ta-row,
.fi-ta-footer {
    border-color: #e6ebf2;
}

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

.fi-input,
.fi-select-input,
.fi-fo-field-wrp input,
.fi-fo-field-wrp textarea,
.fi-fo-field-wrp select {
    border-radius: 0.75rem;
    border-color: #dce3ec;
    background: #f9fbfd;
}

.fi-input:focus,
.fi-select-input:focus,
.fi-fo-field-wrp input:focus,
.fi-fo-field-wrp textarea:focus,
.fi-fo-field-wrp select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.fi-btn {
    border-radius: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.fi-btn.fi-color-primary {
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
}

.fi-btn.fi-color-primary,
.fi-btn.fi-color-info,
.fi-btn.fi-color-success,
.fi-btn.fi-color-warning,
.fi-btn.fi-color-danger {
    color: #ffffff !important;
}

.fi-btn.fi-color-primary .fi-btn-label,
.fi-btn.fi-color-primary .fi-btn-icon,
.fi-btn.fi-color-info .fi-btn-label,
.fi-btn.fi-color-info .fi-btn-icon,
.fi-btn.fi-color-success .fi-btn-label,
.fi-btn.fi-color-success .fi-btn-icon,
.fi-btn.fi-color-warning .fi-btn-label,
.fi-btn.fi-color-warning .fi-btn-icon,
.fi-btn.fi-color-danger .fi-btn-label,
.fi-btn.fi-color-danger .fi-btn-icon,
.fi-btn.fi-color-primary svg,
.fi-btn.fi-color-info svg,
.fi-btn.fi-color-success svg,
.fi-btn.fi-color-warning svg,
.fi-btn.fi-color-danger svg {
    color: currentColor !important;
    stroke: currentColor;
}

.fi-badge {
    border-radius: 999px;
    font-weight: 600;
}

.fi-tabs {
    padding: 0.5rem;
}

.fi-tabs .fi-tabs-item[aria-selected='true'] {
    background: #e8f1ff;
    color: #1d4ed8;
}

.fi-global-search input {
    background: #f8fafc;
    border: 1px solid #dce3ec;
    border-radius: 999px;
}

@media (min-width: 1024px) {
    .fi-main {
        padding: 2rem 2.5rem;
    }

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

/* AESN dashboard dark surface. This static Filament asset applies even when Vite hot mode is active. */
body.fi-panel-aesn:has(.fi-page-dashboard),
body.fi-panel-aesn:has(.fi-page-dashboard) .fi-main,
body.fi-panel-aesn:has(.fi-page-dashboard) .fi-main-ctn,
.fi-panel-aesn:has(.fi-page-dashboard),
.fi-panel-aesn:has(.fi-page-dashboard) .fi-body {
    background:
        radial-gradient(circle at 16% 6%, rgba(37, 99, 235, 0.18), transparent 31rem),
        radial-gradient(circle at 82% 14%, rgba(20, 184, 166, 0.13), transparent 28rem),
        #05070b !important;
    color: #e5edf8 !important;
}

.fi-panel-aesn .fi-page-dashboard,
.fi-panel-aesn .fi-dashboard-page {
    color: #e5edf8 !important;
}

.fi-panel-aesn .fi-page-dashboard > .space-y-4,
.fi-panel-aesn .fi-dashboard-page > .space-y-4 {
    gap: 1.5rem !important;
}

.fi-panel-aesn .fi-page-dashboard > .space-y-4 > .flex:first-child .text-lg,
.fi-panel-aesn .fi-dashboard-page > .space-y-4 > .flex:first-child .text-lg,
.fi-panel-aesn .fi-page-dashboard .fi-header-heading,
.fi-panel-aesn .fi-dashboard-page .fi-header-heading {
    color: #f8fafc !important;
    font-size: clamp(1.45rem, 1.7vw, 2rem) !important;
    letter-spacing: 0 !important;
}

.fi-panel-aesn .fi-page-dashboard .crm-dashboard-content-shell,
.fi-panel-aesn .fi-dashboard-page .crm-dashboard-content-shell {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.fi-panel-aesn .fi-page-dashboard .bg-white,
.fi-panel-aesn .fi-page-dashboard .bg-gray-50,
.fi-panel-aesn .fi-page-dashboard [class*="bg-white"],
.fi-panel-aesn .fi-page-dashboard [class*="bg-gray-50"],
.fi-panel-aesn .fi-dashboard-page .bg-white,
.fi-panel-aesn .fi-dashboard-page .bg-gray-50,
.fi-panel-aesn .fi-dashboard-page [class*="bg-white"],
.fi-panel-aesn .fi-dashboard-page [class*="bg-gray-50"] {
    background-color: transparent !important;
}

.fi-panel-aesn .fi-page-dashboard > .space-y-4 > .rounded-2xl,
.fi-panel-aesn .fi-page-dashboard > .space-y-4 > .rounded-2xl.border,
.fi-panel-aesn .fi-page-dashboard > .space-y-4 > .rounded-2xl.bg-white,
.fi-panel-aesn .fi-page-dashboard > .space-y-4 > .rounded-2xl.border.bg-white,
.fi-panel-aesn .fi-dashboard-page > .space-y-4 > .rounded-2xl,
.fi-panel-aesn .fi-dashboard-page > .space-y-4 > .rounded-2xl.border,
.fi-panel-aesn .fi-dashboard-page > .space-y-4 > .rounded-2xl.bg-white,
.fi-panel-aesn .fi-dashboard-page > .space-y-4 > .rounded-2xl.border.bg-white {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.fi-panel-aesn .fi-page-dashboard > .space-y-4 > .rounded-2xl > .p-4,
.fi-panel-aesn .fi-dashboard-page > .space-y-4 > .rounded-2xl > .p-4 {
    padding: 0 !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-filters-form,
.fi-panel-aesn .fi-dashboard-page .fi-filters-form,
.fi-dashboard-page .fi-filters-form,
.fi-page-dashboard .fi-filters-form,
.fi-panel-aesn .fi-page-dashboard form.fi-form {
    margin-bottom: 1rem !important;
    background: rgba(15, 23, 42, 0.78) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    border-radius: 1rem !important;
    padding: 0.85rem !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28) !important;
}

html:not(.dark) .fi-dashboard-page .fi-filters-form,
html:not(.dark) .fi-page-dashboard .fi-filters-form {
    margin-bottom: 1rem !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-input-wrp,
.fi-panel-aesn .fi-page-dashboard .fi-select-input,
.fi-panel-aesn .fi-page-dashboard .ts-control {
    background: rgba(31, 41, 55, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #e5edf8 !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-widgets {
    gap: 1.5rem !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview,
.fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview > div {
    gap: 1.5rem !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview-stat,
.fi-panel-aesn .fi-page-dashboard .fi-section,
.fi-panel-aesn .fi-page-dashboard .fi-wi-chart,
.fi-panel-aesn .fi-page-dashboard .fi-ta-ctn {
    background: linear-gradient(180deg, rgba(20, 29, 45, 0.98), rgba(15, 23, 42, 0.98)) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    border-radius: 1rem !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36) !important;
    color: #e5edf8 !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview-stat {
    min-height: 8.25rem !important;
    padding: 1.35rem !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview-stat-label,
.fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview-stat-description,
.fi-panel-aesn .fi-page-dashboard .fi-section-header-description,
.fi-panel-aesn .fi-page-dashboard .fi-section-content p,
.fi-panel-aesn .fi-page-dashboard .fi-ta-cell {
    color: #9aa8bb !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview-stat-value,
.fi-panel-aesn .fi-page-dashboard .fi-section-header-heading,
.fi-panel-aesn .fi-page-dashboard .fi-wi-chart-heading,
.fi-panel-aesn .fi-page-dashboard h2,
.fi-panel-aesn .fi-page-dashboard h3 {
    color: #f8fafc !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-section-header,
.fi-panel-aesn .fi-page-dashboard .fi-ta-header {
    border-color: rgba(148, 163, 184, 0.13) !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content,
.fi-panel-aesn .fi-page-dashboard .fi-section-content {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section {
    overflow: hidden !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content {
    padding-top: 1.25rem !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div {
    background: rgba(148, 163, 184, 0.08) !important;
    border: 1px solid rgba(148, 163, 184, 0.13) !important;
    border-radius: 0.75rem !important;
    color: #dbeafe !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(1) {
    background: rgba(59, 130, 246, 0.16) !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(2),
.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(6) {
    background: rgba(16, 185, 129, 0.14) !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(3) {
    background: rgba(239, 68, 68, 0.14) !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(4) {
    background: rgba(168, 85, 247, 0.14) !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(5) {
    background: rgba(245, 158, 11, 0.14) !important;
}

.fi-panel-aesn .fi-page-dashboard .fi-ta-table,
.fi-panel-aesn .fi-page-dashboard table {
    background: transparent !important;
    color: #dbeafe !important;
}

.fi-panel-aesn .fi-page-dashboard thead,
.fi-panel-aesn .fi-page-dashboard tbody tr:hover {
    background: rgba(15, 23, 42, 0.72) !important;
}

.fi-panel-aesn .fi-page-dashboard table thead tr,
.fi-panel-aesn .fi-page-dashboard table tbody tr,
.fi-panel-aesn .fi-page-dashboard .fi-ta-table > thead > tr > th,
.fi-panel-aesn .fi-page-dashboard .fi-ta-table > tbody > tr > td {
    border-color: rgba(148, 163, 184, 0.12) !important;
}

@media (max-width: 768px) {
    .fi-panel-aesn .fi-page-dashboard .fi-widgets,
    .fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview,
    .fi-panel-aesn .fi-page-dashboard .fi-wi-stats-overview > div {
        gap: 1rem !important;
    }
}

/* Dashboard fallback for every panel, including HR. */
body:has(.fi-dashboard-page),
body:has(.fi-page-dashboard),
body:has(.fi-dashboard-page) .fi-main,
body:has(.fi-page-dashboard) .fi-main,
body:has(.fi-dashboard-page) .fi-main-ctn,
body:has(.fi-page-dashboard) .fi-main-ctn {
    background:
        radial-gradient(circle at 16% 6%, rgba(37, 99, 235, 0.18), transparent 31rem),
        radial-gradient(circle at 82% 14%, rgba(20, 184, 166, 0.13), transparent 28rem),
        #05070b !important;
    color: #e5edf8 !important;
}

.fi-dashboard-page,
.fi-page-dashboard {
    color: #e5edf8 !important;
}

.fi-dashboard-page .crm-dashboard-content-shell,
.fi-page-dashboard .crm-dashboard-content-shell,
.fi-dashboard-page > .space-y-4 > .rounded-2xl,
.fi-page-dashboard > .space-y-4 > .rounded-2xl,
.fi-dashboard-page > .space-y-4 > .rounded-2xl.border,
.fi-page-dashboard > .space-y-4 > .rounded-2xl.border,
.fi-dashboard-page > .space-y-4 > .rounded-2xl.bg-white,
.fi-page-dashboard > .space-y-4 > .rounded-2xl.bg-white,
.fi-dashboard-page > .space-y-4 > .rounded-2xl.border.bg-white,
.fi-page-dashboard > .space-y-4 > .rounded-2xl.border.bg-white {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.fi-dashboard-page > .space-y-4 > .rounded-2xl > .p-4,
.fi-page-dashboard > .space-y-4 > .rounded-2xl > .p-4 {
    padding: 0 !important;
}

.fi-dashboard-page .bg-white,
.fi-dashboard-page .bg-gray-50,
.fi-dashboard-page [class*="bg-white"],
.fi-dashboard-page [class*="bg-gray-50"],
.fi-page-dashboard .bg-white,
.fi-page-dashboard .bg-gray-50,
.fi-page-dashboard [class*="bg-white"],
.fi-page-dashboard [class*="bg-gray-50"] {
    background-color: transparent !important;
}

.fi-dashboard-page .fi-wi-stats-overview-stat,
.fi-dashboard-page .fi-section,
.fi-dashboard-page .fi-wi-chart,
.fi-dashboard-page .fi-ta-ctn,
.fi-page-dashboard .fi-wi-stats-overview-stat,
.fi-page-dashboard .fi-section,
.fi-page-dashboard .fi-wi-chart,
.fi-page-dashboard .fi-ta-ctn {
    background: linear-gradient(180deg, rgba(20, 29, 45, 0.98), rgba(15, 23, 42, 0.98)) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    border-radius: 1rem !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36) !important;
    color: #e5edf8 !important;
}

/* Restore the normal light dashboard when the user toggles out of dark mode. */
html:not(.dark) body:has(.fi-dashboard-page),
html:not(.dark) body:has(.fi-page-dashboard),
html:not(.dark) body:has(.fi-dashboard-page) .fi-main,
html:not(.dark) body:has(.fi-page-dashboard) .fi-main,
html:not(.dark) body:has(.fi-dashboard-page) .fi-main-ctn,
html:not(.dark) body:has(.fi-page-dashboard) .fi-main-ctn {
    background: #f8fafc !important;
    color: #0f172a !important;
}

html:not(.dark) .fi-dashboard-page,
html:not(.dark) .fi-page-dashboard {
    color: #0f172a !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-stats-overview-stat,
html:not(.dark) .fi-dashboard-page .fi-section,
html:not(.dark) .fi-dashboard-page .fi-wi-chart,
html:not(.dark) .fi-dashboard-page .fi-ta-ctn,
html:not(.dark) .fi-page-dashboard .fi-wi-stats-overview-stat,
html:not(.dark) .fi-page-dashboard .fi-section,
html:not(.dark) .fi-page-dashboard .fi-wi-chart,
html:not(.dark) .fi-page-dashboard .fi-ta-ctn {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-stats-overview-stat-label,
html:not(.dark) .fi-dashboard-page .fi-wi-stats-overview-stat-description,
html:not(.dark) .fi-dashboard-page .fi-section-header-description,
html:not(.dark) .fi-page-dashboard .fi-wi-stats-overview-stat-label,
html:not(.dark) .fi-page-dashboard .fi-wi-stats-overview-stat-description,
html:not(.dark) .fi-page-dashboard .fi-section-header-description {
    color: #64748b !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-stats-overview-stat-value,
html:not(.dark) .fi-dashboard-page .fi-section-header-heading,
html:not(.dark) .fi-dashboard-page .fi-wi-chart-heading,
html:not(.dark) .fi-page-dashboard .fi-wi-stats-overview-stat-value,
html:not(.dark) .fi-page-dashboard .fi-section-header-heading,
html:not(.dark) .fi-page-dashboard .fi-wi-chart-heading {
    color: #111827 !important;
}

html:not(.dark) .fi-dashboard-page .fi-input-wrp,
html:not(.dark) .fi-dashboard-page .fi-select-input,
html:not(.dark) .fi-dashboard-page .ts-control,
html:not(.dark) .fi-page-dashboard .fi-input-wrp,
html:not(.dark) .fi-page-dashboard .fi-select-input,
html:not(.dark) .fi-page-dashboard .ts-control {
    background: #ffffff !important;
    border-color: #dbe3ef !important;
    color: #111827 !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content,
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content {
    background: transparent !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div,
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div {
    border: 1px solid #e5e7eb !important;
    color: #334155 !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(1),
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(1) {
    background: #eff6ff !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(2),
html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(6),
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(2),
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(6) {
    background: #ecfdf5 !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(3),
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(3) {
    background: #fef2f2 !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(4),
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(4) {
    background: #faf5ff !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(5),
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div:nth-child(5) {
    background: #fffbeb !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div .text-2xl,
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div .text-2xl {
    color: #111827 !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-weekly-summary .fi-section-content > div.grid > div .text-sm,
html:not(.dark) .fi-page-dashboard .fi-wi-weekly-summary .fi-section-content > div.grid > div .text-sm {
    color: #475569 !important;
}

html:not(.dark) .fi-dashboard-page thead,
html:not(.dark) .fi-page-dashboard thead,
html:not(.dark) .fi-dashboard-page table thead tr,
html:not(.dark) .fi-page-dashboard table thead tr,
html:not(.dark) .fi-dashboard-page .fi-wi-recent-activity thead,
html:not(.dark) .fi-page-dashboard .fi-wi-recent-activity thead,
html:not(.dark) .fi-dashboard-page .fi-wi-recent-activity table thead tr,
html:not(.dark) .fi-page-dashboard .fi-wi-recent-activity table thead tr {
    background: #f8fafc !important;
    border-color: #e5e7eb !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-recent-activity th,
html:not(.dark) .fi-page-dashboard .fi-wi-recent-activity th {
    color: #475569 !important;
}

html:not(.dark) .fi-dashboard-page .fi-wi-recent-activity tbody tr,
html:not(.dark) .fi-page-dashboard .fi-wi-recent-activity tbody tr {
    background: #ffffff !important;
    border-color: #eef2f7 !important;
}

html.dark .fi-dashboard-page .fi-wi-recent-activity th,
html.dark .fi-page-dashboard .fi-wi-recent-activity th,
html.dark .fi-dashboard-page .fi-wi-recent-activity td,
html.dark .fi-page-dashboard .fi-wi-recent-activity td,
html.dark .fi-dashboard-page .fi-wi-recent-activity td span,
html.dark .fi-page-dashboard .fi-wi-recent-activity td span,
html.dark .fi-dashboard-page .fi-wi-recent-activity td a,
html.dark .fi-page-dashboard .fi-wi-recent-activity td a {
    color: #f8fafc !important;
}

html.dark .fi-dashboard-page .fi-wi-recent-activity tbody tr,
html.dark .fi-page-dashboard .fi-wi-recent-activity tbody tr {
    border-color: rgba(148, 163, 184, 0.16) !important;
}

/* ──────────────────────────────────────────────────────────────────────────
   Responsive layout fixes (shared — applies to every panel page)

   The sidebar is position:fixed (viewport-relative). A long page-header action
   row (Application Inquiry / Full Application / Candidate detail pages have
   many actions) was a `flex shrink-0` row that did not wrap, forcing the page
   wider than the viewport. That horizontal overflow slid content under the
   fixed sidebar. Fix: let content shrink and let actions/tabs/tables wrap or
   scroll internally so the page never overflows horizontally.
   ────────────────────────────────────────────────────────────────────────── */

/* Allow the main content + page wrappers to shrink (flexbox min-width:auto
   default otherwise lets a wide child push the whole page wider). */
.fi-main,
.fi-page,
.crm-main-content {
    min-width: 0;
    max-width: 100%;
}

/* Page header: heading + actions wrap instead of overflowing off-screen /
   under the sidebar. Important actions stay visible (they wrap, never hidden). */
.fi-header {
    flex-wrap: wrap;
}
.fi-header > div:last-child {
    flex-shrink: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.fi-header .fi-ac {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

/* Tabs: scroll horizontally on smaller widths rather than overflow / hide. */
.fi-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}
.fi-tabs::-webkit-scrollbar {
    height: 6px;
}

/* Wide tables scroll within their container instead of widening the page. */
.fi-ta-ctn,
.fi-ta-content {
    overflow-x: auto;
}

/* Desktop offset fallback: if Alpine has not yet applied the inline margin-left
   to the main content wrapper (slow boot), keep it clear of the fixed 290px
   sidebar so content never starts behind it. Once Alpine sets the inline
   margin-left, this selector no longer matches and the reactive value wins. */
@media (min-width: 1024px) {
    .crm-main-content:not([style*="margin-left"]) {
        margin-left: 290px;
    }
}
