html, body { margin: 0; min-height: 100%; font-family: Inter, "Segoe UI", Arial, sans-serif; }
body { overflow-x: clip; }
/* Document review keeps its workflow and uses the common template palette. */
.icos-template .document-review .revision-groups { background: var(--surface); color: var(--brand-strong); }
.icos-template .document-review .revision-group-button { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 50px; padding: .5rem 1.25rem; font-size: .875rem; text-transform: capitalize; }
.icos-template .document-review .revision-group-button:hover:not(:disabled),
.icos-template .document-review .revision-group-button.is-active { color: var(--brand-strong); background: var(--brand-soft); border-color: var(--brand-line); }
.icos-template .document-review .revision-group-button:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb,var(--brand) 14%,transparent); }
.icos-template .document-review .revision-group-count { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 50px; }
.icos-template .document-review .revision-group-button.is-active .revision-group-count { color: var(--surface); background: var(--brand); border-color: var(--brand); }
.icos-template .document-review .revision-summary { color: var(--ink); background: var(--surface); }
.icos-template .document-review .revision-summary-pending { background: var(--surface-2); }
.icos-template .document-review .revision-summary-reviewed h4 { color: var(--brand-strong); }
.icos-template .document-review .revision-summary-completed { background: var(--brand-soft); }
.icos-template .document-review .revision-summary-completed h4 { color: var(--brand-strong); }
.icos-template .document-review .revision-summary-reviewed .fa-2x,
.icos-template .document-review .revision-summary-completed .fa-2x { color: var(--brand); }
.icos-template .document-review .revision-cancel-button { --bs-btn-color: var(--ink); --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--surface); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-border-color: var(--brand); --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: var(--surface-2); --bs-btn-disabled-border-color: var(--line); --bs-btn-focus-shadow-rgb: 23,107,103; }
.icos-template .document-review .revision-complete-button { --bs-btn-color: var(--surface); --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-color: var(--surface); --bs-btn-hover-bg: var(--brand-strong); --bs-btn-hover-border-color: var(--brand-strong); --bs-btn-active-color: var(--surface); --bs-btn-active-bg: var(--brand-strong); --bs-btn-active-border-color: var(--brand-strong); --bs-btn-disabled-color: var(--surface); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); --bs-btn-focus-shadow-rgb: 23,107,103; }
.icos-template .document-review .revision-user-header,
.icos-template .document-review .revision-user-banner { color: var(--brand-strong); background: var(--brand-soft); border-color: var(--brand-line); }
.icos-template .document-review .revision-document-header { color: var(--surface); background: var(--brand); border-color: var(--brand); }
.icos-template .document-review .revision-document-badge { color: var(--brand-strong); background: var(--surface); }
.icos-template .document-review .revision-approved-label { color: var(--brand); }
.icos-template .document-review .revision-progress { color: var(--ink); background: var(--surface-2); }
.icos-template .document-review .list-group-item { color: var(--ink); background: var(--surface); border-color: var(--line); }
.icos-template .document-review .list-group-item code { color: var(--ink); }
.icos-template .document-review .form-control { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.icos-app-shell .proceso-header, .icos-app-shell .institucion-header, .icos-app-shell .plantillas-header { padding: 20px !important; margin-bottom: 24px !important; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.plantillas-title { font-size: 1.3rem; font-weight: 750; }
.plantillas-header p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.plantillas-header .nav { margin-top: 16px; }
.plantillas-header .nav-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.plantillas-count, .plantillas-scope { display: inline-flex; align-items: center; justify-content: center; padding: 4px 9px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: .8rem; font-weight: 650; }
.plantillas-count { min-width: 32px; }
.email-preview-modal .modal-content, .email-preview-modal .modal-header, .email-preview-modal .modal-body, .email-preview-modal .modal-footer { background: var(--surface); color: var(--ink); }
.email-preview-modal .modal-content { border: 1px solid var(--line); border-radius: 8px; }
.email-preview-modal .modal-header { justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.email-preview-modal .modal-title { margin: 0; font-size: 1.1rem; font-weight: 750; }
.email-preview-modal .modal-footer { border-top: 1px solid var(--line); }
.email-preview-modal .form-control { background: var(--surface); }
.email-preview-modal .form-control:disabled { background: var(--surface-2); }
.icos-app-shell .proceso-header h5, .icos-app-shell .institucion-header h5 { font-size: 1.3rem; font-weight: 750; }
.institucion-body { min-width: 0; }
.proceso-body { min-width: 0; }
.proceso-body .table { --bs-table-bg: var(--surface); --bs-table-color: var(--ink); --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--surface-2); }
.proceso-body .form-control, .proceso-body .form-select { background-color: var(--surface); }
.proceso-body .form-control:disabled, .proceso-body .form-select:disabled { background-color: var(--surface-2); }
.proceso-steps-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.proceso-steps-table { min-width: 900px; }
.proceso-steps-table th, .proceso-steps-table td { padding-left: 10px; padding-right: 10px; }
.proceso-steps-table th { white-space: nowrap; }
.proceso-step-name { min-width: 180px; }
.proceso-step-exam-mark { display: flex; align-items: baseline; gap: 6px; margin-top: 7px; color: var(--brand); font-size: .78rem; font-weight: 650; }
.proceso-step-order { display: flex; align-items: center; gap: 12px; }
.proceso-step-number { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 6px; background: var(--surface-2); color: var(--brand); font-weight: 800; }
.proceso-step-move { display: grid; gap: 4px; }
.proceso-step-type { display: inline-block; padding: 5px 9px; border-radius: 6px; color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); font-size: .8rem; font-weight: 650; }
.proceso-step-enabled { color: var(--brand); }
.proceso-step-actions { display: inline-grid; grid-template-columns: auto auto; align-items: center; gap: 6px; white-space: nowrap; }
.proceso-step-availability { grid-column: 1 / -1; }
.proceso-step-summary { margin-bottom: 20px; padding: 12px 16px; border-left: 3px solid var(--brand); border-radius: 6px; color: var(--ink); background: var(--surface-2); }
.proceso-empty-state { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--muted); }
.proceso-empty-state > i { font-size: 2rem; color: var(--brand); }
.proceso-empty-state h3 { color: var(--ink); font-size: 1rem; font-weight: 750; }
@media(max-width:767.98px) {
    .proceso-steps .arelo-table-footer > .primary-button { width: 100%; }
}
.institucion-logo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.institucion-logo-preview { display: grid; place-items: center; min-height: 220px; padding: 20px; border-radius: 6px; background: var(--surface-2); }
.institucion-logo-preview img { max-width: 100%; max-height: 180px; object-fit: contain; }
@media(max-width:767.98px) { .institucion-logo-grid { grid-template-columns: minmax(0,1fr); } }
html { font-size: 100%; }
.invalid { outline: 1px solid #b42318; }
.validation-message { color: #b42318; }
h1:focus { outline: none; }
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5M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em/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }


.invoice .invoice-header {
    background: var(--bs-light);
    padding: .5rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    border-radius: 0.75rem;
}

.note {
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.note-content {
    flex: 1 1 auto;
    min-width: 250px;
}

.note-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem; /* espacio entre columnas */
}

.info-item {
    flex: 1 1 200px; /* crece, encoge, base mínima */
    min-width: 150px;
}

.modal.modal-message .modal-body, .modal.modal-message .modal-footer, .modal.modal-message .modal-header {
    width: 100%;
    border: none;
    margin: 0 auto;
}

.modal .modal-header {
    display: flex;
    flex: 0;
    align-items: center;
}


thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
}

