:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --sidebar-width: 220px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: #333;
    line-height: 1.6;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
    animation: slideInLeft 0.5s ease-out;
}

/* ========== WRAPPER ========== */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, #1a252f 100%);
    color: #fff;
    transition: all var(--transition-speed);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

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

.sidebar-header {
    padding: 16px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar ul {
    padding: 8px 0;
    flex: 1;
}

.sidebar ul li {
    padding: 0;
    margin: 1px 0;
}

.sidebar ul li a {
    padding: 9px 16px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    text-decoration: none;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.sidebar ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(52, 152, 219, 0.1);
    transition: width var(--transition-speed);
    z-index: -1;
}

.sidebar ul li a:hover::before,
.sidebar ul li a.active::before {
    width: 100%;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-left-color: var(--secondary-color);
    padding-left: 20px;
}

.sidebar ul li a i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

/* Sub-items del menú */
.sidebar ul li.sub-item a {
    padding: 7px 16px 7px 38px;
    font-size: 0.82rem;
}

.sidebar ul li.sub-item a i {
    font-size: 0.95rem;
    width: 20px;
}

.menu-section {
    padding: 16px 16px 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.user-info i {
    font-size: 1.7rem;
    color: var(--secondary-color);
}

/* ========== CONTENT ========== */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all var(--transition-speed);
    margin-left: var(--sidebar-width);
    background: var(--light-bg);
}

#content.active {
    margin-left: 0;
}

.main-content {
    padding: 20px 24px;
    min-height: calc(100vh - 70px);
}

/* ========== TOP NAVBAR ========== */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

#sidebarCollapse {
    border: none;
    transition: all var(--transition-speed);
}

#sidebarCollapse:hover {
    background: var(--light-bg);
    transform: scale(1.1);
}

/* ========== CARDS ========== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    transition: all var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #fff 0%, var(--light-bg) 100%);
    border-bottom: 2px solid var(--secondary-color);
    font-weight: 600;
    padding: 18px 24px;
    font-size: 1.1rem;
}

.card-body {
    padding: 24px;
}

/* ========== STATS CARDS ========== */
.stat-card {
    padding: 24px;
    border-radius: 12px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-speed);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    font-size: 2.2rem;
    margin: 12px 0;
    font-weight: 700;
}

.stat-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* ========== TABLES ========== */
.table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 18px;
    color: #fff;
}

.table tbody tr {
    transition: all var(--transition-speed);
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.05) 0%, transparent 100%);
    transform: scale(1.01);
}

.table tbody td {
    padding: 18px;
    vertical-align: middle;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-speed);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
    color: #fff;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
    color: #fff;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-3px);
}

/* ========== FORMS ========== */
.form-control,
.form-select {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.15);
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.input-group-text {
    border: 2px solid #e0e0e0;
    border-right: none;
    background: var(--light-bg);
    transition: all var(--transition-speed);
}

.input-group .form-control {
    border-left: none;
    border-width: 2px;
}

.input-group .btn {
    border-width: 2px;
    border-left: 1px solid #e0e0e0;
}

.input-group:focus-within {
    border-radius: 8px;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.18);
}

.input-group:focus-within .input-group-text {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.05);
}

.input-group:focus-within .form-control {
    border-color: var(--secondary-color);
    box-shadow: none;
}

.input-group:focus-within .btn {
    border-color: var(--secondary-color);
}

/* ========== BADGES ========== */
.badge {
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ========== LOGIN PAGE ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite;
}

.login-container {
    background: #fff;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-circle {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.3);
}

.logo-circle i {
    font-size: 3.5rem;
    color: #fff;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 700;
}

.login-footer {
    margin-top: 30px;
}

.info-box {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
    display: flex;
    align-items: start;
    gap: 10px;
}

