/* ══════════════════════════════════════════════════════════════
   SCA-CIDE · styles.css
   Design system: Inter + Lucide Icons + glassmorphism subtle
   Paleta institucional SENA · Verde como color primario
══════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    /* ── Color primario: Verde SENA institucional ── */
    --primary:        #1a7a3c;
    --primary-hover:  #145e2e;
    --primary-light:  rgba(26, 122, 60, 0.08);

    /* ── Acento secundario: Verde más brillante para highlights ── */
    --accent:         #22c55e;
    --accent-light:   rgba(34, 197, 94, 0.10);

    /* ── Success (verde esmeralda, diferenciado del primario) ── */
    --success:        #059669;
    --success-light:  rgba(5, 150, 105, 0.08);
    --success-hover:  #047857;

    /* ── Warning & Danger ── */
    --warning:        #f59e0b;
    --warning-light:  rgba(245, 158, 11, 0.10);
    --danger:         #ef4444;
    --danger-light:   rgba(239, 68, 68, 0.08);

    /* ── Tipografía ── */
    --text-main:  #1a2e1a;
    --text-sub:   #3d5c3d;
    --text-muted: #7a9e7a;

    /* ── Superficies ── */
    --border:          #d1e7d1;
    --bg-input:        #f3faf3;
    --bg-card:         rgba(255, 255, 255, 0.90);
    --bg-card-border:  rgba(255, 255, 255, 0.40);
    --card-shadow:     0 8px 32px rgba(26, 122, 60, 0.08);

    /* ── Radios ── */
    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 20px;

    /* ── Fuente y transición ── */
    --font: 'Inter', sans-serif;
    --ease: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Iconos ── */
    --icon-sm: 14px;
    --icon-md: 18px;
    --icon-lg: 22px;
}

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

body {
    font-family: var(--font);
    color: var(--text-main);
    min-height: 100vh;
    background: linear-gradient(135deg, #e6f4ec 0%, #f0faf4 50%, #f8fdf9 100%);
    padding: 20px 16px 40px;
    line-height: 1.55;
}

/* ── Background decoration ───────────────────────────────── */
.background-overlay {
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(26, 122, 60, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(34, 197, 94, 0.07) 0%, transparent 35%);
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: visible;
    animation: fadeInUp 0.35s ease-out;
}
.card-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Narrow card */
.card-sm {
    max-width: 440px;
    margin: 0 auto;
}

/* Stepper card */
.view-stepper { max-width: 680px; margin: 0 auto; }

.card-header {
    padding: 28px 32px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    text-align: center;
}
.card-header h2 {
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.card-header p {
    color: var(--text-sub);
    font-size: 0.93rem;
}

.card-body { padding: 28px 32px 32px; }

/* Brand logo */
.brand-logo {
    width: 52px; height: 52px;
    background: var(--primary-light);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    color: var(--primary);
}
.brand-logo svg { width: 26px; height: 26px; }
.brand-logo--warning { background: var(--warning-light); color: var(--warning); }

/* ── Stepper ─────────────────────────────────────────────── */
.stepper-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}
.step {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem;
    color: var(--text-muted);
    transition: var(--ease);
}
.step.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(26, 122, 60, 0.15);
}
.step.completed {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.step-line {
    height: 2px; width: 36px;
    background: var(--border);
    transition: var(--ease);
    border-radius: 2px;
}
.step-line.active { background: var(--primary); }

.step-title-label {
    margin-top: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
}

/* ── Step content ────────────────────────────────────────── */
.view, .step-content {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--ease);
}
.view.active, .step-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ── Step intro ──────────────────────────────────────────── */
.step-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}
.step-intro-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    color: var(--primary);
}
.step-intro-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}
.step-intro-sub {
    font-size: 0.82rem;
    color: var(--text-sub);
    line-height: 1.4;
}

/* ── Info alert ──────────────────────────────────────────── */
.info-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--primary-light);
    border: 1px solid rgba(26, 122, 60, 0.15);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    color: var(--text-sub);
    margin-bottom: 20px;
    line-height: 1.45;
}
.info-alert strong { color: var(--text-main); }
.alert-icon {
    flex-shrink: 0;
    width: 16px; height: 16px;
    margin-top: 2px;
    color: var(--primary);
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 7px;
    color: var(--text-main);
}

