/* KovAni Systems & Consulting Corporate Design System for Accounting App */
@keyframes spin {
    to { transform: rotate(360deg); }
}

:root {
    --bg-primary: #0a1128;
    --bg-card: rgba(15, 23, 42, 0.85);
    --bg-card-hover: rgba(26, 38, 66, 0.95);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --brand-blue: #1e3a8a;
    --accent-blue: #2563eb;
    --accent-gold: #f59e0b;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-indigo: #6366f1;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --glass-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.45);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --bottom-nav-height: 68px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + 24px);
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.1) 0px, transparent 50%);
}

/* Chrome / Safari Autofill Override for Login Inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    transition: background-color 5000s ease-in-out 0s;
}

body {
    background-attachment: fixed;
}

/* Header & Top Bar with KovAni Official Branding */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 17, 40, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-img {
    height: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    object-fit: contain;
    display: block;
}

.brand-app-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.3px;
    color: #ffffff;
}

/* Container */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 24px;
}

/* WhatsApp Integration Banner */
.wa-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(10, 17, 40, 0.6));
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.wa-banner-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-banner-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Dashboard Cards Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--glass-shadow);
}

.card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

.card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 8px 0 4px 0;
    color: var(--text-primary);
}

.card-foot {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-emerald { color: var(--accent-emerald); }
.text-rose { color: var(--accent-rose); }
.text-amber { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }

/* Buttons & Quick Actions */
.action-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.btn {
    background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    white-space: nowrap;
}

.btn:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
}

.btn-emerald {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
    background: #047857;
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-rose), #be123c);
    color: white;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: #9f1239;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Sections & Lists */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-item {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background-color 0.2s ease;
}

.tx-item:hover {
    background: var(--bg-card-hover);
}

.tx-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.tx-icon.expense { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.tx-icon.income { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.tx-icon.wa { background: rgba(37, 211, 102, 0.15); color: #25D366; }

.tx-details {
    flex: 1;
    min-width: 0;
}

.tx-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tx-amount {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background: rgba(245, 158, 11, 0.2); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-approved { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }

/* Checkbox & Responsive Bulk Actions Toolbar */
.tx-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
    cursor: pointer;
    margin-right: 4px;
    flex-shrink: 0;
}

.bulk-action-bar {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.bulk-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-gold);
}

/* FAB */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    transition: transform 0.2s ease;
}

.fab:hover {
    transform: scale(1.08);
}

/* Navigation Bottom Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(10, 17, 40, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding: 0 8px;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 6px;
    flex: 1 1 0;
    text-align: center;
}

.nav-tab.active {
    color: var(--accent-gold);
}

.nav-tab i {
    width: 20px;
    height: 20px;
}

/* Desktop: hide the mobile "More" tab by default */
.nav-tab-more {
    display: none !important;
}

/* Mobile & PWA responsive navigation bar (<= 768px): clean 6-tab layout */
@media (max-width: 768px) {
    /* Clean Top Bar: hide bulky user widget & Sign Out button on mobile */
    .top-bar {
        padding: 10px 16px !important;
    }

    #header-user-widget {
        display: none !important;
    }

    .nav-tab-desktop-only {
        display: none !important;
    }

    .nav-tab-more {
        display: flex !important;
    }

    .bottom-nav {
        padding: 0 4px !important;
        height: 64px !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    }

    .nav-tab {
        width: 16.66% !important;
        max-width: 16.66% !important;
        padding: 6px 2px !important;
        font-size: 10px !important;
        gap: 2px !important;
        flex: 1 1 0 !important;
    }

    .nav-tab i {
        width: 20px !important;
        height: 20px !important;
    }

    .nav-tab span {
        font-size: 10px !important;
        letter-spacing: -0.2px !important;
        white-space: nowrap !important;
    }

    /* ==========================================================================
       MOBILE TRANSACTION & RECORD CARDS (Spacious, Legible & Never Crunched)
       ========================================================================== */
    .tx-item {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        gap: 8px 12px !important;
        padding: 14px !important;
        border-radius: 14px !important;
        background: rgba(15, 23, 42, 0.75) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        margin-bottom: 4px !important;
    }

    .tx-checkbox {
        margin-top: 3px !important;
        width: 20px !important;
        height: 20px !important;
        flex-shrink: 0 !important;
    }

    .tx-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        flex-shrink: 0 !important;
        border-radius: 10px !important;
    }

    /* Details area gets the full width beside checkbox and icon */
    .tx-details {
        flex: 1 1 calc(100% - 80px) !important;
        min-width: 0 !important;
    }

    /* Title: full text display with natural wrapping, bold & legible */
    .tx-title {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        white-space: normal !important;
        line-height: 1.35 !important;
        word-break: break-word !important;
        margin-bottom: 4px !important;
    }

    /* Subtitle & Metadata: spacious, clean wrapping */
    .tx-sub {
        font-size: 12px !important;
        line-height: 1.45 !important;
        word-break: break-word !important;
        color: #94a3b8 !important;
        margin-top: 2px !important;
    }

    /* Bottom row: Amount & Action Toolbar */
    .tx-item > div:last-child,
    .tx-right-group {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding-top: 10px !important;
        margin-top: 6px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        text-align: left !important;
    }

    .tx-amount {
        font-size: 16.5px !important;
        font-weight: 800 !important;
        letter-spacing: -0.2px !important;
    }

    /* Actions container inside the bottom row */
    .tx-item > div:last-child > div:last-child,
    .tx-actions-row {
        display: flex !important;
        gap: 6px !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        margin-top: 0 !important;
    }

    .tx-item > div:last-child .btn-sm,
    .tx-actions-row .btn-sm {
        padding: 6px 9px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    .tx-item > div:last-child .badge,
    .tx-actions-row .badge {
        font-size: 10.5px !important;
        padding: 3px 8px !important;
    }

    /* Avoid Floating Action Button (FAB) blocking last card on mobile */
    .tx-list {
        padding-bottom: 110px !important;
    }
}

