﻿:root {
    --primary: #0f143c;
    --primary-light: #1a1f5e;
    --primary-lighter: #2a2f7e;
    --secondary: #fabb17;
    --secondary-light: #fcd148;
    --secondary-dark: #d49a0e;
    --dark: #0f143c;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --success: #0f143c;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 2px 16px rgba(15, 20, 60, 0.08);
    --shadow-lg: 0 8px 32px rgba(15, 20, 60, 0.12);
    --shadow-xl: 0 20px 60px rgba(15, 20, 60, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary-lighter) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 440px;
    margin: 20px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    position: relative;
}

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

.login-logo {
    text-align: center;
    margin: 0 auto 20px;
}
.login-logo img {
    max-width: 220px;
    width: 100%;
    height: auto;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.login-form .form-group label i {
    color: var(--secondary);
    font-size: 14px;
    width: 16px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--gray-50);
}

.login-form input:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 4px rgba(250, 187, 23, 0.15);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
}

.login-info {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.5;
}

.login-info i {
    color: var(--secondary);
    margin-right: 4px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    font-size: 12px;
    color: var(--gray-500);
}

.login-decoration {
    display: none;
}

/* Navbar */
.navbar {
    background: var(--primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 16px rgba(15, 20, 60, 0.15);
}

.nav-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    min-height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.nav-brand i {
    font-size: 24px;
}

.nav-brand-logo {
    display: block;
    height: 56px;
    max-height: 56px;
    width: auto;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-user-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: var(--transition);
}

.nav-user-name:hover {
    color: var(--secondary);
}

/* Main Content */
.main-content {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 32px 28px;
    animation: fadeIn 0.4s ease;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(250, 187, 23, 0.35);
}

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

.btn-secondary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: rgba(250, 187, 23, 0.1);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
    border-top: 3px solid #fabb17;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 i {
    color: var(--secondary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border-top: 3px solid #fabb17;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: rgba(15, 20, 60, 0.1);
    color: var(--primary);
}

.stat-icon.gold {
    background: rgba(250, 187, 23, 0.15);
    color: var(--secondary-dark);
}

.stat-icon.green {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
}

.stat-icon.red {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.live-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-left: 6px;
    border-radius: 50%;
    background: #e74c3c;
    vertical-align: middle;
    animation: pulseDot 1.2s ease-in-out infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

@keyframes filaFlash {
    0% { background-color: rgba(16, 185, 129, 0.25); }
    100% { background-color: transparent; }
}

tr.fila-nueva {
    animation: filaFlash 2.2s ease-out 1;
}

@keyframes cardFlashRojo {
    0%, 100% { box-shadow: var(--shadow); border-color: #fabb17; }
    25%, 75% { box-shadow: 0 0 24px rgba(220, 53, 69, 0.5); border-color: #dc3545; }
}

.card-flash {
    animation: cardFlashRojo 1.5s ease;
}

.card-activa {
    border-color: rgba(220, 53, 69, 0.3) !important;
    background: rgba(220, 53, 69, 0.03) !important;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

/* Forms */
.form-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
    border-top: 3px solid #fabb17;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: var(--secondary);
}

.form-section h3 .badge {
    background: var(--secondary);
    color: var(--primary);
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.grid-2col > * {
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(250, 187, 23, 0.12);
}

select.form-control {
    appearance: none;
    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='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-control:disabled,
.form-control[disabled] {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Toast flotante */
#flashToast {
    display: none;
}
#flashToast[data-toast] {
    display: flex;
}
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}
.toast-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #0f143c;
}
.toast-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}
.toast-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}
.toast i {
    font-size: 18px;
}
@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}
.toast.removing {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* --- Toggle Switch para ¿Ha repetido curso? --- */
.toggle-switch-group {
    display: flex;
    align-items: center;
    gap: 0;
    padding-top: 4px;
}
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.toggle-switch input[type="checkbox"] {
    display: none;
}
.toggle-label-off,
.toggle-label-on {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    transition: color 0.25s ease;
    min-width: 24px;
    text-align: center;
}
.toggle-track {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--gray-300);
    border-radius: 13px;
    margin: 0 8px;
    transition: background 0.25s ease;
}
.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.25s ease;
}
/* Estado activo (Sí) */
.toggle-switch input:checked ~ .toggle-track {
    background: #10B981;
}
.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
    transform: translateX(22px);
}
.toggle-switch input:checked ~ .toggle-label-off {
    color: var(--gray-400);
}
.toggle-switch input:checked ~ .toggle-label-on {
    color: #10B981;
}
.toggle-switch input:not(:checked) ~ .toggle-label-off {
    color: var(--gray-600);
}
.toggle-switch input:not(:checked) ~ .toggle-label-on {
    color: var(--gray-400);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: var(--gray-200);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-check-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="radio"],
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary);
    cursor: pointer;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 12px;
}