/* Input con ícono */
.input-with-icon { position: relative; }
.input-with-icon > svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: var(--icon-md); height: var(--icon-md);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}
.input-with-icon input[type="text"],
.input-with-icon input[type="email"],
.input-with-icon input[type="password"] {
    padding-left: 42px !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: var(--ease);
    background: #fff;
    color: var(--text-main);
    outline: none;
    appearance: none;
}
input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 122, 60, 0.10);
}

.input-readonly {
    background: var(--bg-input) !important;
    color: var(--text-sub) !important;
    border-style: dashed !important;
    cursor: default;
}
.input-otro { margin-top: 8px; }

/* Label reference badge */
.label-ref-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #92400e;
    background: var(--warning-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    padding: 1px 7px;
    margin-left: 5px;
    vertical-align: middle;
}

.error-msg {
    display: block;
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 5px;
}

/* Lugar grid */
.lugar-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.lugar-grid select { flex: 1; }

/* Custom checkbox */
.check-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 400;
    font-size: 0.84rem;
    cursor: pointer;
    color: var(--text-sub);
    margin-bottom: 0;
}
.check-label input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Date Picker ─────────────────────────────────────────── */
.dp-wrap { position: relative; width: 100%; }

.dp-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    transition: var(--ease);
}
.dp-input:hover, .dp-input:focus { border-color: var(--primary); }
.dp-input.filled { border-color: var(--success); }

.dp-icon { width: var(--icon-md); height: var(--icon-md); color: var(--text-muted); flex-shrink: 0; }
.dp-chevron { width: 14px; height: 14px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.dp-placeholder { font-size: 0.93rem; color: var(--text-muted); flex: 1; }

.dp-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(300px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.13);
    z-index: 500;
    display: none;
    max-height: 380px;
    overflow-y: auto;
}
.dp-panel.open { display: block; animation: slideDown 0.18s ease-out; overflow-y: visible; }

.dp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg-input);
}
.dp-nav { display: flex; gap: 4px; }
.dp-nav button {
    width: 28px; height: 28px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub);
    transition: var(--ease);
}
.dp-nav button:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
#dpStepLabel { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }

.dp-grid { display: grid; padding: 10px; gap: 3px; }
.dp-grid.years  { grid-template-columns: repeat(4, 1fr); }
.dp-grid.months { grid-template-columns: repeat(3, 1fr); }
.dp-grid.days   { grid-template-columns: repeat(7, 1fr); }

.dp-cell {
    padding: 8px 3px;
    text-align: center;
    font-size: 0.85rem;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--ease);
    color: var(--text-main);
}
.dp-cell:hover:not(.disabled) { background: var(--primary-light); color: var(--primary); }
.dp-cell.selected { background: var(--primary); color: #fff; font-weight: 700; }
.dp-cell.disabled { color: var(--border); cursor: not-allowed; }
.dp-cell.day-label { font-size: 0.72rem; color: var(--text-muted); cursor: default; font-weight: 700; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
    border: 1.5px solid transparent;
    line-height: 1;
    white-space: nowrap;
}
.btn svg { width: var(--icon-md); height: var(--icon-md); flex-shrink: 0; }

.btn-full { width: 100%; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26, 122, 60, 0.28); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28); }

/* ── Overwrite modal ─────────────────────────────────────── */
.overwrite-modal-content { padding: 32px 28px; }
.overwrite-icon {
    width: 60px; height: 60px;
    background: var(--warning-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    color: var(--warning);
}
.overwrite-icon svg { width: 30px; height: 30px; }
.overwrite-body {
    font-size: 0.93rem;
    color: var(--text-sub);
    line-height: 1.55;
    margin-bottom: 10px;
}
.overwrite-body strong { color: var(--text-main); }
.overwrite-sub {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-input); border-color: #a8c9a8; }

.btn-ghost {
    background: transparent;
    color: var(--text-sub);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-input); color: var(--danger); }

