/* ============================================================
   Tri-Netra AdoNext — Add-On Management System
   Production Enterprise Design System & Styling
   ============================================================ */

/* ===== DESIGN TOKENS ===== */
:root {
    color-scheme: dark;
    /* Color Palette */
    --bg-base: #090a10;
    --bg-surface: #121524;
    --bg-surface-hover: #171b2d;
    --bg-elevated: #1a1e34;
    --bg-card: #121524;
    --bg-card2: #171b2d;
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-focus: rgba(255, 255, 255, 0.08);

    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.16);
    --border-gold: rgba(212, 168, 67, 0.4);

    --gold: #d4a843;
    --gold2: #e8c36a;
    --gold-glow: rgba(212, 168, 67, 0.22);
    --gold-dim: rgba(212, 168, 67, 0.12);

    --text: #f1f1f6;
    --text2: #9ba1b6;
    --text3: #636b83;

    /* Semantic Status Palette */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.3);

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.3);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.3);

    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);
    --info-border: rgba(59, 130, 246, 0.3);

    --purple: #8b5cf6;
    --purple-bg: rgba(139, 92, 246, 0.12);
    --purple-border: rgba(139, 92, 246, 0.3);

    --neutral: #94a3b8;
    --neutral-bg: rgba(148, 163, 184, 0.12);
    --neutral-border: rgba(148, 163, 184, 0.25);

    --draft: var(--neutral);
    --sent: var(--info);
    --approved: var(--gold);
    --completed: #10b981;
    --rejected: var(--danger);
    --expired: var(--neutral);

    /* Dimensions & Effects */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --sidebar-width: 260px;
    --topbar-height: 64px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px var(--gold-glow);

    --trans-fast: 0.15s ease;
    --trans-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== RESET & GLOBAL STYLES ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Tabular numbers for financial precision */
.num, .val, .tbl td, .kpi .val, .aging, .k-amt {
    font-variant-numeric: tabular-nums;
}

.hidden { display: none !important; }

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ===== LOGIN SCREEN ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #161a2d 0%, #08090f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}
.login-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
}
.shape-1 {
    width: 550px;
    height: 550px;
    background: var(--gold);
    top: -120px;
    right: -120px;
    animation: float 10s ease-in-out infinite;
}
.shape-2 {
    width: 450px;
    height: 450px;
    background: var(--info);
    bottom: -120px;
    left: -120px;
    animation: float 12s ease-in-out infinite reverse;
}
.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--purple);
    top: 40%;
    left: 45%;
    animation: float 14s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(6deg); }
}

.login-card {
    background: rgba(18, 21, 36, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 44px 38px;
    border-radius: var(--radius-xl);
    width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0,0,0,0.6);
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: var(--bg-base);
    font-weight: 800;
    font-size: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px var(--gold-glow);
}
.login-logo h1 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.login-sub {
    color: var(--text2);
    font-size: 13px;
    margin-top: 4px;
}

/* ===== APP LAYOUT ===== */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-base);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
    transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktop Sidebar Collapsed / Hidden State */
.app.sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-hide-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--trans-fast);
}
.sidebar-hide-btn:hover {
    background: var(--gold-dim);
    border-color: var(--border-gold);
    color: var(--gold);
    transform: scale(1.05);
}

.desktop-sidebar-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--trans-fast);
    margin-right: 4px;
    flex-shrink: 0;
}
.desktop-sidebar-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
    transform: scale(1.03);
}

.sb-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
    height: var(--topbar-height);
}
.brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: var(--bg-base);
    font-weight: 800;
    font-size: 13px;
    border-radius: 9px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--gold-glow);
}
.sb-brand h2 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid var(--border-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Quick-Search Jump Box */
.sidebar-search-box {
    display: flex;
    align-items: center;
    position: relative;
    margin: 10px 12px 6px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--trans-fast);
    height: 36px;
}
.sidebar-search-box:focus-within {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 2px var(--gold-glow);
}
.sidebar-search-icon {
    font-size: 13px;
    opacity: 0.65;
    margin-right: 8px;
    flex-shrink: 0;
    pointer-events: none;
}
#sidebar-quick-search {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 12px;
    height: 100%;
    padding: 0;
    font-family: inherit;
}
#sidebar-quick-search::placeholder {
    color: var(--text3);
    font-size: 11px;
}
.sidebar-search-clear {
    background: transparent;
    border: none;
    color: var(--text3);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-right: 4px;
    transition: color var(--trans-fast);
}
.sidebar-search-clear:hover {
    color: var(--text);
}
.sidebar-search-shortcut {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text3);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 5px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    pointer-events: none;
}
.sidebar-search-empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--text3);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Nav Groups & Functional Clusters */
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}
.nav-group:last-child {
    margin-bottom: 2px;
}
.nav-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text3);
    user-select: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--trans-fast), color var(--trans-fast);
}
.nav-group-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}
.nav-group-icon {
    font-size: 11px;
    opacity: 0.85;
}
.nav-group-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-group-chevron {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text3);
    flex-shrink: 0;
}
.nav-group-header:hover .nav-group-chevron {
    opacity: 1;
    color: var(--gold);
}
.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    max-height: 500px;
}
.nav-group.collapsed .nav-group-chevron {
    transform: rotate(-90deg);
}
.nav-group.collapsed .nav-group-items {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Base Nav Links */
.nl {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 3px solid transparent;
}
.nl:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    transform: translateX(4px);
}
.nl:hover .ni {
    transform: scale(1.12);
}
.nl:active {
    transform: translateX(2px) scale(0.98);
}
.nl.active {
    background: linear-gradient(90deg, rgba(212, 168, 67, 0.14), rgba(212, 168, 67, 0.02));
    color: var(--gold2);
    border-left-color: var(--gold);
    font-weight: 600;
    box-shadow: inset 1px 0 0 var(--gold);
}
.nl.active .ni {
    opacity: 1;
    transform: scale(1.05);
}
.nl-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Primary Daily-Driver Visual Anchors */
.nl.nl-primary {
    font-weight: 600;
    color: var(--text);
}
.nl.nl-primary .nl-label {
    color: #ffffff;
}
.ni {
    font-size: 15px;
    width: 22px;
    text-align: center;
    opacity: 0.85;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    flex-shrink: 0;
}
.ni-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13.5px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nl:hover .ni-icon-box {
    background: rgba(212, 168, 67, 0.12);
    border-color: rgba(212, 168, 67, 0.28);
    transform: scale(1.1);
}
.nl.active .ni-icon-box {
    background: rgba(212, 168, 67, 0.22);
    border-color: var(--border-gold);
    box-shadow: 0 2px 8px var(--gold-glow);
    transform: scale(1.05);
}

/* Feature Badges */
.nl-tag {
    font-size: 8.5px;
    font-weight: 800;
    padding: 1.5px 5px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.tag-core {
    background: rgba(212, 168, 67, 0.16);
    color: var(--gold2);
    border: 1px solid rgba(212, 168, 67, 0.4);
}
.tag-live {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.tag-new {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.sb-foot {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
}
.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--gold);
}

/* Main Area */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}
.topbar {
    height: var(--topbar-height);
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(18, 21, 36, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 5;
    flex-shrink: 0;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar h1 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.topbar-sub {
    font-size: 12px;
    color: var(--text3);
    font-weight: 400;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 13px;
    transition: all var(--trans-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
}
.btn:active {
    transform: scale(0.98);
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: #0c0e17;
    box-shadow: 0 2px 10px var(--gold-glow);
    font-weight: 700;
}
.btn-gold:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 16px var(--gold-glow);
    transform: translateY(-1px);
}
.btn-blue {
    background: var(--info);
    color: #fff;
}
.btn-blue:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-green {
    background: var(--success);
    color: #fff;
}
.btn-green:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.btn-red {
    background: var(--danger);
    color: #fff;
}
.btn-red:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
.btn-dark {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-dark:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--border-hover);
    color: #fff;
}
.btn-outline {
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}
.btn-full { width: 100%; }
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 5px;
    font-weight: 600;
}

/* Button Preloader & Spinner */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: btnSpin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
    box-sizing: border-box;
}

@keyframes btnSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn.btn-loading,
button.btn-loading {
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.8 !important;
}

.btn-blue .btn-spinner,
.btn-red .btn-spinner,
.btn-green .btn-spinner {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
}

[data-theme="light"] .btn-gold .btn-spinner {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
}

/* Icon Action Buttons */
.action-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    transition: all var(--trans-fast);
    font-size: 13px;
}
.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--border-hover);
}
.action-btn.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}
.action-btn.edit:hover {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info-border);
}

/* ===== FORMS & INPUTS ===== */
.fg {
    margin-bottom: 16px;
}
.fg label {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text2);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.fg label .req {
    color: var(--danger);
    margin-left: 2px;
}
.fg input, .fg select, .fg textarea,
.search-bar input, .search-bar select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: all var(--trans-fast);
}
.fg input:focus, .fg select:focus, .fg textarea:focus,
.search-bar input:focus, .search-bar select:focus {
    background: var(--bg-input-focus);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.tbl input, .tbl select {
    background: #14182b !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--radius-sm);
    color: #f1f1f6 !important;
    font-family: inherit;
    outline: none;
    transition: all var(--trans-fast);
}
.tbl input:focus, .tbl select:focus {
    background: #1a1f36 !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 2px var(--gold-glow);
    color: #fff !important;
}
.fg input.is-invalid, .fg select.is-invalid, .fg textarea.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-bg);
}
.field-error {
    color: var(--danger);
    font-size: 11.5px;
    margin-top: 4px;
    display: block;
}
.input-hint {
    color: var(--text3);
    font-size: 11px;
    margin-top: 4px;
    display: block;
}
/* Unified Modern Dropdowns & Selects */
select,
.fg select,
.search-bar select,
.tbl select,
.excel-toolbar select,
.addon-cat-select,
.mp-addon-filter,
.mp-date-quick,
#cat-pick,
#mp-addon-detail-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #14182b !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4a843' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 13px) center !important;
    background-size: 12px 12px !important;
    padding-right: 36px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--radius-md) !important;
    color: #f1f1f6 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

select:hover,
.fg select:hover,
.search-bar select:hover,
.tbl select:hover,
.excel-toolbar select:hover,
.addon-cat-select:hover,
.mp-addon-filter:hover,
.mp-date-quick:hover {
    border-color: rgba(212, 168, 67, 0.48) !important;
    background-color: #1b2038 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(212, 168, 67, 0.15) !important;
    transform: translateY(-1px);
}

select:focus,
select:active,
.fg select:focus,
.search-bar select:focus,
.tbl select:focus,
.excel-toolbar select:focus,
.addon-cat-select:focus,
.mp-addon-filter:focus,
.mp-date-quick:focus {
    border-color: var(--gold) !important;
    background-color: #1c223c !important;
    box-shadow: 0 0 0 3px var(--gold-glow), 0 6px 18px rgba(0, 0, 0, 0.45) !important;
    color: #ffffff !important;
    transform: translateY(0);
}

/* Universal High-Contrast Option Styling Across All Dropdowns */
select option,
select optgroup,
.fg select option,
.search-bar select option,
.tbl select option,
.excel-toolbar select option,
optgroup,
option {
    background: #121526 !important;
    background-color: #121526 !important;
    color: #f1f1f6 !important;
    padding: 11px 15px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
    border: none !important;
}

select option:checked,
select option:hover,
select option:focus {
    background: #242b4b !important;
    background-color: #242b4b !important;
    color: var(--gold) !important;
    font-weight: 700 !important;
}

select option:disabled {
    color: #636b83 !important;
    background-color: #0d0f1b !important;
    font-style: italic !important;
}
.err {
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 10px;
    text-align: center;
}

/* Search Bar Container */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.search-bar input {
    min-width: 250px;
    max-width: 380px;
}

/* ===== CARDS & CONTAINERS ===== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--trans-fast);
}
.card:hover {
    border-color: var(--border-hover);
}

/* KPI Metrics */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.kpi {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all var(--trans-normal);
}
.kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gold);
    border-radius: 4px 0 0 4px;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}
