/* Clean Minimalist UI Design System with Dark Mode Support */
:root {
    /* Professional Color Palette - Light Mode */
    --primary-color: #0f172a;
    --primary-hover: #1e293b;
    --accent-color: #2563eb;
    
    /* Backgrounds */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    
    /* Text */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-base: all 0.2s ease;
}

/* Dark Theme - Premium Modern Style */
[data-theme="dark"] {
    /* Dark Mode Color Overrides */
    --primary-color: #5865f2;
    --primary-hover: #4752c4;
    --accent-color: #00aff4;
    
    /* Backgrounds - True Dark */
    --bg-body: #0d1117;
    --bg-card: #161b22;
    --bg-hover: #21262d;
    
    /* Text */
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --text-light: #0d1117;
    
    /* Borders & Shadows */
    --border-color: #30363d;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.8);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.9);
}

/* Dark mode specific overrides */
[data-theme="dark"] body {
    background: #0d1117;
}

[data-theme="dark"] .card {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .card:hover {
    border-color: #484f58;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .card-header {
    border-bottom-color: #30363d;
    background-color: transparent !important;
}

[data-theme="dark"] .nav-tabs {
    background-color: transparent !important;
    border-bottom-color: #30363d;
}

[data-theme="dark"] .header-navbar {
    background: #161b22 !important;
    border-bottom-color: #30363d !important;
}

[data-theme="dark"] .table thead th {
    background: #0d1117;
    color: #8b949e;
}

[data-theme="dark"] .table tbody tr {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #21262d;
}

[data-theme="dark"] .form-control {
    background: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .form-control:focus {
    background: #161b22;
    border-color: #5865f2;
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    border-color: #5865f2;
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #4752c4 0%, #3c44a8 100%);
    border-color: #4752c4;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.5);
}

[data-theme="dark"] .btn-light-primary,
[data-theme="dark"] .btn-light-success,
[data-theme="dark"] .btn-light-warning,
[data-theme="dark"] .btn-light-info,
[data-theme="dark"] .btn-light-secondary {
    background: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .btn-light-primary:hover {
    background: #30363d;
    border-color: #5865f2;
    color: #5865f2;
}

[data-theme="dark"] .btn-light-success:hover {
    background: #30363d;
    border-color: #3ba55d;
    color: #3ba55d;
}

[data-theme="dark"] .btn-success {
    background: #238636;
    border-color: #238636;
}

[data-theme="dark"] .btn-success:hover {
    background: #2ea043;
    border-color: #2ea043;
    box-shadow: 0 4px 12px rgba(46, 160, 67, 0.4);
}

[data-theme="dark"] .btn-outline-primary {
    background: transparent;
    border-color: #5865f2;
    color: #5865f2;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: #f25867;
    color: white;
}

[data-theme="dark"] .btn-outline-dark {
    background: transparent;
    border-color: #8b949e;
    color: #e6edf3;
}

[data-theme="dark"] .btn-outline-dark:hover {
    background: #21262d;
    border-color: #e6edf3;
    color: #ffffff;
}

[data-theme="dark"] .navbar-brand h4 {
    color: #9fa7ff !important;
}

[data-theme="dark"] .badge {
    background: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .alert {
    background: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] #main-menu-navigation .nav-item > a {
    color: #8b949e !important;
}

[data-theme="dark"] #main-menu-navigation .nav-item > a:hover,
[data-theme="dark"] #main-menu-navigation .nav-item.active > a {
    background: #21262d;
    color: #e6edf3 !important;
}

/* Header Logo - Dark Mode Support */
.header-logo {
    transition: filter 0.3s ease;
}

[data-theme="dark"] .header-logo {
    filter: brightness(0) invert(1);
}

/* Global Reset & Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

/* Table Styles - Light Mode */
.table thead th {
    background-color: var(--bg-hover);
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
    color: var(--text-main);
}

/* Minimalist Card Style */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

/* Utility Classes */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* Form Controls */
.card-header {
 
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.card-title {
    font-size: 1.125rem;
    color: var(--primary-color);
    margin: 0;
}

/* Buttons - Classic Style with Matching Border Colors */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0.5px solid;
    cursor: pointer;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
    border-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-info {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.btn-info:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: #6b7280;
    border-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
    border-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-outline-dark {
    background: transparent;
    border-color: #1e293b;
    color: #1e293b;
}

.btn-outline-dark:hover {
    background-color: #1e293b;
    border-color: #1e293b;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
}

.btn-outline-secondary {
    background: transparent;
    border-color: #6b7280;
    color: #6b7280;
}

.btn-outline-secondary:hover {
    background-color: #6b7280;
    border-color: #6b7280;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
}

/* Small button variants */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Light button variants */
.btn-light-primary {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}

.btn-light-primary:hover {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-light-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.btn-light-success:hover {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #15803d;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
}

.btn-light-warning {
    background-color: #fefce8;
    border-color: #fde68a;
    color: #ca8a04;
}

.btn-light-warning:hover {
    background-color: #fef3c7;
    border-color: #fcd34d;
    color: #a16207;
    box-shadow: 0 4px 12px rgba(202, 138, 4, 0.15);
}

.btn-light-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-light-danger:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.btn-light-info {
    background-color: #ecfeff;
    border-color: #a5f3fc;
    color: #0891b2;
}

.btn-light-info:hover {
    background-color: #cffafe;
    border-color: #67e8f9;
    color: #0e7490;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
}

.btn-light-secondary {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-light-secondary:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
    color: #334155;
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.15);
}

/* Compact Template Download Button */
.btn-template-download {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition-base);
    text-decoration: none !important;
    border: 1.5px solid transparent;
    gap: 0.5rem;
}

.btn-template-download {
    background: rgba(90, 141, 238, 0.1);
    color: #5A8DEE;
    border-color: rgba(90, 141, 238, 0.1);
}

.btn-template-download:hover {
    background: #c5dbf0;
    color: #fff;
    border-color: #5A8DEE;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(90, 141, 238, 0.2);
}

[data-theme="dark"] .btn-template-download {
    background: rgba(88, 101, 242, 0.15);
    color: #5865f2;
    border-color: rgba(88, 101, 242, 0.2);
}

[data-theme="dark"] .btn-template-download:hover {
    background: #02052d;
    color: #fff;
    border-color: #5865f2;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}


/* Authentication Pages Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-body);
}

.auth-card {
    display: flex;
    width: 100%;
    max-width: 1000px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-height: 600px;
    border: 1px solid var(--border-color);
}

.auth-brand-section {
    flex: 1;
    background: var(--primary-color);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.auth-brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.auth-brand-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 3rem;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-feature-icon {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon i {
    font-size: 1.1rem;
    color: white;
}

.auth-feature-item span {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
}

.auth-form-section {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-card);
}

.auth-form-content {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-form-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-section {
    margin-bottom: 1.5rem;
}

.auth-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: #dc2626;
    font-size: 0.875rem;
}

[data-theme="dark"] .form-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    position: relative;
    background: var(--bg-card);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-card {
        flex-direction: column;
    }
    
    .auth-brand-section {
        padding: 2rem;
        min-height: 250px;
    }
    
    .auth-brand-title {
        font-size: 2rem;
    }
    
    .auth-form-section {
        padding: 2rem;
    }
}

/* Legacy Login Page Support */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f1f5f9;
}

.login-card {
    display: flex;
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-height: 550px;
    border: 1px solid var(--border-color);
}

.login-hero {
    flex: 1;
    background: var(--primary-color);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.login-form-section {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Navbar Modernization */
.header-navbar {
    background: white !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
}

.navbar-brand h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

/* Navigation Menu */
.main-menu-content {
    background: transparent;
}

#main-menu-navigation .nav-item > a {
    color: var(--text-muted) !important;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    margin: 0.125rem 0.5rem;
    font-weight: 500;
}

#main-menu-navigation .nav-item > a:hover,
#main-menu-navigation .nav-item.active > a {
    background: #f1f5f9;
    color: var(--primary-color) !important;
}

/* Modern Form Inputs - Enhanced Premium Style */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    line-height: 1.5;
}

.form-control:hover,
input:not(:focus):hover,
select:not(:focus):hover,
textarea:not(:focus):hover {
    border-color: #94a3b8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 2px 8px rgba(37, 99, 235, 0.08);
    outline: none;
    background: var(--bg-card);
    transform: translateY(-1px);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
    font-weight: 400;
}

/* Dark mode input adjustments */
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.2), 0 2px 8px rgba(88, 101, 242, 0.15);
}