thead {
    background: var(--primary);
    color: white;
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

tr:hover td {
    background: var(--gray-50);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Search & Filters */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar .form-control {
    max-width: 360px;
    flex: 1;
}

/* Section Titles */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: var(--secondary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Responsive */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-brand-logo {
        height: 40px;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 16px 24px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
    }

    .nav-user {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding: 16px 0 0;
        margin-top: 8px;
        justify-content: space-between;
    }

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

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-section {
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .grid-2col {
        grid-template-columns: 1fr !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar .form-control {
        max-width: 100%;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-info h3 {
        font-size: 22px;
    }

    .table-container {
        margin: 0 -16px;
        border-radius: 0;
    }

    .login-container {
        max-width: 100%;
        margin: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 24px 16px;
    }

    .login-header h1 {
        font-size: 18px;
    }

    .form-check-group {
        flex-direction: column;
        gap: 8px;
    }

}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 60, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    padding: 0 16px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.progress-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--gray-600);
    flex-shrink: 0;
}

.progress-step.active .step-number {
    background: var(--secondary);
    color: var(--primary);
}

.progress-step.completed .step-number {
    background: var(--success);
    color: white;
}

.progress-step.completed {
    color: var(--success);
}

.progress-step.active {
    color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-primary {
    background: rgba(15, 20, 60, 0.1);
    color: var(--primary);
}

/* Info Box */
.info-box {
    background: rgba(250, 187, 23, 0.08);
    border: 1px solid rgba(250, 187, 23, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-700);
}

.info-box i {
    color: var(--secondary);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px 12px;
    }
}

/* ==========================================
   WIZARD / MODULE STEPPER
   ========================================== */

.wizard-wrapper {
    display: flex;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.wizard-steps {
    flex-shrink: 0;
    width: 200px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    padding-top: 8px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: default;
    transition: all 0.3s ease;
    position: relative;
}

.wizard-step .step-circle {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.wizard-step.pending .step-circle {
    background: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
}

.wizard-step.active .step-circle {
    background: #fabb17;
    color: #0f143c;
    border-color: #fabb17;
    box-shadow: 0 4px 16px rgba(250, 187, 23, 0.35);
    transform: scale(1.08);
}

.wizard-step.completed .step-circle {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.wizard-step .step-label {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.wizard-step.pending .step-label {
    color: #adb5bd;
}

.wizard-step.active .step-label {
    color: #0f143c;
    font-weight: 700;
}

.wizard-step.completed .step-label {
    color: var(--primary);
}

.step-connector {
    width: 2px;
    height: 20px;
    margin-left: 17px;
    background: #dee2e6;
    transition: background 0.3s ease;
}

.step-connector.completed {
    background: var(--primary);
}

.wizard-content {
    flex: 1;
    min-width: 0;
}

.form-module {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-module.active {
    display: block;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    gap: 12px;
}

.btn-next,
.btn-prev {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-next,
.btn-prev {
    background: #fabb17;
    color: #0f143c;
}

.btn-next {
    margin-left: auto;
}

.btn-next:hover,
.btn-prev:hover {
    background: #fcd460;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(250, 187, 23, 0.35);
}

.btn-outline-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 2px solid #0f143c;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #0f143c;
    text-decoration: none;
}

.btn-outline-primary:hover {
    background: #0f143c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 20, 60, 0.2);
}

.form-module .form-section {
    margin-bottom: 0;
}

.form-module[data-step="3"] .form-section {
    margin-bottom: 10px;
}

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

@media (max-width: 900px) {
    .wizard-wrapper {
        flex-direction: column;
        gap: 0;
    }

    .wizard-steps {
        width: 100%;
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 0;
        padding: 16px 0 8px;
        margin-bottom: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .wizard-steps::-webkit-scrollbar {
        display: none;
    }

    .wizard-step {
        flex-direction: column;
        padding: 6px 10px;
        text-align: center;
        min-width: 60px;
        gap: 4px;
    }

    .wizard-step .step-circle {
        width: 30px;
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .wizard-step .step-label {
        font-size: 10px;
        white-space: nowrap;
    }

    .step-connector {
        width: 16px;
        min-width: 16px;
        height: 2px;
        margin: 0;
        align-self: center;
    }

    .wizard-nav {
        flex-direction: column;
        gap: 8px;
    }

    .btn-next,
    .btn-prev,
    .btn-outline-primary {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .wizard-step {
        min-width: 50px;
        padding: 4px 6px;
    }

    .wizard-step .step-circle {
        width: 26px;
        min-width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .wizard-step .step-label {
        font-size: 9px;
    }

    .step-connector {
        width: 10px;
        min-width: 10px;
    }
}

/* Responsive extras: modal, toast, checkbox-grid */
@media (max-width: 768px) {
    .modal {
        padding: 24px;
        max-width: 100%;
        margin: 0 12px;
    }
    .modal-header h3 {
        font-size: 18px;
    }
    .checkbox-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 16px;
    }
    .modal-header h3 {
        font-size: 16px;
    }
    .toast {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        font-size: 13px;
        padding: 12px 16px;
    }
    .checkbox-grid {
        grid-template-columns: 1fr 1fr;
        padding: 8px;
    }
    .checkbox-item {
        font-size: 13px;
    }
}

/* ==========================================
   RESUMEN PAGE
   ========================================== */

.resumen-intro {
    text-align: center;
    padding: 24px 32px;
    margin-bottom: 32px;
    background: #f0f7ff;
    border-radius: 12px;
    border: 1px solid #dbeafe;
}
.resumen-intro h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}
.resumen-intro p {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
}

.resumen-section {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.resumen-section h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--secondary);
}

.resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.resumen-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.resumen-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}
.resumen-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}
.resumen-value .text-muted {
    color: var(--gray-400);
    font-style: italic;
}

/* ==========================================
   BTN SUCCESS (FINALIZAR)
   ========================================== */

.btn-success {
    background: #28a745;
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 17px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.35);
}
.btn-success:active {
    transform: translateY(0);
}

/* ==========================================
   RESUMEN RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .resumen-intro {
        padding: 18px 16px;
        margin-bottom: 20px;
    }
    .resumen-intro h2 {
        font-size: 20px;
    }
    .resumen-intro p {
        font-size: 13px;
    }
    .resumen-section {
        padding: 20px 16px;
    }
    .resumen-section h3 {
        font-size: 15px;
    }
    .resumen-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .resumen-value {
        font-size: 13px;
    }
    .btn-success {
        padding: 14px 32px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .resumen-section {
        padding: 16px 12px;
    }
    .resumen-grid {
        gap: 10px;
    }
    .resumen-label {
        font-size: 10px;
    }
    .resumen-value {
        font-size: 12px;
    }
}

/* ============================================================
   SECCIÓN IMPRIMIR DOCUMENTOS (panel/index.php)
   Lista compacta — tonos grises
   ============================================================ */
.documents-print-section {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.documents-print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.documents-print-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.documents-print-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.documents-print-header-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
    margin: 0;
}

.documents-print-header-text p {
    font-size: 13px;
    color: var(--gray-500);
    margin: 2px 0 0;
}

.documents-print-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.documents-print-badge i {
    font-size: 13px;
}

.documents-print-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.document-print-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 11px 14px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.document-print-card:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.document-print-card:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.document-print-card.is-disabled {
    pointer-events: none;
    opacity: 0.48;
    cursor: default;
}

.document-print-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.document-print-title {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
    margin: 0;
}

.document-print-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 3px 9px;
    border-radius: 5px;
    flex-shrink: 0;
}

.document-print-pdf i {
    color: var(--gray-600);
    font-size: 12px;
}

.document-print-action {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: var(--transition);
}

.document-print-card:hover .document-print-action {
    background: var(--gray-200);
    color: var(--gray-700);
}

.documents-print-empty {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.documents-print-empty i {
    color: var(--gray-400);
    font-size: 14px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .documents-print-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .documents-print-section {
        padding: 18px 14px;
    }
    .document-print-card {
        padding: 10px 12px;
    }
}
