/* =====================================================
   DARK THEME CUSTOMIZATION - Bootstrap 5.3
   ===================================================== */

/* ----- Custom Color Variables ----- */
[data-bs-theme="dark"] {
    /* Backgrounds */
    --bs-body-bg: #0d1117;
    --bs-secondary-bg: #161b22;
    --bs-tertiary-bg: #1c2128;

    /* Borders */
    --bs-border-color: #30363d;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.1);

    /* Accent color */
    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;

    /* Links */
    --bs-link-color: #58a6ff;
    --bs-link-hover-color: #79b8ff;

    /* Code */
    --bs-code-color: #79c0ff;
}

/* ----- Global Transitions ----- */
[data-bs-theme="dark"] * {
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* ----- Cards ----- */
[data-bs-theme="dark"] .card {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .card-header {
    background-color: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .card-footer {
    background-color: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
}

/* ----- Navbar ----- */
/* Navbar uses .navbar-aditio class with fixed brand gradient (does not change with theme) */

/* ----- Sidebar ----- */
/* Dark mode sidebar - CRITICAL: use !important to override any inline styles */
[data-bs-theme="dark"] .sidebar,
[data-bs-theme="dark"] .offcanvas {
    background: #161b22 !important;
    border-right: 1px solid #30363d !important;
}

[data-bs-theme="dark"] .sidebar .nav-link,
[data-bs-theme="dark"] .offcanvas-body .nav-link {
    color: #9ca3af !important;
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    border-radius: 0 8px 8px 0;
    margin: 2px 8px 2px 0;
    background-color: transparent !important;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover,
[data-bs-theme="dark"] .offcanvas-body .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-left-color: rgba(156, 163, 175, 0.5);
}

[data-bs-theme="dark"] .sidebar .nav-link.active,
[data-bs-theme="dark"] .offcanvas-body .nav-link.active {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #3b82f6 !important;
    border-left-color: #3b82f6;
    font-weight: 500;
}

[data-bs-theme="dark"] .sidebar .nav-link i,
[data-bs-theme="dark"] .offcanvas-body .nav-link i {
    color: #6b7280 !important;
    transition: color 0.2s ease;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover i,
[data-bs-theme="dark"] .offcanvas-body .nav-link:hover i {
    color: #d1d5db !important;
}

[data-bs-theme="dark"] .sidebar .nav-link.active i,
[data-bs-theme="dark"] .offcanvas-body .nav-link.active i {
    color: #3b82f6 !important;
}

/* ----- Tables ----- */
[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(59, 130, 246, 0.08);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    border-color: var(--bs-border-color);
    border-collapse: separate;
    border-spacing: 0;
}

[data-bs-theme="dark"] .table thead th {
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #8b949e;
    padding: 0.875rem 0.75rem;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: rgba(0, 0, 0, 0.3);
    --bs-table-color: #8b949e;
    --bs-table-border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .table tbody tr {
    transition: all 0.15s ease;
}

[data-bs-theme="dark"] .table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.08);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.875rem 0.75rem;
}

/* Table action buttons - better visibility */
[data-bs-theme="dark"] .table .btn-outline-primary {
    --bs-btn-color: #58a6ff;
    --bs-btn-border-color: #58a6ff;
}

[data-bs-theme="dark"] .table .btn-outline-secondary {
    --bs-btn-color: #c9d1d9;
    --bs-btn-border-color: #484f58;
}

[data-bs-theme="dark"] .table .btn-outline-secondary:hover {
    --bs-btn-hover-bg: rgba(139, 148, 158, 0.2);
    --bs-btn-hover-color: #f0f6fc;
    --bs-btn-hover-border-color: #8b949e;
}

[data-bs-theme="dark"] .table .btn-outline-danger {
    --bs-btn-color: #f85149;
    --bs-btn-border-color: #f85149;
}

[data-bs-theme="dark"] .table .btn-outline-danger:hover {
    --bs-btn-hover-bg: rgba(248, 81, 73, 0.2);
    --bs-btn-hover-color: #ff7b72;
    --bs-btn-hover-border-color: #ff7b72;
}

/* ----- Forms ----- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    color: #c9d1d9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--bs-tertiary-bg);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    color: #f0f6fc;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #6e7681;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    color: #8b949e;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* ----- Buttons ----- */
[data-bs-theme="dark"] .btn-primary {
    --bs-btn-bg: #3b82f6;
    --bs-btn-border-color: #3b82f6;
    --bs-btn-hover-bg: #2563eb;
    --bs-btn-hover-border-color: #2563eb;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1d4ed8;
}

[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #58a6ff;
    --bs-btn-border-color: #58a6ff;
    --bs-btn-hover-bg: rgba(59, 130, 246, 0.15);
    --bs-btn-hover-color: #79b8ff;
    --bs-btn-hover-border-color: #79b8ff;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #d1d5db;
    --bs-btn-border-color: #6b7280;
    --bs-btn-hover-bg: #374151;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-border-color: #9ca3af;
}

[data-bs-theme="dark"] .btn-outline-danger {
    --bs-btn-color: #f87171;
    --bs-btn-border-color: #ef4444;
    --bs-btn-hover-bg: rgba(239, 68, 68, 0.2);
    --bs-btn-hover-color: #fca5a5;
    --bs-btn-hover-border-color: #f87171;
}

[data-bs-theme="dark"] .btn-outline-light {
    --bs-btn-color: #f0f6fc;
    --bs-btn-border-color: rgba(240, 246, 252, 0.3);
    --bs-btn-hover-bg: rgba(240, 246, 252, 0.1);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-border-color: rgba(240, 246, 252, 0.5);
}

/* ----- Badges ----- */
[data-bs-theme="dark"] .badge.text-bg-primary {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #58a6ff !important;
}

[data-bs-theme="dark"] .badge.text-bg-success {
    background-color: rgba(46, 160, 67, 0.2) !important;
    color: #3fb950 !important;
}

[data-bs-theme="dark"] .badge.text-bg-warning {
    background-color: rgba(187, 128, 9, 0.2) !important;
    color: #d29922 !important;
}

[data-bs-theme="dark"] .badge.text-bg-danger {
    background-color: rgba(248, 81, 73, 0.2) !important;
    color: #f85149 !important;
}

[data-bs-theme="dark"] .badge.text-bg-info {
    background-color: rgba(56, 139, 253, 0.25) !important;
    color: #79b8ff !important;
    font-weight: 500;
}

[data-bs-theme="dark"] .badge.text-bg-secondary {
    background-color: rgba(110, 118, 129, 0.2) !important;
    color: #8b949e !important;
}

/* ----- Alerts ----- */
[data-bs-theme="dark"] .alert-success {
    background-color: rgba(46, 160, 67, 0.15);
    border-color: rgba(46, 160, 67, 0.4);
    color: #3fb950;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.4);
    color: #f85149;
}

[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(187, 128, 9, 0.15);
    border-color: rgba(187, 128, 9, 0.4);
    color: #d29922;
}

[data-bs-theme="dark"] .alert-info {
    background-color: rgba(56, 139, 253, 0.15);
    border-color: rgba(56, 139, 253, 0.4);
    color: #58a6ff;
}

/* ----- Modals ----- */
[data-bs-theme="dark"] .modal-content {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-footer {
    border-top: 1px solid var(--bs-border-color);
}

/* ----- Dropdowns ----- */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #f0f6fc;
}

/* ----- Tabs & Nav Pills ----- */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: var(--bs-border-color);
}

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

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: var(--bs-border-color);
    color: #c9d1d9;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-secondary-bg);
    color: #f0f6fc;
}

/* ----- Pagination ----- */
[data-bs-theme="dark"] .page-link {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: #8b949e;
}

[data-bs-theme="dark"] .page-link:hover {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: #f0f6fc;
}

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

[data-bs-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
    color: #484f58;
}

/* ----- List Groups ----- */
[data-bs-theme="dark"] .list-group-item {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: #c9d1d9;
}

[data-bs-theme="dark"] .list-group-item:hover {
    background-color: var(--bs-tertiary-bg);
}

/* ----- Offcanvas ----- */
[data-bs-theme="dark"] .offcanvas {
    background-color: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .offcanvas-header {
    border-bottom: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ----- Progress Bars ----- */
[data-bs-theme="dark"] .progress {
    background-color: var(--bs-tertiary-bg);
}

/* ----- Tooltips ----- */
[data-bs-theme="dark"] .tooltip-inner {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
}

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

/* ----- Code blocks ----- */
[data-bs-theme="dark"] code {
    background-color: rgba(110, 118, 129, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

/* ----- Scrollbar (Webkit) ----- */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bs-body-bg);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ----- Main content area ----- */
[data-bs-theme="dark"] main {
    background-color: var(--bs-body-bg);
}

/* Add subtle border to sidebar for better separation */
[data-bs-theme="dark"] .sidebar {
    box-shadow: 1px 0 0 0 var(--bs-border-color);
}

/* =====================================================
   END DARK THEME CUSTOMIZATION
   ===================================================== */

/* =====================================================
   THEME TOGGLE BUTTON (standalone, outside navbar)
   Used on login/public pages where navbar-aditio is not present.
   Inside navbar-aditio, use .navbar-aditio-theme instead.
   ===================================================== */
.theme-toggle {
    background: transparent;
    border: 1px solid #adb5bd;
    border-radius: 8px;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: #6c757d;
    color: #212529;
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.theme-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

[data-bs-theme="dark"] .theme-toggle {
    border-color: rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
}

[data-bs-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

[data-bs-theme="dark"] .theme-toggle:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* =====================================================
   BASE SIDEBAR STYLES (fallback / light mode default)
   ===================================================== */
.sidebar .nav-link,
.offcanvas-body .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    border-radius: 0 8px 8px 0;
    margin: 2px 8px 2px 0;
}

.sidebar .nav-link:hover,
.offcanvas-body .nav-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.sidebar .nav-link.active,
.offcanvas-body .nav-link.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    border-left-color: #0d6efd;
    font-weight: 500;
}

/* =====================================================
   LIGHT MODE ADJUSTMENTS
   ===================================================== */

/* Navbar uses .navbar-aditio class with fixed brand gradient (does not change with theme) */

/* Light mode sidebar styling */
[data-bs-theme="light"] .sidebar,
[data-bs-theme="light"] .offcanvas {
    background-color: #f8f9fa !important;
    border-right: 1px solid #dee2e6 !important;
}

[data-bs-theme="light"] .sidebar .nav-link,
[data-bs-theme="light"] .offcanvas-body .nav-link {
    color: #495057 !important;
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    border-radius: 0 8px 8px 0;
    margin: 2px 8px 2px 0;
    background-color: transparent !important;
}

[data-bs-theme="light"] .sidebar .nav-link:hover,
[data-bs-theme="light"] .offcanvas-body .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #212529 !important;
    border-left-color: rgba(0, 0, 0, 0.2);
}

[data-bs-theme="light"] .sidebar .nav-link.active,
[data-bs-theme="light"] .offcanvas-body .nav-link.active {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd !important;
    border-left-color: #0d6efd;
    font-weight: 500;
}

[data-bs-theme="light"] .sidebar .nav-link i,
[data-bs-theme="light"] .offcanvas-body .nav-link i {
    color: #6c757d !important;
}

[data-bs-theme="light"] .sidebar .nav-link.active i,
[data-bs-theme="light"] .offcanvas-body .nav-link.active i {
    color: #0d6efd !important;
}

/* Light mode table improvements */
[data-bs-theme="light"] .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #6c757d;
}

[data-bs-theme="light"] .table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Light mode cards */
[data-bs-theme="light"] .card {
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===== Card subject =====
.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.subject-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.subject-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.subject-badge {
    font-size: 0.75rem;
    background: #f3f4f6;
    color: #374151;
    padding: 3px 8px;
    border-radius: 999px;
}

.subject-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-view {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.icon-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
}

.icon-btn:hover {
    background: #f3f4f6;
}

.icon-btn.delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* ===== add-subject-btn ===== */
.add-subject-btn {
    position: fixed;
    bottom: 40px;
    right: 25px;
}

/* ===== Mobile ===== */
@media (max-width: 576px) {
    .subject-item {
        flex-direction: column;
        align-items: stretch;
    }

    .subject-actions {
        justify-content: space-between;
    }

    .btn-view {
        flex: 1;
    }
}

/* ===== Upload PDF Bootstrap ===== */
.upload-box {
    position: relative;
    width: 100%;
}

.upload-input {
    display: none;
}

.upload-label {
    display: block;
    width: 100%;
    padding: 24px 16px;
    border: 2px dashed #ced4da;
    border-radius: 12px;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: all 0.25s ease;
}

.upload-label:hover {
    background-color: #e9ecef;
    border-color: #0d6efd;
}

.upload-icon {
    font-size: 48px;
    color: #6c757d;
}

.upload-text {
    font-size: 0.95rem;
}

.upload-subtext {
    font-size: 0.8rem;
}

.upload-filename {
    word-break: break-all;
}

/* Drag over */
.upload-label.dragover {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

/* ===== Upload Error State ===== */
.upload-filename.text-danger {
    color: #dc3545 !important;
    font-weight: 500;
    background-color: #f8d7da;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #dc3545;
}

/* ===== Mobile ===== */
@media (max-width: 576px) {
    .upload-label {
        padding: 18px 12px;
    }

    .upload-icon {
        font-size: 38px;
    }
}

/* ===== Custom File Input (Spanish) ===== */
.custom-file-input-es {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-file-input-es input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.custom-file-input-es .custom-file-label {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
}

.custom-file-input-es .custom-file-label::before {
    content: "Seleccionar";
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin: -0.375rem 0.75rem -0.375rem -0.75rem;
    color: #212529;
    background-color: #e9ecef;
    border-right: 1px solid #dee2e6;
    border-radius: 0.375rem 0 0 0.375rem;
}

.custom-file-input-es .custom-file-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6c757d;
}

.custom-file-input-es.has-file .custom-file-text {
    color: #212529;
}

/* =====================================================
   DARK MODE VARIANTS FOR EXISTING COMPONENTS
   ===================================================== */

/* ----- Subject Badge ----- */
[data-bs-theme="dark"] .subject-badge {
    background: rgba(139, 148, 158, 0.15);
    color: #8b949e;
}

/* ----- Icon Buttons ----- */
[data-bs-theme="dark"] .icon-btn {
    color: #8b949e;
}

[data-bs-theme="dark"] .icon-btn:hover {
    background: rgba(139, 148, 158, 0.15);
    color: #c9d1d9;
}

[data-bs-theme="dark"] .icon-btn.delete:hover {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
}

/* ----- Upload PDF Box ----- */
[data-bs-theme="dark"] .upload-label {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .upload-label:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

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

[data-bs-theme="dark"] .upload-label.dragover {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

[data-bs-theme="dark"] .upload-filename.text-danger {
    background-color: rgba(248, 81, 73, 0.15);
    border-left-color: #f85149;
}

/* ----- Custom File Input (Spanish) ----- */
[data-bs-theme="dark"] .custom-file-input-es .custom-file-label {
    color: #c9d1d9;
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .custom-file-input-es .custom-file-label::before {
    color: #c9d1d9;
    background-color: var(--bs-secondary-bg);
    border-right-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .custom-file-input-es .custom-file-text {
    color: #6e7681;
}

[data-bs-theme="dark"] .custom-file-input-es.has-file .custom-file-text {
    color: #c9d1d9;
}

/* =====================================================
   NAVBAR ADITIO - Always brand gradient, never changes with theme
   ===================================================== */

.navbar-aditio {
    background: linear-gradient(135deg, #0099CD 0%, #006B91 100%) !important;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
}

.navbar-aditio .navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
}

.navbar-aditio .navbar-brand:hover {
    color: #ffffff !important;
    opacity: 0.9;
}

/* --- Hamburger --- */
.navbar-aditio-hamburger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.navbar-aditio-hamburger:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* --- Bank selector button --- */
.navbar-aditio-bank-btn {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.navbar-aditio-bank-btn:hover,
.navbar-aditio-bank-btn:focus,
.navbar-aditio-bank-btn.show {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar-aditio-bank-btn::after {
    /* Bootstrap dropdown caret color */
    border-top-color: #ffffff;
}

/* --- Bank label (single bank, no dropdown) --- */
.navbar-aditio-bank-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 400;
}

/* --- User name --- */
.navbar-aditio-user {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 400;
    display: flex;
    align-items: center;
}

/* --- Role badge --- */
.navbar-aditio-role-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 50rem;
    line-height: 1.4;
}

/* --- Theme toggle inside navbar --- */
.navbar-aditio-theme {
    background: transparent;
    border: none;
    padding: 0.375rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.navbar-aditio-theme:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-aditio-theme:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.navbar-aditio-theme i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.navbar-aditio-theme:hover i {
    transform: rotate(15deg);
}

/* --- Logout --- */
.navbar-aditio-logout {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.navbar-aditio-logout:hover {
    color: #ffffff;
}
