/* ── Readonly form inputs — muted background to distinguish from editable fields ── */
.fi-input-wrp:has(input[readonly]) {
    background-color: #f3f4f6 !important; /* gray-100 */
    cursor: default;
}
.dark .fi-input-wrp:has(input[readonly]) {
    background-color: rgba(31, 41, 55, 0.55) !important; /* gray-800/55 */
}

/* ── Invoice Items Repeater (edit/create form) — alternating row colors ── */
.invoice-items-repeater .fi-fo-repeater-item:nth-child(odd) {
    background-color: #ecfdf5;
}
.invoice-items-repeater .fi-fo-repeater-item:nth-child(even) {
    background-color: #ffffff;
}
.dark .invoice-items-repeater .fi-fo-repeater-item:nth-child(odd) {
    background-color: rgba(16, 185, 129, 0.07);
}
.dark .invoice-items-repeater .fi-fo-repeater-item:nth-child(even) {
    background-color: transparent;
}

/* ── Invoice Items View (infolist) — alternating row colors ── */
.invoice-items-view tbody tr:nth-child(odd) {
    background-color: #ecfdf5;
}
.invoice-items-view tbody tr:nth-child(even) {
    background-color: #ffffff;
}
.dark .invoice-items-view tbody tr:nth-child(odd) {
    background-color: rgba(16, 185, 129, 0.07);
}
.dark .invoice-items-view tbody tr:nth-child(even) {
    background-color: transparent;
}

/* ── Print: normalize row colors ── */
@media print {
    .invoice-items-repeater .fi-fo-repeater-item:nth-child(odd),
    .invoice-items-repeater .fi-fo-repeater-item:nth-child(even) {
        background-color: transparent !important;
    }
    .invoice-items-view tbody tr:nth-child(odd),
    .invoice-items-view tbody tr:nth-child(even) {
        background-color: transparent !important;
    }
}



/* ==========================================================================
   OVERSCROLL — disable rubber-band scroll so the page cannot be pulled past
   the top edge (prevents white flash above the sticky topbar)
   ========================================================================== */

html.fi,
html.fi body.fi-body {
    overscroll-behavior-y: none;
}

/* ==========================================================================
   BRAND HEADER — dark emerald, all themes (Smart Aviation identity)
   ========================================================================== */