/* Modal Overlay & Responsive Form Rows */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 999999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 19px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

/* Universal Input Height Normalization (Strict iOS Safari & WebKit Date Pseudo-element Override) */
.form-input, .form-select, .form-textarea, select, input[type="date"], input[type="number"], input[type="text"] {
    width: 100%;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: 44px !important;
    background: #1e293b !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 14px !important;
    color: #ffffff !important;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* ALL DROPDOWN LISTS & OPTIONS DARK GRAY BACKGROUND WITH WHITE FONTS */
select, .form-select, select.form-select {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' 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 12px center !important;
    background-size: 16px !important;
    padding-right: 36px !important;
    cursor: pointer;
}

select option, .form-select option, option {
    background-color: #1e293b !important;
    color: #ffffff !important;
    padding: 10px 14px !important;
}

select option:hover, select option:focus, select option:active, select option:checked,
.form-select option:hover, .form-select option:focus, .form-select option:active, .form-select option:checked {
    background-color: #334155 !important;
    color: #ffffff !important;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    height: 44px !important;
    min-height: 44px !important;
    line-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent-gold);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 520px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    body {
        padding-bottom: 24px;
        padding-left: 250px;
    }

    .bottom-nav {
        top: 0;
        bottom: 0;
        right: auto;
        width: 250px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 85px;
        gap: 8px;
        border-top: none;
        border-right: 1px solid var(--border-color);
    }

    .nav-tab {
        flex-direction: row;
        width: 90%;
        padding: 14px 18px;
        border-radius: var(--radius-md);
        font-size: 14px;
        gap: 12px;
    }

    .nav-tab.active {
        background: rgba(245, 158, 11, 0.15);
        color: var(--accent-gold);
    }

    .modal-overlay {
        align-items: center;
    }

    .modal-card {
        border-radius: 20px;
    }
}

/* ==========================================================================
   OFFICIAL KOVANI TAX INVOICE PRINTABLE PDF SHEET STYLES
   ========================================================================== */
.pdf-page-sheet {
    width: 210mm;
    height: 297mm;
    max-height: 297mm;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    padding: 10mm 14mm 10mm 14mm !important;
    box-sizing: border-box !important;
    margin: 0 auto;
    position: relative;
    overflow: hidden !important;
    border: 1px solid #cbd5e1;
}