.kpi h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text2);
    margin-bottom: 8px;
    font-weight: 600;
}
.kpi .val {
    font-size: 26px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.kpi.blue::before { background: var(--info); }
.kpi.blue .val { color: var(--info); }
.kpi.green::before { background: var(--success); }
.kpi.green .val { color: var(--success); }
.kpi.red::before { background: var(--danger); }
.kpi.red .val { color: var(--danger); }
.kpi.purple::before { background: var(--purple); }
.kpi.purple .val { color: var(--purple); }

/* ===== QUOTATIONS 7-TILE SINGLE-ROW KPI LAYOUT ===== */
.q-kpi-row {
    display: grid !important;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 0.85fr) minmax(0, 0.95fr) minmax(0, 0.75fr) minmax(0, 1.45fr) minmax(0, 1.45fr) minmax(0, 1.45fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    align-items: stretch !important;
}
.q-kpi-row .kpi {
    padding: 12px 10px !important;
    min-width: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.q-kpi-row .kpi.kpi-wide {
    padding: 12px 14px !important;
}
.q-kpi-row .kpi h4 {
    font-size: 9.5px !important;
    letter-spacing: 0.35px !important;
    margin-bottom: 5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.q-kpi-row .kpi.kpi-compact .val {
    font-size: 21px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
}
.q-kpi-row .kpi.kpi-wide .val {
    font-size: 19px !important;
    font-weight: 800 !important;
    letter-spacing: -0.3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.15 !important;
}
@media (max-width: 1100px) {
    .q-kpi-row {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        padding-bottom: 6px !important;
        -webkit-overflow-scrolling: touch;
    }
    .q-kpi-row .kpi.kpi-compact {
        flex: 0 0 115px !important;
        scroll-snap-align: start !important;
    }
    .q-kpi-row .kpi.kpi-wide {
        flex: 0 0 180px !important;
        scroll-snap-align: start !important;
    }
}

/* ===== DASHBOARD WELCOME HERO BANNER ===== */
.dashboard-welcome-hero {
    position: relative;
    background: linear-gradient(135deg, rgba(22, 26, 44, 0.95) 0%, rgba(14, 17, 30, 0.98) 100%);
    border: 1px solid rgba(212, 168, 67, 0.28);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.dashboard-welcome-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.14) 0%, transparent 70%);
    pointer-events: none;
}
.dashboard-welcome-hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 20%;
    width: 180px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.welcome-hero-content {
    position: relative;
    z-index: 1;
    max-width: 820px;
}
.welcome-hero-title {
    font-size: 21px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.35;
    letter-spacing: -0.3px;
    margin: 0;
}
.welcome-hero-title .highlight-gold {
    background: linear-gradient(135deg, #d4a843, #f7d57f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.welcome-hero-aside {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.welcome-hero-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    background: rgba(255, 255, 255, 0.04);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.welcome-hero-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Quick Action Banner */
.quick-action-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.qa-card {
    flex: 1;
    min-width: 170px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--trans-fast);
    display: flex;
    align-items: center;
    gap: 12px;
}
.qa-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.qa-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--gold-dim);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.qa-title {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}
.qa-sub {
    font-size: 11px;
    color: var(--text3);
}

/* Alert Notification Strip */
.alert-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-strip.warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: #fde68a;
}
.alert-strip.info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: #bfdbfe;
}

/* ===== TABLES ===== */
.tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.tbl th {
    text-align: left;
    padding: 11px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
    user-select: none;
}
.tbl th.sortable {
    cursor: pointer;
}
.tbl th.sortable:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}
.tbl td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text);
    vertical-align: middle;
}
.tbl tbody tr {
    transition: background var(--trans-fast);
}
.tbl tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}
.tbl tr:last-child td {
    border-bottom: none;
}

/* Scope of Work Row Completion Styling */
.tbl tbody tr.scope-row-done {
    background: rgba(16, 185, 129, 0.14) !important;
}
.tbl tbody tr.scope-row-done td {
    background: rgba(16, 185, 129, 0.14) !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.22) !important;
    color: #ecfdf5 !important;
}
.tbl tbody tr.scope-row-done td:first-child {
    border-left: 3px solid #10b981 !important;
}
.tbl tbody tr.scope-row-done td strong {
    color: #34d399 !important;
}
.tbl tbody tr.scope-row-done:hover td {
    background: rgba(16, 185, 129, 0.22) !important;
}

/* ===== STATUS BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid transparent;
}
.badge::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}
.b-draft { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-border); }
.b-sent { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.b-approved, .b-paid, .b-completed { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.b-rejected, .b-unpaid, .b-overdue { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.b-partial, .b-partially-paid { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.b-in-progress { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.b-expired { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-border); }
.badge-green { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-gold { background: rgba(212, 168, 67, 0.12); color: var(--gold); border-color: rgba(212, 168, 67, 0.3); }
.badge-red { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-blue { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }

/* ===== COMPACT PAYMENT STATUS INDICATOR ===== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: help;
    vertical-align: middle;
}
.status-indicator:hover {
    transform: scale(1.15);
}
.status-indicator.si-paid {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}
.status-indicator.si-partial {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}
.status-indicator.si-unpaid {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #94a3b8;
}
.status-indicator.si-overdue {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

/* ===== PROJECT TILE CARDS (Projects View) ===== */
.pj-tile-card {
    cursor: pointer;
    transition: transform var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast);
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.pj-tile-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.pj-ref-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.3px;
}
.pj-tile-title {
    margin: 0 0 5px 0;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}
.pj-tile-client {
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pj-progress-box {
    background: rgba(0, 0, 0, 0.25);
    padding: 11px 13px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    border: 1px solid var(--border-subtle);
}
.pj-prog-lbl {
    color: var(--text3);
    font-weight: 500;
}
.pj-prog-pct {
    font-weight: 700;
    color: var(--gold);
}
.pj-prog-track {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0;
}
.pj-prog-bar {
    background: linear-gradient(90deg, var(--gold), var(--gold2));
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.pj-prog-recv, .pj-prog-total {
    color: var(--text2);
    font-size: 11.5px;
}
.pj-prog-recv strong {
    color: var(--success);
}
.pj-prog-total strong {
    color: var(--text);
}
.pj-tile-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}
.pj-bal-lbl {
    color: var(--text3);
    font-size: 11.5px;
}
.pj-bal-val {
    color: var(--danger);
    font-size: 13.5px;
    font-weight: 700;
}

/* ===== KANBAN BOARD & SLIDING SYSTEM ===== */
.kanban-slider-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    flex-wrap: wrap;
}
.kanban-slider-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
    scrollbar-width: none;
}
.kanban-slider-nav::-webkit-scrollbar {
    display: none;
}
.k-col-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--trans-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.k-col-pill:hover,
.k-col-pill.active {
    background: var(--gold-dim);
    border-color: var(--border-gold);
    color: var(--gold);
}
.k-col-pill .pill-badge {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
}
.k-col-pill.active .pill-badge {
    background: var(--gold);
    color: #0c0e17;
    font-weight: 700;
}
.kanban-slide-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.kanban-slide-btn {
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--trans-fast);
}
.kanban-slide-btn:hover {
    background: var(--gold-dim);
    border-color: var(--border-gold);
    color: var(--gold);
}

.kanban {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 16px;
    min-height: calc(100vh - 240px);
    align-items: stretch;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    cursor: grab;
}
.kanban.kanban-grabbing {
    cursor: grabbing !important;
    user-select: none;
}
.kanban-col {
    flex: 0 0 295px;
    min-width: 295px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    transition: border-color var(--trans-fast), background-color var(--trans-fast), box-shadow var(--trans-fast);
    cursor: default;
}
.kanban-col.k-drag-over {
    border-color: var(--gold) !important;
    background: rgba(212, 168, 67, 0.08) !important;
    box-shadow: 0 0 16px var(--gold-glow) !important;
}
.kanban-col-title {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text2);
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-col-title .count {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
}
.kanban-col-sub {
    font-size: 11px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 10px;
}
.k-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    cursor: grab;
    transition: transform var(--trans-fast), box-shadow var(--trans-fast), border-color var(--trans-fast);
    border-left: 3.5px solid var(--gold);
    position: relative;
    user-select: none;
}
.k-card:active {
    cursor: grabbing;
}
.k-card.k-dragging {
    opacity: 0.35;
    transform: scale(0.96);
}
.k-move-btn {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text3);
    cursor: pointer;
    transition: all var(--trans-fast);
}
.k-move-btn:hover {
    background: var(--gold-dim);
    border-color: var(--border-gold);
    color: var(--gold);
}
.k-move-btn.danger {
    color: var(--danger, #ef4444);
    border-color: rgba(239, 68, 68, 0.3);
}
.k-move-btn.danger:hover {
    background: var(--danger-bg, rgba(239, 68, 68, 0.15));
    border-color: var(--danger, #ef4444);
    color: #f87171;
}
.k-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}
.k-card .k-num {
    font-size: 11px;
    color: var(--gold);
    font-weight: 600;
}
.k-card .k-client {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin: 8px 0 2px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.k-card .k-title {
    font-weight: 600;
    margin: 0 0 6px;
    font-size: 12.5px;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 4px;
}
.k-card .k-amt {
    font-weight: 700;
    color: #fff;
    margin-top: 10px;
    font-size: 15px;
}
.k-card .k-date {
    font-size: 11px;
    color: var(--text3);
    margin-top: 5px;
}
.k-card .aging {
    float: right;
    font-size: 10.5px;
    color: var(--danger);
    font-weight: 700;
    background: var(--danger-bg);
    padding: 1px 6px;
    border-radius: 4px;
}

/* ===== MODAL & OVERLAYS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalIn {
    from { transform: scale(0.96) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0,0,0,0.6);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.modal-sm { max-width: 460px; }
.modal-md { max-width: 680px; }
.modal-lg { max-width: 980px; }
.modal-xl { max-width: 1180px; }

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}
.modal-head h3 {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
}
.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text2);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all var(--trans-fast);
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

/* Custom In-App Confirm Dialog */
.confirm-box {
    text-align: center;
    padding: 10px 10px 0;
}
.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}
.confirm-icon.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}
.confirm-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}
.confirm-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.confirm-msg {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* ===== TOASTS ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 280px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.toast.success { background: linear-gradient(135deg, rgba(16,185,129,0.92), rgba(5,150,105,0.95)); }
.toast.error { background: linear-gradient(135deg, rgba(239,68,68,0.92), rgba(185,28,28,0.95)); }
.toast.info { background: linear-gradient(135deg, rgba(59,130,246,0.92), rgba(29,78,216,0.95)); }
.toast.warning { background: linear-gradient(135deg, rgba(245,158,11,0.92), rgba(217,119,6,0.95)); color: #18181b; }
@keyframes toastIn {
    from { transform: translateX(100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ===== PROJECT COMMAND CENTER MODAL ===== */
.proj-hero {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 20px;
}
.proj-gauge {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}
.proj-gauge-item {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
}
.proj-gauge-item .lbl {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    margin-bottom: 4px;
    font-weight: 600;
}
.proj-gauge-item .amt {
    font-size: 17px;
    font-weight: 800;
}

/* Project Key Note Single-Line Strip */
.pd-key-note-strip {
    margin-top: 14px;
    background: rgba(212, 168, 67, 0.08);
    border: 1px solid rgba(212, 168, 67, 0.32);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--trans-fast);
    overflow: hidden;
}
.pd-key-note-strip:hover {
    background: rgba(212, 168, 67, 0.15);
    border-color: var(--gold);
    box-shadow: 0 2px 10px rgba(212, 168, 67, 0.15);
}
.pd-key-note-strip .kn-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
    flex-shrink: 0;
}
.pd-key-note-strip .kn-text {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Key Note Edit Button */
.kn-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #d4a843;
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.15), rgba(180, 130, 20, 0.1));
    border: 1px solid rgba(212, 168, 67, 0.4);
    border-radius: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--trans-fast);
    white-space: nowrap;
    height: 26px;
    line-height: 1;
}
.kn-edit-btn:hover {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.3), rgba(180, 130, 20, 0.22));
    border-color: var(--gold);
    color: #f5d98a;
    box-shadow: 0 2px 8px rgba(212, 168, 67, 0.2);
    transform: translateY(-1px);
}

/* Project Comments Feed */
.comment-bubble {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: background var(--trans-fast);
}
.comment-bubble:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Tab Navigation inside Modals / Views */
.tab-nav {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    padding-bottom: 2px;
}
.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: var(--gold-dim);
}

/* ===== EXPENSE TREE VIEW ===== */
.tree-node {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    overflow: hidden;
    transition: border-color var(--trans-fast);
}
.tree-node:hover {
    border-color: var(--border-hover);
}
.tree-header {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.015);
    user-select: none;
}
.tree-header:hover {
    background: rgba(255, 255, 255, 0.035);
}
.tree-chevron {
    display: inline-block;
    transition: transform var(--trans-fast);
    font-size: 12px;
    color: var(--text3);
    margin-right: 8px;
}
.tree-node.expanded > .tree-header .tree-chevron {
    transform: rotate(90deg);
}
.tree-content {
    display: none;
    padding: 0 20px 16px 20px;
    border-top: 1px solid var(--border-subtle);
}
.tree-node.expanded > .tree-content {
    display: block;
}

/* Sub-Addon Box */
.addon-box {
    margin-top: 14px;
    border: 1px solid rgba(212, 168, 67, 0.22);
    border-left: 4px solid var(--gold);
    background: rgba(18, 20, 29, 0.65);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--trans-fast);
}
.addon-box:hover {
    border-color: rgba(212, 168, 67, 0.45);
}
.addon-header {
    padding: 12px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.025);
    user-select: none;
    transition: background var(--trans-fast);
}
.addon-header:hover {
    background: rgba(212, 168, 67, 0.06);
}
.addon-chevron {
    display: inline-block;
    transition: transform var(--trans-fast);
    font-size: 11px;
    color: var(--gold);
    margin-right: 10px;
}
.addon-box.expanded > .addon-header .addon-chevron {
    transform: rotate(90deg);
}
.addon-content {
    display: none;
    padding: 14px 18px;
    border-top: 1px solid rgba(212, 168, 67, 0.15);
}
.addon-box.expanded > .addon-content {
    display: block;
}
.addon-cat-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}
.cat-chip {
    cursor: pointer;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text2);
    transition: all var(--trans-fast);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}
.cat-chip:hover {
    background: rgba(212, 168, 67, 0.12);
    border-color: rgba(212, 168, 67, 0.35);
    color: #fff;
}
.cat-chip.active {
    background: var(--gold);
    color: #0d0f17;
    font-weight: 700;
    border-color: var(--gold);
}
.cat-chip.active strong {
    color: #0d0f17 !important;
}
.cat-box {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
}