/* Topbar */
.fi-topbar,
.fi-topbar-ctn {
    background: linear-gradient(to right, #065f46, #064e3b) !important;
    border-bottom: 1px solid #047857 !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2) !important;
}
/* Sidebar header */
.fi-sidebar-header,
.fi-sidebar-header-ctn {
    background: linear-gradient(to right, #065f46, #064e3b) !important;
    border-bottom: 1px solid #047857 !important;
}
/* Icons/buttons in topbar — white for dark header */
.fi-topbar svg {
    stroke: rgba(255, 255, 255, 0.85) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
/* Explicit transparent so no stray circular backgrounds appear */
.fi-topbar button,
.fi-topbar .fi-icon-btn {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
.fi-topbar button:hover,
.fi-topbar .fi-icon-btn:hover,
.fi-topbar a:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
}
/* Hide any Filament built-in color-scheme toggler */
.fi-color-scheme-switcher,
[x-data*="colorScheme"] {
    display: none !important;
}

/* ── Brand component (logo + text) ── */
.fi-logo {
    height: auto !important;
}
.sf-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.sf-brand-logo {
    background: #ffffff;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.sf-brand-logo:hover {
    background: #f3f4f6;
}
.sf-brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.sf-brand-name {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}
.sf-brand-line1 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0em;
}
.sf-brand-line2 {
    font-size: 16px;
    font-weight: 700;
    color: #34d399;
    letter-spacing: 0em;
}

/* ── User menu button — match smart-avi-part style ── */
.fi-topbar .fi-user-menu-trigger {
    background-color: rgba(5, 150, 105, 0.5) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    gap: 8px !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    color: rgba(255, 255, 255, 0.9) !important;
}
.fi-topbar .fi-user-menu-trigger:hover {
    background-color: #059669 !important;
}
/* Avatar — 28px circle matching smart-avi-part */
.fi-topbar .fi-user-avatar,
.fi-topbar .fi-avatar.fi-user-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
    object-fit: cover !important;
}
/* Username text in trigger */
.fi-topbar .fi-user-menu-trigger-text {
    color: #ffffff !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}
/* Chevron in trigger */
.fi-topbar .fi-user-menu-trigger svg {
    width: 16px !important;
    height: 16px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    stroke: rgba(255, 255, 255, 0.7) !important;
}


/* ==========================================================================
   SMART AVIATION THEME
   Applied via: html.theme-smart (on top of html.dark)
   Palette: deep aviation navy — cockpit at night, Smart-green signature
   ========================================================================== */

/* ── FOUNDATION ── */
html.theme-smart,
html.theme-smart body,
html.theme-smart .fi-body {
    background-color: #0d1f38 !important;
}

/* ── SIDEBAR ── */
html.theme-smart .fi-sidebar-nav {
    background-color: #071524 !important;
    border-right-color: #0d3320 !important;
    border-right-width: 1px !important;
}
html.theme-smart .fi-sidebar-header,
html.theme-smart .fi-sidebar-header-ctn {
    background: linear-gradient(to right, #047857, #064e3b) !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.3) !important;
}
html.theme-smart .fi-sidebar-footer {
    background-color: #071524 !important;
    border-top-color: #0d3320 !important;
}
html.theme-smart .fi-sidebar-group-label {
    color: #3a8060 !important;
    letter-spacing: 0.06em;
    font-weight: 600 !important;
}
html.theme-smart .fi-sidebar-item-btn {
    color: #8ab8a0 !important;
}
html.theme-smart .fi-sidebar-item-btn:hover {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #d1fae5 !important;
}
html.theme-smart .fi-sidebar-item-btn[aria-current="page"] {
    background-color: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    border-left: 3px solid #10b981 !important;
}
html.theme-smart .fi-sidebar-item-label {
    color: inherit !important;
}
/* Group btn (collapsed nav group toggle) */
html.theme-smart .fi-sidebar-group-btn:hover {
    background-color: rgba(16, 185, 129, 0.08) !important;
}

/* ── TOPBAR (Smart theme — slightly deeper gradient) ── */
html.theme-smart .fi-topbar,
html.theme-smart .fi-topbar-ctn {
    background: linear-gradient(to right, #047857, #064e3b) !important;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.25) !important;
}

/* ── MAIN CONTENT ── */
html.theme-smart .fi-main,
html.theme-smart .fi-main-ctn,
html.theme-smart .fi-page-main {
    background-color: #0d1f38 !important;
}

/* ── PAGE HEADER ── */
html.theme-smart .fi-header {
    background-color: #0d1f38 !important;
    border-bottom-color: #1a3553 !important;
}

/* ── SECTIONS / PANELS ── */
html.theme-smart .fi-section {
    background-color: #1a3554 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}
html.theme-smart .fi-section-header {
    background-color: #152c48 !important;
    border-bottom-color: #2a4d70 !important;
}
html.theme-smart .fi-section-header-heading {
    color: #c8dff0 !important;
}
html.theme-smart .fi-section-header-description {
    color: #5b8ab0 !important;
}

/* ── TABLES ── */
html.theme-smart .fi-ta-ctn {
    background-color: #1a3554 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 6px 28px rgba(0, 0, 0, 0.4) !important;
}
/* fi-ta-panel is the column-layout panel — same treatment */
html.theme-smart .fi-ta-panel {
    background-color: #1a3554 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 6px 28px rgba(0, 0, 0, 0.4) !important;
}
/* fi-ta-main fills the full card — clip it so children can't escape the
   parent's rounded corners even if the browser doesn't propagate
   overflow:hidden through the flex subtree. */
html.theme-smart .fi-ta-ctn > .fi-ta-main {
    border-radius: 12px !important;
    overflow: hidden !important;
}
/* The toolbar / header-ctn is the topmost visible element in the card.
   Give it rounded top corners directly so the card LOOKS rounded at the
   top regardless of overflow propagation. */
html.theme-smart .fi-ta-header,
html.theme-smart .fi-ta-header-ctn {
    background-color: #152c48 !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border-bottom-color: #2a4d70 !important;
}
/* Toolbar row (search bar, column manager) — has its own bottom border */
html.theme-smart .fi-ta-header-toolbar {
    background-color: #152c48 !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border-color: #2a4d70 !important;
}
/* Content-ctn top border + divide-y between sections */
html.theme-smart .fi-ta-content-ctn {
    border-top-color: #2a4d70 !important;
}
html.theme-smart .fi-ta-content-ctn > * {
    border-color: #2a4d70 !important;
}
/* Column header row — set the ROW itself to #0f2338 so the checkbox
   column (left) and empty actions area (right) match the labeled cells.
   Previously #152c48 on the row vs #0f2338 on cells created a mismatch. */
html.theme-smart .fi-ta-content-ctn .fi-ta-content-header {
    background-color: #0f2338 !important;
    border-color: #2a4d70 !important;
}
/* Pagination row — override Filament's dark-mode border and give it
   the correct card background so it blends with the table card. */
html.theme-smart .fi-ta-ctn .fi-pagination {
    background-color: #1a3554 !important;
    border-top-color: #2a4d70 !important;
}
/* Pagination page-number buttons list — has its own white/translucent bg */
html.theme-smart .fi-pagination .fi-pagination-items {
    background-color: #0f2338 !important;
    --tw-ring-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70 !important;
}
html.theme-smart .fi-pagination .fi-pagination-item {
    border-color: #2a4d70 !important;
}
html.theme-smart .fi-pagination .fi-pagination-item.fi-active .fi-pagination-item-btn {
    background-color: rgba(16, 185, 129, 0.15) !important;
}
html.theme-smart .fi-pagination .fi-pagination-item.fi-active .fi-pagination-item-label {
    color: #34d399 !important;
}
html.theme-smart .fi-pagination .fi-pagination-overview {
    color: #7fa3c7 !important;
}
html.theme-smart .fi-ta-header-heading {
    color: #c8dff0 !important;
}
html.theme-smart .fi-ta-header-cell {
    background-color: #0f2338 !important;
    border-color: #2a4d70 !important;
    color: #7fa3c7 !important;
}
html.theme-smart .fi-ta-content {
    background-color: #1a3554 !important;
}
html.theme-smart .fi-ta-main table tr td {
    border-color: #1e3e60 !important;
}
html.theme-smart .fi-ta-main table tbody tr:hover td {
    background-color: rgba(30, 70, 110, 0.5) !important;
}
html.theme-smart .fi-ta-empty-state-content {
    color: #5b8ab0 !important;
}

/* ── FORM ELEMENTS ── */
html.theme-smart .fi-input,
html.theme-smart .fi-select-input,
html.theme-smart .fi-textarea {
    background-color: #0f2338 !important;
    border-color: #2a4d70 !important;
    color: #e2f0fb !important;
}
html.theme-smart .fi-input:focus,
html.theme-smart .fi-select-input:focus,
html.theme-smart .fi-textarea:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4) !important;
}
html.theme-smart .fi-input-wrp {
    background-color: #0f2338 !important;
    border-color: #2a4d70 !important;
    /* override Filament dark-mode ring (rgba(255,255,255,0.2)) */
    --tw-ring-color: #2a4d70 !important;
}
/* Divider between prefix label and input — dark-mode uses rgba(255,255,255,0.1)
   which is nearly invisible on Smart theme. Use the same border palette. */
html.theme-smart .fi-input-wrp .fi-input-wrp-prefix:not(.fi-inline) {
    border-color: #2a4d70 !important;
}
/* "Per page" prefix text color */
html.theme-smart .fi-input-wrp .fi-input-wrp-prefix {
    color: #7fa3c7 !important;
}
html.theme-smart .fi-input-wrp .fi-input-wrp-suffix {
    color: #7fa3c7 !important;
    border-color: #2a4d70 !important;
}
html.theme-smart .fi-fo-field-label-content {
    color: #7fa3c7 !important;
}

/* ── WIDGETS (account, etc.) ── */
html.theme-smart .fi-wi-account {
    background-color: #1a3554 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* ── PRIMARY BUTTONS: light mode — Filament's contrast algo picks emerald-400
   bg (too light) with dark text. Force dark green + white text. ── */
html:not(.dark) .fi-btn.fi-color-primary:not(.fi-outlined) {
    background-color: #059669 !important;
    color: #ffffff !important;
}
html:not(.dark) .fi-btn.fi-color-primary:not(.fi-outlined):hover {
    background-color: #047857 !important;
    color: #ffffff !important;
}

/* ── DROPDOWN ICONS: light mode — Filament's gray-400 (slate ~#94a3b8) has
   2.28:1 contrast on white, making icons appear invisible. Force gray-700. ── */
html:not(.dark) .fi-dropdown-list-item > .fi-icon,
html:not(.dark) .fi-dropdown-panel .fi-icon {
    color: #374151 !important;
}

/* ── DROPDOWNS ── */
html.theme-smart .fi-dropdown-panel {
    background-color: #1a3554 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

/* ── MODALS ── */
html.theme-smart .fi-modal-window {
    background-color: #1a3554 !important;
    border-color: #2a4d70 !important;
}
html.theme-smart .fi-modal-header {
    background-color: #152c48 !important;
    border-bottom-color: #2a4d70 !important;
}

/* ── BADGES ── */
html.theme-smart .fi-badge {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ── SCROLLBAR ── */
html.theme-smart ::-webkit-scrollbar-track {
    background: #0a1a2e;
}
html.theme-smart ::-webkit-scrollbar-thumb {
    background: #1e3e60;
    border-radius: 4px;
}
html.theme-smart ::-webkit-scrollbar-thumb:hover {
    background: #2a5280;
}

/* ── THEME MENU (inside profile dropdown) ── */
.sf-theme-menu-group {
    padding: 6px 8px 8px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.dark .sf-theme-menu-group {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
.sf-theme-menu-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px;
    flex: 1;
    padding: 8px 4px;
    border-radius: 10px;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    transition: background-color 0.12s ease;
    text-align: center;
    position: relative;
    width: auto !important;
}
.sf-theme-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}
.dark .sf-theme-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
}
.sf-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1.5px solid transparent;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
/* Light mode: add visible border so icon box is clear on white bg */
.sf-icon-light {
    background: #fef3c7;
    color: #d97706;
    border-color: #fcd34d;
}
.sf-icon-light svg { stroke: #d97706 !important; }
.sf-icon-dark {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}
.sf-icon-dark svg { stroke: #94a3b8 !important; }
.sf-icon-smart {
    background: #d1fae5;
    color: #059669;
    border-color: #6ee7b7;
}
.sf-icon-smart svg { stroke: #059669 !important; }
.dark .sf-icon-light { background: rgba(251,191,36,0.18); border-color: rgba(251,191,36,0.3); }
.dark .sf-icon-dark  { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.25); }
.dark .sf-icon-smart { background: rgba(16,185,129,0.18); border-color: rgba(16,185,129,0.3); }

/* Active state: ring around icon */
.sf-theme-menu-item.sf-menu-active .sf-icon-light {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217,119,6,0.25);
}
.sf-theme-menu-item.sf-menu-active .sf-icon-dark {
    border-color: #64748b;
    box-shadow: 0 0 0 2px rgba(100,116,139,0.3);
}
.sf-theme-menu-item.sf-menu-active .sf-icon-smart {
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(5,150,105,0.3);
}

.sf-menu-text {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1;
}
.dark .sf-menu-text {
    color: #9ca3af;
}
.sf-theme-menu-item.sf-menu-active .sf-menu-text {
    color: #059669;
    font-weight: 600;
}
.dark .sf-theme-menu-item.sf-menu-active .sf-menu-text {
    color: #34d399;
}
.sf-menu-check { display: none; }
.sf-theme-menu-divider {
    height: 1px;
    background: rgba(0,0,0,0.08);
    margin: 8px 4px 4px;
}
.dark .sf-theme-menu-divider {
    background: rgba(255,255,255,0.08);
}

/* ── STAT CARDS (all themes) ── */
.sf-stat-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    perspective: 1000px;
    perspective-origin: 50% 0%;
}
@media (min-width: 640px) {
    .sf-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .sf-stat-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Base card */
.sf-stat-card {
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 128px;
    position: relative;
    overflow: hidden;
}

/* Gradient color variants — !important to override Filament dark-mode bg */
.sf-stat-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important; }
.sf-stat-amber   { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important; }
.sf-stat-rose    { background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important; }
.sf-stat-sky     { background: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%) !important; }
.sf-stat-violet  { background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%) !important; }
.sf-stat-teal    { background: linear-gradient(135deg, #2dd4bf 0%, #0f766e 100%) !important; }

/* Decorative corner circle */
.sf-card-circle {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    pointer-events: none;
}

/* Content wrapper — sits above the circle */
.sf-stat-content {
    position: relative;
    z-index: 1;
}

/* Icon row: icon box + badge side by side */
.sf-stat-icon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Frosted-glass icon box — fixed 44 × 44 so SVG can't escape */
.sf-stat-icon-box {
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sf-stat-icon-box svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    color: #ffffff !important;
    stroke: #ffffff !important;
    flex-shrink: 0;
}

/* Badge / label next to icon */
.sf-stat-badge {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.05em;
}

/* Pulse dots (shown when overdue > 0) */
.sf-pulse-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}
.sf-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: sf-pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes sf-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.75); }
}

/* Text */
.sf-stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.70);
}
.sf-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-top: 2px;
    letter-spacing: -0.02em;
}
.sf-stat-desc {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.60);
    margin-top: 4px;
}