/* Select styling */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    appearance: none;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Textarea */
textarea {
    min-height: 100px;
    resize: vertical;
}

/* Form Labels */
label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.375rem;
    display: inline-block;
}


.modal.fade .modal-dialog {
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease-out;
    transform: translate(0, -20px) scale(0.75);
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: translate(0, 0) scale(1);
    opacity: 1;
}

.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 600px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.15), 
        0 10px 10px -5px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

[data-theme="dark"] .modal-content {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.6), 
        0 10px 10px -5px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.modal-header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-header .close,
.modal-header .btn-close {
    background: var(--bg-hover);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-muted);
    opacity: 0.8;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-header .close:hover,
.modal-header .btn-close:hover {
    opacity: 1;
    background: var(--border-color);
    color: var(--text-main);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.75rem;
    color: var(--text-main);
    line-height: 1.6;
}

.modal-footer {
    background: var(--bg-hover);
    border-top: 2px solid var(--border-color);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.875rem;
}

/* Modal sizes */
.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1140px;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

.input-group-text {
    background: var(--bg-hover);
    border: 1.5px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .input-group-text:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    border-right: none;
}

.input-group > .input-group-text:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    border-left: none;
}

/* Tables */
.table {
    border-collapse: collapse;
    width: 100%;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.table tbody tr {
    background: white;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.1s;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    color: var(--text-main);
}

/* Theme-aware utility classes */
.text-white {
    color: #ffffff !important;
}
.bg-white {
    background-color: var(--bg-card) !important;
}

/* Ensure dark mode respects these utilities */
[data-theme="dark"] .text-white {
    color: var(--text-main) !important;
}
[data-theme="dark"] .bg-white {
    background-color: var(--bg-body) !important;
}

/* === COMPREHENSIVE DARK MODE OVERRIDES === */

/* Nav Tabs */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: #30363d;
}

[data-theme="dark"] .nav-tabs .nav-link {
    background: transparent;
    border-color: transparent;
    color: #8b949e;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background: #161b22;
    border-color: #30363d #30363d transparent;
    color: #e6edf3;
}

/* Tab Content */
[data-theme="dark"] .tab-content {
    background: transparent;
    color: #e6edf3;
}

/* All headings and text */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] label {
    color: #e6edf3 !important;
}

/* Dropdown menus */
[data-theme="dark"] .dropdown-menu {
    background: #161b22;
    border-color: #30363d;
}

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

[data-theme="dark"] .dropdown-item:hover {
    background: #21262d;
    color: #ffffff;
}

[data-theme="dark"] .dropdown-divider {
    border-top-color: #30363d;
}

/* Modals */
[data-theme="dark"] .modal-content {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #30363d;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #30363d;
}

/* Breadcrumbs */


[data-theme="dark"] .list-group-item:hover {
    background: #21262d;
}