/* ===== CHARTS ===== */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}
.chart-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.chart-box h3 {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chart-box canvas {
    max-height: 280px;
}
.chart-full {
    grid-column: 1 / -1;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text2);
}
.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.6;
}
.empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}
.empty-desc {
    font-size: 12.5px;
    color: var(--text3);
    max-width: 320px;
    margin: 0 auto 16px;
}

/* ===== PDF DOCUMENT ENGINE (A4 1055x1491 px) ===== */
.pdf-page-container {
    width: 1055px;
    height: 1491px;
    position: relative;
    background: #ffffff;
    overflow: hidden;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
    page-break-after: always;
}

.pdf-page-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 1055px;
    height: 1491px;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

.pdf-content-wrapper {
    position: relative;
    z-index: 2;
    padding: 290px 75px 175px 85px;
    height: 1491px;
    max-height: 1491px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.pdf-content-wrapper.theme-R { --theme-primary: #1e293b; --theme-accent: #d4a843; --theme-head-bg: #1e293b; }
.pdf-content-wrapper.theme-G { --theme-primary: #1e293b; --theme-accent: #d4a843; --theme-head-bg: #1e293b; }
.pdf-content-wrapper.theme-P {
    --theme-primary: #881337;
    --theme-accent: #d4af37;
    --theme-head-bg: #881337;
    padding: 365px 85px 390px 125px !important;
}
.pdf-content-wrapper.theme-D { --theme-primary: #7c2d12; --theme-accent: #eab308; --theme-head-bg: #7c2d12; }
.pdf-content-wrapper.theme-C { --theme-primary: #14532d; --theme-accent: #b91c1c; --theme-head-bg: #14532d; }
.pdf-content-wrapper.theme-INV { --theme-primary: #0f172a; --theme-accent: #d4a843; --theme-head-bg: #0f172a; }

.pdf-glass-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.pdf-table th {
    background: var(--theme-primary, #1e293b);
    color: #ffffff;
    padding: 10px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--theme-accent, #d4a843);
}

.pdf-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12.5px;
    color: #1e293b;
}

.pdf-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.85);
}

/* Pay Slip & Receipt Styling */
.payslip-page,
.receipt-page {
    width: 1055px;
    height: 1491px;
    position: relative;
    background: #ffffff;
    padding: 60px 70px;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ===== 360° MODERN EXCEL VIEW ===== */
.v360-kpi-ribbon {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.v360-kpi-ribbon .kpi {
    padding: 12px 14px;
}
.v360-kpi-ribbon .kpi h4 {
    font-size: 10px;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v360-kpi-ribbon .kpi .val {
    font-size: 20px;
    letter-spacing: -0.3px;
}
@media (max-width: 1024px) {
    .v360-kpi-ribbon {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .v360-kpi-ribbon {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.excel-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.excel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #111424;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.excel-toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}
.excel-search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.excel-search-box .excel-search-icon {
    position: absolute;
    left: 11px;
    font-size: 13px;
    color: var(--text3);
    pointer-events: none;
    z-index: 1;
}
.excel-toolbar input,
.excel-toolbar select {
    height: 36px;
    background: #181d33 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px;
    color: #f1f1f6 !important;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    padding: 0 12px;
    outline: none;
    transition: all var(--trans-fast);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.excel-search-box input {
    padding-left: 32px !important;
    min-width: 250px;
    max-width: 320px;
}
.excel-toolbar input::placeholder {
    color: #636b83;
}
.excel-toolbar select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4a843' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    padding-right: 30px !important;
    cursor: pointer;
}
.excel-toolbar input:hover,
.excel-toolbar select:hover {
    border-color: rgba(212, 168, 67, 0.45) !important;
    background: #1e243e !important;
}
.excel-toolbar input:focus,
.excel-toolbar select:focus {
    background: #1e243e !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px var(--gold-glow), inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    color: #ffffff !important;
}
.excel-toolbar select option {
    background: #131627;
    color: #f1f1f6;
    padding: 8px 12px;
}
.excel-table-container {
    overflow-x: auto;
    max-height: calc(100vh - 280px);
}
.excel-table-container::-webkit-scrollbar {
    height: 7px;
    width: 7px;
}
.excel-table-container::-webkit-scrollbar-track {
    background: #0f1220;
}
.excel-table-container::-webkit-scrollbar-thumb {
    background: #252c48;
    border-radius: 4px;
}
.excel-table-container::-webkit-scrollbar-thumb:hover {
    background: #374169;
}
.excel-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.excel-tbl th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #161a2d;
    padding: 10px 11px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    border-bottom: 2px solid var(--border-hover);
    border-right: 1px solid var(--border-subtle);
    white-space: nowrap;
    user-select: none;
}
.excel-tbl th.sortable {
    cursor: pointer;
}
.excel-tbl th.sortable:hover {
    color: #fff;
    background: #1c213a;
}
.excel-tbl td {
    padding: 9px 11px;
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    color: var(--text);
    vertical-align: middle;
    white-space: nowrap;
}
.excel-tbl tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.012);
}
.excel-tbl tbody tr:hover td {
    background: rgba(212, 168, 67, 0.05);
}
.excel-tbl tr.excel-totals-row td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #181d33;
    font-weight: 800;
    color: #fff;
    border-top: 2px solid var(--gold);
    border-bottom: none;
    padding: 12px 14px;
}
.margin-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.3px;
}
.margin-pill.high {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}
.margin-pill.med {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}
.margin-pill.loss {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* ===== DESKTOP GAUNTLET & RESPONSIVENESS ===== */
/* Mobile Elements - Explicitly hidden on desktop */
.mobile-menu-btn,
.mobile-close-btn,
.sidebar-backdrop,
.mobile-bottom-nav {
    display: none !important;
}

/* Narrow Desktop / Tablet Landscape View (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { width: 64px; }
    .sidebar-search-box, .nav-group-header, .sidebar-search-empty { display: none !important; }
    .sb-brand div:not(.brand-icon), .nl span:not(.ni), .sb-foot span, .pill, .nl-tag { display: none !important; }
    .sb-brand { padding: 12px; justify-content: center; }
    .nav-group { margin-bottom: 4px !important; gap: 4px !important; }
    .nl { justify-content: center !important; padding: 10px 0 !important; border-left: none !important; border-radius: 8px !important; }
    .nl.active { border-left: none !important; background: rgba(212, 168, 67, 0.2) !important; box-shadow: none !important; }
    .ni { font-size: 18px; width: auto; }
    .ni-icon-box { background: transparent !important; border: none !important; width: auto !important; height: auto !important; }
    .chart-grid { grid-template-columns: 1fr; }
    .content { padding: 18px; }
}

/* ============================================================
   ENTERPRISE MOBILE REDESIGN (max-width: 768px)
   Native App Feel, Touch-First UI, Zero Horizontal Blowout
   ============================================================ */
@media (max-width: 768px) {
    /* 1. App Shell & Sliding Drawer */
    .desktop-sidebar-btn,
    .sidebar-hide-btn {
        display: none !important;
    }

    .app {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        position: relative;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 290px !important;
        max-width: 84vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 2000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease !important;
        background: #0f1220 !important;
        border-right: 1px solid rgba(212, 168, 67, 0.25) !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 16px 0 50px rgba(0, 0, 0, 0.9) !important;
    }

    /* Backdrop overlay behind sliding drawer */
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(5, 7, 13, 0.72);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 1990;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.active {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Inside the drawer: full labels and full brand */
    .sidebar .sb-brand div:not(.brand-icon),
    .sidebar .nl span:not(.ni),
    .sidebar .sb-foot span,
    .sidebar .pill,
    .sidebar .nl-tag {
        display: inline-block !important;
    }

    .sidebar-search-box {
        display: flex !important;
        margin: 10px 14px 6px !important;
        height: 38px !important;
    }
    .sidebar-search-shortcut {
        display: none !important;
    }
    .nav-group-header {
        display: flex !important;
    }

    .sb-brand {
        padding: 14px 18px !important;
        justify-content: space-between !important;
        height: 60px !important;
        border-bottom: 1px solid var(--border);
    }

    .sb-brand h2 {
        font-size: 14.5px !important;
        font-weight: 700 !important;
    }

    .mobile-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid var(--border);
        color: var(--text2);
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
        transition: all var(--trans-fast);
    }

    .mobile-close-btn:active {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    #sidebar-nav {
        padding: 10px 10px !important;
        gap: 2px !important;
    }

    .nl {
        justify-content: flex-start !important;
        padding: 9px 12px !important;
        font-size: 13.5px !important;
        border-radius: 8px !important;
        transform: none !important;
        min-height: 42px !important;
    }

    .ni {
        font-size: 16px !important;
        width: 24px !important;
        text-align: left !important;
    }

    .sb-foot {
        padding: 14px 18px !important;
        background: rgba(0, 0, 0, 0.4) !important;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
    }

    .user-badge {
        display: flex !important;
    }

    /* 2. Main View & Topbar */
    .main {
        width: 100% !important;
        flex: 1 !important;
        margin: 0 !important;
        overflow: hidden !important;
        height: 100vh !important;
        height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .topbar {
        height: 56px !important;
        padding: 0 12px !important;
        gap: 8px !important;
        background: rgba(18, 21, 36, 0.95) !important;
        border-bottom: 1px solid var(--border) !important;
        flex-shrink: 0 !important;
    }

    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border);
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        flex-shrink: 0;
        transition: all var(--trans-fast);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-btn:active {
        background: var(--gold-dim);
        border-color: var(--gold);
        transform: scale(0.95);
    }

    .topbar-left {
        gap: 10px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .topbar h1 {
        font-size: 15px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        letter-spacing: -0.2px !important;
    }

    .topbar-sub {
        display: none !important;
    }

    .topbar-actions {
        gap: 6px !important;
        flex-shrink: 0 !important;
    }

    .topbar-actions .btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
        gap: 4px !important;
    }

    .content {
        padding: 14px 12px 76px 12px !important; /* reserve room for bottom nav */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 1 !important;
    }

    /* 3. Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 58px !important;
        background: rgba(14, 17, 28, 0.96) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        z-index: 1000 !important;
        align-items: center !important;
        justify-content: space-around !important;
        padding: 0 4px !important;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.5) !important;
    }

    .mb-nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        flex: 1 !important;
        height: 100% !important;
        color: #717b99 !important;
        text-decoration: none !important;
        border: none !important;
        background: transparent !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .mb-nav-icon {
        font-size: 17px !important;
        line-height: 1 !important;
        transition: transform 0.2s ease !important;
    }

    .mb-nav-label {
        font-size: 9.5px !important;
        font-weight: 600 !important;
        letter-spacing: 0.2px !important;
    }

    .mb-nav-item.active {
        color: var(--gold) !important;
    }

    .mb-nav-item.active .mb-nav-icon {
        transform: translateY(-2px) scale(1.1) !important;
        filter: drop-shadow(0 2px 6px var(--gold-glow)) !important;
    }

    .mb-nav-item:active {
        transform: scale(0.93) !important;
    }

    /* 4. Login Screen on Mobile */
    .login-card {
        width: calc(100vw - 28px) !important;
        max-width: 380px !important;
        padding: 28px 20px !important;
        border-radius: var(--radius-lg) !important;
    }

    .login-logo h1 {
        font-size: 19px !important;
    }

    .login-sub {
        font-size: 11.5px !important;
    }

    /* 5. Dashboard, Welcome Hero & Quick Action Cards */
    .dashboard-welcome-hero {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 18px 16px !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }
    .welcome-hero-title {
        font-size: 17px !important;
        line-height: 1.3 !important;
    }
    .welcome-hero-aside {
        align-items: flex-start !important;
        width: 100% !important;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
    }

    .kpi {
        padding: 12px 14px !important;
        border-radius: var(--radius-md) !important;
    }

    .kpi h4 {
        font-size: 9.5px !important;
        margin-bottom: 4px !important;
        letter-spacing: 0.4px !important;
    }

    .kpi .val {
        font-size: 17px !important;
        letter-spacing: -0.3px !important;
        word-break: break-all !important;
    }

    .quick-action-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }

    .qa-card {
        min-width: 0 !important;
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .qa-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 15px !important;
        border-radius: 7px !important;
    }

    .qa-title {
        font-size: 12px !important;
    }

    .qa-sub {
        display: none !important;
    }

    .chart-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Override inline desktop 2-column grids */
    [style*="minmax(420px"],
    [style*="minmax( 420px"],
    [style*="minmax(320px"],
    [style*="minmax( 320px"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 6. Fund Management — Single-Row KPI & Available Fund Hero Card */
    #fund-hero-outer {
        margin: 14px 0 !important;
        padding: 2px !important;
        border-radius: 16px !important;
    }

    #fund-hero-outer > div {
        flex-direction: column !important;
        padding: 20px 16px !important;
        gap: 14px !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* Hero Left (Icon + Title) */
    #fund-hero-outer > div > div:first-child {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
    }

    #fund-hero-outer > div > div:first-child > div:first-child {
        width: 52px !important;
        height: 52px !important;
        font-size: 26px !important;
        border-radius: 12px !important;
    }

    /* Hero Center (Amount) */
    #fund-hero-amount {
        font-size: 28px !important;
        letter-spacing: -0.5px !important;
        line-height: 1.2 !important;
    }

    #fund-hero-status {
        font-size: 11.5px !important;
    }

    /* Hero Right (Eye Toggle) */
    #fund-hero-outer > div > div:last-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-top: 4px !important;
    }

    #fund-eye-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 18px !important;
    }

    #fund-eye-label {
        margin-top: 0 !important;
        font-size: 10px !important;
        font-weight: 700 !important;
    }

    /* Action buttons in Fund Management & similar views */
    div:has(> button[onclick*="Views._addFund"]),
    div:has(> button[onclick*="Views._deductFund"]) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin: 14px 0 !important;
    }

    div:has(> button[onclick*="Views._addFund"]) button,
    div:has(> button[onclick*="Views._deductFund"]) button {
        width: 100% !important;
        padding: 9px 8px !important;
        font-size: 11.5px !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* Symmetrical 2-column search and filter bar */
    .search-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        margin-bottom: 14px !important;
    }

    .search-bar input[type="text"],
    .search-bar input[type="search"],
    .search-bar input:not([type="date"]) {
        grid-column: 1 / -1 !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .search-bar select,
    .search-bar input[type="date"],
    .search-bar .fg {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .search-bar .fg input,
    .search-bar .fg select {
        width: 100% !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    /* 7. Modals as Bottom-Sheet Drawers */
    .modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
        justify-content: center !important;
        z-index: 2500 !important;
    }

    .modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 94vh !important;
        max-height: 94dvh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
        border-bottom: none !important;
        animation: modalSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    @keyframes modalSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-head {
        padding: 14px 16px !important;
        border-bottom: 1px solid var(--border) !important;
        flex-shrink: 0 !important;
    }

    .modal-head h3 {
        font-size: 15px !important;
        letter-spacing: -0.2px !important;
    }

    .modal-body {
        padding: 16px 14px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 1 !important;
    }

    .modal-foot {
        padding: 12px 14px !important;
        border-top: 1px solid var(--border) !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        flex-shrink: 0 !important;
    }

    .modal-foot .btn {
        flex: 1 1 auto !important;
        padding: 10px 14px !important;
        font-size: 12.5px !important;
    }

    /* Stack flex containers and forms inside modal */
    .modal [style*="min-width:440px"],
    .modal [style*="min-width: 440px"],
    .modal [style*="min-width:320px"],
    .modal [style*="min-width: 320px"],
    .modal [style*="min-width:280px"],
    .modal [style*="min-width: 280px"] {
        min-width: 0 !important;
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    .modal [style*="display:flex;gap:12px"],
    .modal [style*="display: flex; gap: 12px"],
    .modal [style*="display:flex;gap:14px"],
    .modal [style*="display: flex; gap: 14px"],
    .modal [style*="display:flex;gap:24px"],
    .modal [style*="display: flex; gap: 24px"] {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .modal [style*="grid-template-columns:1fr 1fr"],
    .modal [style*="grid-template-columns: 1fr 1fr"],
    .modal [style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* 8. Tables, 360 View & Lists */
    .card {
        padding: 14px 12px !important;
        border-radius: var(--radius-md) !important;
    }

    .tbl th, .tbl td {
        padding: 9px 10px !important;
        font-size: 12px !important;
    }

    .badge {
        padding: 2px 6px !important;
        font-size: 9.5px !important;
    }

    .excel-toolbar {
        padding: 10px 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .excel-toolbar-left {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .excel-search-box input {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .excel-toolbar select {
        width: 100% !important;
    }

    .v360-kpi-ribbon {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-bottom: 12px !important;
    }

    .tab-nav {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        gap: 4px !important;
        padding-bottom: 4px !important;
    }

    .tab-btn {
        padding: 7px 12px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important;
    }

    .proj-hero {
        padding: 14px 12px !important;
    }

    .proj-gauge {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* 9. Floating Toasts on Mobile */
    #toast-container {
        bottom: 68px !important;
        right: 12px !important;
        left: 12px !important;
    }

    .toast {
        min-width: 0 !important;
        max-width: 100% !important;
        font-size: 12px !important;
        padding: 10px 14px !important;
    }
}

/* Micro Phone Optimization (≤ 420px) */
@media (max-width: 420px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .kpi .val {
        font-size: 15.5px !important;
    }

    #fund-hero-amount {
        font-size: 24px !important;
    }

    .quick-action-bar {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .qa-card {
        padding: 8px 10px !important;
    }
}

/* ===== PDF TEMPLATES & RECEIPT PRINT ENGINE ===== */
.pdf-page-container {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.pdf-content-wrapper {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.theme-R {
    --theme-primary: #1a1a2e;
    --theme-accent: #d4a843;
}
.theme-G {
    --theme-primary: #1e293b;
    --theme-accent: #d4a843;
}
.theme-P {
    --theme-primary: #8b0000;
    --theme-accent: #d4af37;
}
.theme-P.pdf-content-wrapper {
    padding: 325px 80px 340px 105px !important;
}
.theme-D {
    --theme-primary: #cc0000;
    --theme-accent: #ffd700;
}
.theme-C {
    --theme-primary: #006400;
    --theme-accent: #b91c1c;
}
.theme-INV {
    --theme-primary: #0f172a;
    --theme-accent: #d4a843;
}
.receipt-page, .payslip-page {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@keyframes fundGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fundShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================================
   REVENUE & FINANCIAL ANALYTICS STYLES
   ============================================================ */
.revenue-filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.revenue-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    align-items: flex-end;
}
.revenue-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.revenue-filter-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
}
.revenue-filter-group select,
.revenue-filter-group input {
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    padding: 0 10px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}
/* Revenue Executive KPI Containers: 2-Row Asymmetric Complete Layout */
.revenue-kpi-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
    width: 100%;
}
.revenue-kpi-row {
    width: 100%;
}
.revenue-kpi-row-1 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}
.revenue-kpi-row-2 {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr 1.25fr; /* Creative Asymmetric Visual Proportions */
    gap: 16px;
    width: 100%;
}
.revenue-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.revenue-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.revenue-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
.revenue-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: var(--kpi-color, var(--primary));
}
.revenue-kpi-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.revenue-kpi-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
}
.revenue-kpi-icon {
    font-size: 18px;
    opacity: 0.85;
}
.revenue-kpi-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.revenue-kpi-sub {
    font-size: 11.5px;
    color: var(--text3);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Micro-Progress Bar for Collection Rate */
.kpi-mini-progress {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    margin: 8px 0 4px 0;
    overflow: hidden;
}
[data-theme="light"] .kpi-mini-progress {
    background: #e2e8f0;
}
.kpi-mini-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Row 2 Executive Prominent Cards */
.kpi-cashflow-hero {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(5, 150, 105, 0.06) 100%);
    border-color: rgba(5, 150, 105, 0.28);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.06);
}
.kpi-cashflow-hero .revenue-kpi-val {
    font-size: 26px;
    letter-spacing: -0.6px;
}
.kpi-profit-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(2, 132, 199, 0.05) 100%);
    border-color: rgba(2, 132, 199, 0.22);
}
.kpi-profit-card .revenue-kpi-val,
.kpi-margin-card .revenue-kpi-val {
    font-size: 25px;
}

/* Status Chips */
.kpi-status-chip {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.chip-cash-pos {
    background: rgba(5, 150, 105, 0.14);
    color: #10b981;
}
.chip-cash-neg {
    background: rgba(220, 38, 38, 0.14);
    color: #ef4444;
}
[data-theme="light"] .chip-cash-pos {
    background: #dcfce7;
    color: #15803d;
}
[data-theme="light"] .chip-cash-neg {
    background: #fee2e2;
    color: #b91c1c;
}
.revenue-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 26px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.revenue-sec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.revenue-sec-title {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.revenue-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.revenue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}
.revenue-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text2);
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.revenue-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.revenue-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.revenue-table tfoot td {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 800;
    border-top: 2px solid var(--border);
    color: var(--text);
}
.margin-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.margin-high { background: #dcfce7; color: #15803d; }
.margin-healthy { background: #e0f2fe; color: #0369a1; }
.margin-moderate { background: #fef9c3; color: #a16207; }
.margin-slim { background: #ffedd5; color: #c2410c; }
.margin-loss { background: #fee2e2; color: #b91c1c; }

/* Ledger Modal Styles */
.ledger-modal-wrapper {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.ledger-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 14px 0;
}
.ledger-summary-item .lbl {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
}
.ledger-summary-item .val {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-top: 2px;
}

/* ============================================================
   THEME TOGGLE BUTTON & THEME PREFERENCE CARDS
   ============================================================ */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
    white-space: nowrap;
}
.theme-toggle-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.theme-toggle-btn:active {
    transform: translateY(0);
}
.theme-toggle-btn #theme-toggle-icon {
    font-size: 14px;
    line-height: 1;
}
.theme-card-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-surface);
    user-select: none;
}
.theme-card-option:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.theme-card-option.active {
    border-color: var(--gold);
    background: var(--gold-dim);
    box-shadow: 0 0 12px var(--gold-glow);
}

@media (max-width: 768px) {
    .theme-toggle-btn {
        padding: 0 8px !important;
        height: 32px !important;
    }
    .theme-toggle-label {
        display: none !important;
    }
}

/* ============================================================
   NEW LIGHT MODE DESIGN SYSTEM
   Deep contrast, crisp slate-white surfaces, and rich amber gold
   ============================================================ */
:root[data-theme="light"],
body.light-mode {
    color-scheme: light;

    /* Base Surfaces */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card2: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-input: #ffffff;
    --bg-input-focus: #ffffff;

    /* Borders */
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --border-hover: #cbd5e1;
    --border-gold: rgba(180, 130, 20, 0.45);

    /* Brand Gold (Calibrated for Light Backgrounds) */
    --gold: #b48214;
    --gold2: #8d6205;
    --gold-glow: rgba(180, 130, 20, 0.16);
    --gold-dim: rgba(180, 130, 20, 0.08);

    /* High-Legibility Typography */
    --text: #0f172a;
    --text2: #334155;
    --text3: #64748b;

    /* Semantic Status Palette (Light Mode) */
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;

    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --info: #2563eb;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    --purple: #7c3aed;
    --purple-bg: #f5f3ff;
    --purple-border: #ddd6fe;

    --neutral: #64748b;
    --neutral-bg: #f8fafc;
    --neutral-border: #e2e8f0;

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 20px rgba(180, 130, 20, 0.15);
}

/* Light Mode Structural Overrides */
[data-theme="light"] body {
    background: var(--bg-base);
    color: var(--text);
}

[data-theme="light"] .topbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .topbar h1,
[data-theme="light"] .sb-brand h2,
[data-theme="light"] .login-logo h1,
[data-theme="light"] #user-display,
[data-theme="light"] .stat-val,
[data-theme="light"] .kpi-val,
[data-theme="light"] .confirm-title {
    color: #0f172a !important;
}

[data-theme="light"] .topbar-sub {
    color: #64748b !important;
}

[data-theme="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .sb-brand {
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .desktop-sidebar-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .desktop-sidebar-btn:hover {
    background: #f1f5f9 !important;
    border-color: #b48214 !important;
    color: #b48214 !important;
}

[data-theme="light"] .sidebar-hide-btn {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

[data-theme="light"] .sidebar-hide-btn:hover {
    background: #f1f5f9 !important;
    border-color: #b48214 !important;
    color: #b48214 !important;
}

[data-theme="light"] .sb-foot {
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

/* Light Mode Feature Search Bar (Sidebar Quick Search) */
[data-theme="light"] .sidebar-search-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    height: 38px !important;
    padding: 0 10px 0 11px !important;
    margin: 10px 12px 8px !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-theme="light"] .sidebar-search-box:hover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

[data-theme="light"] .sidebar-search-box:focus-within {
    background: #ffffff !important;
    border-color: #b48214 !important;
    box-shadow: 0 0 0 3px rgba(180, 130, 20, 0.16), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .sidebar-search-icon {
    opacity: 0.8 !important;
    filter: saturate(0.85);
    margin-right: 8px !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

[data-theme="light"] .sidebar-search-box:focus-within .sidebar-search-icon {
    opacity: 1 !important;
    transform: scale(1.08);
}

/* Prevent global input:hover & input:focus from creating double borders / jitter on inner search input */
[data-theme="light"] #sidebar-quick-search,
[data-theme="light"] #sidebar-quick-search:hover,
[data-theme="light"] #sidebar-quick-search:focus,
[data-theme="light"] #sidebar-quick-search:active {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    color: #0f172a !important;
    padding: 0 !important;
    height: 100% !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
}

[data-theme="light"] #sidebar-quick-search::placeholder {
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

[data-theme="light"] .sidebar-search-shortcut {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.07) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 5px !important;
    letter-spacing: 0.3px !important;
    line-height: 1.3 !important;
}

[data-theme="light"] .sidebar-search-clear {
    color: #94a3b8 !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    transition: all 0.15s ease !important;
}

[data-theme="light"] .sidebar-search-clear:hover {
    color: #dc2626 !important;
    background: #fee2e2 !important;
}

[data-theme="light"] .sidebar-search-empty {
    color: #64748b !important;
    background: #f8fafc !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 8px !important;
    margin: 8px 10px !important;
    padding: 14px 10px !important;
}

[data-theme="light"] .nav-group-header {
    color: #64748b !important;
}

[data-theme="light"] .nl {
    color: #475569 !important;
}

[data-theme="light"] .nl:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-theme="light"] .nl.active {
    background: linear-gradient(90deg, rgba(180, 130, 20, 0.14), rgba(180, 130, 20, 0.02)) !important;
    color: #8d6205 !important;
    border-left: 3px solid #b48214 !important;
    font-weight: 700 !important;
    box-shadow: inset 1px 0 0 #b48214 !important;
}

[data-theme="light"] .nl-primary .nl-label {
    color: #0f172a !important;
}

[data-theme="light"] .ni-icon-box {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

[data-theme="light"] .nl:hover .ni-icon-box {
    background: rgba(180, 130, 20, 0.1) !important;
    border-color: rgba(180, 130, 20, 0.3) !important;
}

[data-theme="light"] .nl.active .ni-icon-box {
    background: rgba(180, 130, 20, 0.18) !important;
    border-color: #b48214 !important;
    box-shadow: 0 2px 6px rgba(180, 130, 20, 0.2) !important;
}

[data-theme="light"] .tag-core {
    background: rgba(180, 130, 20, 0.14) !important;
    color: #8d6205 !important;
    border-color: rgba(180, 130, 20, 0.35) !important;
}

[data-theme="light"] .tag-live {
    background: rgba(22, 163, 74, 0.14) !important;
    color: #15803d !important;
    border-color: rgba(22, 163, 74, 0.35) !important;
}

[data-theme="light"] .tag-new {
    background: rgba(37, 99, 235, 0.14) !important;
    color: #1d4ed8 !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
}

[data-theme="light"] .sidebar.mobile-open {
    background: #ffffff !important;
    border-right-color: #cbd5e1 !important;
}

[data-theme="light"] .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .card h3,
[data-theme="light"] .card h4 {
    color: #0f172a !important;
}

/* Light Mode Universal Form Inputs, Selects & Textareas */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .fg input,
[data-theme="light"] .fg select,
[data-theme="light"] .fg textarea,
[data-theme="light"] .search-bar input,
[data-theme="light"] .search-bar select,
[data-theme="light"] .filter-bar input,
[data-theme="light"] .filter-bar select,
[data-theme="light"] .excel-toolbar input,
[data-theme="light"] .excel-toolbar select,
[data-theme="light"] .tbl input,
[data-theme="light"] .tbl select,
[data-theme="light"] .addon-cat-select,
[data-theme="light"] .mp-addon-filter,
[data-theme="light"] .mp-date-quick,
[data-theme="light"] #cat-pick,
[data-theme="light"] #qb-to,
[data-theme="light"] #qb-th,
[data-theme="light"] #qb-dt2,
[data-theme="light"] #qb-st,
[data-theme="light"] #emp-colony,
[data-theme="light"] #es-cat-select,
[data-theme="light"] #es-unit-select {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

/* Light Mode Select Chevron */
[data-theme="light"] select,
[data-theme="light"] .fg select,
[data-theme="light"] .search-bar select,
[data-theme="light"] .filter-bar select,
[data-theme="light"] .excel-toolbar select,
[data-theme="light"] .tbl select,
[data-theme="light"] .addon-cat-select,
[data-theme="light"] .mp-addon-filter,
[data-theme="light"] .mp-date-quick,
[data-theme="light"] #cat-pick,
[data-theme="light"] #qb-to,
[data-theme="light"] #qb-th,
[data-theme="light"] #qb-dt2,
[data-theme="light"] #qb-st,
[data-theme="light"] #emp-colony,
[data-theme="light"] #es-cat-select,
[data-theme="light"] #es-unit-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b48214' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 13px) center !important;
    background-size: 12px 12px !important;
    padding-right: 36px !important;
}

/* Light Mode Hover Contrast — Fixes dark navy hover issue across all modules */
[data-theme="light"] input:hover,
[data-theme="light"] select:hover,
[data-theme="light"] textarea:hover,
[data-theme="light"] .fg input:hover,
[data-theme="light"] .fg select:hover,
[data-theme="light"] .fg textarea:hover,
[data-theme="light"] .search-bar input:hover,
[data-theme="light"] .search-bar select:hover,
[data-theme="light"] .filter-bar input:hover,
[data-theme="light"] .filter-bar select:hover,
[data-theme="light"] .excel-toolbar input:hover,
[data-theme="light"] .excel-toolbar select:hover,
[data-theme="light"] .tbl input:hover,
[data-theme="light"] .tbl select:hover,
[data-theme="light"] .addon-cat-select:hover,
[data-theme="light"] .mp-addon-filter:hover,
[data-theme="light"] .mp-date-quick:hover,
[data-theme="light"] #cat-pick:hover,
[data-theme="light"] #qb-to:hover,
[data-theme="light"] #qb-th:hover,
[data-theme="light"] #qb-dt2:hover,
[data-theme="light"] #qb-st:hover,
[data-theme="light"] #emp-colony:hover,
[data-theme="light"] #es-cat-select:hover,
[data-theme="light"] #es-unit-select:hover {
    background-color: #f8fafc !important;
    border-color: #b48214 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(180, 130, 20, 0.16) !important;
    transform: translateY(-1px);
}

/* Light Mode Active & Focus Contrast */
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] select:active,
[data-theme="light"] textarea:focus,
[data-theme="light"] .fg input:focus,
[data-theme="light"] .fg select:focus,
[data-theme="light"] .fg textarea:focus,
[data-theme="light"] .search-bar input:focus,
[data-theme="light"] .search-bar select:focus,
[data-theme="light"] .filter-bar input:focus,
[data-theme="light"] .filter-bar select:focus,
[data-theme="light"] .excel-toolbar input:focus,
[data-theme="light"] .excel-toolbar select:focus,
[data-theme="light"] .tbl input:focus,
[data-theme="light"] .tbl select:focus,
[data-theme="light"] .addon-cat-select:focus,
[data-theme="light"] .mp-addon-filter:focus,
[data-theme="light"] .mp-date-quick:focus,
[data-theme="light"] #cat-pick:focus,
[data-theme="light"] #qb-to:focus,
[data-theme="light"] #qb-th:focus,
[data-theme="light"] #qb-dt2:focus,
[data-theme="light"] #qb-st:focus,
[data-theme="light"] #emp-colony:focus,
[data-theme="light"] #es-cat-select:focus,
[data-theme="light"] #es-unit-select:focus {
    background-color: #ffffff !important;
    border-color: #b48214 !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(180, 130, 20, 0.22), 0 4px 14px rgba(15, 23, 42, 0.08) !important;
    outline: none !important;
    transform: translateY(0);
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}