/* ── 3-D hover effect ── */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-3d:hover {
    transform: translateY(-8px) rotateX(5deg);
}
.hover-glow:hover {
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.35) !important;
}

/* ── Staggered fade-in animation ── */
@keyframes sf-fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0);    }
}
.animate-on-load {
    opacity: 0;
    animation: sf-fadeInUp 0.55s ease-out forwards;
}
.sf-stat-grid .animate-on-load:nth-child(1) { animation-delay: 0.05s; }
.sf-stat-grid .animate-on-load:nth-child(2) { animation-delay: 0.15s; }
.sf-stat-grid .animate-on-load:nth-child(3) { animation-delay: 0.25s; }
.sf-stat-grid .animate-on-load:nth-child(4) { animation-delay: 0.35s; }
.sf-stat-grid .animate-on-load:nth-child(5) { animation-delay: 0.45s; }
.sf-stat-grid .animate-on-load:nth-child(6) { animation-delay: 0.55s; }

/* ── Particle canvas ── */
.sf-particles-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.20;
}

/* ==========================================================================
   REPORT PAGES — theme-aware primitives
   Classes: sf-report-* used in revenue-report, aging-report, tax-report
   Light → white cards  |  Dark → gray-900  |  Smart → navy blue palette
   ========================================================================== */