.info-box i {
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.info-box code {
    background: rgba(52, 152, 219, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--secondary-color);
    font-weight: 600;
}

.login-features {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.feature-item {
    text-align: center;
}

.feature-item i {
    font-size: 2rem;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 8px;
}

.feature-item span {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* ========== WELCOME PAGE ========== */
.welcome-page {
    min-height: 100vh;
    background: #fff;
}

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.hero-section::before {
    width: 500px;
    height: 500px;
    top: -250px;
    right: -250px;
    animation: float 8s ease-in-out infinite;
}

.hero-section::after {
    width: 400px;
    height: 400px;
    bottom: -200px;
    left: -200px;
    animation: float 10s ease-in-out infinite reverse;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.hero-icon {
    margin-bottom: 30px;
}

.hero-icon i {
    font-size: 6rem;
    animation: pulse 2s ease-in-out infinite;
}

.hero-buttons {
    margin-top: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.features-section {
    padding: 100px 0;
    background: var(--light-bg);
}

.section-header {
    margin-bottom: 60px;
}

.feature-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    height: 100%;
    transition: all var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    font-size: 2.5rem;
    color: #fff;
}

.feature-icon.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.feature-icon.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.feature-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.feature-list li {
    padding: 8px 0;
    color: #666;
}

.feature-list i {
    color: var(--success-color);
    margin-right: 8px;
}

.benefits-section {
    padding: 100px 0;
    background: #fff;
}

.benefits-image {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card {
    position: absolute;
    background: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.floating-card.card-1 {
    top: 50px;
    left: 20px;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 150px;
    right: 50px;
    animation-delay: 1s;
}

.floating-card.card-3 {
    bottom: 100px;
    left: 80px;
    animation-delay: 2s;
}

.main-illustration {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: #fff;
    box-shadow: 0 20px 50px rgba(52, 152, 219, 0.3);
}

.benefits-content {
    padding: 40px;
}

.benefit-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: start;
}

.benefit-item i {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.benefit-item h4 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 700;
}

.cta-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: #fff;
}

.welcome-footer {
    padding: 40px 0;
    background: var(--light-bg);
    border-top: 1px solid #e0e0e0;
}

/* ========== ALERTS ========== */
.alert {
    border: none;
    border-radius: 10px;
    padding: 16px 20px;
    border-left: 4px solid;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-left-color: var(--info-color);
    color: var(--info-color);
}

/* ========== PAGE TITLE ========== */
.page-title {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-bg);
}

.page-title h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
}

.page-title p {
    color: #666;
    margin: 0;
    font-size: 1.05rem;
}

/* ========== LOADING ========== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.active {
        margin-left: 0;
    }

    #content {
        margin-left: 0;
        width: 100%;
    }

    .main-content {
        padding: 20px 15px;
    }

    .stat-card h3 {
        font-size: 1.8rem;
    }

    .login-container {
        padding: 35px 25px;
        margin: 20px;
    }

    .hero-section {
        min-height: auto;
        padding: 80px 0;
    }

    .hero-icon i {
        font-size: 4rem;
    }

    .features-section,
    .benefits-section,
    .cta-section {
        padding: 60px 0;
    }

    .benefits-image {
        display: none;
    }

    .floating-card {
        display: none;
    }
}

/* ========== STAT CARDS COMPACT ========== */
.stat-card-sm {
    padding: 14px 18px;
    border-radius: 10px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card-sm .stat-label {
    font-size: 0.78rem;
    opacity: 0.85;
    margin-bottom: 2px;
    font-weight: 500;
}

.stat-card-sm .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.stat-card-sm small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.stat-card-sm .stat-icon {
    font-size: 2rem;
    opacity: 0.25;
}

.stat-card-sm.primary  { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card-sm.success  { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.stat-card-sm.warning  { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card-sm.danger   { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

/* ========== COMPACT DESIGN STYLES ========== */
.form-label-sm {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

.form-control-sm,
.form-select-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.table-sm thead th {
    font-size: 0.8rem;
    padding: 0.5rem;
    background: #f8f9fa;
    color: var(--primary-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-sm tbody td {
    padding: 0.5rem;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.card.border-0.shadow-sm {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08) !important;
    border-radius: 0.5rem;
}

.card.border-0.shadow-sm:hover {
    transform: none;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12) !important;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-outline-info,
.btn-outline-warning,
.btn-outline-danger {
    border-width: 1px;
}

.btn-outline-info:hover {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-outline-warning:hover {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #fff;
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.alert.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

h5.mb-0 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.card-body.p-0 .table {
    margin-bottom: 0;
}

.text-muted.mt-2.mb-0 {
    font-size: 0.9rem;
}

/* Compact spacing */
.g-2 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

.gap-2 {
    gap: 0.5rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Form check adjustments */
.form-check-label.small {
    font-size: 0.875rem;
}

/* Adjust icon sizes in compact tables */
.table-sm .bi {
    font-size: 1rem;
}

/* ========== DARK MODE TOGGLE BUTTON ========== */
.dark-mode-toggle {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    color: #666;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0,0,0,0.1);
    color: #333;
}

/* Toggle dentro del sidebar */
.sidebar-dark-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.sidebar-dark-toggle:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.sidebar-dark-toggle i {
    font-size: 1rem;
    color: #aab8c8;
    transition: color 0.3s;
}

body.dark-mode .sidebar-dark-toggle i {
    color: #ffd54f;
}

body.dark-mode .sidebar-dark-toggle {
    background: rgba(255, 213, 79, 0.1);
    border-color: rgba(255, 213, 79, 0.25);
    color: #ffd54f;
}

/* ========== DARK MODE ========== */

/* Aplicado por JS y por el script inline del head */
html.dark-mode-init body { background-color: #121212 !important; }

body.dark-mode {
    background-color: #121212;
    color: #dde1e7;
}

/* Layout */
body.dark-mode #content {
    background-color: #121212;
}

body.dark-mode .main-content {
    background-color: #121212;
}

/* Navbar superior */
body.dark-mode .navbar {
    background: rgba(24, 24, 32, 0.98) !important;
    border-bottom-color: rgba(255, 255, 255, 0.07) !important;
}

body.dark-mode .navbar .text-muted {
    color: #888 !important;
}

body.dark-mode #sidebarCollapse {
    background: #2a2a38;
    color: #ccc;
    border-color: #3a3a4a;
}

body.dark-mode #sidebarCollapse:hover {
    background: #3a3a4a;
}

body.dark-mode .dark-mode-toggle {
    color: #ffd54f;
    border-color: rgba(255, 213, 79, 0.2);
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 213, 79, 0.1);
    border-color: rgba(255, 213, 79, 0.4);
}

/* Cards */
body.dark-mode .card {
    background-color: #1e1e2e;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .card-header {
    background: linear-gradient(135deg, #1e1e2e 0%, #252535 100%);
    border-bottom-color: rgba(52, 152, 219, 0.5);
    color: #dde1e7;
}

body.dark-mode .card-body {
    background-color: #1e1e2e;
}

/* Tables */
body.dark-mode .table {
    background: #1e1e2e;
    color: #dde1e7;
    --bs-table-bg: #1e1e2e;
    --bs-table-color: #dde1e7;
    --bs-table-border-color: #2a2a3e;
    --bs-table-hover-bg: rgba(52, 152, 219, 0.08);
}

body.dark-mode .table thead th {
    background: linear-gradient(135deg, #0d1b2a 0%, #1a2a3a 100%);
    color: #a0b4c8;
    border-color: #1a2a3a;
}

body.dark-mode .table-light,
body.dark-mode .table-light > th,
body.dark-mode .table-light > td {
    background-color: #252535 !important;
    color: #a0aab8 !important;
    border-color: #2a2a3e !important;
}

body.dark-mode .table tbody tr {
    border-bottom-color: #2a2a3e;
}

body.dark-mode .table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.08);
}

body.dark-mode .table tbody td {
    color: #dde1e7;
    border-color: #2a2a3e;
}

body.dark-mode .table-hover > tbody > tr:hover > * {
    background-color: rgba(52, 152, 219, 0.08);
    color: #dde1e7;
}

/* Forms */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #252535;
    border-color: #3a3a4e;
    color: #dde1e7;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #2c2c3e;
    border-color: #3498db;
    color: #dde1e7;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.2);
}

body.dark-mode .form-control::placeholder {
    color: #555;
}

body.dark-mode .form-control:disabled,
body.dark-mode .form-select:disabled {
    background-color: #1a1a28;
    color: #666;
}

body.dark-mode .input-group-text {
    background-color: #252535;
    border-color: #3a3a4e;
    border-right: none;
    color: #aaa;
}

body.dark-mode .input-group .form-control {
    background-color: #252535;
    border-color: #3a3a4e;
    border-left: none;
    color: #dde1e7;
}

body.dark-mode .input-group .form-control:focus {
    background-color: #2c2c3e;
    border-color: #3498db;
    box-shadow: none;
}

body.dark-mode .input-group:focus-within .input-group-text {
    background-color: #2c2c3e;
    border-color: #3498db;
}

body.dark-mode .input-group:focus-within .form-control {
    border-color: #3498db;
}

body.dark-mode .input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.2);
    border-radius: 8px;
}

body.dark-mode .input-group .btn-outline-secondary {
    background-color: #252535;
    border-color: #3a3a4e;
    border-left: 1px solid #3a3a4e;
    color: #888;
}

body.dark-mode .input-group .btn-outline-secondary:hover {
    background-color: #3a3a4e;
    color: #dde1e7;
}

body.dark-mode .input-group:focus-within .btn-outline-secondary {
    border-color: #3498db;
}

body.dark-mode .form-label,
body.dark-mode .form-label-sm {
    color: #b0b8c8;
}

body.dark-mode .form-check-label {
    color: #b0b8c8;
}

body.dark-mode .form-text {
    color: #666;
}

/* Buttons */
body.dark-mode .btn-light {
    background-color: #2a2a3a;
    border-color: #3a3a4a;
    color: #dde1e7;
}

body.dark-mode .btn-light:hover {
    background-color: #3a3a4a;
    color: #fff;
}

body.dark-mode .btn-outline-secondary {
    border-color: #555;
    color: #bbb;
}

body.dark-mode .btn-outline-secondary:hover {
    background-color: #3a3a4a;
    border-color: #666;
    color: #fff;
}

body.dark-mode .btn-secondary {
    background-color: #3a3a4a;
    border-color: #4a4a5a;
    color: #dde1e7;
}

body.dark-mode .btn-outline-primary {
    border-color: #3498db;
    color: #3498db;
}

body.dark-mode .btn-outline-primary:hover {
    background-color: #3498db;
    color: #fff;
}

body.dark-mode .btn-outline-danger {
    border-color: #e74c3c;
    color: #e74c3c;
}

body.dark-mode .btn-outline-danger:hover {
    background-color: #e74c3c;
    color: #fff;
}

/* Alerts */
body.dark-mode .alert-danger {
    background: rgba(231, 76, 60, 0.15);
    border-left-color: var(--danger-color);
    color: #ef9a9a;
}

body.dark-mode .alert-success {
    background: rgba(39, 174, 96, 0.15);
    border-left-color: var(--success-color);
    color: #a5d6a7;
}

body.dark-mode .alert-warning {
    background: rgba(243, 156, 18, 0.15);
    border-left-color: var(--warning-color);
    color: #ffe082;
}

body.dark-mode .alert-info {
    background: rgba(23, 162, 184, 0.15);
    border-left-color: var(--info-color);
    color: #80deea;
}

/* Text & misc */
body.dark-mode .text-muted {
    color: #777 !important;
}

body.dark-mode .text-dark {
    color: #dde1e7 !important;
}

body.dark-mode code {
    background: rgba(52, 152, 219, 0.15);
    color: #64b5f6;
}

body.dark-mode .bg-light {
    background-color: #252535 !important;
}

body.dark-mode .bg-white {
    background-color: #1e1e2e !important;
}

body.dark-mode .border,
body.dark-mode .border-bottom {
    border-color: #2a2a3e !important;
}

body.dark-mode hr {
    border-color: #2a2a3e;
}

body.dark-mode .rounded.bg-light {
    background-color: #2a2a3e !important;
}

body.dark-mode small {
    color: #9aa3b0;
}

body.dark-mode h5, body.dark-mode h6 {
    color: #dde1e7;
}

/* Badges override */
body.dark-mode .badge.bg-secondary {
    background-color: #3a3a4a !important;
}

/* ========== DARK MODE - LOGIN ========== */
body.dark-mode .login-wrapper {
    background: linear-gradient(135deg, #0d0d1a 0%, #1a0a2e 100%);
}

body.dark-mode .login-container {
    background: #1e1e2e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .login-header h2 {
    color: #dde1e7;
}

body.dark-mode .login-header .text-muted {
    color: #888 !important;
}

body.dark-mode .info-box {
    background: rgba(52, 152, 219, 0.08);
    border-left-color: #3498db;
}

body.dark-mode .info-box strong {
    color: #b0c4d8;
}

body.dark-mode .info-box .text-muted {
    color: #777 !important;
}

body.dark-mode .info-box code {
    background: rgba(52, 152, 219, 0.2);
    color: #64b5f6;
}

body.dark-mode .login-features {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .feature-item i {
    color: #3498db;
}

body.dark-mode .feature-item span {
    color: #888;
}

body.dark-mode .form-check-label {
    color: #999;
}

body.dark-mode .form-check-input {
    background-color: #2c2c3e;
    border-color: #4a4a5e;
}

body.dark-mode .form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}