/* Light Mode High-Contrast Dropdown Options */
[data-theme="light"] select option,
[data-theme="light"] select optgroup,
[data-theme="light"] option,
[data-theme="light"] optgroup,
[data-theme="light"] .fg select option,
[data-theme="light"] .tbl select option,
[data-theme="light"] .search-bar select option,
[data-theme="light"] .excel-toolbar select option {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    padding: 10px 14px !important;
}

[data-theme="light"] select option:checked,
[data-theme="light"] select option:hover,
[data-theme="light"] select option:focus,
[data-theme="light"] option:checked,
[data-theme="light"] option:hover,
[data-theme="light"] option:focus {
    background: #fef3c7 !important;
    background-color: #fef3c7 !important;
    color: #8d6205 !important;
    font-weight: 700 !important;
}

[data-theme="light"] .search-bar,
[data-theme="light"] .filter-bar,
[data-theme="light"] .revenue-filter-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03) !important;
}

[data-theme="light"] .tbl,
[data-theme="light"] table {
    background: #ffffff !important;
}

[data-theme="light"] .tbl th,
[data-theme="light"] table th,
[data-theme="light"] .revenue-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .tbl td,
[data-theme="light"] table td,
[data-theme="light"] .revenue-table td {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

[data-theme="light"] .tbl tr:hover td,
[data-theme="light"] table tr:hover td,
[data-theme="light"] .revenue-table tr:hover td {
    background: #f8fafc !important;
}

[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.55) !important;
}