/* Filter label */
.sf-report-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #374151;
}
.dark .sf-report-label { color: #d1d5db; }
html.theme-smart .sf-report-label { color: #7fa3c7 !important; }

/* Filter <select> / <input> — full-width within its grid cell */
.sf-report-select {
    display: block;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #111827;
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.sf-report-select:focus { border-color: #10b981; box-shadow: 0 0 0 1px rgba(16,185,129,0.3); }
.dark .sf-report-select { background-color: #1f2937; border-color: #374151; color: #f9fafb; }
html.theme-smart .sf-report-select { background-color: #0f2338 !important; border-color: #2a4d70 !important; color: #e2f0fb !important; }

/* Small stat summary card */
.sf-report-stat {
    border-radius: 12px;
    padding: 16px 20px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    min-width: 0; /* allow shrinking inside grid on mobile */
}
.dark .sf-report-stat { background-color: #1f2937; border-color: #374151; }
html.theme-smart .sf-report-stat {
    background-color: #152c48 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* Stat card value (main number) — responsive font, allows long IDR strings to wrap */
.sf-report-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    overflow-wrap: anywhere;
    margin-top: 2px;
}
@media (min-width: 640px) { .sf-report-stat-value { font-size: 17px; } }
@media (min-width: 1024px) { .sf-report-stat-value { font-size: 20px; } }
.dark .sf-report-stat-value { color: #f9fafb; }
html.theme-smart .sf-report-stat-value { color: #c8dff0 !important; }

/* Stat card label (uppercase, muted) */
.sf-report-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 4px;
}
.dark .sf-report-stat-label { color: #9ca3af; }
html.theme-smart .sf-report-stat-label { color: #7fa3c7 !important; }

/* Grand Total card — visually distinct: stronger border, bolder label */
.sf-report-stat-grand {
    border-color: #9ca3af;
    border-width: 2px;
}
.dark .sf-report-stat-grand { border-color: #6b7280; }
html.theme-smart .sf-report-stat-grand { border-color: #5b8ab0 !important; border-width: 2px !important; }
.sf-report-stat-grand .sf-report-stat-label { color: #374151; font-weight: 700; }
.dark .sf-report-stat-grand .sf-report-stat-label { color: #e5e7eb; }
html.theme-smart .sf-report-stat-grand .sf-report-stat-label { color: #c8dff0 !important; }

/* Stat card description text */
.sf-report-stat-desc {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}
html.theme-smart .sf-report-stat-desc { color: #5b8ab0 !important; }

/* Section / table card container */
.sf-report-section {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dark .sf-report-section { background-color: #1f2937; border-color: #374151; }
html.theme-smart .sf-report-section {
    background-color: #1a3554 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 6px 28px rgba(0,0,0,0.4) !important;
}

/* Section header bar */
.sf-report-section-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dark .sf-report-section-header { border-bottom-color: #374151; }
html.theme-smart .sf-report-section-header {
    background-color: #152c48 !important;
    border-bottom-color: #2a4d70 !important;
}

/* Section title */
.sf-report-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}
.dark .sf-report-section-title { color: #f9fafb; }
html.theme-smart .sf-report-section-title { color: #c8dff0 !important; }

/* Small count/badge beside the title */
.sf-report-count {
    font-size: 13px;
    color: #6b7280;
}
.dark .sf-report-count { color: #9ca3af; }
html.theme-smart .sf-report-count { color: #5b8ab0 !important; }

/* Table base — min-width forces horizontal scroll on small viewports */
.sf-report-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }

/* Table — header cells */
.sf-report-table thead th {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.dark .sf-report-table thead th {
    color: #9ca3af;
    background-color: #111827;
    border-bottom-color: #374151;
}
html.theme-smart .sf-report-table thead th {
    color: #7fa3c7 !important;
    background-color: #0f2338 !important;
    border-bottom-color: #2a4d70 !important;
}

/* Table — column group label row (sits above main header row) */
.sf-report-table thead tr.sf-group-row th {
    padding: 5px 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    background-color: #f3f4f6;
    border-bottom: none;
}
.dark .sf-report-table thead tr.sf-group-row th {
    color: #6b7280;
    background-color: #0d1117;
    border-bottom: none;
}
html.theme-smart .sf-report-table thead tr.sf-group-row th {
    color: #5b7fa0 !important;
    background-color: #091929 !important;
    border-bottom: none !important;
}

/* Table — vertical separator between column groups */
.sf-report-table .sf-col-group-border {
    border-right: 1px solid #e5e7eb;
}
.dark .sf-report-table .sf-col-group-border {
    border-right-color: #374151;
}
html.theme-smart .sf-report-table .sf-col-group-border {
    border-right-color: #2a4d70 !important;
}

/* Table — prevent wrapping on all cells by default; use sf-col-wrap to opt out */
.sf-report-table thead th { white-space: nowrap; }
.sf-report-table tbody td { white-space: nowrap; }
.sf-report-table tfoot td { white-space: nowrap; }
.sf-report-table .sf-col-wrap { white-space: normal; min-width: 140px; }
/* Group label row headers are centred spans — allow them to display normally */
.sf-report-table thead tr.sf-group-row th { white-space: normal; }

/* Table — body rows */
.sf-report-table tbody tr { border-bottom: 1px solid #f3f4f6; transition: background-color 0.1s; }
.dark .sf-report-table tbody tr { border-bottom-color: #374151; }
html.theme-smart .sf-report-table tbody tr { border-bottom-color: #1e3e60 !important; }

.sf-report-table tbody tr:last-child { border-bottom: none; }
.sf-report-table tbody tr:hover { background-color: #f9fafb; }
.dark .sf-report-table tbody tr:hover { background-color: rgba(55,65,81,0.5); }
html.theme-smart .sf-report-table tbody tr:hover { background-color: rgba(30,70,110,0.5) !important; }

/* Table — body cells */
.sf-report-table tbody td { padding: 12px 20px; color: #374151; }
.dark .sf-report-table tbody td { color: #d1d5db; }
html.theme-smart .sf-report-table tbody td { color: #c8dff0 !important; }

/* Table — explicit color overrides must win over the Smart theme td rule */
html.theme-smart .sf-report-table tbody td .sf-keep-color,
html.theme-smart .sf-report-table tbody td span { color: inherit; }

/* Table — footer */
.sf-report-table tfoot tr {
    border-top: 2px solid #e5e7eb;
    background-color: #f9fafb;
}
.dark .sf-report-table tfoot tr { border-top-color: #374151; background-color: #111827; }
html.theme-smart .sf-report-table tfoot tr { border-top-color: #2a4d70 !important; background-color: #152c48 !important; }

.sf-report-table tfoot td { padding: 12px 20px; font-weight: 600; color: #111827; }
.dark .sf-report-table tfoot td { color: #f9fafb; }
html.theme-smart .sf-report-table tfoot td { color: #c8dff0 !important; }

/* Empty-state row */
.sf-report-empty { padding: 40px 20px; text-align: center; color: #9ca3af; }
html.theme-smart .sf-report-empty { color: #5b8ab0 !important; }

/* fi-in-table-repeatable tfoot — totals row matching thead style */
.fi-in-table-repeatable > table > tfoot > tr > th,
.fi-in-table-repeatable > table > tfoot > tr > td {
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    background-color: #f9fafb;
    border-top: 2px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}
.dark .fi-in-table-repeatable > table > tfoot > tr > th,
.dark .fi-in-table-repeatable > table > tfoot > tr > td {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    border-top-color: rgba(255, 255, 255, 0.1);
    text-align: left;
    vertical-align: middle;
}

/* Smart theme — fi-in-table-repeatable full override */
html.theme-smart .fi-in-table-repeatable > table {
    background-color: #112240 !important;
    --tw-ring-color: #1e3a5f !important;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.4), 0 0 0 1px #1e3a5f !important;
}
html.theme-smart .fi-in-table-repeatable > table > thead > tr > th {
    background-color: #0f2338 !important;
    color: #7fa3c7 !important;
    border-color: #1e3a5f !important;
}
html.theme-smart .fi-in-table-repeatable > table > tbody {
    border-color: #1e3e60 !important;
}
html.theme-smart .fi-in-table-repeatable > table > tbody > tr {
    border-color: #1e3e60 !important;
}
html.theme-smart .fi-in-table-repeatable > table > tbody > tr > td {
    color: #c8dff0 !important;
    border-color: #1e3e60 !important;
}
html.theme-smart .fi-in-table-repeatable > table > tfoot > tr > th,
html.theme-smart .fi-in-table-repeatable > table > tfoot > tr > td {
    color: #c8dff0 !important;
    background-color: #0f2338 !important;
    border-top-color: #2a4d70 !important;
    text-align: left !important;
    vertical-align: middle !important;
}



/* ── Button helpers for custom pages ── */
.sf-btn-primary {
    display: inline-flex; align-items: center; padding: 0.5rem 1.25rem;
    background-color: #10b981; color: #fff; font-size: 0.875rem;
    font-weight: 600; border-radius: 0.375rem; border: none; cursor: pointer;
    transition: background-color 0.15s;
}
.sf-btn-primary:hover { background-color: #059669; }
.sf-btn-secondary {
    display: inline-flex; align-items: center; padding: 0.5rem 1.25rem;
    background-color: transparent; color: #374151; font-size: 0.875rem;
    font-weight: 500; border-radius: 0.375rem; border: 1px solid #d1d5db; cursor: pointer;
    transition: background-color 0.15s;
}
.sf-btn-secondary:hover { background-color: #f3f4f6; }
.dark .sf-btn-secondary { color: #d1d5db; border-color: #374151; }
.dark .sf-btn-secondary:hover { background-color: #1f2937; }
html.theme-smart .sf-btn-primary { background-color: #1a6fa8 !important; }
html.theme-smart .sf-btn-primary:hover { background-color: #145a8a !important; }
html.theme-smart .sf-btn-secondary { color: #7fa3c7 !important; border-color: #2a4d70 !important; }


/* ═══════════════════════════════════════════════════════════════════════════
   MARKETING REVENUE PIPELINE WIDGET  (sf-pipeline-*)
   ═══════════════════════════════════════════════════════════════════════════ */

.sf-pipeline-header-icon {
    color: #10b981;
    flex-shrink: 0;
}
html.theme-smart .sf-pipeline-header-icon { color: #5b9bd5 !important; }

.sf-pipeline-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(16,185,129,0.1);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.2);
    white-space: nowrap;
    flex-shrink: 0;
}
html.theme-smart .sf-pipeline-badge {
    color: #5b9bd5 !important;
    background: rgba(26,111,168,0.15) !important;
    border-color: rgba(26,111,168,0.3) !important;
}

/* ── Stat Grid ── */
.sf-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #e5e7eb;
}
.dark .sf-pipeline-grid { border-top-color: #374151; }
html.theme-smart .sf-pipeline-grid { border-top-color: #2a4d70 !important; }

.sf-pipeline-stat {
    padding: 20px 22px;
    min-width: 0;
}

/* Desktop: cells 2-4 get left border */
@media (min-width: 768px) {
    .sf-pipeline-stat:not(:first-child) {
        border-left: 1px solid #e5e7eb;
    }
    .dark .sf-pipeline-stat:not(:first-child) { border-left-color: #374151; }
    html.theme-smart .sf-pipeline-stat:not(:first-child) { border-left-color: #2a4d70 !important; }
}

/* Mobile 2-col: evens get left border, 3rd+4th get top border */
@media (max-width: 767px) {
    .sf-pipeline-grid { grid-template-columns: repeat(2, 1fr); }

    .sf-pipeline-stat:nth-child(2),
    .sf-pipeline-stat:nth-child(4) {
        border-left: 1px solid #e5e7eb;
    }
    .dark .sf-pipeline-stat:nth-child(2),
    .dark .sf-pipeline-stat:nth-child(4) { border-left-color: #374151; }
    html.theme-smart .sf-pipeline-stat:nth-child(2),
    html.theme-smart .sf-pipeline-stat:nth-child(4) { border-left-color: #2a4d70 !important; }

    .sf-pipeline-stat:nth-child(3),
    .sf-pipeline-stat:nth-child(4) {
        border-top: 1px solid #e5e7eb;
    }
    .dark .sf-pipeline-stat:nth-child(3),
    .dark .sf-pipeline-stat:nth-child(4) { border-top-color: #374151; }
    html.theme-smart .sf-pipeline-stat:nth-child(3),
    html.theme-smart .sf-pipeline-stat:nth-child(4) { border-top-color: #2a4d70 !important; }
}

.sf-pipeline-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .sf-pipeline-stat-label { color: #9ca3af; }
html.theme-smart .sf-pipeline-stat-label { color: #7fa3c7 !important; }

.sf-pipeline-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.dark .sf-pipeline-stat-value { color: #f9fafb; }
html.theme-smart .sf-pipeline-stat-value { color: #c8dff0 !important; }

.sf-pipeline-stat-desc {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.45;
    overflow-wrap: break-word;
}
html.theme-smart .sf-pipeline-stat-desc { color: #5b8ab0 !important; }

/* ── Billing Coverage ── */
.sf-pipeline-coverage {
    padding: 14px 22px 18px;
    border-top: 1px solid #e5e7eb;
}
.dark .sf-pipeline-coverage { border-top-color: #374151; }
html.theme-smart .sf-pipeline-coverage { border-top-color: #2a4d70 !important; }

.sf-pipeline-coverage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.sf-pipeline-coverage-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}
.dark .sf-pipeline-coverage-label { color: #9ca3af; }
html.theme-smart .sf-pipeline-coverage-label { color: #7fa3c7 !important; }

.sf-pipeline-coverage-value {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}
.dark .sf-pipeline-coverage-value { color: #f9fafb; }
html.theme-smart .sf-pipeline-coverage-value { color: #c8dff0 !important; }

.sf-pipeline-coverage-sub {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}
html.theme-smart .sf-pipeline-coverage-sub { color: #5b8ab0 !important; }

.sf-pipeline-progress {
    height: 7px;
    background: rgba(156,163,175,0.2);
    border-radius: 99px;
    overflow: hidden;
}
.dark .sf-pipeline-progress { background: rgba(55,65,81,0.5); }
html.theme-smart .sf-pipeline-progress { background: rgba(42,77,112,0.4) !important; }

.sf-pipeline-progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* Pipeline period tabs — pill style */
.sf-pipeline-tabs {
    display: flex;
    gap: 4px;
}
.sf-pipeline-tab {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 99px;
    border: 1px solid transparent;
    cursor: pointer;
    color: #6b7280;
    background: transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    line-height: 1.5;
    letter-spacing: 0.01em;
}
.sf-pipeline-tab:hover {
    color: #374151;
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.sf-pipeline-tab--active {
    color: #065f46;
    background: #d1fae5;
    border-color: #6ee7b7;
    font-weight: 600;
}

.dark .sf-pipeline-tab { color: #9ca3af; }
.dark .sf-pipeline-tab:hover { color: #e5e7eb; background: #374151; border-color: #4b5563; }
.dark .sf-pipeline-tab--active { color: #34d399; background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.35); }

html.theme-smart .sf-pipeline-tab { color: #7fa3c7 !important; }
html.theme-smart .sf-pipeline-tab:hover { color: #c8dff0 !important; background: rgba(42,77,112,0.35) !important; border-color: rgba(42,77,112,0.6) !important; }
html.theme-smart .sf-pipeline-tab--active { color: #34d399 !important; background: rgba(52,211,153,0.12) !important; border-color: rgba(52,211,153,0.35) !important; }
html.theme-smart .sf-pipeline-progress-fill { background: #1a6fa8 !important; }


/* ═══════════════════════════════════════════════════════════════════════════
   EXECUTIVE ANALYTICS WIDGET  (sf-exec-*)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Outer wrapper ── */
.sf-exec-widget {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Widget header bar ── */
.sf-exec-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dark .sf-exec-widget-header { background: #1f2937; border-color: #374151; }
html.theme-smart .sf-exec-widget-header {
    background: #152c48 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 4px 20px rgba(0,0,0,0.35) !important;
}

.sf-exec-widget-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sf-exec-widget-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(16,185,129,0.12);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
html.theme-smart .sf-exec-widget-icon { background: rgba(26,111,168,0.2) !important; color: #5b9bd5 !important; }

.sf-exec-widget-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}
.dark .sf-exec-widget-title { color: #f9fafb; }
html.theme-smart .sf-exec-widget-title { color: #c8dff0 !important; }

.sf-exec-widget-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.dark .sf-exec-widget-subtitle { color: #9ca3af; }
html.theme-smart .sf-exec-widget-subtitle { color: #7fa3c7 !important; }

.sf-exec-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #10b981;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 6px;
    padding: 3px 10px;
}
html.theme-smart .sf-exec-badge {
    color: #5b9bd5 !important;
    background: rgba(26,111,168,0.15) !important;
    border-color: rgba(26,111,168,0.35) !important;
}

/* ── KPI Strip ── */
.sf-exec-kpi-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dark .sf-exec-kpi-strip { background: #1f2937; border-color: #374151; }
html.theme-smart .sf-exec-kpi-strip {
    background: #1a3554 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 4px 20px rgba(0,0,0,0.35) !important;
}

.sf-exec-kpi { padding: 20px 24px 18px; }

.sf-exec-kpi-sep { border-left: 1px solid #e5e7eb; }
.dark .sf-exec-kpi-sep { border-left-color: #374151; }
html.theme-smart .sf-exec-kpi-sep { border-left-color: #2a4d70 !important; }

.sf-exec-kpi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
    margin-bottom: 6px;
}
.dark .sf-exec-kpi-label { color: #9ca3af; }
html.theme-smart .sf-exec-kpi-label { color: #7fa3c7 !important; }

.sf-exec-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}
.dark .sf-exec-kpi-value { color: #f9fafb; }
html.theme-smart .sf-exec-kpi-value { color: #c8dff0 !important; }

.sf-exec-kpi-progress {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.dark .sf-exec-kpi-progress { background: #374151; }
html.theme-smart .sf-exec-kpi-progress { background: #2a4d70 !important; }

.sf-exec-kpi-progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 2px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
html.theme-smart .sf-exec-kpi-progress-fill { background: #1a6fa8 !important; }

.sf-exec-kpi-sub-spacer { height: 12px; }

.sf-exec-kpi-sub {
    font-size: 11px;
    color: #9ca3af;
}
html.theme-smart .sf-exec-kpi-sub { color: #5b8ab0 !important; }

/* ── Charts grid ── */
.sf-exec-charts-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
}
@media (max-width: 1023px) {
    .sf-exec-charts-grid { grid-template-columns: 1fr; }
}

.sf-exec-chart-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dark .sf-exec-chart-panel { background: #1f2937; border-color: #374151; }
html.theme-smart .sf-exec-chart-panel {
    background: #1a3554 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 4px 20px rgba(0,0,0,0.35) !important;
}

/* ── Chart card header (shared by all panels) ── */
.sf-exec-chart-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.dark .sf-exec-chart-header { border-bottom-color: #374151; }
html.theme-smart .sf-exec-chart-header {
    background: #152c48 !important;
    border-bottom-color: #2a4d70 !important;
}

.sf-exec-chart-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sf-exec-icon-green { background: rgba(16,185,129,0.12); color: #10b981; }
.sf-exec-icon-blue  { background: rgba(59,130,246,0.12);  color: #3b82f6; }
.sf-exec-icon-amber { background: rgba(245,158,11,0.12);  color: #d97706; }
html.theme-smart .sf-exec-icon-green,
html.theme-smart .sf-exec-icon-blue,
html.theme-smart .sf-exec-icon-amber { background: rgba(26,111,168,0.2) !important; color: #5b9bd5 !important; }

.sf-exec-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}
.dark .sf-exec-chart-title { color: #f9fafb; }
html.theme-smart .sf-exec-chart-title { color: #c8dff0 !important; }

.sf-exec-chart-subtitle {
    font-size: 11px;
    color: #6b7280;
    margin-top: 1px;
}
.dark .sf-exec-chart-subtitle { color: #9ca3af; }
html.theme-smart .sf-exec-chart-subtitle { color: #7fa3c7 !important; }

/* ── Bar chart canvas area ── */
.sf-exec-chart-body {
    padding: 16px 20px 20px;
    position: relative;
    height: 270px;
}

/* ── Donut panel body ── */
.sf-exec-donut-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sf-exec-donut-canvas-wrap {
    position: relative;
    height: 160px;
}

.sf-exec-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.sf-exec-donut-total {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}
.dark .sf-exec-donut-total { color: #f9fafb; }
html.theme-smart .sf-exec-donut-total { color: #c8dff0 !important; }

.sf-exec-donut-total-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}
html.theme-smart .sf-exec-donut-total-label { color: #7fa3c7 !important; }

/* ── Status legend ── */
.sf-exec-status-legend { display: flex; flex-direction: column; gap: 7px; }

.sf-exec-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #374151;
}
.dark .sf-exec-legend-item { color: #d1d5db; }
html.theme-smart .sf-exec-legend-item { color: #c8dff0 !important; }

.sf-exec-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sf-exec-dot-draft   { background: rgba(107,114,128,0.85); }
.sf-exec-dot-sent    { background: rgba(59,130,246,0.85);  }
.sf-exec-dot-partial { background: rgba(245,158,11,0.85);  }
.sf-exec-dot-paid    { background: rgba(16,185,129,0.85);  }
.sf-exec-dot-overdue { background: rgba(239,68,68,0.85);   }

.sf-exec-legend-label { flex: 1; }

.sf-exec-legend-count {
    font-weight: 700;
    color: #111827;
    min-width: 22px;
    text-align: right;
}
.dark .sf-exec-legend-count { color: #f9fafb; }
html.theme-smart .sf-exec-legend-count { color: #c8dff0 !important; }

.sf-exec-legend-pct {
    font-size: 10px;
    color: #9ca3af;
    min-width: 40px;
    text-align: right;
}
html.theme-smart .sf-exec-legend-pct { color: #5b8ab0 !important; }

/* ── Top Customers panel ── */
.sf-exec-cust-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dark .sf-exec-cust-panel { background: #1f2937; border-color: #374151; }
html.theme-smart .sf-exec-cust-panel {
    background: #1a3554 !important;
    border-color: #2a4d70 !important;
    box-shadow: 0 0 0 1px #2a4d70, 0 4px 20px rgba(0,0,0,0.35) !important;
}

.sf-exec-cust-list { padding: 8px 20px 16px; }

.sf-exec-cust-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #f3f4f6;
}
.sf-exec-cust-row:last-child { border-bottom: none; }
.dark .sf-exec-cust-row { border-bottom-color: #374151; }
html.theme-smart .sf-exec-cust-row { border-bottom-color: #1e3e60 !important; }

.sf-exec-cust-rank {
    flex: 0 0 22px;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-align: center;
}
html.theme-smart .sf-exec-cust-rank { color: #5b8ab0 !important; }

.sf-exec-cust-name {
    flex: 0 0 200px;
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .sf-exec-cust-name { color: #f9fafb; }
html.theme-smart .sf-exec-cust-name { color: #c8dff0 !important; }

.sf-exec-cust-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sf-exec-cust-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}
.dark .sf-exec-cust-bar { background: #374151; }
html.theme-smart .sf-exec-cust-bar { background: #2a4d70 !important; }

.sf-exec-cust-fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
html.theme-smart .sf-exec-cust-fill { background: #1a6fa8 !important; }

.sf-exec-cust-amount {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    min-width: 150px;
    text-align: right;
}
.dark .sf-exec-cust-amount { color: #d1d5db; }
html.theme-smart .sf-exec-cust-amount { color: #c8dff0 !important; }

.sf-exec-cust-outstanding {
    flex: 0 0 160px;
    text-align: right;
}

.sf-exec-outstanding-badge {
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
}
.dark .sf-exec-outstanding-badge { color: #f87171; }
html.theme-smart .sf-exec-outstanding-badge { color: #ef9292 !important; }

.sf-exec-settled-badge {
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 4px;
    padding: 1px 8px;
}
html.theme-smart .sf-exec-settled-badge {
    color: #4adeaa !important;
    background: rgba(74,222,170,0.08) !important;
    border-color: rgba(74,222,170,0.2) !important;
}

.sf-exec-empty {
    padding: 32px 0;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}
html.theme-smart .sf-exec-empty { color: #5b8ab0 !important; }

/* ── Mobile responsive ── */
@media (max-width: 767px) {
    .sf-exec-kpi-strip { grid-template-columns: 1fr; }

    .sf-exec-kpi-sep {
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
    .dark .sf-exec-kpi-sep { border-top-color: #374151; }
    html.theme-smart .sf-exec-kpi-sep { border-top-color: #2a4d70 !important; }

    .sf-exec-cust-name       { flex: 0 0 120px; }
    .sf-exec-cust-outstanding { flex: 0 0 100px; }
    .sf-exec-cust-amount      { min-width: 90px; }
}
html.theme-smart .sf-btn-secondary:hover { background-color: #0f2338 !important; }

/* ── Activity Log detail modal ── */
.al-modal-rows {
    border-top: 1px solid #e5e7eb;
}
.dark .al-modal-rows { border-top-color: #374151; }
html.theme-smart .al-modal-rows { border-top-color: #2a4d70; }

.al-modal-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0 1rem;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: start;
}
.dark .al-modal-row { border-bottom-color: #1f2937; }
html.theme-smart .al-modal-row { border-bottom-color: #152d4d; }

.al-modal-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    padding-top: 2px;
}
.dark .al-modal-label { color: #9ca3af; }
html.theme-smart .al-modal-label { color: #7fa3c7; }

.al-modal-value {
    font-size: 14px;
    color: #111827;
    word-break: break-word;
}
.dark .al-modal-value { color: #f3f4f6; }
html.theme-smart .al-modal-value { color: #c8dff0; }

.al-modal-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 4px;
}
.dark .al-modal-meta { color: #6b7280; }
html.theme-smart .al-modal-meta { color: #5b8ab0; }

.al-modal-useragent {
    font-size: 12px;
}

.al-modal-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}
.dark .al-modal-section-title { color: #9ca3af; }
html.theme-smart .al-modal-section-title { color: #7fa3c7; }

.al-modal-json {
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: ui-monospace, monospace;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
}
.dark .al-modal-json {
    background-color: rgba(31, 41, 55, 0.7);
    border-color: #374151;
    color: #d1d5db;
}
html.theme-smart .al-modal-json {
    background-color: rgba(13, 31, 56, 0.6);
    border-color: #2a4d70;
    color: #c8dff0;
}

.al-modal-empty {
    font-size: 12px;
    font-style: italic;
    color: #9ca3af;
}
.dark .al-modal-empty { color: #6b7280; }
html.theme-smart .al-modal-empty { color: #5b8ab0; }