.pdf-page-sheet * {
    box-sizing: border-box !important;
    color: #0f172a;
}

#printable-invoice-template {
    width: 794px !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
}

.pdf-top-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.pdf-top-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    color: #0f172a !important;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 4px;
}

.pdf-brand-right {
    text-align: right;
}

.pdf-brand-img {
    height: 36px;
    object-fit: contain;
}

.pdf-meta-bar {
    width: 100%;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
}

.pdf-sec-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 11px;
}

.pdf-sec-table th, .pdf-sec-table td {
    border: 1px solid #0f172a;
    padding: 5px 8px;
    vertical-align: top;
}

.pdf-dark-head {
    background: #0f172a !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    text-transform: uppercase;
    padding: 5px 8px !important;
    letter-spacing: 0.5px;
}

.pdf-dark-head * {
    color: #ffffff !important;
}

.pdf-label-cell {
    font-weight: 700;
    width: 25%;
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 10.5px;
}

.pdf-item-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 11px;
}

.pdf-item-table th {
    background: #881337 !important; /* Dark maroon/red matching user screenshot */
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 6px 8px;
    border: 1px solid #0f172a;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
}

.pdf-item-table th * {
    color: #ffffff !important;
}

.pdf-item-table td {
    border: 1px solid #0f172a;
    padding: 6px 8px;
    vertical-align: top;
}

.pdf-footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 18px;
}

.pdf-graphics-left {
    position: relative;
    width: 110px;
    height: 80px;
}

.pdf-graphics-left .tri-red {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 80px solid #9f1239;
}

.pdf-graphics-left .tri-dark {
    position: absolute;
    bottom: 0;
    left: 18px;
    width: 0;
    height: 0;
    border-left: 55px solid transparent;
    border-right: 55px solid transparent;
    border-bottom: 70px solid #0f172a;
}

.pdf-sign-box {
    text-align: right;
}

.pdf-sig-img {
    height: 48px;
    object-fit: contain;
}

.pdf-stamp-img {
    height: 85px;
    width: 85px;
    object-fit: contain;
}

.pdf-sign-title {
    font-size: 12px;
    font-weight: 700;
}

.pdf-sign-sub {
    font-size: 11px;
    color: #334155;
    font-weight: 600;
}

.pdf-bottom-address {
    margin-top: 16px;
    text-align: right;
    font-size: 9.5px;
    color: #334155;
    line-height: 1.4;
    border-top: 1px solid #e2e8f0;
    padding-top: 7px;
}

.pdf-bottom-address strong {
    font-size: 10.5px;
    color: #0f172a;
}

/* ==========================================================================
   STRICT UNAUTHENTICATED STATE - HIDE SIDEBAR, TOP BAR, AND FAB
   ========================================================================== */
body.unauthenticated .top-bar,
body.unauthenticated .bottom-nav,
body.unauthenticated .fab {
    display: none !important;
}

body.unauthenticated {
    padding-left: 0 !important;
    padding-bottom: 0 !important;
    background: #1b2a47 !important;
}

/* ==========================================================================
   ASSET MANAGEMENT & DEPRECIATION STYLES
   ========================================================================== */