[data-theme="light"] .modal-box,
[data-theme="light"] .modal-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2) !important;
    color: #0f172a !important;
}

[data-theme="light"] .modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .modal-title,
[data-theme="light"] .modal-header h3 {
    color: #0f172a !important;
}

[data-theme="light"] .modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .btn-outline {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

[data-theme="light"] .btn-outline:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

[data-theme="light"] .btn-gold {
    background: linear-gradient(135deg, #d4a843, #b48214) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(180, 130, 20, 0.25) !important;
}

[data-theme="light"] .btn-dark {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #0f172a !important;
}

[data-theme="light"] .btn-dark:hover {
    background: #1e293b !important;
}

[data-theme="light"] .btn-ghost {
    color: #475569 !important;
}

[data-theme="light"] .btn-ghost:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-theme="light"] .action-btn {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}

[data-theme="light"] .action-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .mb-nav-item {
    color: #64748b !important;
}

[data-theme="light"] .mb-nav-item.active {
    color: #b48214 !important;
}

[data-theme="light"] .mobile-menu-btn {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .revenue-kpi-card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03) !important;
}

[data-theme="light"] .revenue-section {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03) !important;
}

[data-theme="light"] .revenue-sec-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .revenue-sec-title {
    color: #0f172a !important;
}

[data-theme="light"] .revenue-table tfoot td {
    background: #f8fafc !important;
    border-top: 2px solid #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .ledger-summary-strip {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .ledger-summary-item .val {
    color: #0f172a !important;
}

[data-theme="light"] .accordion-header,
[data-theme="light"] .tree-header {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

[data-theme="light"] .login-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1) !important;
}

/* Light mode support for welcome hero banner */
[data-theme="light"] .dashboard-welcome-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
}
[data-theme="light"] .welcome-hero-title {
    color: #0f172a !important;
}
[data-theme="light"] .welcome-hero-title .highlight-gold {
    background: linear-gradient(135deg, #b48214, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="light"] .welcome-hero-date {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

/* Light mode support for status indicators */
[data-theme="light"] .status-indicator.si-paid {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.5);
    color: #059669;
}
[data-theme="light"] .status-indicator.si-partial {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.5);
    color: #d97706;
}
[data-theme="light"] .status-indicator.si-unpaid {
    background: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.4);
    color: #475569;
}
[data-theme="light"] .status-indicator.si-overdue {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.5);
    color: #dc2626;
}

/* ===== EXHAUSTIVE LIGHT MODE HIGH-CONTRAST SYSTEM ===== */
[data-theme="light"] .qa-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}
[data-theme="light"] .qa-card:hover {
    background: #f8fafc !important;
    border-color: #b48214 !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08) !important;
}
[data-theme="light"] .qa-title {
    color: #0f172a !important;
    font-weight: 700 !important;
}
[data-theme="light"] .qa-sub {
    color: #64748b !important;
}

