:root {
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.80);
    --glass-shadow: 0 10px 40px rgba(31, 55, 80, 0.05);
    --glass-radius: 20px;
    --text-primary: #172A43;
    --text-secondary: #68798D;
    --text-muted: #8D9BAA;
    --brand-color: #22577A; /* Default brand */
    --hover-bg: rgba(255, 255, 255, 0.75);
}

/* Global Background */
body, .container-scroller, .page-body-wrapper, .content-wrapper, .main-panel {
    background: linear-gradient(135deg, #edf4fa 0%, #e5eef6 45%, #dbe7f1 100%) !important;
    color: var(--text-primary);
    font-family: 'Inter', 'Manrope', 'Plus Jakarta Sans', sans-serif !important;
    min-height: 100vh;
}

/* Reusable Glass Classes */
.glass-panel, .card, .modal-content, .dropdown-menu {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(24px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(120%) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--glass-radius) !important;
    box-shadow: var(--glass-shadow) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), var(--glass-shadow) !important;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6, .card-title, .menu-title, .page-title {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

/* Top Header */
.navbar.default-layout-navbar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(24px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(120%) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 8px 30px rgba(31, 55, 80, 0.04) !important;
    margin: 8px 10px;
    border-radius: 24px;
    width: calc(100% - 50px);
    top: 0;
    transition: all 0.3s ease;
}
.navbar .navbar-brand-wrapper {
    background: transparent !important;
}

/* Sidebar */
.sidebar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(24px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(120%) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 24px;
    margin: 85px 0 20px 20px;
    box-shadow: var(--glass-shadow) !important;
    height: calc(100vh - 105px) !important;
    padding-top: 15px;
}
.sidebar .nav .nav-item .nav-link {
    color: var(--text-secondary) !important;
    border-radius: 14px;
    margin: 2px 15px;
    padding: 10px 15px;
    transition: all 0.25s ease;
}
.sidebar .nav .nav-item.active > .nav-link {
    background: var(--text-primary) !important; /* dark navy active state */
    color: white !important;
    box-shadow: 0 4px 15px rgba(23, 42, 67, 0.2) !important;
}
.sidebar .nav .nav-item.active > .nav-link .menu-title,
.sidebar .nav .nav-item.active > .nav-link .menu-icon {
    color: white !important;
}
.sidebar .nav .nav-item .nav-link:hover:not(.active) {
    background: var(--hover-bg);
    transform: translateX(4px);
}
.sidebar .nav .nav-item .menu-icon {
    color: var(--text-muted);
}

/* Main Panel Layout */
.main-panel {
    background: transparent !important;
    padding-top: 85px;
}
.content-wrapper {
    background: transparent !important;
    padding: 1.5rem 2rem;
}

/* Cards & Widgets */
.card {
    margin-bottom: 25px;
    padding: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: 24px !important;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(31, 55, 80, 0.08) !important;
}
.card .card-body {
    padding: 1.8rem !important;
}
.card .card-title {
    font-size: 1.1rem !important;
    margin-bottom: 1.2rem;
}

/* Buttons */
.btn {
    border-radius: 12px !important;
    font-weight: 500 !important;
    padding: 10px 22px !important;
    transition: all 0.2s ease;
}
.btn-primary, .btn-theme {
    background: var(--text-primary) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(23, 42, 67, 0.15) !important;
}
.btn-primary:hover, .btn-theme:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(23, 42, 67, 0.25) !important;
    background: #101e30 !important;
}
.btn-secondary, .btn-inverse-info {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
}
.btn-secondary:hover, .btn-inverse-info:hover {
    background: var(--hover-bg) !important;
}

/* Tables */
.table-responsive {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 15px;
    border: 1px solid var(--glass-border);
}
table.table {
    background: transparent !important;
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
}
table.table th {
    border-bottom: 1px solid rgba(160, 180, 200, 0.2) !important;
    border-top: none !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px;
    padding: 12px 15px !important;
}
table.table td {
    background: rgba(255, 255, 255, 0.45) !important;
    border: none !important;
    padding: 16px 15px !important;
    color: var(--text-primary) !important;
    vertical-align: middle !important;
    transition: background 0.2s ease;
}
table.table tr:hover td {
    background: rgba(255, 255, 255, 0.7) !important;
}
table.table td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
table.table td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Forms */
.form-control, .select2-container .select2-selection, select {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(160, 180, 200, 0.3) !important;
    border-radius: 14px !important;
    padding: 12px 16px !important;
    color: var(--text-primary) !important;
    height: auto !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}
.form-control:focus, .select2-container--open .select2-selection {
    border-color: rgba(23, 42, 67, 0.3) !important;
    box-shadow: 0 0 0 4px rgba(23, 42, 67, 0.05) !important;
    background: rgba(255, 255, 255, 0.8) !important;
}
label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* Modals */
.modal-backdrop {
    background-color: rgba(20, 35, 50, 0.35) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-content {
    border-radius: 28px !important;
    padding: 10px;
}
.modal-header {
    border-bottom: 1px solid rgba(160, 180, 200, 0.2) !important;
    padding: 1.5rem 2rem !important;
}
.modal-footer {
    border-top: 1px solid rgba(160, 180, 200, 0.2) !important;
}
.modal-dialog {
    animation: modalEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalEntrance {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Dropdowns & Notifications */
.dropdown-menu {
    border-radius: 16px !important;
    padding: 12px 0;
    animation: dropFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.dropdown-item {
    padding: 10px 24px;
    color: var(--text-primary);
    font-weight: 500;
}
.dropdown-item:hover {
    background: var(--hover-bg);
}
@keyframes dropFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auth Pages / Login */
.auth .auth-form-light {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(30px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(120%) !important;
    border: 1px solid rgba(255,255,255,0.7) !important;
    border-radius: 30px !important;
    box-shadow: 0 20px 50px rgba(31, 55, 80, 0.08) !important;
    padding: 3.5rem !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent; 
}
::-webkit-scrollbar-thumb {
    background: rgba(160, 180, 200, 0.4); 
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 180, 200, 0.7); 
}

/* Search bar header */
.navbar-menu-wrapper .menu-search {
    background: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 20px !important;
    padding: 10px 20px !important;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.navbar-menu-wrapper .menu-search:focus {
    background: rgba(255, 255, 255, 0.7) !important;
    width: 250px !important;
}

/* Status Badges */
.badge {
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.75rem;
}
.badge-success { background: rgba(40, 167, 69, 0.15) !important; color: #1e7e34 !important; border: 1px solid rgba(40, 167, 69, 0.2); }
.badge-danger { background: rgba(220, 53, 69, 0.15) !important; color: #bd2130 !important; border: 1px solid rgba(220, 53, 69, 0.2); }
.badge-warning { background: rgba(255, 193, 7, 0.15) !important; color: #d39e00 !important; border: 1px solid rgba(255, 193, 7, 0.2); }
.badge-info { background: rgba(23, 162, 184, 0.15) !important; color: #117a8b !important; border: 1px solid rgba(23, 162, 184, 0.2); }

/* Remove excessive dashboard borders and solid colors */
.bg-theme {
    background: var(--text-primary) !important; /* Navy */
}
.border-theme {
    border-color: rgba(23, 42, 67, 0.2) !important;
}

/* Statistics Widgets Custom Override */
.custom-card-body h3 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-top: 10px;
    color: var(--text-primary) !important;
}
.custom-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
