        :root {
            --color-primary: #5b61ff;
            --color-primary-dark: #4b52ff;
            --color-bg: #f8fafc;
            --color-surface: #ffffff;
            --color-text: #1e293b;
            --color-text-muted: #64748b;
            --color-border: #e2e8f0;
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 16px;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--color-bg);
            margin: 0;
            padding: 0;
            color: var(--color-text);
        }

        /* Loading Screen */
        #loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background-color: #282c34;
            color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            z-index: 9999;
        }

        /* Spinner Animation */
        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #61dafb;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        /* Wizard  */

        .navbar {
            margin-bottom: 20px;
        }

        .wizard {
            max-width: 900px;
            margin: 20px auto;
            background: var(--color-surface);
            padding: 24px;
            border-radius: var(--radius-lg);
            border: 1px solid var(--color-border);
            box-shadow: var(--shadow-md);
        }

        .step {
            display: none;
            padding: 18px;
            background: #fbfcff;
            border: 1px solid var(--color-border);
            border-radius: 12px;
        }

        .step.active {
            display: block;
        }

        .step h3 {
            font-weight: 700;
            font-size: 1.35rem;
            color: var(--color-primary);
            text-align: center;
            letter-spacing: 0.01em;
        }

        .step hr {
            border-color: var(--color-border);
        }

        /* Section titles inside steps */
        .step .section-title {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--color-primary);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: 0.5rem;
        }

        .wizard label,
        .wizard .form-label {
            font-weight: 500;
            font-size: 0.875rem;
            color: var(--color-text-muted);
        }

        .wizard .form-control,
        .wizard .form-select {
            border-radius: var(--radius-sm);
            border-color: var(--color-border);
            background-color: #ffffff;
            transition: box-shadow 0.2s ease, border-color 0.2s ease;
        }

        .wizard .form-control::placeholder {
            color: #94a3b8;
        }

        .wizard .form-control:focus,
        .wizard .form-select:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(91, 97, 255, 0.15);
        }

        .wizard .form-check:not(.form-check-inline) {
            background: #f9fafb;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-sm);
            padding: 10px 12px;
        }

        /* Step Timeline */
        .step-timeline {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            padding: 10px 0;
            overflow-x: auto;
        }

        .step-indicator {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 60px;
            opacity: 0.5;
        }

        .step-indicator:hover {
            opacity: 0.8;
        }

        .step-indicator.completed {
            opacity: 1;
            cursor: pointer;
        }

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

        .step-indicator.active {
            opacity: 1;
        }

        .step-indicator.active .step-number {
            background: white;
            color: var(--color-primary);
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(91, 97, 255, 0.2);
        }

        .step-indicator.future {
            cursor: not-allowed;
            opacity: 0.4;
        }

        .step-number {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #e2e8f0;
            border: 2px solid #cbd5e1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            color: #64748b;
            transition: all 0.3s ease;
        }

        .step-label {
            font-size: 11px;
            color: #64748b;
            margin-top: 6px;
            text-align: center;
            font-weight: 500;
            white-space: nowrap;
        }

        .step-indicator.completed .step-label,
        .step-indicator.active .step-label {
            color: var(--color-primary);
            font-weight: 600;
        }

        .step-connector {
            flex: 1;
            height: 2px;
            background: #e2e8f0;
            margin: 0 5px;
            margin-bottom: 20px;
            transition: background 0.3s ease;
        }

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

        @media (max-width: 768px) {
            .step-timeline {
                padding: 5px 0;
            }
            .step-number {
                width: 28px;
                height: 28px;
                font-size: 12px;
            }
            .step-label {
                font-size: 9px;
            }
            .step-indicator {
                min-width: 45px;
            }
        }

        .progress-bar {
            height: 6px;
            background-color: #e2e8f0;
            border-radius: 999px;
            overflow: hidden;
            margin-bottom: 20px;
        }

        .progress-bar-fill {
            height: 100%;
            width: 0;
            background: linear-gradient(90deg, var(--color-primary) 0%, #8f7dff 100%);
            transition: width 0.4s ease;
        }

        /* Tables */
        .wizard .table-responsive {
            border: 1px solid var(--color-border);
            border-radius: var(--radius-md);
            background: #ffffff;
            padding: 0;
            overflow: hidden;
        }

        .wizard .table {
            margin-bottom: 0;
        }

        .wizard .table thead th {
            background: #f1f5f9;
            color: var(--color-text);
            font-weight: 600;
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            border-bottom: 2px solid var(--color-border);
        }

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

        .wizard .table td,
        .wizard .table th {
            border-color: var(--color-border);
            vertical-align: middle;
        }

        /* Buttons */
        .wizard .btn {
            border-radius: var(--radius-sm);
            font-weight: 600;
            font-size: 0.9rem;
        }

        .wizard .btn-primary {
            background-color: var(--color-primary);
            border-color: var(--color-primary);
            box-shadow: 0 4px 10px rgba(91, 97, 255, 0.2);
        }

        .wizard .btn-primary:hover {
            background-color: var(--color-primary-dark);
            border-color: var(--color-primary-dark);
        }

        .wizard .btn-secondary {
            background-color: #f1f5f9;
            border-color: var(--color-border);
            color: var(--color-text);
        }

        .wizard .btn-secondary:hover {
            background-color: #e2e8f0;
        }

        .wizard .alert-info {
            border-left: 4px solid #4c6ef5;
        }

        /* Navigation buttons */
        #buttonContainer .btn-secondary {
            background: transparent;
            border: 2px solid var(--color-border);
            color: var(--color-text-muted);
        }

        #buttonContainer .btn-secondary:hover {
            background: #f1f5f9;
            color: var(--color-text);
        }

        #buttonContainer .btn-primary {
            padding-left: 2rem;
            padding-right: 2rem;
        }

        #finalForm {
            display: none;
            text-align: center;
            margin-top: 20px;
        }

        .success-container {
            background-color: white;
            border-radius: var(--radius-lg);
            padding: 40px 30px;
            box-shadow: var(--shadow-md);
            text-align: center;
            max-width: 420px;
            margin: auto;
        }

        .success-icon {
            color: #10b981;
            font-size: 56px;
            margin-bottom: 16px;
        }

        .success-message {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 8px;
            color: var(--color-text);
        }

        .success-text {
            font-size: 15px;
            margin-bottom: 24px;
            color: var(--color-text-muted);
        }

        .success-button {
            padding: 10px 24px;
            background-color: var(--color-primary);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            text-decoration: none;
            font-size: 15px;
            font-weight: 600;
            transition: background-color 0.2s;
        }

        .success-button:hover {
            background-color: var(--color-primary-dark);
            color: white;
        }

        .navbar-text h4 {
            color: black;
        }

        .icon {
            font-size: 56px;
            color: #10b981;
        }

        /* Upload - Legacy container removed, now using signature-step-card */
        .upload-container {
            /* Removed */
        }

        .drag-area {
            border: 3px dashed #cbd5e1;
            padding: 48px 30px;
            border-radius: var(--radius-lg);
            color: var(--color-text-muted);
            margin: 10px 0;
            background-color: #f8fafc;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
        }

        .drag-area:hover {
            background-color: #f0f9ff;
            border-color: #3b82f6;
            transform: scale(1.01);
        }

        .drag-area.drag-over {
            background-color: #dbeafe;
            border-color: #2563eb;
            border-style: solid;
            transform: scale(1.02);
        }

        .progress-upload {
            height: 20px;
            margin-top: 10px;
        }

        .progress-bar-upload {
            background-color: #cad2dd;
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 20px;
        }


        .thumbnail {
            max-width: 150px;
            margin-top: 10px;
        }

        .file-icon {
            font-size: 48px;
            color: #d9534f;
        }

        .download-link {
            margin-top: 10px;
            display: block;
        }

        .question-container {
            margin: 15px 0;
        }

        /* Add Form */

        .form-section {
            margin-bottom: 15px;
        }

        .combo-group {
            display: flex;
            justify-content: space-around;
        }

        .otras-areas-table .select-col,
        .otras-areas-table .condition-col {
            min-width: 110px;
        }

        /* Column widths for step 5 table */
        #otrasAreasTable th:nth-child(1),
        #otrasAreasTable td:nth-child(1) {
            width: 30%;
        }

        #otrasAreasTable th:nth-child(2),
        #otrasAreasTable td:nth-child(2) {
            width: 10%;
        }

        #otrasAreasTable th:nth-child(3),
        #otrasAreasTable td:nth-child(3) {
            width: 20%;
        }

        #otrasAreasTable th:nth-child(4),
        #otrasAreasTable td:nth-child(4),
        #otrasAreasTable th:nth-child(5),
        #otrasAreasTable td:nth-child(5) {
            width: 20%;
        }

        .otras-areas-select,
        .otras-areas-condition {
            width: 100%;
        }

        /* Column widths for "Población Estudiantil" table */
        #poblacionTable th:nth-child(1),
        #poblacionTable td:nth-child(1) {
            width: 30%;
        }

        #poblacionTable th:nth-child(2),
        #poblacionTable td:nth-child(2),
        #poblacionTable th:nth-child(3),
        #poblacionTable td:nth-child(3),
        #poblacionTable th:nth-child(4),
        #poblacionTable td:nth-child(4),
        #poblacionTable th:nth-child(5),
        #poblacionTable td:nth-child(5) {
            width: 15%;
        }

        #poblacionTable th:nth-child(6),
        #poblacionTable td:nth-child(6) {
            width: 10%;
        }

        /* Legacy signature styles - kept for compatibility */
        .signature-section {
            /* Removed - now using signature-step-card */
        }

        .signature-canvas-container {
            /* Removed - now using signature-canvas-wrapper */
        }

        #signatureCanvas {
            display: block;
            touch-action: none;
        }

        .signature-buttons {
            /* Removed - now using signature-actions */
        }

        /* PDF Preview Section - now integrated in signature-step-card */
        .pdf-preview-section {
            /* Removed */
        }

        .pdf-controls {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            padding: 12px;
            background: #f8fafc;
            border-radius: var(--radius-sm);
            border: 1px solid #e2e8f0;
        }

        .pdf-viewer-container {
            max-height: 600px;
            overflow-y: auto;
            overflow-x: auto;
            border: 2px solid #6c757d;
            border-radius: 5px;
            background-color: #525659;
            padding: 20px;
            position: relative;
        }

        .pdf-viewer-container.expanded {
            max-height: none;
            height: 80vh;
        }

        .pdf-viewer {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .pdf-page {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            background-color: white;
            margin-bottom: 10px;
            position: relative;
        }

        .pdf-page canvas {
            display: block;
            max-width: 100%;
            height: auto;
        }

        .page-number {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 5px 10px;
            border-radius: 3px;
            font-size: 12px;
        }

        #reviewStatus {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        #confirmPdfBtn {
            width: 100%;
            font-size: 18px;
            padding: 15px;
        }

        /* Step 7 Options */
        .signature-section,
        .upload-container {
            transition: opacity 0.3s ease;
        }

        /* Expanded PDF full screen */
        .pdf-viewer-container.expanded {
            position: fixed;
            top: 50px;
            left: 0;
            width: 100vw !important;
            height: calc(100vh - 50px) !important;
            max-height: calc(100vh - 50px) !important;
            z-index: 9999;
            border-radius: 0;
            margin: 0;
        }

        .pdf-viewer-container.expanded .pdf-viewer {
            padding: 20px;
        }

        /* Close button for expanded PDF */
        .pdf-close-btn {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 50px;
            background: linear-gradient(90deg, var(--color-primary) 0%, #8f7dff 100%);
            z-index: 10000;
            display: none;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            color: white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        .pdf-close-btn.active {
            display: flex;
        }

        .pdf-close-btn button {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 20px;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .pdf-close-btn button:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
        }

        .pdf-close-btn .title {
            font-weight: 600;
            font-size: 16px;
        }

        /* Legacy Signature Option Cards - Removed (now using signature-method-card) */

        /* Signature Method Selection Cards */
        .signature-method-selection {
            display: none; /* Ocultar selección de método - solo firma electrónica */
            background: #f8fafc;
            padding: 20px;
            border-radius: var(--radius-lg);
            border: 2px solid #e2e8f0;
        }

        .signature-method-radio {
            display: none;
        }

        .signature-method-card {
            display: block;
            background: #ffffff;
            border: 3px solid #cbd5e1;
            border-radius: var(--radius-lg);
            padding: 24px;
            cursor: pointer;
            transition: all 0.3s ease;
            min-height: 220px;
            position: relative;
            text-align: center;
        }

        .signature-method-card:hover {
            border-color: #94a3b8;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        }

        .signature-method-radio:checked + .signature-method-card {
            border-color: #22c55e;
            background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
            box-shadow: 0 6px 20px rgba(34, 197, 94, 0.25);
            transform: translateY(-4px);
        }

        .signature-method-radio:not(:checked) + .signature-method-card {
            opacity: 0.6;
            filter: grayscale(0.3);
        }

        .signature-method-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 16px;
            transition: all 0.3s ease;
        }

        .signature-method-icon i {
            font-size: 32px;
            color: white;
        }

        .signature-method-radio:checked + .signature-method-card .signature-method-icon {
            background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
            transform: scale(1.1);
        }

        .signature-method-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--color-text);
            margin-bottom: 8px;
        }

        .signature-method-desc {
            font-size: 0.9rem;
            color: var(--color-text-muted);
            margin-bottom: 16px;
            line-height: 1.5;
        }

        .signature-method-badge {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 6px;
            background: #22c55e;
            color: white;
            padding: 8px 16px;
            border-radius: 999px;
            font-size: 0.85rem;
            font-weight: 600;
            margin-top: 12px;
        }

        .signature-method-radio:checked + .signature-method-card .signature-method-badge {
            display: inline-flex;
        }

        /* Signature Flow Sections */
        .signature-flow-section {
            animation: fadeIn 0.4s ease;
        }

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

        .signature-step-card {
            background: #ffffff;
            border: 2px solid #e2e8f0;
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }

        .signature-step-header {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 2px solid #e2e8f0;
        }

        .signature-step-number {
            width: 36px;
            height: 36px;
            background: var(--color-primary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .signature-step-title {
            margin: 0;
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--color-text);
        }

        .signature-step-body {
            padding: 24px;
        }

        .signature-instruction {
            background: #fffbeb;
            border-left: 4px solid #f59e0b;
            padding: 12px 16px;
            border-radius: var(--radius-sm);
            margin-bottom: 20px;
            color: #78350f;
            font-size: 0.95rem;
        }

        .signature-canvas-wrapper {
            background: #ffffff;
            border: 3px dashed #cbd5e1;
            border-radius: var(--radius-md);
            padding: 8px;
            display: block;
            width: 100%;
            box-sizing: border-box;
        }

        #signatureCanvas {
            border-radius: var(--radius-sm);
            background: white;
            cursor: crosshair;
            touch-action: none;
            display: block;
            width: 100%;
            height: 210px;
        }

        .signature-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
            align-items: center;
        }

        /* Confirm button styling */
        #confirmPdfBtn {
            font-size: 1.1rem;
            padding: 14px 32px;
            font-weight: 700;
            box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
        }

        #confirmPdfBtn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            box-shadow: none;
        }

        #reviewStatus {
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 500;
        }

        #reviewStatus.alert-success {
            background-color: #f0fdf4;
            border-color: #86efac;
            color: #166534;
        }

        /* Step header improvements */
        .signature-step-header {
            position: relative;
        }

        .signature-step-header .step-completed-badge {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
        }

        /* Table button spacing */
        .wizard .table-responsive + .btn,
        .wizard .table-responsive + button {
            margin-top: 0.75rem;
        }

        /* Day chips for docente working days */
        .day-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .day-chip {
            position: relative;
        }

        .day-chip input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .day-chip label {
            display: inline-block;
            padding: 6px 16px;
            border: 1.5px solid var(--color-border);
            border-radius: 999px;
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--color-text-muted);
            cursor: pointer;
            transition: all 0.2s ease;
            user-select: none;
        }

        .day-chip input[type="checkbox"]:checked + label {
            background: var(--color-primary);
            border-color: var(--color-primary);
            color: white;
        }

        .day-chip label:hover {
            border-color: var(--color-primary);
            color: var(--color-primary);
        }

        /* Step 6: Multiple docente tabs */
        .docente-tab-content {
            border: 1px solid var(--color-border);
            border-top: 0;
            border-radius: 0 0 var(--radius-sm) var(--radius-sm);
            padding: 0.75rem 0.75rem 0.25rem;
            background: #fff;
        }

        #docenteTabs .nav-link {
            font-size: 0.85rem;
            padding: 0.35rem 0.75rem;
        }

        .docente-tab-remove {
            text-decoration: none;
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            .signature-method-card {
                min-height: auto;
                padding: 20px;
            }

            .signature-method-icon {
                width: 64px;
                height: 64px;
            }

            .signature-method-icon i {
                font-size: 28px;
            }

            .signature-method-title {
                font-size: 1rem;
            }

            .signature-method-desc {
                font-size: 0.85rem;
            }

            .signature-step-body {
                padding: 16px;
            }

            .signature-canvas-wrapper {
                max-width: 100%;
                overflow-x: auto;
            }

            #signatureCanvas {
                max-width: 100%;
                height: auto;
            }

            .signature-actions {
                flex-direction: column;
            }

            .signature-actions .btn {
                width: 100%;
            }
        }