/* Kanban Board in Light Mode */
[data-theme="light"] .kanban-col {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .kanban-col-title {
    color: #334155 !important;
}
[data-theme="light"] .kanban-col-title .count {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
[data-theme="light"] .k-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid #b48214 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}
[data-theme="light"] .k-card:hover {
    border-color: #cbd5e1 !important;
    border-left-color: #b48214 !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.09) !important;
}
[data-theme="light"] .k-card .k-client {
    color: #0f172a !important;
}
[data-theme="light"] .k-card .k-title {
    color: #b48214 !important;
}
[data-theme="light"] .k-card .k-amt {
    color: #0f172a !important;
}
[data-theme="light"] .kanban-slider-bar {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
[data-theme="light"] .k-col-pill {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}
[data-theme="light"] .k-col-pill:hover,
[data-theme="light"] .k-col-pill.active {
    background: rgba(180, 130, 20, 0.1) !important;
    border-color: #b48214 !important;
    color: #b48214 !important;
}
[data-theme="light"] .k-col-pill .pill-badge {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
[data-theme="light"] .kanban-slide-btn {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}
[data-theme="light"] .kanban-slide-btn:hover {
    background: rgba(180, 130, 20, 0.1) !important;
    border-color: #b48214 !important;
    color: #b48214 !important;
}
[data-theme="light"] .kanban-col.k-drag-over {
    border-color: #b48214 !important;
    background: rgba(180, 130, 20, 0.08) !important;
    box-shadow: 0 0 16px rgba(180, 130, 20, 0.2) !important;
}
[data-theme="light"] .k-move-btn {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
[data-theme="light"] .k-move-btn:hover {
    background: rgba(180, 130, 20, 0.1) !important;
    border-color: #b48214 !important;
    color: #b48214 !important;
}
[data-theme="light"] .k-move-btn.danger {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #ef4444 !important;
}
[data-theme="light"] .k-move-btn.danger:hover {
    background: #fee2e2 !important;
    border-color: #dc2626 !important;
    color: #b91c1c !important;
}

/* Alert Strips in Light Mode */
[data-theme="light"] .alert-strip.warning {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
}
[data-theme="light"] .alert-strip.info {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1e40af !important;
}

/* Form Labels */
[data-theme="light"] .fg label,
[data-theme="light"] label {
    color: #334155 !important;
    font-weight: 600 !important;
}

/* Tab buttons in Light Mode */
[data-theme="light"] .tab-btn {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}
[data-theme="light"] .tab-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
[data-theme="light"] .tab-btn.active {
    background: #ffffff !important;
    border-color: #b48214 !important;
    color: #8d6205 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(180, 130, 20, 0.15) !important;
}

/* Summary boxes & Stat Values */
[data-theme="light"] .stat-val,
[data-theme="light"] .kpi-val,
[data-theme="light"] .revenue-kpi-val,
[data-theme="light"] .summary-val,
[data-theme="light"] .amt {
    color: #0f172a !important;
}

/* All headings, bold text, and strong tags */
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3,
[data-theme="light"] h4, [data-theme="light"] h5, [data-theme="light"] h6 {
    color: #0f172a !important;
}
[data-theme="light"] .card strong,
[data-theme="light"] .tbl strong,
[data-theme="light"] .content strong,
[data-theme="light"] b {
    color: #0f172a !important;
}
[data-theme="light"] .empty-state .es-title,
[data-theme="light"] .empty-state h3,
[data-theme="light"] .empty-state h4 {
    color: #0f172a !important;
}
[data-theme="light"] .empty-state .es-msg,
[data-theme="light"] .empty-state p {
    color: #475569 !important;
}

/* Universal Light Mode Contrast Safety: Overrides hardcoded inline white text on content */
[data-theme="light"] :not(.btn):not(.btn *):not(.badge):not(.badge *):not(.margin-pill):not(.welcome-hero-title):not(.welcome-hero-title *)[style*="color:#fff"],
[data-theme="light"] :not(.btn):not(.btn *):not(.badge):not(.badge *):not(.margin-pill):not(.welcome-hero-title):not(.welcome-hero-title *)[style*="color: #fff"],
[data-theme="light"] :not(.btn):not(.btn *):not(.badge):not(.badge *):not(.margin-pill):not(.welcome-hero-title):not(.welcome-hero-title *)[style*="color:#ffffff"],
[data-theme="light"] :not(.btn):not(.btn *):not(.badge):not(.badge *):not(.margin-pill):not(.welcome-hero-title):not(.welcome-hero-title *)[style*="color: #ffffff"],
[data-theme="light"] :not(.btn):not(.btn *):not(.badge):not(.badge *):not(.margin-pill):not(.welcome-hero-title):not(.welcome-hero-title *)[style*="color:white"],
[data-theme="light"] :not(.btn):not(.btn *):not(.badge):not(.badge *):not(.margin-pill):not(.welcome-hero-title):not(.welcome-hero-title *)[style*="color: white"] {
    color: #0f172a !important;
}

/* Light Mode Project Command Center Modal & Hero */
[data-theme="light"] .proj-hero {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}
[data-theme="light"] .proj-hero h2 {
    color: #0f172a !important;
}
[data-theme="light"] .proj-hero .lbl {
    color: #64748b !important;
    font-weight: 600;
}
[data-theme="light"] .proj-gauge {
    border-top: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .proj-gauge-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .proj-gauge-item .amt {
    color: #0f172a !important;
}

/* Light Mode Key Note Strip */
[data-theme="light"] .pd-key-note-strip {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    box-shadow: 0 1px 3px rgba(180, 130, 20, 0.08) !important;
}
[data-theme="light"] .pd-key-note-strip:hover {
    background: #fef3c7 !important;
    border-color: #b48214 !important;
    box-shadow: 0 2px 8px rgba(180, 130, 20, 0.15) !important;
}
[data-theme="light"] .pd-key-note-strip .kn-badge {
    color: #92400e !important;
}
[data-theme="light"] .pd-key-note-strip .kn-text {
    color: #0f172a !important;
    font-weight: 500;
}
[data-theme="light"] .kn-edit-btn {
    color: #92400e !important;
    background: linear-gradient(135deg, rgba(180, 130, 20, 0.12), rgba(180, 130, 20, 0.06)) !important;
    border-color: #fbbf24 !important;
}
[data-theme="light"] .kn-edit-btn:hover {
    color: #78350f !important;
    background: linear-gradient(135deg, rgba(180, 130, 20, 0.22), rgba(180, 130, 20, 0.14)) !important;
    border-color: #b48214 !important;
    box-shadow: 0 2px 8px rgba(180, 130, 20, 0.15) !important;
}

/* Light Mode Comments Feed & Composer */
[data-theme="light"] .comment-item,
[data-theme="light"] .comment-bubble {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
}
[data-theme="light"] .comment-item:hover,
[data-theme="light"] .comment-bubble:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07) !important;
}
[data-theme="light"] #pd-comment-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
[data-theme="light"] #pd-comment-input:focus {
    background: #ffffff !important;
    border-color: #b48214 !important;
    box-shadow: 0 0 0 3px rgba(180, 130, 20, 0.16) !important;
}

/* Light Mode 360 Project Overview & Excel Table */
[data-theme="light"] .excel-wrapper {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}
[data-theme="light"] .excel-toolbar {
    background: #f8fafc !important;
    border-bottom: 1px solid #cbd5e1 !important;
}
[data-theme="light"] .excel-toolbar input,
[data-theme="light"] .excel-toolbar select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
[data-theme="light"] .excel-toolbar input:hover,
[data-theme="light"] .excel-toolbar select:hover {
    background: #f8fafc !important;
    border-color: #b48214 !important;
}
[data-theme="light"] .excel-toolbar input:focus,
[data-theme="light"] .excel-toolbar select:focus {
    background: #ffffff !important;
    border-color: #b48214 !important;
    box-shadow: 0 0 0 3px rgba(180, 130, 20, 0.16) !important;
    color: #0f172a !important;
}
[data-theme="light"] .excel-toolbar input::placeholder {
    color: #64748b !important;
}
[data-theme="light"] .excel-toolbar select option {
    background: #ffffff !important;
    color: #0f172a !important;
}
[data-theme="light"] .excel-tbl th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    border-right: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .excel-tbl th.sortable:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
[data-theme="light"] .excel-tbl td {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}
[data-theme="light"] .excel-tbl tr:nth-child(even) td {
    background: #f8fafc !important;
}
[data-theme="light"] .excel-tbl tbody tr:hover td {
    background: #fef9c3 !important;
}

/* 360 Totals Summary Row in Light Mode (The last row) */
[data-theme="light"] .excel-tbl tr.excel-totals-row td {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-top: 2.5px solid #b48214 !important;
    border-bottom: none !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04) !important;
}
[data-theme="light"] .excel-tbl tr.excel-totals-row td strong {
    color: #0f172a !important;
}

/* ============================================================
   EXPENSES VIEW LIGHT MODE REFINEMENT (Premium Executive Finish)
   Replaces dark muddy slabs with crisp slate surfaces & gold accents
   ============================================================ */

/* 1. Master Project Tree Card */
[data-theme="light"] .tree-node {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    margin-bottom: 16px !important;
}
[data-theme="light"] .tree-node:hover {
    border-color: #cbd5e1 !important;
}
[data-theme="light"] .tree-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 16px 20px !important;
}
[data-theme="light"] .tree-header:hover {
    background: #f8fafc !important;
}
[data-theme="light"] .tree-chevron {
    color: #b48214 !important;
}
[data-theme="light"] .tree-content {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 16px 20px !important;
}

/* Master Account Metadata Strip */
[data-theme="light"] .mp-meta-strip {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02) !important;
}

/* 2. Sub-Addon Box */
[data-theme="light"] .addon-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid #b48214 !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
    margin-top: 14px !important;
}
[data-theme="light"] .addon-box:hover {
    border-color: #cbd5e1 !important;
    border-left-color: #8d6205 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}
[data-theme="light"] .addon-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
[data-theme="light"] .addon-header:hover {
    background: #f8fafc !important;
}
[data-theme="light"] .addon-chevron {
    color: #b48214 !important;
}
[data-theme="light"] .addon-content {
    background: #ffffff !important;
    border-top: 1px solid #f1f5f9 !important;
    padding: 14px 18px !important;
}

/* 3. Category Filter Toolbar — Clean Slate-50 finish */
[data-theme="light"] .addon-cat-toolbar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02) !important;
    margin-bottom: 14px !important;
}
[data-theme="light"] .addon-cat-select {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    font-weight: 500 !important;
}
[data-theme="light"] .addon-cat-select:focus {
    border-color: #b48214 !important;
    box-shadow: 0 0 0 3px rgba(180, 130, 20, 0.16) !important;
}

/* 4. Category Filter Chips */
[data-theme="light"] .cat-chip {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.15s ease !important;
}
[data-theme="light"] .cat-chip:hover {
    background: #f1f5f9 !important;
    border-color: #b48214 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
}
[data-theme="light"] .cat-chip.active {
    background: linear-gradient(135deg, #d4a843, #b48214) !important;
    border-color: #b48214 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(180, 130, 20, 0.25) !important;
}
[data-theme="light"] .cat-chip.active strong {
    color: #ffffff !important;
}

/* 5. Category Box & Internal Tables */
[data-theme="light"] .cat-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
    margin-top: 10px !important;
}
[data-theme="light"] .cat-box-header {
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
}
[data-theme="light"] .cat-box .tbl {
    background: #ffffff !important;
}
[data-theme="light"] .cat-box .tbl th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 700 !important;
}
[data-theme="light"] .cat-box .tbl td {
    background: #ffffff !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
[data-theme="light"] .cat-box .tbl tr:hover td {
    background: #f8fafc !important;
}

/* 6. Addon Details Modal in Light Mode */
[data-theme="light"] .ad-stat-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .ad-cat-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .ad-cat-item .bar-bg {
    background: #e2e8f0 !important;
}

/* 7. Project Tile Card in Light Mode (Refined Executive Finish) */
[data-theme="light"] .pj-tile-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid #b48214 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02) !important;
    padding: 18px 20px !important;
}
[data-theme="light"] .pj-tile-card:hover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    border-left-color: #8d6205 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(180, 130, 20, 0.12) !important;
}
[data-theme="light"] .pj-ref-badge {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    display: inline-block !important;
}
[data-theme="light"] .pj-tile-title {
    color: #0f172a !important;
    font-weight: 700 !important;
}
[data-theme="light"] .pj-tile-client {
    color: #475569 !important;
    font-weight: 500 !important;
}
[data-theme="light"] .pj-progress-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 11px 13px !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02) !important;
}
[data-theme="light"] .pj-prog-lbl {
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 11.5px !important;
}
[data-theme="light"] .pj-prog-pct {
    color: #b48214 !important;
    font-weight: 800 !important;
    font-size: 12px !important;
}
[data-theme="light"] .pj-prog-track {
    background: #e2e8f0 !important;
}
[data-theme="light"] .pj-prog-bar {
    background: linear-gradient(90deg, #d4a843, #b48214) !important;
}
[data-theme="light"] .pj-prog-recv {
    color: #475569 !important;
    font-size: 11.5px !important;
}
[data-theme="light"] .pj-prog-recv strong {
    color: #16a34a !important;
    font-weight: 700 !important;
}
[data-theme="light"] .pj-prog-total {
    color: #475569 !important;
    font-size: 11.5px !important;
}
[data-theme="light"] .pj-prog-total strong {
    color: #0f172a !important;
    font-weight: 700 !important;
}
[data-theme="light"] .pj-tile-foot {
    border-top: 1px solid #e2e8f0 !important;
}
[data-theme="light"] .pj-bal-lbl {
    color: #64748b !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
}
[data-theme="light"] .pj-bal-val {
    color: #dc2626 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

/* ============================================================
   MOBILE-FIRST QUICK EXPERIENCE SYSTEM (max-width: 768px)
   Lightweight, on-the-go actions & status checking
   Zero impact on Desktop view (Strictly scoped)
   ============================================================ */
/* Explicitly hide mobile-only elements on desktop */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }

    /* 1. Mobile Quick Glance Banner */
    .mobile-glance-banner {
        background: var(--bg-card, #121524);
        border: 1px solid var(--border);
        border-left: 3.5px solid var(--gold);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        margin-bottom: 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    [data-theme="light"] .mobile-glance-banner {
        background: #ffffff !important;
        border-color: #e2e8f0 !important;
        border-left-color: #b48214 !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    }

    /* 2. Center Quick Log FAB in Mobile Bottom Nav */
    .mb-nav-fab {
        position: relative !important;
        top: -12px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        padding: 0 !important;
    }
    .mb-fab-circle {
        width: 46px !important;
        height: 46px !important;
        border-radius: 50% !important;
        background: linear-gradient(135deg, #e5b94c 0%, #b48214 100%) !important;
        color: #0b0d17 !important;
        font-size: 21px !important;
        font-weight: 800 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 4px 14px rgba(212, 168, 67, 0.45) !important;
        border: 3.5px solid #0e111c !important;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease !important;
    }
    [data-theme="light"] .mb-fab-circle {
        border-color: #ffffff !important;
        box-shadow: 0 4px 14px rgba(180, 130, 20, 0.3) !important;
        color: #ffffff !important;
    }
    .mb-nav-fab:active .mb-fab-circle {
        transform: scale(0.92) !important;
    }
    .mb-nav-fab .mb-nav-label {
        color: var(--gold) !important;
        font-weight: 700 !important;
        margin-top: 2px !important;
    }

    /* 3. Mobile Quick Log Hub Sheet */
    .mobile-quick-hub {
        padding: 4px 0;
    }
    .mq-card {
        background: var(--bg-surface, #171b2d);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 14px 12px;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        -webkit-tap-highlight-color: transparent;
    }
    [data-theme="light"] .mq-card {
        background: #ffffff !important;
        border-color: #e2e8f0 !important;
    }
    .mq-card:active {
        transform: scale(0.96);
        border-color: var(--gold);
        background: var(--gold-dim);
    }
    .mq-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 19px;
        margin-bottom: 2px;
    }
    .mq-title {
        font-size: 13px;
        font-weight: 700;
        color: var(--text);
        line-height: 1.2;
    }
    .mq-sub {
        font-size: 11px;
        color: var(--text3);
        line-height: 1.25;
    }

    /* 4. Revenue View on Mobile: Executive Tiles First & Collapsible Filter */
    #rev-filter-grid {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
        margin-top: 0;
    }
    #rev-filter-grid.mobile-open {
        max-height: 1200px !important;
        opacity: 1 !important;
        margin-top: 14px !important;
        overflow: visible !important;
    }
    .revenue-filter-card {
        padding: 14px 14px !important;
        margin-bottom: 16px !important;
    }
    .revenue-kpi-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
    }
    .revenue-kpi-row-1,
    .revenue-kpi-row-2,
    .revenue-kpi-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
    }
    .revenue-kpi-row-1 .revenue-kpi-card:first-child {
        grid-column: 1 / -1 !important;
    }
    .revenue-kpi-row-2 .revenue-kpi-card:last-child {
        grid-column: 1 / -1 !important;
    }
    .revenue-kpi-card {
        padding: 10px 12px !important;
    }
    .revenue-kpi-title {
        font-size: 10px !important;
        letter-spacing: 0.2px !important;
    }
    .revenue-kpi-val {
        font-size: 17px !important;
    }
    .revenue-kpi-sub {
        display: none !important;
    }
    .kpi-mini-progress {
        display: none !important;
    }
    .revenue-section {
        padding: 10px 10px !important;
        margin-bottom: 12px !important;
        border-radius: var(--radius-md) !important;
    }
    .revenue-sec-header {
        margin-bottom: 8px !important;
        padding-bottom: 6px !important;
    }
    .revenue-sec-title {
        font-size: 12.5px !important;
        gap: 6px !important;
    }
    .revenue-table-wrapper {
        border-radius: var(--radius-sm) !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .revenue-table {
        font-size: 11px !important;
    }
    .revenue-table th {
        padding: 6px 8px !important;
        font-size: 9.5px !important;
        letter-spacing: 0.2px !important;
    }
    .revenue-table td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
    .revenue-table tfoot td {
        padding: 7px 8px !important;
        font-size: 11px !important;
    }
    .margin-pill {
        padding: 2px 5px !important;
        font-size: 9px !important;
        border-radius: 6px !important;
    }

    /* Compact Mobile Tables & Big Data Ledgers */
    .tbl th, .tbl td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
    .tbl tfoot td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }
    .excel-tbl th, .excel-tbl td {
        padding: 5px 7px !important;
        font-size: 10.5px !important;
    }
    .tbl .btn,
    .excel-tbl .btn,
    .revenue-table .btn,
    .action-btn {
        min-height: 24px !important;
        padding: 2px 6px !important;
        font-size: 10px !important;
    }

    /* 5. Projects View: 100% Mobile Cards */
    #pj-container > div {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 6. Quotations View: Touch Snap Kanban & Sliders Compact */
    .kanban-slider-bar {
        padding: 6px 8px !important;
        margin-bottom: 10px !important;
        gap: 6px !important;
    }
    .kanban-slide-btns {
        display: none !important;
    }
    .kanban {
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 12px !important;
        padding-bottom: 12px !important;
        touch-action: pan-x pan-y !important;
        cursor: auto !important;
    }
    .kanban-col {
        flex: 0 0 84vw !important;
        min-width: 84vw !important;
        max-width: 86vw !important;
        scroll-snap-align: center !important;
        scroll-snap-stop: always !important;
        min-height: auto !important;
        padding: 12px 10px !important;
    }
    .tab-nav {
        gap: 3px !important;
        padding-bottom: 3px !important;
    }
    .tab-btn {
        padding: 5px 9px !important;
        font-size: 11px !important;
        min-height: 28px !important;
    }
    .revenue-table-wrapper::-webkit-scrollbar,
    .tab-nav::-webkit-scrollbar,
    .kanban::-webkit-scrollbar {
        height: 3px;
    }
    .revenue-table-wrapper::-webkit-scrollbar-thumb,
    .tab-nav::-webkit-scrollbar-thumb,
    .kanban::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }

    /* 7. Master Projects View: Compact Touch Table */
    .search-bar {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        align-items: stretch !important;
    }
    .search-bar input,
    .search-bar select,
    .search-bar button {
        width: 100% !important;
    }

    /* 8. Touch Friendliness & Mobile Input Height */
    input, select, textarea {
        font-size: 13.5px !important;
        min-height: 40px !important;
    }
    .btn {
        min-height: 38px !important;
    }
    .btn-xs {
        min-height: 28px !important;
    }
    .btn-sm {
        min-height: 34px !important;
    }
}