.table td {
    vertical-align: middle;
    padding-top: .65rem;
    padding-bottom: .65rem;
}

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

.card {
    border-radius: .65rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 14px rgba(0,0,0,.04);
}

.card-header {
    background: linear-gradient(180deg, #fdfdfd, #f7f8fa);
    border-bottom: 1px solid #e9ecef;
}

    .card-header h5 {
        font-weight: 600;
        letter-spacing: .2px;
    }

.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    background-color: #fcfcfd;
}

.table td {
    padding-top: .65rem;
    padding-bottom: .65rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color .15s ease;
}

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

.table .btn {
    --bs-btn-padding-y: .15rem;
    --bs-btn-padding-x: .4rem;
}

.card-footer {
    border-top: 1px solid #e9ecef;
}

.pagination .page-link {
    border-radius: .4rem;
    margin: 0 .1rem;
}

.table .empty-state {
    font-style: italic;
    color: #adb5bd;
}

/* ============================================================ */
/* Gradientes para tarjetas de contadores */
/* ============================================================ */
.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%) !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Efecto hover en las cards de contadores */
.bg-gradient-warning:hover,
.bg-gradient-success:hover,
.bg-gradient-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease;
}

/* ============================================================ */
/* Botones tipo pill para selector de grupos */
/* ============================================================ */
.btn-pill {
    border-radius: 50px !important;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-transform: capitalize;
    position: relative;
    overflow: hidden;
}