.btn-icon {
    padding: 8px;
    border-radius: 8px;
}
.btn-icon svg { width: 16px; height: 16px; }

/* Botones pequeños */
.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.btn-sm svg { width: var(--icon-sm); height: var(--icon-sm); }
.btn-sm.btn-primary { background: var(--primary); color: #fff; }
.btn-sm.btn-primary:hover { background: var(--primary-hover); }
.btn-sm.btn-secondary { background: #fff; color: var(--text-main); border-color: var(--border); }
.btn-sm.btn-secondary:hover { background: var(--bg-input); }
.btn-sm.btn-ghost { background: transparent; color: var(--text-sub); }
.btn-sm.btn-ghost:hover { background: var(--danger-light); color: var(--danger); }
.btn-sm.btn-icon { padding: 7px; }

/* Form actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}
.form-actions .btn { flex: 1; }

/* ── Media Capture Cards ─────────────────────────────────── */
.media-capture-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--ease);
}
.media-capture-card.small { padding: 14px; }

.media-placeholder {
    width: 100%;
    height: 160px;
    background: var(--bg-input);
    border: 2px dashed #a8c9a8;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    transition: var(--ease);
    color: var(--text-muted);
    font-size: 0.83rem;
    text-align: center;
}
.media-placeholder.big { height: 240px; }
.media-placeholder.has-image {
    border: none;
    background: transparent;
    padding: 0;
}
.media-placeholder.has-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Foto carnet preview */
#foto-preview-box.has-image {
    height: auto;
    min-height: unset;
}
#foto-preview-box.has-image img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

/* SVG icons inside placeholders */
.media-icon-svg {
    width: 44px; height: 44px;
    color: #a8c9a8;
}