/* ============================================================
   PROJECT COMMAND CENTER UI ENHANCEMENTS
   ============================================================ */

/* 1. Add-on Expenses in Light Mode */
.addon-title {
    color: #ffffff;
}
.addon-cat-card {
    background: rgba(0, 0, 0, 0.2);
}
.addon-cat-name {
    color: inherit;
}
.addon-cat-amt {
    color: var(--text2);
}
.addon-exp-row {
    color: var(--text2);
}
.addon-exp-val {
    color: var(--text);
}

[data-theme="light"] #pd-exps .addon-box,
[data-theme="light"] .addon-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid var(--gold, #d4a843) !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
}
[data-theme="light"] #pd-exps .addon-box .addon-title,
[data-theme="light"] .addon-box .addon-title,
[data-theme="light"] #pd-exps .addon-box strong[style*="color:#fff"] {
    color: #0f172a !important;
    font-weight: 800 !important;
}
[data-theme="light"] #pd-exps .addon-box .addon-total,
[data-theme="light"] .addon-box .addon-total {
    color: #b48214 !important;
    font-weight: 800 !important;
}
[data-theme="light"] #pd-exps .addon-cat-card,
[data-theme="light"] .addon-cat-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--radius-sm) !important;
    margin-top: 8px !important;
    padding: 10px 14px !important;
}
[data-theme="light"] #pd-exps .addon-cat-card .addon-cat-name,
[data-theme="light"] .addon-cat-card .addon-cat-name {
    color: #0f172a !important;
    font-weight: 700 !important;
}
[data-theme="light"] #pd-exps .addon-cat-card .addon-cat-amt,
[data-theme="light"] .addon-cat-card .addon-cat-amt {
    color: #475569 !important;
    font-weight: 700 !important;
}
[data-theme="light"] #pd-exps .addon-exp-row,
[data-theme="light"] .addon-exp-row {
    color: #334155 !important;
    border-top: 1px dashed #cbd5e1 !important;
    padding: 6px 0 !important;
}
[data-theme="light"] #pd-exps .addon-exp-row .addon-exp-desc,
[data-theme="light"] .addon-exp-row .addon-exp-desc {
    color: #475569 !important;
}
[data-theme="light"] #pd-exps .addon-exp-row .addon-exp-val,
[data-theme="light"] .addon-exp-row .addon-exp-val {
    color: #0f172a !important;
    font-weight: 800 !important;
}
[data-theme="light"] #pd-exps .addon-exp-row .action-btn,
[data-theme="light"] .addon-exp-row .action-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
[data-theme="light"] #pd-exps .addon-exp-row .action-btn:hover,
[data-theme="light"] .addon-exp-row .action-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

/* 2. Scope of Work Done Row in Light Mode */
[data-theme="light"] .tbl tbody tr.scope-row-done,
[data-theme="light"] .tbl tbody tr.scope-row-done td {
    background: #f0fdf4 !important;
    border-bottom: 1px solid #bbf7d0 !important;
    color: #1e293b !important;
}
[data-theme="light"] .tbl tbody tr.scope-row-done td:first-child {
    border-left: 4px solid #16a34a !important;
}
[data-theme="light"] .tbl tbody tr.scope-row-done td strong {
    color: #14532d !important;
    font-weight: 700 !important;
}
[data-theme="light"] .tbl tbody tr.scope-row-done td .badge {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}
[data-theme="light"] .tbl tbody tr.scope-row-done td:nth-child(3),
[data-theme="light"] .tbl tbody tr.scope-row-done td:nth-child(4) {
    color: #334155 !important;
    font-weight: 600 !important;
}
[data-theme="light"] .tbl tbody tr.scope-row-done td:nth-child(5) {
    color: #0f172a !important;
    font-weight: 800 !important;
}
[data-theme="light"] .tbl tbody tr.scope-row-done .scope-status-label {
    color: #15803d !important;
    font-weight: 800 !important;
}
[data-theme="light"] .tbl tbody tr.scope-row-done:hover td {
    background: #dcfce7 !important;
}

/* 3. WhatsApp-Style Premium Comments UI */
.wa-chat-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wa-chat-canvas {
    background-color: #efeae2;
    background-image: radial-gradient(#d5cdc4 0.75px, transparent 0.75px), radial-gradient(#d5cdc4 0.75px, #efeae2 0.75px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    border: 1px solid #d1d7db;
    border-radius: 14px;
    padding: 16px 18px;
    min-height: 240px;
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    scroll-behavior: smooth;
}
[data-theme="dark"] .wa-chat-canvas {
    background-color: #0b141a;
    background-image: radial-gradient(#1e293b 0.75px, transparent 0.75px), radial-gradient(#1e293b 0.75px, #0b141a 0.75px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    border: 1px solid #222e35;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.4);
}
.wa-date-divider {
    text-align: center;
    margin: 4px 0 8px 0;
}
.wa-date-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.92);
    color: #54656f;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(11,20,26,0.1);
    letter-spacing: 0.3px;
}
[data-theme="dark"] .wa-date-pill {
    background: #182229;
    color: #8696a0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* WhatsApp Message Row & Bubble */
.wa-msg-row {
    display: flex;
    width: 100%;
}
.wa-msg-row.me {
    justify-content: flex-end;
}
.wa-msg-row.other {
    justify-content: flex-start;
}
.wa-bubble {
    position: relative;
    max-width: 82%;
    padding: 5px 9px 4px 11px;
    box-shadow: 0 1px 1px rgba(11, 20, 26, 0.12);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.42;
    word-break: break-word;
    display: inline-block;
}
.wa-bubble::after {
    content: "";
    display: table;
    clear: both;
}
.wa-bubble.me {
    background: #d9fdd3;
    border-radius: 8px 8px 2px 8px;
}
[data-theme="dark"] .wa-bubble.me {
    background: #005c4b;
    border-radius: 8px 8px 2px 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.wa-bubble.other {
    background: #ffffff;
    border-radius: 8px 8px 8px 2px;
}
[data-theme="dark"] .wa-bubble.other {
    background: #202c33;
    border-radius: 8px 8px 8px 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.wa-sender-prefix {
    font-weight: 700;
    color: #128c7e;
    margin-right: 4px;
    font-size: 13px;
}
[data-theme="dark"] .wa-sender-prefix {
    color: #25d366;
}
.wa-msg-text {
    color: #111b21;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    display: inline;
}
[data-theme="dark"] .wa-msg-text {
    color: #e9edef;
}
.wa-msg-meta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #667781;
    margin-left: 10px;
    float: right;
    position: relative;
    bottom: -2px;
    user-select: none;
    line-height: 1.2;
}
[data-theme="dark"] .wa-msg-meta {
    color: #8696a0;
}
.wa-delete-action {
    opacity: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    font-size: 11px;
    transition: opacity 0.15s ease;
    color: #ef4444;
    vertical-align: middle;
    line-height: 1;
}
.wa-bubble:hover .wa-delete-action {
    opacity: 1;
}

/* WhatsApp Composer Bar */
.wa-composer-card {
    background: #f0f2f5;
    border: 1px solid #d1d7db;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
[data-theme="dark"] .wa-composer-card {
    background: #202c33;
    border-color: #2a3942;
}
.wa-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(18,140,126,0.3);
}
.wa-input-pill {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e9edef;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 13.5px;
    color: #111b21;
    outline: none;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    max-height: 90px;
    min-height: 38px;
    box-sizing: border-box;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}
[data-theme="dark"] .wa-input-pill {
    background: #2a3942;
    border-color: #2a3942;
    color: #e9edef;
}
.wa-input-pill:focus {
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}
.wa-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
    transition: transform var(--trans-fast), background var(--trans-fast);
}
.wa-send-btn:hover {
    background: #20bd5a;
    transform: scale(1.05);
}
.wa-send-btn:active {
    transform: scale(0.95);
}

/* Datalist Combobox Indicator */
input[list]::-webkit-calendar-picker-indicator {
    opacity: 0.75;
    cursor: pointer;
    font-size: 13px;
    padding: 3px;
    transition: opacity var(--trans-fast);
}
input[list]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ───── MYSQL SYNC TOPBAR BADGE & MODAL ───── */
.mysql-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
    white-space: nowrap;
}
.mysql-badge-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.mysql-badge-btn:active {
    transform: translateY(0);
}
.mysql-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    display: inline-block;
    flex-shrink: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.mysql-status-connected .mysql-dot {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: mysqlPulse 2.5s infinite;
}
.mysql-status-syncing .mysql-dot {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.7);
    animation: mysqlSpinDot 1s infinite linear;
}
.mysql-status-error .mysql-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.mysql-status-connecting .mysql-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

@keyframes mysqlPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes mysqlSpinDot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .mysql-badge-btn {
        padding: 0 8px;
        height: 32px;
    }
    .mysql-badge-btn .mysql-label {
        display: none;
    }
}

.mysql-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    margin: 14px 0;
}
.mysql-table-item {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.mysql-table-name {
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.mysql-table-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
}

/* ============================================================
   ANALYTICS & TRENDS — SECTION-BASED EXECUTIVE DASHBOARD
   ============================================================ */
.analytics-filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.analytics-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.analytics-filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    margin-right: 2px;
}

