:root {
    --primary-bg: #FFFFFF;
    --primary-blue: #0A3D62;
    /* Business Blue */
    --primary-red: #E84118;
    /* Action Red */
    --primary-gold: #FBC531;
    /* Premium Gold */
    --text-dark: #2F3640;
    --text-light: #F5F6FA;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-dark);
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
}

/* Navbar */
.navbar {
    background-color: var(--primary-blue) !important;
}

.navbar-brand,
.navbar .nav-link {
    color: var(--primary-bg) !important;
}

.navbar .nav-link:hover {
    color: var(--primary-gold) !important;
}

/* Extreme Tabs Contrast Fix */
.nav-tabs .nav-link {
    color: #ffffff !important;
    background-color: #495057 !important;
    /* Dark Grey */
    border: 1px solid #343a40 !important;
    font-weight: 800 !important;
    margin-right: 5px;
    padding: 12px 25px !important;
}

.nav-tabs .nav-link.active {
    color: #ffffff !important;
    background-color: #000000 !important;
    /* Solid Black */
    border-color: #000000 !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--primary-bg);
}

.btn-primary:hover {
    background-color: #c23616;
    border-color: #c23616;
}

.btn-outline-primary {
    color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-outline-primary:hover {
    background-color: var(--primary-red);
    color: var(--primary-bg);
}

.btn-gold {
    background-color: var(--primary-gold);
    color: var(--text-dark);
    font-weight: bold;
}

.btn-gold:hover {
    background-color: #e1b12c;
    color: var(--text-dark);
}

/* Headers */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--primary-blue);
    color: var(--primary-bg);
    border-bottom: 3px solid var(--primary-gold);
}

/* Alerts */
.alert-primary {
    background-color: #ffda79;
    color: var(--text-dark);
    border-color: var(--primary-gold);
}

.alert-danger {
    background-color: #f8a5c2;
    color: #780F0F;
    border-color: var(--primary-red);
}

/* Badges / Highlights */
.badge-gold {
    background-color: var(--primary-gold);
    color: var(--text-dark);
}

/* Metrics Icon Centering */
.rounded-circle.bg-primary-subtle, 
.rounded-circle.bg-danger-subtle, 
.rounded-circle.bg-warning-subtle, 
.rounded-circle.bg-success-subtle,
.rounded-circle.bg-info-subtle,
.rounded-circle.bg-secondary-subtle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px;
    height: 50px;
    padding: 0 !important;
}

/* Sidebar Dashboard */
.sidebar {
    background-color: var(--primary-blue);
    min-height: 100vh;
    padding-top: 20px;
}

.sidebar .nav-link {
    color: #ffffff !important;
    padding: 12px 20px;
    margin-bottom: 5px;
    border-radius: 0 25px 25px 0;
    margin-right: 15px;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.sidebar i {
    font-size: 1.1rem;
    width: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-gold) !important;
    border-left: 4px solid var(--primary-gold);
}

/* Custom Table Theme */
.table-custom thead {
    background-color: var(--primary-blue);
    color: var(--primary-bg);
}

.table-custom tbody tr:hover {
    background-color: #f1f2f6;
}

/* --- Mobile Navigation & Responsiveness --- */

/* Sidebar Overlay Backdrop */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1035;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Premium Hamburger Icon (3 segments) */
.hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Table Responsiveness Hack */
@media (max-width: 767.98px) {
    .table-responsive {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #dee2e6;
    }

    .table thead {
        display: none;
    }

    .table-stacked tr {
        display: block;
        margin-bottom: 1rem;
        background: #fff;
        border: 1px solid #edf2f7;
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .table-stacked td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 8px 12px !important;
        border: none !important;
        border-bottom: 1px solid #f7fafc !important;
    }

    .table-stacked td:last-child {
        border-bottom: none !important;
    }

    .table-stacked td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: #718096;
        text-align: left;
    }
}

/* Global Icon Alignment Fix */
i.fas, i.fab, i.far {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: -0.15em !important;
}

/* Layout Utilities */
.dashboard-content {
    background-color: #f5f6fa;
    min-height: 100vh;
    padding: 24px;
}

/* Mobile Sidebar Overrides */
@media (max-width: 767.98px) {
    #sidebarMenu {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        width: 280px;
        height: 100vh;
        background-color: var(--primary-blue) !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        transform: translateX(-100%);
        box-shadow: 15px 0 30px rgba(0, 0, 0, 0.1);
        padding-top: 20px;
        overflow-y: auto;
    }

    #sidebarMenu.show {
        transform: translateX(0);
    }

    /* Adjust main content when sidebar is hidden on mobile */
    .dashboard-content {
        padding: 15px !important;
    }

    .navbar {
        padding: 18px 15px 10px 15px !important;
        min-height: 70px;
    }

    /* Tap Target Optimization */
    .btn,
    .nav-link,
    select,
    input {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .btn-lg {
        min-height: 54px;
    }
}
/* Global Icon Alignment Fix */
i.fas, i.fab, i.far {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: -0.15em !important;
    line-height: inherit !important;
}
