/* ============================================
   SISTEMA DE GESTIÓN DE DIPLOMAS - ESTILOS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ============================================
   MÓDULOS
   ============================================ */

.module {
    display: none;
}

.module.active {
    display: block;
}

/* ============================================
   LOGIN
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 15px;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: var(--gray-100);
    padding: 6px;
    border-radius: var(--radius);
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn svg {
    flex-shrink: 0;
}

.public-info {
    text-align: center;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.public-info svg {
    color: var(--primary);
    margin-bottom: 12px;
}

.public-info p {
    color: var(--gray-600);
    font-size: 14px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* ============================================
   FORMULARIOS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
}

.input-icon {
    position: relative;
}

.input-icon svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.input-icon input {
    padding-left: 44px;
}

.input-icon.large svg {
    left: 16px;
}

.input-icon.large input {
    padding-left: 52px;
    font-size: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--gray-800);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input::placeholder {
    color: var(--gray-400);
}

.input-hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================
   BOTONES
   ============================================ */

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--primary);
}

/* FILE INPUT */
input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.file-label:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    color: var(--primary);
}

.file-label svg {
    color: var(--gray-400);
}

.file-label:hover svg {
    color: var(--primary);
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: var(--white);
    padding: 16px 32px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.navbar h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.navbar-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.card-icon.green {
    background: #ecfdf5;
    color: #10b981;
}

.card-icon.purple {
    background: #f5f3ff;
    color: #8b5cf6;
}

.card-icon.orange {
    background: #fff7ed;
    color: #f97316;
}

.card-icon.teal {
    background: #f0fdfa;
    color: #14b8a6;
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-description {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ============================================
   ADMIN GRID
   ============================================ */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.full-width {
    grid-column: 1 / -1;
}

/* ============================================
   CAMPOS / FIELDS
   ============================================ */

.fields-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.field-tag {
    display: inline-block;
    padding: 8px 14px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', monospace;
}

.field-tag.auto {
    background: var(--success);
}

.auto-fields {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.auto-fields-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

/* ============================================
   CORRELATIVOS
   ============================================ */

.correlativo-display {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.correlativo-label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-bottom: 8px;
}

.correlativo-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: white;
}

.correlativo-update {
    display: flex;
    gap: 12px;
}

.correlativo-update input {
    flex: 1;
    margin: 0;
}

.correlativo-update button {
    flex-shrink: 0;
}

/* ============================================
   GENERATION STEPS
   ============================================ */

.generation-steps {
    margin-bottom: 24px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content label {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.step-content select,
.step-content .file-label {
    margin: 0;
}

/* ============================================
   INSTRUCTIONS
   ============================================ */

.instructions-list {
    margin: 0 0 20px 24px;
    color: var(--gray-600);
}

.instructions-list li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.instructions-list code {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
}

.expected-columns {
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.expected-columns p {
    margin-top: 8px;
    color: var(--gray-500);
    font-size: 13px;
}

/* ============================================
   DIPLOMAS HISTORIAL
   ============================================ */

.diplomas-actions {
    margin-bottom: 20px;
}

.diplomas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 16px;
}

.diplomas-table th,
.diplomas-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.diplomas-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.diplomas-table tr:hover {
    background: var(--gray-50);
}

.diplomas-table code {
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-700);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 6px;
    transition: all 0.2s ease;
}

.btn-small.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-small.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-small.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-small.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-small.btn-view {
    background: var(--info);
    color: white;
}

.btn-small.btn-view:hover {
    background: #0891b2;
}

.btn-small.btn-success {
    background: var(--success);
    color: white;
}

.btn-small.btn-success:hover {
    background: var(--success-dark);
}

/* BATCH DOWNLOAD SECTION */
#batchDownloadSection {
    background: var(--gray-50);
    padding: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    margin: 20px 0;
}

.batch-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.batch-header svg {
    color: var(--primary);
}

.batch-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.batch-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#selectionCount {
    margin-top: 16px;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}

/* CHECKBOXES */
.diploma-checkbox,
#selectAllCheckbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.diplomas-table td:first-child,
.diplomas-table th:first-child {
    text-align: center;
    width: 50px;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.diploma-detail {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.diploma-detail label {
    font-weight: 600;
    color: var(--gray-500);
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.diploma-detail span {
    font-size: 16px;
    color: var(--gray-800);
}

.diploma-code {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%) !important;
}

.diploma-code label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.diploma-code span {
    color: white !important;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 18px;
    font-weight: 600;
}

/* ============================================
   VALIDADOR
   ============================================ */

.validator-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.validator-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-xl);
}

.validator-header {
    text-align: center;
    margin-bottom: 40px;
}

.validator-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
}

.validator-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.validator-subtitle {
    color: var(--gray-500);
    font-size: 15px;
    line-height: 1.6;
}

.validator-form {
    margin-bottom: 24px;
}

.validator-footer {
    margin-top: 24px;
    text-align: center;
}

.validator-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* RESULT BOX */
.result-box {
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius-sm);
    text-align: center;
    display: none;
}