.analytics-filter-select,
.analytics-filter-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.analytics-filter-select:focus,
.analytics-filter-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.15);
}

.analytics-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.analytics-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--sec-accent, var(--gold));
}

.analytics-sec-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.analytics-sec-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.analytics-sec-sub {
    font-size: 12px;
    color: var(--text3);
    margin-top: 3px;
}

.analytics-sec-badge {
    background: rgba(212, 168, 67, 0.12);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 67, 0.25);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Big Tiles in Section */
.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.analytics-kpi-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: var(--transition);
    position: relative;
}

.analytics-kpi-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(212, 168, 67, 0.3);
}

.analytics-kpi-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.analytics-kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.analytics-kpi-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Section Body: Two Columns (Data List + Corresponding Graph) */
.analytics-body-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .analytics-body-grid {
        grid-template-columns: 1fr;
    }
}

.analytics-full-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.analytics-list-pane {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
}

.analytics-list-head {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.analytics-graph-pane {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    position: relative;
}

.analytics-graph-head {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.analytics-canvas-wrap {
    flex: 1;
    position: relative;
    min-height: 240px;
    width: 100%;
}

.analytics-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text2);
}

.analytics-rank-1 { background: rgba(212, 168, 67, 0.2); color: var(--gold); }
.analytics-rank-2 { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.analytics-rank-3 { background: rgba(205, 127, 50, 0.2); color: #e2a878; }

.analytics-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.analytics-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--gold);
    transition: width 0.4s ease;
}

/* ============================================================
   ANALYTICS & TRENDS — LIGHT MODE HIGH-CONTRAST SYSTEM
   ============================================================ */
[data-theme="light"] .analytics-section {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02) !important;
}

[data-theme="light"] .analytics-sec-head {
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .analytics-sec-title {
    color: #0f172a !important;
}

[data-theme="light"] .analytics-sec-sub {
    color: #64748b !important;
}

[data-theme="light"] .analytics-sec-badge {
    background: rgba(180, 130, 20, 0.08) !important;
    color: #b48214 !important;
    border-color: rgba(180, 130, 20, 0.25) !important;
}

[data-theme="light"] .analytics-kpi-tile {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

[data-theme="light"] .analytics-kpi-tile:hover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

[data-theme="light"] .analytics-kpi-title {
    color: #64748b !important;
}

[data-theme="light"] .analytics-kpi-val {
    color: #0f172a !important;
}

[data-theme="light"] .analytics-kpi-sub {
    color: #64748b !important;
}

[data-theme="light"] .analytics-list-pane {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02) !important;
}

[data-theme="light"] .analytics-graph-pane {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02) !important;
}

[data-theme="light"] .analytics-list-head,
[data-theme="light"] .analytics-graph-head {
    color: #0f172a !important;
}

[data-theme="light"] .analytics-filter-bar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .analytics-filter-label {
    color: #64748b !important;
}

[data-theme="light"] .analytics-filter-select,
[data-theme="light"] .analytics-filter-input {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .analytics-filter-select:focus,
[data-theme="light"] .analytics-filter-input:focus {
    background: #ffffff !important;
    border-color: #b48214 !important;
    box-shadow: 0 0 0 3px rgba(180, 130, 20, 0.15) !important;
}

[data-theme="light"] .analytics-progress-bar {
    background: #e2e8f0 !important;
}

[data-theme="light"] .analytics-rank-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

[data-theme="light"] .analytics-rank-1 {
    background: rgba(180, 130, 20, 0.12) !important;
    color: #b48214 !important;
}

[data-theme="light"] .analytics-rank-2 {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

[data-theme="light"] .analytics-rank-3 {
    background: rgba(205, 127, 50, 0.15) !important;
    color: #9a5522 !important;
}

/* ─────────────────────────────────────────────────────────────
   SEARCHABLE SELECT POPUP (MULTI-WORD REAL-TIME FILTERING)
   ───────────────────────────────────────────────────────────── */
.ssm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999998;
}

.searchable-select-menu {
    position: fixed;
    background: #111424;
    border: 1px solid rgba(212, 168, 67, 0.45);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999999;
    font-family: inherit;
    animation: ssmFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ssmFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.searchable-select-menu.ssm-mobile-sheet {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(212, 168, 67, 0.6);
}

.ssm-header {
    padding: 10px 12px 8px;
    background: #161a2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ssm-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ssm-search-icon {
    position: absolute;
    left: 10px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0.75;
}

.ssm-search-input {
    width: 100%;
    padding: 8px 58px 8px 32px !important;
    background: #0d101d !important;
    border: 1px solid rgba(212, 168, 67, 0.35) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-family: inherit !important;
    outline: none !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.ssm-search-input:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

.ssm-clear-btn {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text3);
    font-size: 13px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.ssm-clear-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.ssm-close-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text3);
    font-size: 15px;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.ssm-close-btn:hover {
    color: #ff6b6b;
    background: rgba(239, 68, 68, 0.15);
}

.ssm-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 0 2px;
    font-size: 11px;
}

.ssm-counter {
    color: var(--gold);
    font-weight: 700;
}

.ssm-hint {
    color: var(--text3);
    font-size: 10px;
}

.ssm-list {
    flex: 1;
    overflow-y: auto;
    max-height: 280px;
    padding: 6px 0;
    scroll-behavior: smooth;
}

.ssm-list::-webkit-scrollbar {
    width: 6px;
}

.ssm-list::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 67, 0.3);
    border-radius: 3px;
}

.ssm-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 67, 0.55);
}

.ssm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    font-size: 12.5px;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    user-select: none;
    line-height: 1.35;
    border-left: 2px solid transparent;
}

.ssm-item.placeholder {
    color: var(--text3);
    font-style: italic;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 3px;
}

.ssm-item:hover,
.ssm-item.highlighted {
    background: rgba(212, 168, 67, 0.15);
    color: #ffffff;
    border-left-color: var(--gold);
}

.ssm-item.selected {
    background: rgba(212, 168, 67, 0.24);
    color: #ffd700;
    font-weight: 700;
    border-left-color: #ffd700;
}

.ssm-item.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.ssm-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
}

.ssm-check {
    color: #ffd700;
    font-weight: 800;
    margin-left: 10px;
    font-size: 13px;
}

mark.ssm-hl {
    background: rgba(212, 168, 67, 0.42) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-radius: 2px !important;
    padding: 0 3px !important;
}

.ssm-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text2);
}

/* Light Theme Overrides */
[data-theme="light"] .searchable-select-menu {
    background: #ffffff !important;
    border-color: #d4a843 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
}
[data-theme="light"] .ssm-header {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}
[data-theme="light"] .ssm-search-input {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
[data-theme="light"] .ssm-item {
    color: #1e293b !important;
}
[data-theme="light"] .ssm-item:hover,
[data-theme="light"] .ssm-item.highlighted {
    background: rgba(212, 168, 67, 0.15) !important;
    color: #0f172a !important;
}
[data-theme="light"] .ssm-item.selected {
    background: rgba(212, 168, 67, 0.25) !important;
    color: #b48214 !important;
}
[data-theme="light"] mark.ssm-hl {
    background: rgba(212, 168, 67, 0.35) !important;
    color: #000000 !important;
}

/* ==========================================================================
   MOBILE-FIRST CREATIVE & COMPACT DASHBOARD
   ========================================================================== */
.dashboard-mobile-layout {
    display: none;
}
.dashboard-desktop-layout {
    display: block;
}

@media (max-width: 768px) {
    .dashboard-desktop-layout {
        display: none !important;
    }
    .dashboard-mobile-layout {
        display: block !important;
        padding: 4px 0 24px 0;
    }

    /* 1. Header & Greeting */
    .mob-dash-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: var(--radius-lg, 16px);
        margin-bottom: 12px;
        backdrop-filter: blur(10px);
    }
    [data-theme="light"] .mob-dash-header {
        background: #ffffff;
        border-color: #e2e8f0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    }
    .mob-dash-user {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .mob-dash-avatar {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--gold) 0%, #b48528 100%);
        color: #0b0d17;
        font-weight: 800;
        font-size: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(212,168,67,0.3);
    }
    .mob-dash-greeting {
        font-size: 11px;
        color: var(--text3);
        font-weight: 500;
        line-height: 1.1;
    }
    .mob-dash-name {
        font-size: 14.5px;
        font-weight: 800;
        color: var(--text);
        letter-spacing: -0.2px;
    }
    .mob-dash-date-pill {
        font-size: 11px;
        font-weight: 600;
        color: var(--gold);
        background: rgba(212,168,67,0.1);
        border: 1px solid rgba(212,168,67,0.22);
        padding: 4px 9px;
        border-radius: 20px;
        white-space: nowrap;
    }

    /* 2. Alert Banner */
    .mob-dash-alert {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 9px 12px;
        background: rgba(239, 68, 68, 0.12);
        border: 1px solid rgba(239, 68, 68, 0.28);
        border-radius: 12px;
        margin-bottom: 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .mob-dash-alert-icon {
        font-size: 14px;
    }
    .mob-dash-alert-text {
        font-size: 12px;
        font-weight: 700;
        color: #ef4444;
        flex: 1;
    }
    .mob-dash-alert-arrow {
        font-size: 13px;
        color: #ef4444;
        font-weight: 800;
    }

    /* 3. Compact Pulse Strip */
    .mob-dash-pulse-strip {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }
    .mob-pulse-chip {
        background: var(--bg-surface, #171b2d);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 9px 8px;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    [data-theme="light"] .mob-pulse-chip {
        background: #ffffff;
        border-color: #e2e8f0;
    }
    .mob-pulse-chip:active {
        transform: scale(0.96);
    }
    .mob-pulse-icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        flex-shrink: 0;
    }
    .mob-pulse-val {
        font-size: 14.5px;
        font-weight: 800;
        color: var(--text);
        line-height: 1.1;
    }
    .mob-pulse-lbl {
        font-size: 10px;
        font-weight: 600;
        color: var(--text3);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    /* 4. Quick Action Tiles */
    .mob-dash-actions {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 14px;
    }
    .mob-act-card {
        background: var(--bg-surface, #171b2d);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 10px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        text-align: center;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    [data-theme="light"] .mob-act-card {
        background: #ffffff;
        border-color: #e2e8f0;
    }
    .mob-act-card:active {
        transform: scale(0.94);
        border-color: var(--gold);
    }
    .mob-act-card.act-pay .mob-act-icon {
        background: rgba(16, 185, 129, 0.14);
        color: #10b981;
    }
    .mob-act-card.act-exp .mob-act-icon {
        background: rgba(239, 68, 68, 0.14);
        color: #ef4444;
    }
    .mob-act-card.act-quote .mob-act-icon {
        background: rgba(212, 168, 67, 0.14);
        color: var(--gold);
    }
    .mob-act-card.act-addon .mob-act-icon {
        background: rgba(59, 130, 246, 0.14);
        color: #3b82f6;
    }
    .mob-act-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
    }
    .mob-act-label {
        font-size: 10.5px;
        font-weight: 700;
        color: var(--text);
        line-height: 1.15;
    }

    /* 5. Clean Feed Sections */
    .mob-dash-section {
        background: var(--bg-surface, #171b2d);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg, 16px);
        padding: 12px;
        overflow: hidden;
    }
    [data-theme="light"] .mob-dash-section {
        background: #ffffff;
        border-color: #e2e8f0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    }
    .mob-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
    }
    .mob-section-title {
        font-size: 13px;
        font-weight: 800;
        color: var(--text);
        letter-spacing: -0.2px;
    }
    .mob-section-link {
        background: none;
        border: none;
        color: var(--gold);
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        padding: 2px 6px;
        border-radius: 6px;
    }
    .mob-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .mob-item-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px;
        background: rgba(255,255,255,0.02);
        border: 1px solid rgba(255,255,255,0.04);
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    [data-theme="light"] .mob-item-card {
        background: #f8fafc;
        border-color: #f1f5f9;
    }
    .mob-item-card:active {
        transform: scale(0.98);
        border-color: var(--gold);
        background: rgba(212,168,67,0.06);
    }
    .mob-item-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        flex-shrink: 0;
    }
    .mob-item-body {
        flex: 1;
        min-width: 0;
    }
    .mob-item-primary {
        font-size: 13px;
        font-weight: 700;
        color: var(--text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }
    .mob-item-secondary {
        font-size: 11px;
        color: var(--text3);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 2px;
    }
    .mob-item-aside {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        flex-shrink: 0;
    }
    .mob-item-val {
        font-size: 12.5px;
        font-weight: 800;
        color: var(--text);
    }
}

/* Round Task Addition Checkbox (Gray by default -> Royal Blue on click) */
.task-add-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    margin: 0 auto;
    position: relative;
}

.task-add-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.task-add-round {
    width: 22px;
    height: 22px;
    border-radius: 50% !important;
    border: 2px solid #94a3b8;
    background-color: rgba(148, 163, 184, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.task-add-wrap:hover .task-add-round {
    border-color: #cbd5e1;
    background-color: rgba(148, 163, 184, 0.28);
    transform: scale(1.1);
}

/* When Checked -> Royal Blue */
.task-add-wrap input[type="checkbox"]:checked + .task-add-round {
    background-color: #2563eb !important; /* Royal Blue */
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5) !important;
}

.task-add-round .task-add-svg {
    width: 13px;
    height: 13px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-width: 3.5;
}

.task-add-wrap input[type="checkbox"]:checked + .task-add-round .task-add-svg {
    opacity: 1;
    transform: scale(1);
}



