/**
 * ILMLI Professional Theme - "Classic Navy Enterprise"
 * Built entirely around deep, cohesive Navy Blue shades.
 */

/* ==========================================================================
   1. GLOBAL COLOR VARIABLES (Pure Navy Palette)
   ========================================================================== */
:root {
    /* THE NAVY PALETTE */
    --primary-dark: #040169c4;       /* Deepest Navy - For Sidebar & Top Banners */
    --primary-main: #003366;       /* YOUR THEME COLOR - Classic Navy for Buttons & Links */
    --primary-medium: #004C99;     /* Medium Navy - For hover states */
    --primary-light: #b2c9fbfd;      /* Soft Slate-Blue - For visible borders */
    --primary-lighter: #E6F0FA;    /* Crisp Icy Navy - Distinct color for Table Headers */
    --primary-lightest: #F5F9FD;   /* Barely-there Navy tint - For table row hovers */
    
    /* TEXT COLORS */
    --text-dark: #0A192F;          /* Deepest blue-black for highest text readability */
    --text-muted: #5C7080;         /* Navy-tinted gray for secondary text */
    --text-white: #FFFFFF;
    
    /* NEUTRAL BACKGROUNDS */
    --bg-light: #F8FAFC;           /* Page background (slightly cool off-white) */
    --border-color: #D5E1EA;
    --border-light: #EBF0F5;

    --sidebar-width: 280px; 
    --header-height: 70px;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ==========================================================================
   2. GLOBAL OVERRIDES (Replacing Black with Deep Navy)
   ========================================================================== */

.bg-dark {
    background-color: var(--primary-dark) !important;
    color: var(--text-white) !important;
    border-color: var(--primary-dark) !important;
}

.sidebar-wrapper {
    background-color: var(--primary-dark) !important;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.card-header {
    background-color: var(--primary-light) !important;
    color: var(--primary-dark) !important;
}

.btn-primary {
    background-color: var(--primary-main) !important;
    border-color: var(--primary-main) !important;
    box-shadow: 0 2px 4px rgba(0, 51, 102, 0.2) !important;
}

.btn-primary:hover {
    background-color: var(--primary-medium) !important;
    border-color: var(--primary-medium) !important;
}

.btn-outline-primary {
    color: var(--primary-main) !important;
    border-color: var(--primary-main) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-main) !important;
    color: var(--text-white) !important;
}

/* ==========================================================================
   3. TABLE ENHANCEMENTS (Crisp Icy Navy Headers)
   ========================================================================== */

.card > .table-responsive > .table { margin-bottom: 0; }

.table-light, 
.table-light > th, 
.table-light > td,
thead.table-light th,
thead.table-light tr th {
    background-color: var(--primary-lighter) !important;
    color: var(--primary-dark) !important;
    border-bottom: 2px solid var(--primary-light) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.empty-state-cell {
    background-color: #ffffff !important;
    color: var(--text-muted) !important;
    border-bottom: none !important;
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
    background-color: var(--primary-lightest) !important;
    color: var(--primary-dark) !important;
    transition: background-color 0.2s ease;
}

tfoot.bg-light, tfoot.table-light {
    background-color: var(--primary-lightest) !important;
    border-top: 2px solid var(--primary-light) !important;
}

/* ==========================================================================
   4. MOBILE RESPONSIVENESS & TABS
   ========================================================================== */

.main-wrapper {
    width: 100%;
    overflow-x: hidden;
}

#financeTabs, .swipe-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid var(--border-color);
    scrollbar-width: none;
}
#financeTabs::-webkit-scrollbar, .swipe-tabs::-webkit-scrollbar {
    display: none;
}
.swipe-tabs .nav-link {
    white-space: nowrap;
    padding: 12px 20px;
    color: var(--text-white);
}
.swipe-tabs .nav-link.active {
    color: var(--primary-medium);
    border-bottom: 3px solid var(--primary-light);
}

@media (max-width: 576px) {
    .container-fluid.px-4 { padding-left: 10px !important; padding-right: 10px !important; }
    .tab-content.p-4 { padding: 15px !important; }
    .row { margin-left: 0; margin-right: 0; }
    .col-md-8, .col-md-6 { padding-left: 0; padding-right: 0; }
}

/* REMOVED THE CONFLICTING MOBILE SIDEBAR CSS THAT BROKE THE OFFCANVAS DRAWER 
*/

/* Mobile Table-to-Card Logic */
@media (max-width: 768px) {
    .responsive-card-table thead { display: none; }
    
    .responsive-card-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .responsive-card-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid var(--border-light);
        padding: 12px 15px;
    }
    
    .responsive-card-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-main);
        text-align: left;
        flex: 1;
    }
    
    .responsive-card-table td:last-child {
        border-bottom: none;
        background-color: var(--bg-light);
        justify-content: center;
        border-radius: 0 0 8px 8px;
    }
}

/* ==========================================================================
   5. PRINTING (Auditor Friendly)
   ========================================================================== */

@media print {
    body { font-family: 'Times New Roman', serif; background-color: #fff !important; }
    .sidebar, .navbar, .no-print, .btn { display: none !important; }
    
    .card, .container-fluid {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    table { width: 100% !important; border-collapse: collapse !important; }
    th, td { border: 1px solid #000 !important; padding: 8px !important; color: #000 !important; }
    .table-light, .bg-dark { background-color: #fff !important; color: #000 !important; }
    
    .text-success, .text-danger, .text-primary { color: #000 !important; } 
}

/* ==========================================================================
   6. BULLETPROOF BOOTSTRAP OVERRIDES (Forcing #003366)
   ========================================================================== */

body .bg-dark,
body div.bg-dark,
body nav.bg-dark,
body header.bg-dark,
.card-header.bg-dark {
    background-color: #003366 !important;
    color: #FFFFFF !important;
    border-color: #003366 !important;
}

.nav-tabs { border-bottom: 2px solid #003366 !important; }

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
    background-color: #003366 !important;
    color: #FFFFFF !important;
    border-color: #003366 !important;
    font-weight: bold !important;
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
    color: #5C7080 !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover,
.nav-pills .nav-link:hover {
    color: #003366 !important;
    background-color: #E6F0FA !important;
}