.result-box.success {
    background: #ecfdf5;
    border: 2px solid var(--success);
    color: #065f46;
    display: block;
}

.result-box.error {
    background: #fef2f2;
    border: 2px solid var(--danger);
    color: #991b1b;
    display: block;
}

.result-box strong {
    display: block;
    font-size: 18px;
    margin-bottom: 12px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0 12px;
}

#progressFill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

#progressText {
    text-align: center;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 14px;
}

/* ============================================
   SPINNER
   ============================================ */

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 24px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   ITEM LIST
   ============================================ */

.item-list {
    margin-top: 16px;
}

.item-card {
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.item-card img {
    max-width: 100px;
    max-height: 60px;
    border-radius: 4px;
    object-fit: contain;
}

.item-card p {
    flex: 1;
    margin-left: 16px;
    font-weight: 500;
    color: var(--gray-700);
}

.item-card button {
    padding: 8px 16px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.item-card button:hover {
    background: var(--danger-dark);
}

/* ============================================
   EXCEL PREVIEW
   ============================================ */

#excelPreview {
    max-height: 320px;
    overflow-y: auto;
    margin: 24px 0;
    background: var(--gray-50);
    padding: 20px;
    border-radius: var(--radius-sm);
}

#excelPreview h4 {
    margin-bottom: 16px;
    color: var(--gray-700);
}

#excelPreview table {
    width: 100%;
    border-collapse: collapse;
}

#excelPreview th,
#excelPreview td {
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    text-align: left;
    font-size: 13px;
}

#excelPreview th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

#excelPreview tr:nth-child(even) {
    background: var(--gray-100);
}

/* ============================================
   MAPPING TABLE
   ============================================ */

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.mapping-table th,
.mapping-table td {
    padding: 12px;
    border: 1px solid var(--gray-200);
    text-align: left;
}

.mapping-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.mapping-table tr:nth-child(even) {
    background: var(--gray-50);
}

.field-mapping-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

.field-mapping-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#fieldMappingSection {
    margin-top: 24px;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

/* ============================================
   NO DATA / ERROR
   ============================================ */

.no-data {
    text-align: center;
    color: var(--gray-500);
    padding: 40px 20px;
    font-style: italic;
}

.error {
    color: var(--danger);
    text-align: center;
    padding: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .navbar-brand {
        width: 100%;
        justify-content: center;
    }

    .login-card,
    .validator-card {
        padding: 28px;
    }

    .tab-btn {
        padding: 10px 6px;
        font-size: 12px;
    }

    .tab-btn svg {
        display: none;
    }

    .container {
        padding: 16px;
    }

    .card {
        padding: 20px;
    }

    .batch-actions {
        flex-direction: column;
    }

    .batch-actions button {
        width: 100%;
    }

    .correlativo-update {
        flex-direction: column;
    }

    .diplomas-table {
        font-size: 12px;
    }

    .diplomas-table th,
    .diplomas-table td {
        padding: 10px 8px;
    }

    .btn-small {
        padding: 5px 8px;
        font-size: 11px;
        margin-right: 4px;
        margin-bottom: 4px;
    }
}