/* Input groups */
[data-theme="dark"] .input-group-text {
    background: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

/* Badges - more specific */
[data-theme="dark"] .badge-info {
    background: #1f6feb !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge-success {
    background: #238636 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge-warning {
    background: #9e6a03 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge-danger {
    background: #da3633 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge-primary {
    background: #5865f2 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge-light-primary {
    background: #30363d !important;
    color: #5865f2 !important;
}

/* Content header */
[data-theme="dark"] .content-header-title {
    color: #e6edf3 !important;
}

/* Text utilities */
[data-theme="dark"] .text-bold-500,
[data-theme="dark"] .text-bold-700 {
    color: #e6edf3 !important;
}

[data-theme="dark"] .text-muted {
    color: #8b949e !important;
}

/* Borders */
[data-theme="dark"] .border-right-grey,
[data-theme="dark"] .border-left-grey,
[data-theme="dark"] .border-top-grey {
    border-color: #30363d !important;
}

/* App content */
[data-theme="dark"] .app-content {
    background: transparent;
}

[data-theme="dark"] .content-wrapper {
    background: transparent;
}

/* Select2 dropdowns */
[data-theme="dark"] .select2-container--default .select2-selection--single {
    background: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e6edf3;
}

[data-theme="dark"] .select2-dropdown {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .select2-results__option {
    background: #161b22;
    color: #e6edf3;
}

[data-theme="dark"] .select2-results__option--highlighted {
    background: #21262d !important;
}

/* Buttons in various states - force override */
[data-theme="dark"] .btn-info {
    background: #1f6feb !important;
    border-color: #1f6feb !important;
    color: white !important;
}

[data-theme="dark"] .btn-outline-info {
    background: transparent !important;
    border-color: #1f6feb !important;
    color: #1f6feb !important;
}

[data-theme="dark"] .btn-outline-info:hover {
    background: #1f6feb !important;
    color: white !important;
}

[data-theme="dark"] .btn-warning {
    background: #9e6a03 !important;
    border-color: #9e6a03 !important;
    color: white !important;
}

[data-theme="dark"] .btn-warning:hover {
    background: #854d0e !important;
    border-color: #854d0e !important;
    box-shadow: 0 4px 12px rgba(158, 106, 3, 0.4) !important;
}

[data-theme="dark"] .btn-danger {
    background: #da3633 !important;
    border-color: #da3633 !important;
    color: white !important;
}

[data-theme="dark"] .btn-danger:hover {
    background: #b92d2a !important;
    border-color: #b92d2a !important;
    box-shadow: 0 4px 12px rgba(218, 54, 51, 0.4) !important;
}

[data-theme="dark"] .btn-secondary {
    background: #30363d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #21262d !important;
    border-color: #21262d !important;
    box-shadow: 0 4px 12px rgba(48, 54, 61, 0.4) !important;
}

/* Search input */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #0d1117 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #6e7681 !important;
}

/* Specific table header override */
[data-theme="dark"] .table thead th,
[data-theme="dark"] table thead th,
[data-theme="dark"] thead th {
    background: #0d1117 !important;
    color: #8b949e !important;
    border-color: #30363d !important;
}

/* Table body cells */
[data-theme="dark"] .table tbody td,
[data-theme="dark"] table tbody td {
    background: #161b22 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
}

/* Links */
[data-theme="dark"] a {
    color: #58a6ff;
}

[data-theme="dark"] a:hover {
    color: #79c0ff;
}

/* Avatar and user info */
[data-theme="dark"] .user-name {
    color: #e6edf3 !important;
}

/* Pagination */
[data-theme="dark"] .pagination .page-link {
    background: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .pagination .page-link:hover {
    background: #21262d;
    color: #ffffff;
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background: #5865f2;
    border-color: #5865f2;
}

/* === LEGACY UTILITY OVERRIDES FOR DARK MODE === */
/* These overrides handle hardcoded Bootstrap classes found in templates */

[data-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-body) !important;
}

/* Text Colors */
[data-theme="dark"] .text-dark,
[data-theme="dark"] .black,
[data-theme="dark"] .text-black {
    color: var(--text-main) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .white,
[data-theme="dark"] .text-white {
    color: var(--text-main) !important;
}

/* Background Lighten/Darken Variants */
[data-theme="dark"] .bg-lighten-1,
[data-theme="dark"] .bg-lighten-2,
[data-theme="dark"] .bg-lighten-3,
[data-theme="dark"] .bg-lighten-4,
[data-theme="dark"] .bg-lighten-5 {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .bg-darken-1,
[data-theme="dark"] .bg-darken-2,
[data-theme="dark"] .bg-darken-3,
[data-theme="dark"] .bg-darken-4 {
    background-color: var(--bg-body) !important;
}

/* Specific Color Backgrounds - Map to Dark Theme equivalents */
[data-theme="dark"] .bg-blue,
[data-theme="dark"] .bg-cyan,
[data-theme="dark"] .bg-info,
[data-theme="dark"] .bg-success,
[data-theme="dark"] .bg-warning,
[data-theme="dark"] .bg-danger,
[data-theme="dark"] .bg-grey {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}

/* Specific overrides to maintain some color hint but dark */
[data-theme="dark"] .bg-blue.bg-lighten-5,
[data-theme="dark"] .bg-cyan.bg-lighten-5 {
    background-color: rgba(37, 99, 235, 0.1) !important;
    color: #60a5fa !important;
    border-color: rgba(37, 99, 235, 0.2) !important;
}

[data-theme="dark"] .bg-success.bg-lighten-5 {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .bg-warning.bg-lighten-5 {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .bg-danger.bg-lighten-5 {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
}

/* Fix for transparent backgrounds with opacity */
[data-theme="dark"] .bg-white.bg-opacity-25 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Table specific overrides for legacy classes */
[data-theme="dark"] .table .bg-blue,
[data-theme="dark"] .table .bg-cyan {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

/* Border overrides */
[data-theme="dark"] .border-cyan,
[data-theme="dark"] .border-blue,
[data-theme="dark"] .border-grey {
    border-color: var(--border-color) !important;
}

/* === AGGRESSIVE INLINE STYLE OVERRIDES === */
/* Force dark backgrounds on elements that might have inline styles */

[data-theme="dark"] .card-header {
    background-color: transparent !important;
}

[data-theme="dark"] .table tr,
[data-theme="dark"] .table td {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table th {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Table Header Colors - Default (Light Mode) */
.table thead th.bg-cyan {
    background: #06b6d4 !important; /* Cyan-500 */
    color: #000000 !important;
}

.table thead th.bg-yellow {
    background: #eab308 !important; /* Yellow-500 */
    color: #000000 !important;
}

.table thead th.bg-success {
    background: #22c55e !important; /* Green-500 */
    color: #000000 !important;
}

/* Table Header Colors - Dark Mode Override */
[data-theme="dark"] .table th.bg-cyan {
    background-color: rgba(6, 182, 212, 0.2) !important;
    color: #22d3ee !important;
}

[data-theme="dark"] .table th.bg-yellow {
    background-color: rgba(234, 179, 8, 0.2) !important;
    color: #facc15 !important;
}

[data-theme="dark"] .table th.bg-success {
    background-color: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}



/* Allow specific status colors if they are classes, but override inline backgrounds */
[data-theme="dark"] .table tr[class*="bg-"],
[data-theme="dark"] .table td[class*="bg-"] {
    background-color: var(--bg-card) !important;
}

/* Fix input backgrounds that might be hardcoded */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Text Color Overrides for Dark Mode */
[data-theme="dark"] .text-primary {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .text-info {
    color: #60a5fa !important; /* Lighter blue */
}

[data-theme="dark"] .text-success {
    color: #34d399 !important; /* Lighter green */
}

[data-theme="dark"] .text-warning {
    color: #fbbf24 !important; /* Lighter yellow */
}

[data-theme="dark"] .text-danger {
    color: #f87171 !important; /* Lighter red */
}

[data-theme="dark"] .text-secondary {
    color: #9ca3af !important;
}

/* Override inline color styles in dark mode */
[data-theme="dark"] [style*="color: black"],
[data-theme="dark"] [style*="color:black"],
[data-theme="dark"] [style*="color: rgb(8, 27, 90)"] {
    color: var(--text-main) !important;
}

[data-theme="dark"] [style*="color: red"] {
    color: #f87171 !important;
}

/* Specific overrides for hardcoded classes found in templates */
[data-theme="dark"] .black,
[data-theme="dark"] .darken-3,
[data-theme="dark"] .darken-2,
[data-theme="dark"] .darken-4 {
    color: var(--text-main) !important;
}

[data-theme="dark"] .white {
    color: var(--text-main) !important;
}

/* Fix for specific elements with hardcoded styles */
[data-theme="dark"] h4[style*="color: rgb(8, 27, 90)"],
[data-theme="dark"] h5[style*="color: rgb(8, 27, 90)"] {
    color: #e6edf3 !important;
}

/* Border Color Overrides for Dark Mode */
[data-theme="dark"] .border-grey,
[data-theme="dark"] .border-gray,
[data-theme="dark"] .border-blue,
[data-theme="dark"] .border-cyan,
[data-theme="dark"] .border-info,
[data-theme="dark"] .border-success,
[data-theme="dark"] .border-warning,
[data-theme="dark"] .border-danger,
[data-theme="dark"] .border-red,
[data-theme="dark"] .border-indigo,
[data-theme="dark"] .border-lighten-1,
[data-theme="dark"] .border-lighten-2,
[data-theme="dark"] .border-lighten-3,
[data-theme="dark"] .border-lighten-4,
[data-theme="dark"] .border-right-grey,
[data-theme="dark"] .border-left-grey,
[data-theme="dark"] .border-top-grey,
[data-theme="dark"] .border-bottom-grey {
    border-color: var(--border-color) !important;
}

/* Fix specific border-0 overrides that might be fighting with other classes */
[data-theme="dark"] .border-0 {
    border: none !important;
}

/* Button Overrides for Dark Mode */
[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-light-primary,
[data-theme="dark"] .btn-light-blue {
    background-color: var(--bg-hover) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-light:hover,
[data-theme="dark"] .btn-light-primary:hover,
[data-theme="dark"] .btn-light-blue:hover {
    background-color: var(--border-color) !important;
}


/* Additional Background Color Overrides */
[data-theme="dark"] .bg-indigo,
[data-theme="dark"] .bg-purple,
[data-theme="dark"] .bg-pink,
[data-theme="dark"] .bg-red,
[data-theme="dark"] .bg-orange,
[data-theme="dark"] .bg-yellow,
[data-theme="dark"] .bg-green,
[data-theme="dark"] .bg-teal,
[data-theme="dark"] .bg-cyan {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}

/* Lighten variants for these colors */
[data-theme="dark"] .bg-indigo.bg-lighten-4,
[data-theme="dark"] .bg-purple.bg-lighten-4,
[data-theme="dark"] .bg-pink.bg-lighten-4,
[data-theme="dark"] .bg-red.bg-lighten-4,
[data-theme="dark"] .bg-orange.bg-lighten-4,
[data-theme="dark"] .bg-yellow.bg-lighten-4,
[data-theme="dark"] .bg-green.bg-lighten-4,
[data-theme="dark"] .bg-teal.bg-lighten-4,
[data-theme="dark"] .bg-cyan.bg-lighten-4 {
    background-color: var(--bg-hover) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Table Hover Override for Dark Mode */
[data-theme="dark"] .table tbody tr:hover {
    background-color: var(--bg-hover) !important;
}

/* Modern Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: transparent;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom: 2px solid var(--primary-color);
}

.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-color: transparent transparent var(--primary-color);
}

[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: var(--text-main);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* ============================================
   SweetAlert (swal) Dark/Light Mode Styles
   ============================================ */

/* Light Mode SweetAlert Styles (Default) */
.swal-overlay {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

.swal-modal {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

.swal-title {
    color: var(--text-main) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.5rem !important;
}

.swal-text {
    color: var(--text-muted) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    text-align: center !important;
    max-width: 100% !important;
}

.swal-content {
    color: var(--text-main) !important;
}

.swal-content__input,
.swal-content__textarea {
    background-color: var(--bg-card) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-main) !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
    transition: all 0.3s ease !important;
}

.swal-content__input:focus,
.swal-content__textarea:focus {
    border-color: var(--accent-color) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* SweetAlert Buttons */
.swal-button {
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    padding: 0.625rem 1.5rem !important;
    font-size: 0.9375rem !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid transparent !important;
}

.swal-button:not([disabled]):hover {
    transform: translateY(-1px) !important;
}

.swal-button--confirm {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.swal-button--confirm:not([disabled]):hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25) !important;
}

.swal-button--cancel {
    background-color: #6b7280 !important;
    color: white !important;
    border-color: #6b7280 !important;
}

.swal-button--cancel:not([disabled]):hover {
    background-color: #4b5563 !important;
    border-color: #4b5563 !important;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3) !important;
}

.swal-button--danger {
    background-color: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}

.swal-button--danger:not([disabled]):hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

/* SweetAlert Icons */
.swal-icon--success {
    border-color: #10b981 !important;
}

.swal-icon--success__line {
    background-color: #10b981 !important;
}

.swal-icon--success__ring {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.swal-icon--success__hide-corners {
    background-color: var(--bg-card) !important;
}

.swal-icon--success:before,
.swal-icon--success:after {
    background-color: var(--bg-card) !important;
}

.swal-icon--warning {
    border-color: #f59e0b !important;
}

.swal-icon--warning__body,
.swal-icon--warning__dot {
    background-color: #f59e0b !important;
}

.swal-icon--error {
    border-color: #ef4444 !important;
}

.swal-icon--error__line {
    background-color: #ef4444 !important;
}

.swal-icon--info {
    border-color: #3b82f6 !important;
}

.swal-icon--info:before,
.swal-icon--info:after {
    background-color: #3b82f6 !important;
}

/* Footer */
.swal-footer {
    background-color: transparent !important;
    border-top: 1px solid var(--border-color) !important;
    margin-top: 0 !important;
    padding-top: 13px !important;
}

/* ============================================
   Dark Mode SweetAlert Overrides
   ============================================ */
[data-theme="dark"] .swal-overlay {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .swal-modal {
    background-color: #161b22 !important;
    border-color: #30363d !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .swal-title {
    color: #e6edf3 !important;
}

[data-theme="dark"] .swal-text {
    color: #8b949e !important;
}

[data-theme="dark"] .swal-content {
    color: #e6edf3 !important;
}

[data-theme="dark"] .swal-content__input,
[data-theme="dark"] .swal-content__textarea {
    background-color: #0d1117 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

[data-theme="dark"] .swal-content__input:focus,
[data-theme="dark"] .swal-content__textarea:focus {
    border-color: #5865f2 !important;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15) !important;
}

[data-theme="dark"] .swal-content__input::placeholder,
[data-theme="dark"] .swal-content__textarea::placeholder {
    color: #484f58 !important;
}

/* Dark Mode Buttons */
[data-theme="dark"] .swal-button {
    background-color: #5865f2 !important;
    border-color: #5865f2 !important;
}

[data-theme="dark"] .swal-button:not([disabled]):hover {
    background-color: #4752c4 !important;
    border-color: #4752c4 !important;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.5) !important;
}

[data-theme="dark"] .swal-button--confirm {
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%) !important;
    border-color: #5865f2 !important;
}

[data-theme="dark"] .swal-button--confirm:not([disabled]):hover {
    background: linear-gradient(135deg, #4752c4 0%, #3c44a8 100%) !important;
    border-color: #4752c4 !important;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.5) !important;
}

[data-theme="dark"] .swal-button--cancel {
    background-color: #21262d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

[data-theme="dark"] .swal-button--cancel:not([disabled]):hover {
    background-color: #30363d !important;
    border-color: #484f58 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .swal-button--danger {
    background-color: #da3633 !important;
    border-color: #da3633 !important;
}

[data-theme="dark"] .swal-button--danger:not([disabled]):hover {
    background-color: #f85149 !important;
    border-color: #f85149 !important;
    box-shadow: 0 4px 12px rgba(248, 81, 73, 0.4) !important;
}

/* Dark Mode Icons */
[data-theme="dark"] .swal-icon--success {
    border-color: #3ba55d !important;
}

[data-theme="dark"] .swal-icon--success__line {
    background-color: #3ba55d !important;
}

[data-theme="dark"] .swal-icon--success__ring {
    border-color: rgba(59, 165, 93, 0.3) !important;
}

[data-theme="dark"] .swal-icon--success__hide-corners {
    background-color: #161b22 !important;
}

[data-theme="dark"] .swal-icon--success:before,
[data-theme="dark"] .swal-icon--success:after {
    background-color: #161b22 !important;
}

[data-theme="dark"] .swal-icon--warning {
    border-color: #faa61a !important;
}

[data-theme="dark"] .swal-icon--warning__body,
[data-theme="dark"] .swal-icon--warning__dot {
    background-color: #faa61a !important;
}

[data-theme="dark"] .swal-icon--error {
    border-color: #f85149 !important;
}

[data-theme="dark"] .swal-icon--error__line {
    background-color: #f85149 !important;
}

[data-theme="dark"] .swal-icon--info {
    border-color: #00aff4 !important;
}

[data-theme="dark"] .swal-icon--info:before,
[data-theme="dark"] .swal-icon--info:after {
    background-color: #00aff4 !important;
}

/* Dark Mode Footer */
[data-theme="dark"] .swal-footer {
    border-top-color: #30363d !important;
}

/* SweetAlert2 Compatibility (if using sweetalert2) */
.swal2-popup {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
}

.swal2-title {
    color: var(--text-main) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

.swal2-html-container,
.swal2-content {
    color: var(--text-muted) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

.swal2-input,
.swal2-textarea {
    background-color: var(--bg-card) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-main) !important;
}

.swal2-input:focus,
.swal2-textarea:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.swal2-confirm {
    background-color: var(--primary-color) !important;
    border-radius: var(--radius-md) !important;
}

.swal2-cancel {
    background-color: #6b7280 !important;
    border-radius: var(--radius-md) !important;
}

[data-theme="dark"] .swal2-popup {
    background-color: #161b22 !important;
    border-color: #30363d !important;
}

[data-theme="dark"] .swal2-title {
    color: #e6edf3 !important;
}

[data-theme="dark"] .swal2-html-container,
[data-theme="dark"] .swal2-content {
    color: #8b949e !important;
}

[data-theme="dark"] .swal2-input,
[data-theme="dark"] .swal2-textarea {
    background-color: #0d1117 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

[data-theme="dark"] .swal2-input:focus,
[data-theme="dark"] .swal2-textarea:focus {
    border-color: #5865f2 !important;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15) !important;
}

[data-theme="dark"] .swal2-confirm {
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%) !important;
}

[data-theme="dark"] .swal2-cancel {
    background-color: #21262d !important;
    color: #e6edf3 !important;
}

/* ========================================
   Modern Nav Pills / Status Tabs
   ======================================== */

.nav-pills.nav-fill {
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
}

.nav-pills .nav-link {
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid transparent;
}

.nav-pills .nav-link:hover {
    color: var(--text-main);
    background-color: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nav-pills .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

/* Status tabs specific styling */
.status_tabs i {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.status_tabs:hover i,
.status_tabs.active i {
    opacity: 1;
}

/* Dark mode nav pills */
[data-theme="dark"] .nav-pills.nav-fill {
    background-color: #21262d;
    border-color: #30363d;
}

[data-theme="dark"] .nav-pills .nav-link {
    color: #8b949e;
}

[data-theme="dark"] .nav-pills .nav-link:hover {
    color: #e6edf3;
    background-color: #30363d;
    border-color: #484f58;
}

[data-theme="dark"] .nav-pills .nav-link.active {
    background: linear-gradient(135deg, #5865f2, #4752c4);
    border-color: #5865f2;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

/* Nav tabs underline style (used in level2) */
.nav-tabs.nav-underline .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.nav-tabs.nav-underline .nav-link:hover {
    color: var(--text-main);
    border-bottom-color: var(--border-color);
    background-color: var(--bg-hover);
}

.nav-tabs.nav-underline .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

[data-theme="dark"] .nav-tabs.nav-underline .nav-link {
    color: #8b949e;
}

[data-theme="dark"] .nav-tabs.nav-underline .nav-link:hover {
    color: #e6edf3;
    border-bottom-color: #30363d;
    background-color: #21262d;
}

[data-theme="dark"] .nav-tabs.nav-underline .nav-link.active {
    color: #5865f2;
    border-bottom-color: #5865f2;
}

/* ========================================
   Modern File Input Styles
   ======================================== */

/* Note: File inputs are now styled inline using the drag-drop wrapper pattern.
   This section provides utility classes for custom file upload styling. */


/* Custom file input wrapper */
.file-input-wrapper,
.custom-file-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 1.5rem;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-hover));
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.file-input-wrapper:hover,
.custom-file-upload:hover {
    border-color: var(--accent-color);
    background: linear-gradient(145deg, var(--bg-hover), var(--bg-card));
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.file-input-wrapper.dragover,
.custom-file-upload.dragover {
    border-color: var(--accent-color);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15);
}

/* Style for bare file inputs without wrapper - Using parent positioning */
label + input[type="file"],
.col-12 > input[type="file"],
.form-group input[type="file"],
.modal-body input[type="file"] {
    position: relative;
    display: block;
    width: 100%;
    min-height: 100px;
    padding: 2rem 1rem;
    margin-top: 0.5rem;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-hover));
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    opacity: 1;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: transparent;
    text-align: center;
}

label + input[type="file"]:hover,
.col-12 > input[type="file"]:hover,
.form-group input[type="file"]:hover,
.modal-body input[type="file"]:hover {
    border-color: var(--accent-color);
    background: linear-gradient(145deg, var(--bg-hover), var(--bg-card));
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

label + input[type="file"]:focus,
.col-12 > input[type="file"]:focus,
.form-group input[type="file"]:focus,
.modal-body input[type="file"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* File input button styling */
input[type="file"]::file-selector-button {
    padding: 0.625rem 1.25rem;
    margin-right: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
    transform: translateY(-1px);
}

/* Webkit specific styling */
input[type="file"]::-webkit-file-upload-button {
    padding: 0.625rem 1.25rem;
    margin-right: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

/* File input icon styling for custom wrappers */
.file-input-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    padding: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.05));
    border-radius: 50%;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.file-input-wrapper:hover .file-input-icon,
.custom-file-upload:hover .file-input-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.1));
    transform: scale(1.1);
}

/* File input text styles */
.file-input-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.file-input-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.file-input-formats {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Selected file display */
.file-selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
}

.file-selected i {
    font-size: 1rem;
}

/* Dark Mode - File Input Styles */
[data-theme="dark"] label + input[type="file"],
[data-theme="dark"] .col-12 > input[type="file"],
[data-theme="dark"] .form-group input[type="file"],
[data-theme="dark"] .modal-body input[type="file"] {
    background: linear-gradient(145deg, #161b22, #21262d);
    border-color: #30363d;
}

[data-theme="dark"] label + input[type="file"]:hover,
[data-theme="dark"] .col-12 > input[type="file"]:hover,
[data-theme="dark"] .form-group input[type="file"]:hover,
[data-theme="dark"] .modal-body input[type="file"]:hover {
    border-color: #5865f2;
    background: linear-gradient(145deg, #21262d, #161b22);
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.15);
}

[data-theme="dark"] label + input[type="file"]:focus,
[data-theme="dark"] .col-12 > input[type="file"]:focus,
[data-theme="dark"] .form-group input[type="file"]:focus,
[data-theme="dark"] .modal-body input[type="file"]:focus {
    border-color: #5865f2;
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.2);
}

[data-theme="dark"] input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #5865f2, #4752c4);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

[data-theme="dark"] input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, #4752c4, #5865f2);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, #5865f2, #4752c4);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

[data-theme="dark"] input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, #4752c4, #5865f2);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

[data-theme="dark"] .file-input-wrapper,
[data-theme="dark"] .custom-file-upload {
    background: linear-gradient(145deg, #161b22, #21262d);
    border-color: #30363d;
}

[data-theme="dark"] .file-input-wrapper:hover,
[data-theme="dark"] .custom-file-upload:hover {
    border-color: #5865f2;
    background: linear-gradient(145deg, #21262d, #161b22);
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.15);
}

[data-theme="dark"] .file-input-wrapper.dragover,
[data-theme="dark"] .custom-file-upload.dragover {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.1);
    box-shadow: 0 8px 30px rgba(88, 101, 242, 0.2);
}

[data-theme="dark"] .file-input-icon {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.15), rgba(88, 101, 242, 0.08));
    color: #5865f2;
}

[data-theme="dark"] .file-input-wrapper:hover .file-input-icon,
[data-theme="dark"] .custom-file-upload:hover .file-input-icon {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.12));
}

[data-theme="dark"] .file-input-text {
    color: #e6edf3;
}

[data-theme="dark"] .file-input-hint {
    color: #8b949e;
}

[data-theme="dark"] .file-input-formats {
    background: rgba(88, 101, 242, 0.1);
    color: #8b949e;
}

[data-theme="dark"] .file-selected {
    background: rgba(46, 160, 67, 0.15);
    border-color: rgba(46, 160, 67, 0.4);
    color: #3ba55d;
}

/* Small/Compact file input variant */
.file-input-sm input[type="file"],
input[type="file"].file-input-sm {
    min-height: 60px;
    padding: 1rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    label + input[type="file"],
    .col-12 > input[type="file"],
    .form-group input[type="file"],
    .modal-body input[type="file"] {
        min-height: 80px;
        padding: 1.5rem 1rem;
    }
    
    input[type="file"]::file-selector-button,
    input[type="file"]::-webkit-file-upload-button {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

/* Animation for file input */
@keyframes file-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
}

.file-input-wrapper.highlight,
.custom-file-upload.highlight {
    animation: file-pulse 1.5s ease-in-out infinite;
}

[data-theme="dark"] .file-input-wrapper.highlight,
[data-theme="dark"] .custom-file-upload.highlight {
    animation-name: file-pulse-dark;
}

@keyframes file-pulse-dark {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(88, 101, 242, 0);
    }
}

/* ========================================
   Modern DataTable Styling
   ======================================== */

/* DataTable wrapper */
.dataTables_wrapper {
    padding: 0;
    font-family: var(--font-family);
}

/* Table base styling */
table.dataTable {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0;
    margin: 0 !important;
}

table.dataTable thead th,
table.dataTable thead td {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0.875rem;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
    vertical-align: middle;
}

table.dataTable thead th:first-child {
    border-top-left-radius: var(--radius-lg);
}

table.dataTable thead th:last-child {
    border-top-right-radius: var(--radius-lg);
}

/* Sorting arrows */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    cursor: pointer;
    position: relative;
    padding-right: 28px !important;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'feather' !important;
    font-size: 14px;
    opacity: 0.5;
}

table.dataTable thead .sorting::after {
    content: '\e842';
}

table.dataTable thead .sorting_asc::after {
    content: '\e845';
    opacity: 1;
    color: var(--primary-color);
}

table.dataTable thead .sorting_desc::after {
    content: '\e842';
    opacity: 1;
    color: var(--primary-color);
}

/* Table body */
table.dataTable tbody td {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.875rem;
    color: var(--text-main);
    background: var(--bg-card);
    transition: background-color 0.15s ease;
}

table.dataTable tbody tr:hover td {
    background-color: var(--bg-hover) !important;
}

table.dataTable tbody tr.selected td {
    background-color: rgba(37, 99, 235, 0.08) !important;
}

/* Striped rows */
table.dataTable.table-striped tbody tr:nth-of-type(odd) td {
    background-color: rgba(0, 0, 0, 0.02);
}

table.dataTable.table-striped tbody tr:nth-of-type(odd):hover td {
    background-color: var(--bg-hover) !important;
}

/* Table info section */
.dataTables_info {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 1rem 0;
}

/* Pagination styling */
.dataTables_paginate {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.875rem;
    margin: 0 2px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dataTables_paginate .paginate_button:hover {
    color: var(--primary-color);
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.dataTables_paginate .paginate_button.current {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.dataTables_paginate .paginate_button.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.5;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* Length menu styling */
.dataTables_length {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dataTables_length select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 70px;
    transition: all 0.2s ease;
}

.dataTables_length select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Filter/Search styling */
.dataTables_filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.dataTables_filter input {
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.875rem;
    min-width: 250px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.dataTables_filter input::placeholder {
    color: var(--text-muted);
}

/* DataTable buttons styling */
.dt-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dt-buttons .dt-button {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dt-buttons .dt-button:hover {
    color: var(--primary-color);
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dt-buttons .dt-button.buttons-excel,
.dt-buttons .dt-button.buttons-csv {
    color: #16a34a;
    border-color: #16a34a;
}

.dt-buttons .dt-button.buttons-excel:hover,
.dt-buttons .dt-button.buttons-csv:hover {
    background: rgba(22, 163, 74, 0.08);
    color: #16a34a;
}

.dt-buttons .dt-button.buttons-pdf {
    color: #dc2626;
    border-color: #dc2626;
}

.dt-buttons .dt-button.buttons-pdf:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.dt-buttons .dt-button.buttons-print {
    color: #2563eb;
    border-color: #2563eb;
}

.dt-buttons .dt-button.buttons-print:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

/* Top controls row */
.dataTables_wrapper .row:first-child {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

/* Filter/Search - align to right */
.dataTables_filter {
    margin-left: auto;
    float: right;
}

/* Bottom controls row */
.dataTables_wrapper .row:last-child {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Processing indicator */


/* Responsive/scroll styles */
.dataTables_scrollHead {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}

.dataTables_scrollBody {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* Empty table message */
table.dataTable tbody td.dataTables_empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========================================
   DataTable Dark Mode
   ======================================== */

[data-theme="dark"] table.dataTable thead th,
[data-theme="dark"] table.dataTable thead td {
    background: linear-gradient(135deg, #21262d 0%, #161b22 100%);
    border-bottom-color: #30363d;
    color: #8b949e;
}

[data-theme="dark"] table.dataTable tbody td {
    background: #0d1117;
    border-bottom-color: #21262d;
    color: #e6edf3;
}

[data-theme="dark"] table.dataTable tbody tr:hover td {
    background-color: #161b22 !important;
}

[data-theme="dark"] table.dataTable tbody tr.selected td {
    background-color: rgba(88, 101, 242, 0.12) !important;
}

[data-theme="dark"] table.dataTable.table-striped tbody tr:nth-of-type(odd) td {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] table.dataTable thead .sorting_asc::after,
[data-theme="dark"] table.dataTable thead .sorting_desc::after {
    color: #5865f2;
}

[data-theme="dark"] .dataTables_info {
    color: #8b949e;
}

[data-theme="dark"] .dataTables_paginate .paginate_button {
    color: #8b949e;
    background: #21262d;
    border-color: #30363d;
}

[data-theme="dark"] .dataTables_paginate .paginate_button:hover {
    color: #5865f2;
    background: #30363d;
    border-color: #5865f2;
}

[data-theme="dark"] .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #5865f2, #4752c4);
    border-color: #5865f2;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.35);
}

[data-theme="dark"] .dataTables_paginate .paginate_button.disabled {
    color: #484f58;
}

[data-theme="dark"] .dataTables_length select {
    background: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .dataTables_length select:focus {
    border-color: #5865f2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

[data-theme="dark"] .dataTables_filter input {
    background: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .dataTables_filter input:focus {
    border-color: #5865f2;
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.15);
}

[data-theme="dark"] .dt-buttons .dt-button {
    background: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .dt-buttons .dt-button:hover {
    background: #30363d;
    border-color: #5865f2;
    color: #5865f2;
}

[data-theme="dark"] .dt-buttons .dt-button.buttons-excel,
[data-theme="dark"] .dt-buttons .dt-button.buttons-csv {
    color: #3fb950;
    border-color: #3fb950;
}

[data-theme="dark"] .dt-buttons .dt-button.buttons-excel:hover,
[data-theme="dark"] .dt-buttons .dt-button.buttons-csv:hover {
    background: rgba(63, 185, 80, 0.12);
}

[data-theme="dark"] .dt-buttons .dt-button.buttons-pdf {
    color: #f85149;
    border-color: #f85149;
}

[data-theme="dark"] .dt-buttons .dt-button.buttons-pdf:hover {
    background: rgba(248, 81, 73, 0.12);
}

[data-theme="dark"] .dt-buttons .dt-button.buttons-print {
    color: #5865f2;
    border-color: #5865f2;
}

[data-theme="dark"] .dt-buttons .dt-button.buttons-print:hover {
    background: rgba(88, 101, 242, 0.12);
}

[data-theme="dark"] .dataTables_processing {
    background: #21262d;
    color: #e6edf3;
    border-color: #30363d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .dataTables_wrapper .row:first-child,
[data-theme="dark"] .dataTables_wrapper .row:last-child {
    border-color: #30363d;
}

[data-theme="dark"] .dataTables_scrollBody {
    border-color: #30363d;
}

/* DataTables Fixed Columns Dark Mode */
[data-theme="dark"] .DTFC_LeftWrapper {
    border-right: none;
    /* Use inset shadow for the separator line to avoid width shifts */
    box-shadow: inset -1px 0 0 #30363d, 4px 0 8px -2px rgba(0, 0, 0, 0.5);
    z-index: 10 !important;
}

[data-theme="dark"] .DTFC_LeftWrapper,
[data-theme="dark"] .DTFC_RightWrapper,
[data-theme="dark"] .DTFC_LeftBodyWrapper,
[data-theme="dark"] .DTFC_RightBodyWrapper,
[data-theme="dark"] .DTFC_LeftBodyLiner,
[data-theme="dark"] .DTFC_RightBodyLiner,
[data-theme="dark"] .DTFC_LeftHeadWrapper,
[data-theme="dark"] .DTFC_RightHeadWrapper {
    background: #0d1117 !important;
}

[data-theme="dark"] .DTFC_LeftWrapper table,
[data-theme="dark"] .DTFC_RightWrapper table {
    background: #0d1117 !important;
    margin: 0 !important; /* Ensure no margins break alignment */
}

[data-theme="dark"] .DTFC_LeftWrapper table thead th,
[data-theme="dark"] .DTFC_RightWrapper table thead th {
    background: linear-gradient(135deg, #21262d 0%, #161b22 100%) !important;
    border-color: #30363d !important;
    border-bottom: 1px solid #30363d !important;
    vertical-align: middle !important;
    height: auto !important;
}

[data-theme="dark"] .DTFC_LeftWrapper table tbody td,
[data-theme="dark"] .DTFC_RightWrapper table tbody td {
    background: #0d1117 !important;
    border-color: #21262d !important;
    border-bottom: 1px solid #21262d !important;
    vertical-align: middle !important;
}

[data-theme="dark"] .dataTables_scrollBody::-webkit-scrollbar-thumb,
[data-theme="dark"] .DTFC_LeftBodyLiner::-webkit-scrollbar-thumb,
[data-theme="dark"] .DTFC_RightBodyLiner::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

/* Empty table state in dark mode */
[data-theme="dark"] .dataTables_empty {
    background: #0d1117 !important;
    color: #8b949e !important;
}

[data-theme="dark"] table.dataTable.no-footer {
    border-bottom-color: #30363d !important;
}

/* Fix scroll head and body backgrounds */
[data-theme="dark"] .dataTables_scrollHead,
[data-theme="dark"] .dataTables_scrollHeadInner {
    background: #0d1117 !important;
}

[data-theme="dark"] .dataTables_scroll {
    background: #0d1117;
}

/* ========================================
   DataTable Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .dataTables_wrapper .row:first-child {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dataTables_filter input {
        min-width: 100%;
    }
    
    .dt-buttons {
        width: 100%;
        justify-content: flex-start;
    }
    
    .dataTables_paginate {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }
}

/* Modern User Profile Dropdown */
.dropdown-user .dropdown-menu {
    border: 0;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1);
    border-radius: 12px;
    min-width: 260px;
    margin-top: 15px;
    padding: 0;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease-out forwards;
    transform-origin: top right;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-user .dropdown-toggle::after {
    display: none;
}

/* User Info in Navbar */
.dropdown-user .user-nav {
    margin-right: 12px;
    text-align: right;
}

.dropdown-user .user-nav .user-name {
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.dropdown-user .user-nav .user-status {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Avatar Styling */
.dropdown-user .avatar {
    position: relative;
    transition: transform 0.2s ease;
    display: inline-block;
}

.dropdown-user:hover .avatar {
    transform: scale(1.05);
}

.dropdown-user .avatar img {
    object-fit: cover;
    border: 2px solid var(--bg-card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Dropdown Header User Area */
.dropdown-user .dropdown-header {
    background: linear-gradient(to right bottom, var(--bg-hover), var(--bg-card));
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.dropdown-user .dropdown-header .avatar img {
    border: 3px solid var(--bg-card);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown-user .dropdown-header h6 {
    font-size: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0.2rem;
    color: var(--text-main);
    font-weight: 700;
}

.dropdown-user .dropdown-header span {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.05);
    padding: 2px 10px;
    border-radius: 12px;
    margin-top: 4px;
    display: inline-block;
}

/* Dropdown Items */
.dropdown-user .dropdown-item {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    background: transparent;
}

.dropdown-user .dropdown-item i {
    width: 20px;
    margin-right: 10px;
    font-size: 1rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.dropdown-user .dropdown-item:hover,
.dropdown-user .dropdown-item:focus {
    background-color: var(--bg-hover);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    text-decoration: none;
}

.dropdown-user .dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0;
    border-top: 1px solid var(--border-color);
}

/* Dark Mode Overrides */
[data-theme="dark"] .dropdown-user .dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

[data-theme="dark"] .dropdown-user .dropdown-header {
    background: linear-gradient(to right bottom, #1e2530, #161b22);
}

[data-theme="dark"] .dropdown-user .dropdown-header span {
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
}

/* Fix for Dropdown Hover & Visibility */
.dropdown-user .dropdown-menu {
    display: none;
    margin-top: 0; /* Removing large margin to prevent hover gaps */
    top: 100%;
}

.dropdown-user:hover .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out forwards;
}

/* Add an invisible bridge to prevent dropdown closing when moving mouse across gap */
.dropdown-user::after {
    content: '';
    position: absolute;
    bottom: -10px; /* Extend hit area downwards */
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
    z-index: 100;
}

/* Enforce User Dropdown Styles */
.dropdown-user .dropdown-header h6 {
    text-transform: none !important;
}

.dropdown-user .dropdown-header .avatar {
    width: 100px !important;
    height: 100px !important;
    display: inline-block;
}

.dropdown-user .dropdown-header .avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
    border-radius: 50%;
}

/* Footer Customization */
footer.footer {
    background-color: var(--bg-card) !important;
    color: var(--text-muted) !important;
    border-top: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

footer.footer p {
    margin-bottom: 0;
}

footer.footer a {
    color: var(--text-main) !important;
    transition: color 0.2s;
}

footer.footer a:hover {
    color: var(--primary-color) !important;
}

/* Dark Mode Footer Overrides */
[data-theme="dark"] footer.footer {
    background-color: #1e293b !important; /* Dark Slate to match body/card */
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] footer.footer .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] footer.footer .grey.darken-2 {
    color: #94a3b8 !important; /* Muted Slate */
}

[data-theme="dark"] footer.footer a {
    color: #cbd5e1 !important; /* Lighter Slate */
}

[data-theme="dark"] footer.footer a:hover {
    color: var(--primary-color) !important;
}

/* Modern Loading Spinner */
.modern-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s ease-in-out infinite;
    margin: 0 auto;
}

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

[data-theme="dark"] .modern-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
}

/* Pulse animation for skeleton loading feeling */
.animate-pulse {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Fade in animation for content */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