.badge-active {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-fully-depreciated {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.badge-disposed {
    background: rgba(100, 116, 139, 0.2) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(100, 116, 139, 0.4) !important;
}

.asset-disposed-row {
    opacity: 0.55 !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

.asset-schedule-year-header {
    background: rgba(15, 23, 42, 0.8) !important;
    color: var(--accent-gold) !important;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent-gold);
}

.payroll-sub-tab.active {
    background: var(--accent-emerald) !important;
    color: #fff !important;
    border-color: var(--accent-emerald) !important;
}

/* Printable PDF Export Page Sheet for Payslip */
.pdf-payslip-page-sheet {
    width: 210mm;
    background: #ffffff;
    padding: 8mm 0;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
}

.pdf-payslip-page-sheet .payslip-document-wrapper {
    max-width: 680px;
    width: 175mm;
    margin: 0 auto;
    box-shadow: none;
    border: 1px solid #cbd5e1;
}

/* ==========================================================================
   OFFICIAL PAYSLIP PRINT & PDF EXPORT STYLES
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #0f172a !important;
        width: 210mm !important;
        height: 297mm !important;
        max-height: 297mm !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide ALL non-printable SPA shell elements */
    header, footer, nav, .top-bar, .bottom-nav, .fab, .container, #view-container, #login-screen,
    .modal-overlay:not(#modal-payroll-payslip):not(#modal-view-invoice),
    #pdf-container-wrapper, #pdf-payslip-wrapper {
        display: none !important;
        visibility: hidden !important;
    }

    body > *:not(#modal-payroll-payslip):not(#modal-view-invoice) {
        display: none !important;
        visibility: hidden !important;
    }

    .no-print, .modal-header, .close-btn, button, .btn {
        display: none !important;
        visibility: hidden !important;
    }

    /* INVOICE PRINT: Position at absolute top:0 left:0 to eliminate blank page 1 */
    #modal-view-invoice {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        max-height: 297mm !important;
        box-shadow: none !important;
        border: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow: hidden !important;
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        break-before: avoid !important;
        break-after: avoid !important;
    }

    #modal-view-invoice .modal-card {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        max-width: 210mm !important;
        width: 210mm !important;
        height: 297mm !important;
        max-height: 297mm !important;
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        overflow: hidden !important;
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        break-before: avoid !important;
        break-after: avoid !important;
    }

    #invoice-preview-render-container {
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        max-height: 297mm !important;
        overflow: hidden !important;
    }

    #invoice-preview-render-container .tax-invoice-sheet {
        width: 794px !important;
        height: 1120px !important;
        max-height: 1120px !important;
        margin: 0 auto !important;
        box-shadow: none !important;
        border: none !important;
        overflow: hidden !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        break-before: avoid !important;
        break-inside: avoid !important;
        break-after: avoid !important;
    }

    /* PAYSLIP PRINT: Position at absolute top:0 left:0 */
    #modal-payroll-payslip {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
        background: #ffffff !important;
        padding: 8mm 0 0 0 !important;
        margin: 0 auto !important;
        width: 210mm !important;
        height: 297mm !important;
        max-height: 297mm !important;
        box-shadow: none !important;
        border: none !important;
        overflow: hidden !important;
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        break-before: avoid !important;
        break-after: avoid !important;
    }

    #modal-payroll-payslip .modal-card {
        max-width: 680px !important;
        width: 90% !important;
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-shadow: none !important;
        border: none !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #payslip-render-container {
        overflow: visible !important;
        max-height: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        width: 100% !important;
    }

    .payslip-document-wrapper {
        box-shadow: none !important;
        padding: 16px 20px !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 680px !important;
        border-radius: 8px !important;
        border: 1px solid #cbd5e1 !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}


/* ==========================================================================
   STRICT OVERRIDE: FULL-SCREEN LOG-IN PORTAL FOR UNAUTHENTICATED USERS
   ========================================================================== */
html.unauthenticated,
body.unauthenticated {
    padding-left: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    background: #1b2a47 !important;
    overflow: auto !important;
}

html.unauthenticated .top-bar,
html.unauthenticated .bottom-nav,
html.unauthenticated nav.bottom-nav,
html.unauthenticated .fab,
body.unauthenticated .top-bar,
body.unauthenticated .bottom-nav,
body.unauthenticated nav.bottom-nav,
body.unauthenticated .fab {
    display: none !important;
    visibility: hidden !important;
}

html.unauthenticated #login-screen,
body.unauthenticated #login-screen {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #1b2a47 !important;
    z-index: 99999999 !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   FINANCIAL YEAR (FY) FILTER COMPONENT (Modern, Sleek, Responsive)
   ========================================================================== */
.fy-filter-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.fy-filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    margin: 0;
}

.fy-filter-select {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.fy-filter-select:hover,
.fy-filter-select:focus {
    border-color: var(--accent-gold) !important;
    background: rgba(30, 41, 59, 1) !important;
}

.fy-filter-select option {
    background: #0f172a !important;
    color: #ffffff !important;
}