/* ============================================
   FORMULARIOS - MODAL
   ============================================ */

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: var(--gray-100);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

.image-preview {
    margin-top: 12px;
    display: none;
}

.image-preview.show {
    display: block;
}

.image-preview img {
    max-width: 200px;
    max-height: 100px;
    border-radius: 8px;
    border: 2px solid var(--gray-200);
    object-fit: contain;
}

/* LISTA DE FORMULARIOS */
.form-list-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.form-list-item:hover {
    box-shadow: var(--shadow-md);
}

.form-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.form-list-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.form-list-code {
    font-size: 13px;
    color: var(--gray-500);
    font-family: 'Monaco', 'Menlo', monospace;
}

.form-list-actions {
    display: flex;
    gap: 8px;
}

.form-list-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.form-list-info {
    font-size: 13px;
}

.form-list-info-label {
    color: var(--gray-500);
    font-weight: 500;
}

.form-list-info-value {
    color: var(--gray-700);
    font-weight: 600;
}

.form-link-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-top: 12px;
}

.form-link-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--gray-700);
}

.qr-code-container {
    padding: 16px;
    background: white;
    border-radius: 8px;
    text-align: center;
    margin-top: 16px;
}

.qr-code-container img {
    max-width: 200px;
    height: auto;
    margin: 0 auto;
}

/* ============================================
   MENÚ PRINCIPAL (Post-login cards)
   ============================================ */

.menu-card {
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.menu-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.menu-card:active {
    transform: translateY(-2px);
}

.menu-card h3 {
    margin-bottom: 8px;
}

.menu-card .card-description {
    margin-bottom: 0;
}

/* ============================================
   BACK NAVIGATION BUTTON
   ============================================ */

.btn-back-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 16px;
    flex-shrink: 0;
}

.btn-back-nav:hover {
    background: var(--gray-100);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-back-nav svg {
    flex-shrink: 0;
}

/* ============================================
   EXAM TABS
   ============================================ */

.exam-tab {
    transition: all 0.2s ease;
    border: none !important;
}

.exam-tab.active {
    background: var(--white) !important;
    color: var(--primary) !important;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.exam-tab:hover:not(.active) {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

/* ============================================
   EXAM VIEWS
   ============================================ */

.exam-view {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   QUESTION BUILDER CARDS
   ============================================ */

.question-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--gray-300);
    transition: box-shadow 0.2s ease;
}

.question-card:hover {
    box-shadow: var(--shadow-md);
}

.question-card.title {
    border-left-color: var(--primary);
}

.question-card.paragraph {
    border-left-color: var(--secondary);
}

.question-card.date {
    border-left-color: var(--warning);
}

.question-card.multiple_choice {
    border-left-color: var(--success);
}

.question-card.open_text {
    border-left-color: var(--info);
}

.alternatives-container {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

/* ============================================
   REQUIRED FIELD MARKER
   ============================================ */

.required {
    color: var(--danger);
    font-weight: 600;
}

/* ============================================
   INSTRUCTIONS CARD
   ============================================ */

.instructions-card {
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ============================================
   DIPLOMAS GRID (history container)
   ============================================ */

.diplomas-grid {
    margin-top: 16px;
}

/* ============================================
   DATE/DATETIME INPUTS
   ============================================ */

input[type="date"],
input[type="datetime-local"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--gray-800);
}

input[type="date"]:focus,
input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ============================================
   RESPONSIVE - NEW COMPONENTS
   ============================================ */

@media (max-width: 768px) {
    .menu-card {
        padding: 20px;
    }

    #mainMenuModule .admin-grid {
        grid-template-columns: 1fr !important;
    }

    .btn-back-nav {
        padding: 6px 12px;
        font-size: 13px;
    }

    .exam-tab {
        font-size: 12px;
        padding: 10px 8px;
    }

    .question-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .menu-card .card-icon {
        width: 48px !important;
        height: 48px !important;
    }

    .menu-card .card-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body * {
        visibility: hidden;
    }

    #print-container,
    #print-container * {
        visibility: visible;
    }

    #print-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0 !important;
    }

    #print-controls {
        display: none !important;
    }
}