/* Capture footer */
.capture-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.capture-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Docs grid */
.docs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.doc-card-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 10px;
}
.doc-card-header svg { width: 15px; height: 15px; color: var(--primary); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge.pending { background: var(--warning-light); color: #92400e; }
.badge.success { background: var(--success-light); color: #065f46; }

/* ── Alt upload link ─────────────────────────────────────── */
.alt-upload-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    text-align: center;
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.alt-upload-link svg { width: 13px; height: 13px; color: var(--text-muted); }
.alt-upload-link label {
    display: inline;
    margin: 0;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.alt-upload-link label:hover { color: var(--primary-hover); }

/* ── PDF success card ────────────────────────────────────── */
.pdf-success-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--success);
    background: var(--success-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}
.pdf-success-icon {
    width: 36px; height: 36px;
    background: rgba(5, 150, 105, 0.15);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: var(--success);
    flex-shrink: 0;
}
.pdf-success-icon svg { width: 20px; height: 20px; }
.pdf-success-body { flex: 1; min-width: 0; }
.pdf-success-title { font-weight: 600; font-size: 0.88rem; color: var(--success); }
.pdf-success-name { font-size: 0.78rem; color: var(--text-sub); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Shutter button ──────────────────────────────────────── */
.btn-shutter {
    width: 66px; height: 66px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid rgba(255,255,255,0.35);
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.shutter-inner {
    display: block;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--text-main);
}
.btn-shutter:active { transform: scale(0.88); }

/* ── Camera Modal ────────────────────────────────────────── */
.camera-modal-content {
    background: #0d1f0d;
    color: #fff;
    max-width: 560px;
    width: 95%;
}
.camera-modal-content h3 { color: #fff; }
.camera-hint { color: rgba(255,255,255,0.7); font-size: 0.85rem; margin-bottom: 4px; }

.camera-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin: 14px 0;
}
.camera-aspect-ratio {
    position: relative;
    width: 100%;
    padding-bottom: 133.33%;
}
.camera-aspect-ratio.doc-mode { padding-bottom: 67%; }

#camera-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
#camera-stencil {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

.camera-actions {
    justify-content: space-around;
    align-items: center;
    padding-bottom: 8px;
}

/* ── Document camera guide ───────────────────────────────── */
.doc-camera-guide {
    position: absolute; inset: 0; z-index: 15;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    pointer-events: none;
}
.doc-camera-guide.hidden { display: none !important; }

.doc-guide-frame {
    position: relative;
    width: 88%;
    aspect-ratio: 1.586 / 1;
    border: 2px solid rgba(26, 122, 60, 0.30);
    border-radius: 10px;
}

.doc-corner {
    position: absolute;
    width: 22px; height: 22px;
    border-color: var(--primary);
    border-style: solid;
    animation: cornerPulse 1.8s ease-in-out infinite;
}
.doc-corner.top-left    { top: -2px; left: -2px;  border-width: 3px 0 0 3px; border-radius: 6px 0 0 0; }
.doc-corner.top-right   { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-radius: 0 6px 0 0; }
.doc-corner.bottom-left  { bottom: -2px; left: -2px;  border-width: 0 0 3px 3px; border-radius: 0 0 0 6px; }
.doc-corner.bottom-right { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-radius: 0 0 6px 0; }

@keyframes cornerPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.doc-guide-label {
    position: absolute;
    bottom: -26px;
    left: 50%; transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(0,0,0,0.55);
    padding: 3px 10px;
    border-radius: 20px;
}
.doc-guide-tips {
    margin-top: 38px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.73rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
    text-align: center;
}

/* ── Modals (shared) ─────────────────────────────────────── */
.modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(5px);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}
.modal.hidden { display: none !important; }

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    text-align: center;
}
.modal-content h3 { margin-bottom: 6px; font-size: 1.1rem; }

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}
.modal-actions .btn { flex: 1; }

/* ── Admin Preview Modal ─────────────────────────────────── */
.preview-modal-content {
    max-width: 720px;
    text-align: left;
    padding: 24px;
}
.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}
.preview-modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}
.preview-modal-body {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-img-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}
.preview-img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    display: block;
}
.preview-pdf-wrap {
    width: 100%;
    height: 60vh;
}
.preview-pdf {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.preview-modal-content .modal-actions {
    justify-content: flex-end;
}
.preview-modal-content .modal-actions .btn {
    flex: 0 0 auto;
    min-width: 130px;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 0;
    line-height: 1.45;
}

.cropper-container {
    width: 100%;
    max-height: 48vh;
    margin: 16px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
#cropper-image { max-width: 100%; display: block; }

/* ── Loading overlay ─────────────────────────────────────── */
#loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 999;
}
#loading-overlay.hidden { display: none; }
#loading-text { margin-top: 14px; font-weight: 500; color: var(--text-sub); font-size: 0.93rem; }

.spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--bg-input);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

/* ── Admin Dashboard ─────────────────────────────────────── */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}
.dashboard-header h2 { margin-bottom: 0; }

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.metric-card {
    background: #fff;
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
}
.metric-icon {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px;
    color: var(--text-muted);
}
.metric-icon svg { width: 17px; height: 17px; }
.metric-card h4 { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.metric-card p  { font-size: 1.8rem; font-weight: 800; color: var(--text-main); }
.metric-card.success .metric-icon { background: var(--success-light); color: var(--success); }
.metric-card.success p { color: var(--success); }
.metric-card.danger .metric-icon { background: var(--danger-light); color: var(--danger); }
.metric-card.danger p { color: var(--danger); }
.metric-card.warning .metric-icon { background: var(--warning-light); color: var(--warning); }
.metric-card.warning p { color: var(--warning); }
/* Métrica primaria verde SENA */
.metric-card.primary .metric-icon { background: var(--primary-light); color: var(--primary); }
.metric-card.primary p { color: var(--primary); }

.dashboard-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.table-responsive {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #f1f5f9; }
th {
    background: var(--bg-input);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-input); }

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-sub);
}

/* ── Utilities ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    body { padding: 12px 12px 32px; }
    .card-header, .card-body { padding: 20px 18px; }
    .docs-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .lugar-grid { flex-direction: column; }
    .dashboard-filters { grid-template-columns: 1fr; }
    .capture-footer { flex-direction: column; align-items: flex-start; }
    .dashboard-header { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 800px) {
    .dashboard-filters { grid-template-columns: 1fr 1fr; }
}