.btn-pill:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-pill:active:not(:disabled) {
    transform: translateY(0);
}

.btn-pill:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-pill .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Botones outline específicos para el selector de grupos */
.btn-outline-light {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    background-color: transparent;
}

.btn-outline-light:hover:not(:disabled) {
    color: #0c5460 !important;
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
}

.btn-outline-light:hover:not(:disabled) .badge {
    background-color: #17a2b8 !important;
    color: white !important;
}

.btn-outline-light:hover:not(:disabled) {
    color: #0c5460 !important;
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
}

.btn-outline-light:hover:not(:disabled) .badge {
    background-color: #17a2b8 !important;
    color: white !important;
}

.btn-outline-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Botón activo (seleccionado) */
.btn-pill.btn-light {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-pill.btn-light:hover:not(:disabled) {
    background-color: white;
    border-color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Efecto ripple al hacer click */
.btn-pill::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-pill:active:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

/* Animación de pulso para el botón seleccionado */
@keyframes pulse-subtle {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    }
}

.btn-pill.btn-light.text-info {
    animation: pulse-subtle 2s ease-in-out infinite;
}

/* Responsive - hacer los botones más pequeños en móvil */
@media (max-width: 767.98px) {
    .btn-pill {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }

    .btn-pill .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Mejora visual para la card de grupos */
.bg-gradient-info.overflow-hidden {
    position: relative;
}

.bg-gradient-info.overflow-hidden::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.reserva-card {
    background: transparent;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

/* HEADER */
.reserva-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.estado-icon i {
    font-size: 1.6rem;
}

/* MAIN (PROGRAMA / ESCUELA) */
.reserva-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.reserva-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

    .reserva-item .label {
        font-size: 0.8rem;
        color: #6b7280;
        margin-bottom: 4px;
    }

    .reserva-item .value {
        font-size: 1.1rem;
        font-weight: 600;
    }

/* 🔥 AQUÍ LO IMPORTANTE */
.value.programa {
    color: #2563eb;
    font-size: 1.25rem;
}

.value.escuela {
    color: #059669;
    font-size: 1.25rem;
}

.reserva-divider {
    width: 1px;
    background: #e5e7eb;
    height: 40px;
}

/* TIMER */
.reserva-timer {
    margin-bottom: 20px;
}

.timer-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.timer-badge {
    font-weight: 600;
}

/* PROGRESS LIMPIO */
.custom-progress {
    height: 10px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

    .custom-progress .progress-bar {
        border-radius: 999px;
        transition: width 0.3s ease;
    }

/* EXPIRADO */
.reserva-expirada {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* BOTONES */
.reserva-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.proceso-step-drag { cursor: grab; touch-action: none; }
.proceso-step-drag:active { cursor: grabbing; }
.proceso-step-drop { outline: 2px solid var(--brand-line); outline-offset: -2px; }

/* Alerts opened by a form remain above its dialog. */
body .swal2-container { z-index: 1600; }
.cuestionario-savebar { position: sticky; bottom: 0; z-index: 2; background: rgba(255,255,255,.96); padding: 1rem 0; border-top: 1px solid var(--line, #d9e0e7); }
@media (max-width: 700px) { .icos-form-panel:has(.cq-preview) { padding: 0; border: 0; background: transparent; box-shadow: none; } }
.icos-template .icos-modal:has(.audit-file-preview) { width: min(94vw,1100px); max-height: 92dvh; }

/* Roles acumulables: misma interacción en alta y edición. */
.icos-role-chips{display:flex;flex-wrap:wrap;gap:.6rem;margin:.5rem 0}
.icos-role-chip{display:inline-flex;align-items:center;gap:.5rem;padding:.6rem .9rem;border:1px solid var(--icos-border,#dce4e9);border-radius:999px;background:var(--icos-surface,#fff);cursor:pointer;font-weight:600;color:var(--icos-text,#334155)}
.icos-role-chip.selected{background:var(--icos-primary-soft,#e8f3ed);border-color:var(--icos-primary,#408167);color:var(--icos-primary,#32654f)}
.icos-role-chip input{accent-color:var(--icos-primary,#408167)}
