:root {
    --primary-color: #0b4f8a;
    --primary-dark: #073863;
    --primary-light: #e8f1f9;
    --secondary-color: #2b7a78;
    --success-color: #198754;
    --warning-color: #f59e0b;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --sidebar-width: 260px;
    --header-height: 64px;
    --body-bg: #f4f6f9;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #1e293b;
    color: #fff;
    transition: all 0.3s;
    z-index: 1000;
}

#sidebar.toggled {
    margin-left: calc(-1 * var(--sidebar-width));
}

#sidebar .sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: #0f172a;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .nav-link {
    color: #94a3b8;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #38bdf8;
}

#content-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-navbar {
    height: var(--header-height);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    justify-content: space-between;
}

.main-content {
    flex: 1 0 auto;
    padding: 1.75rem 1.5rem;
}

.footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

/* Cards & Widgets */
.card-stat {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.card-stat:hover {
    transform: translateY(-2px);
}

.card-stat .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Tables & Forms */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #edf2f7;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.badge-status {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.status-draft { background-color: #e2e8f0; color: #475569; }
.status-submitted { background-color: #dbeafe; color: #1e40af; }
.status-verified { background-color: #fef3c7; color: #92400e; }
.status-approved { background-color: #dcfce7; color: #166534; }
.status-rejected { background-color: #fee2e2; color: #991b1b; }

/* Loader Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-dual {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.show-sidebar {
        margin-left: 0;
    }
}

/* ==========================================================================
   Dark Theme Overrides & Enhancements (data-bs-theme="dark")
   ========================================================================== */
[data-bs-theme="dark"] {
    --body-bg: #0f172a;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] body {
    background-color: var(--body-bg);
    color: #e2e8f0;
}

[data-bs-theme="dark"] .top-navbar {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .footer {
    background: #1e293b;
    border-top: 1px solid #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .card {
    background-color: #1e293b;
    border: 1px solid #334155;
}

[data-bs-theme="dark"] .card-header {
    background-color: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #27354a;
    --bs-table-color: #f1f5f9;
}

[data-bs-theme="dark"] .table {
    --bs-table-color: #cbd5e1;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.02);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #172033;
    border-color: #38bdf8;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.2);
}

[data-bs-theme="dark"] .form-control:read-only,
[data-bs-theme="dark"] .form-control.bg-light {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #27354a !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .text-gray-800 {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: #334155;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border: 1px solid #334155;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #334155;
    color: #fff;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #334155;
}

[data-bs-theme="dark"] .page-link {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #0b4f8a;
    border-color: #0b4f8a;
    color: #fff;
}

[data-bs-theme="dark"] .dataTables_info,
[data-bs-theme="dark"] .dataTables_length,
[data-bs-theme="dark"] .dataTables_filter {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] #loading-overlay {
    background: rgba(15, 23, 42, 0.85);
}

