:root {
    --color-primary: #2563eb;
    --color-primary-soft: #eff4ff;
    --color-primary-strong: #1d4ed8;

    --color-bg: #f3f4f6;
    --color-surface: #ffffff;

    --color-text-main: #111827;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-danger: #dc2626;
    --color-danger-soft: #fee2e2;

    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.10);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at top, #e0ecff 0, #f3f4f6 45%, #f9fafb 100%);
    color: var(--color-text-main);
    font-size: 15px;
}

/* Layout */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
}

/* Card */
.card {
    display: block;
    color: inherit;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 620px; /* nuevo ancho */
    padding: 32px 36px 28px; /* más espacio interno */
    border: 1px solid rgba(148, 163, 184, 0.20);
    position: relative;
    overflow: hidden;
}

/* Línea decorativa */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    height: 3px;
    background: linear-gradient(90deg, #1d4ed8, #6366f1, #0ea5e9);
}

/* Cabecera */
.card-header {
    padding: 0;
    border: 0;
    background: transparent;
    margin-top: 12px;
    margin-bottom: 24px;
}

.card-title {
    margin: 0 0 6px;
    font-size: 1.65rem;
    font-weight: 600;
}

.card-subtitle {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Formulario general */
form {
    display: flex;
    flex-direction: column;
    gap: 22px; /* más respiración */
}

/* Grupos */
.form-group,
.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 3px;  /* compactado */
}

.form-group-inline {
    flex-direction: row;
    gap: 18px; /* proporcional al nuevo ancho */
}

.form-group-inline .form-group {
    flex: 1;
}

/* Labels */
label {
    font-size: 0.92rem;
    font-weight: 500;
}

/* Inputs y selects */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 12px 14px; /* mayor comodidad */
    font-size: 1rem;
    background: #ffffff;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

input[type="file"] {
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border);
    padding: 12px 14px;
    background-color: #f9fafb;
    font-size: 0.95rem;
}

/* Focus */
input:focus,
select:focus {
    border-color: var(--color-primary-strong);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    background-color: var(--color-primary-soft);
}

/* Texto explicativo */
.form-help {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: -2px; /* más compacto */
}

/* Botón */
.button-primary {
    border-radius: var(--radius-md);
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.30);
    transition: transform .12s, box-shadow .12s;
    text-decoration: none;
    text-align: center;
}

.button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.38);
}

.button-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.30);
}

/* Texto interno de info */
.message-info {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: -6px;
}

/* Errores */
.card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.card ul li {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.88rem;
    border: 1px solid rgba(220, 38, 38, .25);
    margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 640px) {
    .form-group-inline {
        flex-direction: column;
        gap: 12px;
    }

    .card {
        padding: 24px;
        max-width: 90%;
    }
}
.keyword-access {
    display: flex;
    align-items: center;
    gap: 10px;
}

.keyword-access input {
    flex: 1;
}

.keyword-lock {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #f9fafb;
    color: var(--color-text-muted);
    font-size: 1rem;
    transition: color .15s, border-color .15s, background .15s;
}

.keyword-access.is-unlocked .keyword-lock {
    color: #15803d;
    border-color: #86efac;
    background: #f0fdf4;
}

.upload-locked {
    opacity: .5;
    pointer-events: none;
}

.selected-files {
    display: flex;
    margin-top: 10px;
    flex-direction: column;
    gap: 6px;
}

.selected-files:empty {
    display: none;
}

.selected-file {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 5px 6px 5px 10px;
    border: 1px solid #dbe6f0;
    border-radius: 9px;
    background: #f7fbfe;
    color: #263746;
}

.selected-file > i {
    color: #3c83ae;
}

.selected-file-name {
    overflow: hidden;
    font-size: .86rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-file-size {
    color: #6f8090;
    font-size: .76rem;
    white-space: nowrap;
}

.selected-file-remove {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8b9baa;
    font: 400 1.2rem/1 Arial, sans-serif;
    cursor: pointer;
}

.selected-file-remove:hover,
.selected-file-remove:focus-visible {
    background: #e8f0f6;
    color: #34495a;
    outline: none;
}

.button-primary:disabled {
    cursor: not-allowed;
    opacity: .55;
    box-shadow: none;
    transform: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.button-secondary {
    display: inline-block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    background: #ffffff;
    color: var(--color-primary-strong);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
}

.receipt-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.error-message {
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, .25);
    border-radius: var(--radius-sm);
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.admin-page {
    align-items: flex-start;
}

.admin-login-card {
    margin-top: 8vh;
}

.admin-shell {
    width: min(1180px, 100%);
}

.admin-session-bar {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 5px 10px;
    color: #475569;
    font-size: .82rem;
}

.admin-session-name {
    font-weight: 600;
}

.admin-session-logout {
    padding: 5px 10px;
    border: 1px solid rgba(100, 116, 139, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    color: #475569;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.admin-session-logout:hover,
.admin-session-logout:focus-visible {
    border-color: rgba(37, 99, 235, .3);
    background: rgba(255, 255, 255, .92);
    color: var(--color-primary-strong);
}

.admin-panel {
    width: min(1180px, 100%);
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-header h1,
.admin-header p {
    margin: 0;
}

.admin-header p {
    margin-top: 5px;
    color: var(--color-text-muted);
}

.admin-table-wrap {
    margin-top: 24px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.admin-table th,
.admin-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--color-text-muted);
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.admin-table td:nth-child(5) {
    max-width: 300px;
    overflow-wrap: anywhere;
}

.admin-table a {
    color: var(--color-primary-strong);
    font-weight: 600;
}

.admin-empty {
    padding: 32px !important;
    color: var(--color-text-muted);
    text-align: center !important;
}

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

    .admin-panel {
        padding: 20px;
    }
}
.admin-access {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 20;
}

.admin-access-link {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(107, 114, 128, .22);
    border-radius: 50%;
    background: rgba(107, 114, 128, .35);
    color: rgba(75, 85, 99, .72);
    font-size: 1rem;
    text-decoration: none;
    transition: color .15s, background .15s, box-shadow .15s, transform .15s;
}

.admin-access-link:hover,
.admin-access-link:focus-visible {
    background: rgba(37, 99, 235, .78);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, .25);
    transform: scale(1.05);
}

.admin-access-link:active {
    transform: scale(.98);
}
.admin-access-link.is-admin-active {
    border-color: #b8ddec;
    background: #e7f5fb;
    color: #2f779e;
    box-shadow: 0 3px 12px rgba(47, 119, 158, .12);
}
.admin-access-link.is-admin-active:hover,
.admin-access-link.is-admin-active:focus-visible {
    border-color: #9dcee2;
    background: #dff1f8;
    color: #286b90;
    box-shadow: 0 3px 12px rgba(47, 119, 158, .16);
}
.admin-section {
    width: 100%;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-section-heading h2,
.admin-section-heading p { margin: 0; }
.admin-section-heading p { margin-top: 5px; color: var(--color-text-muted); }
.admin-notice { margin-top: 22px; padding: 11px 14px; border-radius: var(--radius-md); }
.admin-notice.is-success { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.admin-notice.is-error { color: var(--color-danger); background: var(--color-danger-soft); border: 1px solid #fecaca; }
.admin-create-course { flex: 0 0 auto; }
.course-table-wrap { width: 100%; margin-top: 16px; border: 1px solid #dbe4ee; border-radius: 10px; background: #fff; }
.course-table { width: 100% !important; min-width: 760px; --bs-table-bg: transparent; --bs-table-hover-bg: #f7faff; color: var(--color-text-main); font-size: .86rem; }
.course-table > :not(caption) > * > * { padding: 9px 11px; border-color: #e7edf4; }
.course-table th,
.course-table td { text-align: center; vertical-align: middle; }
.course-table thead th { color: #536273; background: #f4f8fc; font-size: .72rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.course-table tbody tr:last-child td { border-bottom: 0; }
.course-name-link { color: #172033; font-weight: 650; text-decoration: none; }
.course-name-link:hover { color: var(--color-primary-strong); }
.course-code { color: var(--color-primary-strong); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.course-keyword-control,
.course-row-actions { display: flex; align-items: center; gap: 4px; }
.course-keyword-control,
.course-row-actions { justify-content: center; }
.course-summary-link { color: #5269cf; font-size: .78rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.course-summary-link:hover { color: #3549a7; }
.course-keyword-value,
.course-keyword-mask { display: inline-block; min-width: 72px; color: #334155; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.course-keyword-value[hidden],
.course-keyword-mask[hidden] { display: none; }
.course-keyword-mask { color: #8b98a8; letter-spacing: .06em; }
.course-icon-button {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #aab5c2;
    background: transparent;
    font-size: .78rem;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.course-icon-button:hover,
.course-icon-button:focus-visible { color: #526579; background: #eef4fa; }
.course-icon-button.is-copied { color: #3b82f6; background: #eff6ff; }
.course-open-link { margin-left: 5px; color: #526579; font-size: .78rem; font-weight: 650; text-decoration: none; }
.course-open-link:hover { color: var(--color-primary-strong); }
.admin-form { margin-top: 20px; }
.file-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.check-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #f9fafb; cursor: pointer; }
.check-card input { width: 17px; height: 17px; accent-color: var(--color-primary); }
.admin-back { display: inline-block; margin-bottom: 12px; color: var(--color-primary-strong); font-weight: 600; text-decoration: none; }
.task-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; margin-top: 24px; }
.task-stat { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #f9fafb; }
.task-stat span { color: var(--color-text-muted); font-size: .78rem; }
.task-stat strong { font-size: 1.35rem; }
body.modal-open { overflow: hidden; }
.admin-page .modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}
.admin-page .modal[aria-hidden="true"] { display: none !important; }
.admin-page .modal.show { display: block; }
.admin-page .modal-dialog {
    position: relative;
    width: auto;
    max-width: 620px;
    margin: 28px auto;
    pointer-events: none;
}
.admin-page .course-settings-dialog { max-width: 820px; }
.admin-page .modal-dialog-centered { display: flex; min-height: calc(100% - 56px); align-items: center; }
.admin-page .modal-dialog-scrollable { height: calc(100% - 56px); }
.admin-page .modal-dialog-scrollable .modal-content { height: 100%; max-height: 100%; overflow: hidden; }
.admin-page .modal-dialog-scrollable .admin-modal > form { display: flex; height: 100%; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.admin-page .modal-dialog-scrollable .modal-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.admin-page .modal-content { position: relative; display: flex; width: 100%; flex-direction: column; pointer-events: auto; background: #fff; }
.admin-page .modal-header,
.admin-page .modal-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 16px 20px; }
.admin-page .modal-footer { justify-content: flex-end; gap: 8px; }
.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: #172433;
}
.admin-modal-backdrop.show { opacity: .42; }
.admin-modal { border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(28, 42, 58, .22); }
.admin-modal .modal-header,
.admin-modal .modal-footer { border-color: #e7edf4; }
.admin-modal .modal-title { color: #172033; font-weight: 700; }
.admin-modal .modal-body { padding: 20px; }
.admin-modal-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    background: #f8fafc;
    color: #526273;
    font: 400 1.45rem/1 Arial, sans-serif;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.admin-modal-close:hover,
.admin-modal-close:focus-visible { border-color: #cbd5e1; background: #eaf0f6; color: #172033; outline: none; }
.admin-modal .form-group:first-of-type { margin-top: 0; }
.modal-course-name { margin: 3px 0 0; color: var(--color-text-muted); font-size: .82rem; }
.task-limit-list { display: flex; flex-direction: column; }
.task-limit-head,
.task-limit-row { display: grid; grid-template-columns: minmax(90px, 1fr) 105px 105px 92px; align-items: center; gap: 10px; }
.task-limit-head { padding: 0 8px 7px; color: #64748b; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.task-limit-head small { display: block; color: #94a3b8; font-size: .62rem; font-weight: 500; text-transform: none; }
.task-limit-row { padding: 7px 8px; border-top: 1px solid #edf1f5; }
.task-limit-entry[hidden],
.task-file-types-panel[hidden] { display: none !important; }
.task-limit-row strong { color: #334155; font-size: .84rem; }
.task-limit-row input { min-height: 36px; padding: 6px 8px; text-align: center; }
.task-types-toggle {
    justify-self: end;
    padding: 5px 8px;
    border: 1px solid #dbe6ef;
    border-radius: 7px;
    background: #f7fafc;
    color: #607486;
    font-size: .72rem;
    font-weight: 650;
    cursor: pointer;
}
.task-types-toggle:hover,
.task-types-toggle:focus-visible,
.task-types-toggle[aria-expanded="true"] { border-color: #b9d5e5; background: #edf7fb; color: #346f91; }
.task-file-types-panel { margin: 0 8px 10px; padding: 12px; border: 1px solid #dce8ef; border-radius: 9px; background: #f8fbfd; }
.task-file-types-panel > p { margin: 0 0 8px; color: #607486; font-size: .74rem; font-weight: 700; }
.task-category-list { display: flex; flex-direction: column; gap: 5px; }
.task-category-option {
    display: grid;
    grid-template-columns: auto 24px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 7px 9px;
    border: 1px solid #e1eaf0;
    border-radius: 8px;
    background: #fff;
}
.task-category-option:has(> input:checked) { border-color: #b9d9e9; background: #eff8fc; }
.task-category-option > input[type="checkbox"] { width: 16px; height: 16px; accent-color: #478bb1; }
.task-category-option > i { color: #5487a6; font-size: .88rem; text-align: center; }
.task-category-option > span { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.task-category-option strong { color: #334858; font-size: .78rem; }
.task-category-option small { color: #80909d; font-size: .66rem; line-height: 1.3; overflow-wrap: anywhere; }
.task-category-custom > span { gap: 5px; }
.task-category-custom label { width: max-content; cursor: pointer; }
.task-category-custom input[type="text"] { width: 100%; min-height: 34px; padding: 6px 8px; border: 1px solid #d8e3ea; border-radius: 7px; background: #fff; font-size: .78rem; }
.task-category-custom input[type="text"]:disabled { color: #94a3b8; background: #f1f5f9; }
.task-count-field { max-width: 190px; margin-bottom: 18px; }
/* Confirmación de entrega */
.submission-code-row {
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #f8fafc;
}
.submission-code-row > span { color: var(--color-text-muted); font-size: .84rem; }
.submission-code-row strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1rem; letter-spacing: .06em; }
.copy-code-button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #d5dbe3;
    font-size: .82rem;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.copy-code-button:hover,
.copy-code-button:focus-visible { color: #94a3b8; background: #f1f5f9; }
.copy-code-button.is-copied { color: #94a3b8; background: #f8fafc; }
.copy-status { min-height: 18px; margin-top: 5px; color: #64748b; font-size: .8rem; text-align: right; }

/* Categorías de archivos */
.file-category-list { display: flex; max-width: 760px; flex-direction: column; gap: 7px; }
.category-card {
    display: grid;
    grid-template-columns: auto 28px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #f9fafb;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.category-card:has(input:checked) { border-color: #93c5fd; background: var(--color-primary-soft); box-shadow: 0 0 0 1px rgba(37, 99, 235, .05); }
.category-card > input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--color-primary); }
.category-card > i { color: var(--color-primary-strong); font-size: 1rem; text-align: center; }
.category-card span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.category-card small { color: var(--color-text-muted); font-size: .7rem; line-height: 1.35; overflow-wrap: anywhere; }
.category-card-custom { cursor: default; }
.category-card-custom span { gap: 6px; }
.category-card-custom label { width: max-content; cursor: pointer; }
.category-card-custom span input {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    background: #fff;
    font-size: .82rem;
}
.category-card-custom span input:disabled { color: #94a3b8; background: #f1f5f9; }
.admin-header .button-secondary { white-space: nowrap; }

/* Resumen de tareas por participante */
.admin-summary-page { padding-inline: clamp(16px, 2.6vw, 42px); }
.admin-summary-page .admin-shell,
.admin-summary-page .summary-panel { width: min(1500px, 100%); }
.summary-panel { padding: 24px; }
.summary-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 24px; padding: 13px 15px; border: 1px solid #ebe5d8; border-radius: 10px; background: #fffdf8; }
.summary-course-form { display: flex; min-width: 240px; max-width: 360px; gap: 5px; }
.summary-course-form label { color: #687180; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.summary-course-form select { min-height: 36px; padding: 6px 34px 6px 10px; border-color: #dfe3ea; background-color: #fff; font-size: .84rem; }
.summary-participant-count { color: #717986; font-size: .82rem; white-space: nowrap; }
.summary-participant-count strong { color: #5269cf; font-size: .94rem; }
.delivery-matrix-wrap { width: 100%; max-height: calc(100vh - 245px); margin-top: 14px; overflow: auto; border: 1px solid #e3e6eb; border-radius: 10px; background: #fff; scrollbar-color: #cbd3dc transparent; scrollbar-width: thin; }
.delivery-matrix { width: 100%; min-width: max-content; border-collapse: separate; border-spacing: 0; color: #454b58; font-size: .84rem; }
.delivery-matrix th,
.delivery-matrix td { height: 43px; padding: 8px 12px; border-right: 1px solid #edf0f3; border-bottom: 1px solid #edf0f3; text-align: center; vertical-align: middle; }
.delivery-matrix th { position: sticky; top: 0; z-index: 3; background: #eef2f8; color: #566171; font-size: .72rem; font-weight: 700; letter-spacing: .025em; white-space: nowrap; }
.delivery-matrix th:first-child,
.delivery-matrix td:first-child { position: sticky; left: 0; min-width: 128px; text-align: left; }
.delivery-matrix th:nth-child(2),
.delivery-matrix td:nth-child(2) { position: sticky; left: 128px; min-width: 230px; text-align: left; }
.delivery-matrix th:first-child,
.delivery-matrix th:nth-child(2) { z-index: 5; background: #e9eef6; }
.delivery-matrix td:first-child,
.delivery-matrix td:nth-child(2) { z-index: 2; background: #fff; }
.delivery-matrix tbody tr:nth-child(even) td { background: #fbfcfd; }
.delivery-matrix tbody tr:hover td { background: #f6f8fc; }
.delivery-matrix tbody tr:hover td:first-child,
.delivery-matrix tbody tr:hover td:nth-child(2) { background: #f3f6fb; }
.summary-rut { color: #5c6573; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; white-space: nowrap; }
.summary-name { color: #353b46; font-weight: 620; white-space: nowrap; }
.summary-task-state { min-width: 78px; }
.summary-task-check { color: #5269cf; font-size: .92rem; font-weight: 800; }
.summary-task-empty { color: #d6dbe1; }
.summary-empty { position: static !important; padding: 34px !important; color: #7b8490; text-align: center !important; }
.summary-note { margin: 10px 2px 0; color: #89919c; font-size: .72rem; }

@media (max-width: 720px) {
    .summary-toolbar { align-items: stretch; flex-direction: column; }
    .summary-course-form { width: 100%; min-width: 0; max-width: none; }
    .delivery-matrix-wrap { max-height: calc(100vh - 285px); }
}

@media (max-width: 620px) {
    .admin-section-heading { align-items: flex-start; flex-direction: column; }
    .admin-page .modal-dialog { margin: 14px; }
    .admin-page .modal-dialog-centered { min-height: calc(100% - 28px); }
    .admin-page .modal-dialog-scrollable { height: calc(100% - 28px); }
    .task-limit-head,
    .task-limit-row { grid-template-columns: minmax(60px, 1fr) 72px 72px 78px; gap: 6px; }
}

/* Vista limpia para mostrar entregas */
.viewer-page {
    --board-ink: #343946;
    --board-blue: #5269cf;
    --board-blue-soft: #f1f4ff;
    --board-yellow: #eabf45;
    --board-orange: #e99563;
    --board-cream: #fffdf7;
    padding: 22px clamp(18px, 3vw, 48px) 16px;
    background-color: #fffdf8;
    background-image:
        linear-gradient(rgba(232, 209, 146, .13) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 209, 146, .13) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, .65), rgba(255, 250, 239, .5));
    background-size: 240px 240px, 240px 240px, 100% 100%;
}
.viewer-panel {
    width: min(1380px, 100%);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.viewer-header {
    display: block;
    padding: 16px 20px;
    border: 1px solid #eee7d7;
    border-left: 4px solid #efc84f;
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 6px 18px rgba(67, 62, 49, .045);
}
.viewer-heading { min-width: 0; }
.viewer-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--board-ink);
    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: -.03em;
}
.viewer-header h1::before {
    display: inline-block;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    background: transparent;
    color: #e4b72d;
    box-shadow: none;
    content: '★';
    font-size: 1rem;
}
.viewer-context {
    display: flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    gap: 7px;
    margin: 7px 0 0 27px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #555d6b;
    font-size: .9rem;
    line-height: 1.45;
    white-space: nowrap;
}
.viewer-context-count { color: #657080; font-size: inherit; }
.viewer-context-count strong { color: #6672a7; font-size: inherit; font-weight: 750; }
.viewer-filter-control {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.viewer-filter-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
}
.viewer-filter-trigger:hover,
.viewer-filter-trigger:focus-visible { color: var(--board-blue); }
.viewer-filter-trigger:focus-visible {
    outline: 1px dotted #aeb6bf;
    outline-offset: 3px;
}
.viewer-filter-menu {
    display: none;
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 20;
    min-width: 128px;
    padding: 5px;
    border: 1px solid #e1e5e9;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(53, 62, 72, .1);
}
.viewer-filter-menu.is-open {
    display: flex;
    flex-direction: column;
}
.viewer-course-menu {
    width: max-content;
    min-width: 220px;
    max-width: 72vw;
}
.viewer-task-menu { min-width: 132px; }
.viewer-filter-option {
    padding: 8px 10px;
    border-radius: 6px;
    color: #65717d;
    font-size: .79rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
}
.viewer-filter-option:hover,
.viewer-filter-option:focus-visible {
    outline: none;
    background: #f5f7f9;
    color: #46515d;
}
.viewer-filter-option.is-selected {
    background: var(--board-blue-soft);
    color: #344acb;
}
.viewer-table-wrap {
    margin-top: 17px;
    max-height: calc(100vh - 158px);
    max-height: calc(100dvh - 158px);
    overflow: auto;
    scrollbar-color: #cbd9e2 transparent;
    scrollbar-width: thin;
    padding: 7px 9px 9px;
    border: 1px solid #ebe5d8;
    border-radius: 12px;
    background: rgba(255, 253, 248, .94);
    box-shadow: 0 7px 20px rgba(62, 59, 50, .045);
}
.viewer-table {
    width: 100%;
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0 5px;
    --bs-table-bg: transparent;
    --bs-table-color: #263540;
    --bs-table-hover-bg: #eef7fc;
    --bs-table-hover-color: #111820;
}
.viewer-table th,
.viewer-table td { padding: 10px 14px; vertical-align: middle; }
.viewer-table th {
    position: sticky;
    top: 0;
    z-index: 4;
    border-top: 1px solid #e2e6ee;
    border-bottom: 1px solid #dbe1eb;
    background: #eef2f8;
    color: #505969;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.viewer-table thead th:first-child { border-left: 1px solid #e2e6ee; border-radius: 8px 0 0 8px; }
.viewer-table thead th:last-child { border-right: 1px solid #e2e6ee; border-radius: 0 8px 8px 0; }
.viewer-table tbody td {
    border-top: 1px solid #ece9e2;
    border-bottom: 1px solid #ece9e2;
    background: rgba(255, 255, 255, .88);
    color: #454b57;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.viewer-table tbody td:first-child { border-left: 2px solid #dce3f2; border-radius: 8px 0 0 8px; }
.viewer-table tbody td:last-child { border-right: 1px solid #ece9e2; border-radius: 0 8px 8px 0; }
.viewer-table th:nth-child(n+2),
.viewer-table td:nth-child(n+2) { text-align: center; }
.viewer-table th:nth-child(3),
.viewer-table td:nth-child(3) { text-align: center !important; }
.viewer-table th:nth-child(1) { width: 46%; }
.viewer-table th:nth-child(2) { width: 24%; }
.viewer-table th:nth-child(3) { width: 14%; }
.viewer-table th:nth-child(4) { width: 16%; }
.viewer-table tbody tr:last-child td { border-bottom: 1px solid #ece9e2; }
.viewer-table tbody tr:nth-child(even) { background: transparent; }
.viewer-table tbody tr:hover > td { border-color: #d9deed; background: #f7f8fc; }
.viewer-table tbody tr:first-child:not(.empty-row) > td {
    border-color: #eadcae;
    background: #fffaf0;
}
.viewer-table tbody tr.is-trashed > td,
.viewer-table tbody tr.is-trashed:hover > td,
.viewer-table tbody tr.is-trashed:first-child:not(.empty-row) > td {
    border-color: #e0e2e5;
    background: #f1f2f3;
    color: #9197a0;
}
.viewer-table tbody tr.is-trashed > td:first-child { border-left-color: #bfc4ca; }
.viewer-table tbody tr.is-trashed .student-name,
.viewer-table tbody tr.is-trashed .submission-list-code,
.viewer-table tbody tr.is-trashed .submission-file-count,
.viewer-table tbody tr.is-trashed .viewer-open { color: #9399a1; }
.viewer-table tbody tr.is-new-arrival > td {
    position: relative;
    z-index: 1;
    animation: viewer-new-arrival-halo 20s ease-out both;
    animation-delay: var(--arrival-delay, 0ms);
}
.viewer-table tbody tr.is-new-arrival .student-name span {
    display: inline-block;
    animation: viewer-new-arrival-name 20s ease-out both;
    animation-delay: var(--arrival-delay, 0ms);
}
.viewer-table tbody tr.is-new-arrival .achievement-icon {
    animation: viewer-new-arrival-star 20s ease-out both;
    animation-delay: var(--arrival-delay, 0ms);
}
@keyframes viewer-new-arrival-halo {
    0%, 24% {
        border-color: #e9cf79;
        background-color: #fff5d8;
        box-shadow: inset 3px 0 0 #e9c24f;
    }
    58% {
        border-color: #eadcae;
        background-color: #fff8e7;
        box-shadow: inset 2px 0 0 rgba(233, 194, 79, .45);
    }
    100% {
        border-color: #eadcae;
        background-color: #fffaf0;
        box-shadow: none;
    }
}
@keyframes viewer-new-arrival-name {
    0%, 22% { color: #3f4654; font-size: 1.16rem; font-weight: 750; transform: translateX(3px); }
    58% { color: #454b58; font-size: 1.08rem; font-weight: 700; transform: translateX(0); }
    100% { color: #454b58; font-size: 1.04rem; font-weight: 680; transform: translateX(0); }
}
@keyframes viewer-new-arrival-star {
    0%, 22% { color: #dfad1f; transform: translateY(-1px) scale(1.12); }
    58%, 100% { color: #dfad1f; transform: translateY(0) scale(1); }
}
.viewer-table .student-name { min-width: 260px; color: #454b58; font-weight: 620; white-space: nowrap; }
.viewer-table tbody tr:first-child:not(.empty-row) .student-name span { font-size: 1.04rem; font-weight: 680; }
.submission-status-toggle {
    display: inline-grid;
    width: 18px;
    height: 24px;
    place-items: center;
    margin: 0 8px 0 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    vertical-align: middle;
    cursor: pointer;
}
.submission-status-toggle:hover,
.submission-status-toggle:focus-visible { background: #f5f1e4; outline: none; }
.submission-status-toggle:focus-visible { box-shadow: 0 0 0 2px rgba(82, 105, 207, .18); }
.submission-status-toggle:disabled { cursor: wait; opacity: .55; }
.achievement-icon {
    display: inline-block;
    width: 18px;
    height: auto;
    margin-right: 8px;
    border-radius: 0;
    background: transparent;
    color: #e0b538;
    font-size: .76rem;
    vertical-align: .08em;
}
.submission-status-toggle .achievement-icon { margin-right: 0; }
.submission-status-toggle.has-observations .achievement-icon,
.viewer-table tbody tr:first-child:not(.empty-row) .submission-status-toggle.has-observations .achievement-icon {
    color: #65b9dc;
}
.viewer-table tbody tr:first-child:not(.empty-row) .achievement-icon { background: transparent; color: #dca918; }
.submission-list-code {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    background: transparent;
    color: #626b7c;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .76rem;
    letter-spacing: .025em;
    white-space: nowrap;
}
.submission-file-count {
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #5b6480;
    text-align: center;
    font-size: .78rem;
    font-weight: 800;
}
.original-filename { display: block; color: #273640; white-space: nowrap; }
.submission-date,
.submission-size { white-space: nowrap; }
.submission-date { color: #3f4f5b; }
.submission-size { color: #18232c; font-weight: 550; }
.viewer-file-actions { display: flex; align-items: center; justify-content: center; gap: 13px; white-space: nowrap; }
.viewer-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    color: #3d51d4;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 500;
}
.viewer-download:hover { color: #f06d2d; }
.viewer-open { color: #3d51d4; }
.viewer-panel:not(.is-editing) .edit-action { display: none; }
.viewer-panel.is-editing .viewer-file-actions .edit-action { display: inline-flex; }
.viewer-table .edit-only { display: none; width: 34px; }
.viewer-panel.is-editing .viewer-table .edit-only { display: table-cell; }
.edit-submission-name,
.delete-submission {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #dde2e8;
    font-size: .72rem;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.edit-submission-name { color: #d7d9e7; }
.edit-submission-name:hover,
.edit-submission-name:focus-visible { color: var(--board-blue); background: var(--board-blue-soft); }
.delete-submission:hover,
.delete-submission:focus-visible { color: #9ea8b3; background: #f4f6f8; }
.delete-submission.is-restore { color: #7f8993; }
.delete-submission.is-restore:hover,
.delete-submission.is-restore:focus-visible { color: #53606c; background: #e7e9eb; }
.viewer-edit-area { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 30px; margin-top: 5px; }
.viewer-admin-back {
    color: #c1c7cf;
    font-size: .72rem;
    font-weight: 500;
    text-decoration: none;
}
.viewer-admin-back:hover { color: #8f99a5; }
.viewer-download-all {
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 6px;
    color: #a5aeb8;
    font-size: .72rem;
    font-weight: 500;
    text-decoration: none;
}
.viewer-panel.is-editing .viewer-download-all { display: inline-flex; }
.viewer-download-all:hover { background: #f7f8fa; color: #7d8995; }
.viewer-edit-toggle {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #e7ebef;
    font-size: .66rem;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.viewer-edit-toggle:hover,
.viewer-edit-toggle:focus-visible,
.viewer-edit-toggle[aria-pressed="true"] { color: #b5bdc6; background: #f7f8fa; }
.viewer-message { color: #8c96a1; font-size: .76rem; }
.viewer-name-modal {
    --board-ink: #292b31;
    --board-blue: #4960e6;
    --board-orange: #ff8a42;
    width: min(470px, calc(100vw - 28px));
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #fffdf8;
    color: var(--board-ink);
    box-shadow: 0 26px 80px rgba(35, 35, 40, .26);
}
.viewer-name-modal::backdrop { background: rgba(37, 38, 44, .48); }
.viewer-name-form { margin: 0; }
.viewer-name-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 19px 20px 16px;
    border-bottom: 1px solid #f1e4bd;
    background: linear-gradient(120deg, #fff2b9, #fffaf0 58%, #eef0ff);
}
.viewer-name-modal-header h2,
.viewer-name-modal-header p { margin: 0; }
.viewer-name-modal-header h2 { font-size: 1.12rem; font-weight: 750; }
.viewer-name-modal-header p { margin-top: 3px; color: #727681; font-size: .78rem; }
.viewer-name-modal-close {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .72);
    color: #555963;
    font-size: 1.2rem;
    cursor: pointer;
}
.viewer-name-modal-body { padding: 18px 20px; }
.viewer-name-modal-body > label { display: block; margin-bottom: 6px; color: #474b55; font-size: .78rem; font-weight: 700; }
.viewer-name-modal-body > input {
    width: 100%;
    min-height: 43px;
    padding: 9px 11px;
    border: 1px solid #d9ddeb;
    border-radius: 10px;
    background: #ffffff;
    color: #292c33;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
}
.viewer-name-modal-body > input:focus { border-color: var(--board-blue); outline: 3px solid rgba(73, 96, 230, .12); }
.viewer-original-name {
    display: flex;
    margin-top: 15px;
    padding: 10px 12px;
    flex-direction: column;
    gap: 3px;
    border-left: 3px solid var(--board-orange);
    border-radius: 8px;
    background: #fff5eb;
}
.viewer-original-name span { color: #8a6b58; font-size: .69rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.viewer-original-name strong { color: #4f4037; font-size: .86rem; font-weight: 650; }
.viewer-name-error { margin: 10px 0 0; color: #b53e36; font-size: .76rem; }
.viewer-name-modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px 18px; }
.viewer-name-cancel,
.viewer-name-save { padding: 8px 13px; border-radius: 9px; font-family: inherit; font-size: .78rem; font-weight: 700; line-height: 1.2; cursor: pointer; }
.viewer-name-cancel { border: 1px solid #e1e2e8; background: #fff; color: #676b75; }
.viewer-name-save { border: 1px solid var(--board-blue); background: var(--board-blue); color: #fff; box-shadow: 0 5px 13px rgba(73, 96, 230, .2); }
.viewer-name-save:disabled { cursor: wait; opacity: .6; }
.viewer-files-modal {
    width: min(1180px, calc(100vw - 32px));
    height: min(780px, calc(100vh - 32px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: #1f2e39;
    box-shadow: 0 24px 70px rgba(28, 36, 44, .22);
}
.viewer-files-modal::backdrop { background: rgba(38, 46, 54, .42); }
.viewer-files-modal-content {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
}
.viewer-files-modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 20px;
    border-bottom: 1px solid #dce7ef;
    background: #f8fbfd;
}
.viewer-files-modal-header h2 { margin: 0; color: #162b39; font-size: 1.05rem; font-weight: 700; }
.viewer-files-modal-header p { margin: 3px 0 0; color: #6b7d8b; font-size: .78rem; }
.viewer-files-modal-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #d8e3eb;
    border-radius: 50%;
    background: #fff;
    color: #6f7e8a;
    font: 400 1.35rem/1 Arial, sans-serif;
    cursor: pointer;
}
.viewer-files-modal-close:hover { border-color: #bdceda; background: #eef4f8; color: #314754; }
.viewer-files-modal-layout {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: 290px minmax(0, 1fr);
}
.viewer-submission-files {
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    border-right: 1px solid #dce7ef;
    background: #fbfdfe;
}
.viewer-submission-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: 3px;
    margin-bottom: 7px;
}
.viewer-submission-file {
    display: grid;
    min-width: 0;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #2b3b47;
    text-align: left;
    cursor: pointer;
}
.viewer-submission-file:hover,
.viewer-submission-file.is-active { border-color: #c9dfec; background: #edf7fc; }
.viewer-submission-file > i { color: #4b86a9; }
.viewer-submission-file-text { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.viewer-submission-file-text strong {
    overflow: hidden;
    font-size: .8rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewer-submission-file-text small { color: #7a8995; font-size: .7rem; }
.viewer-submission-file-action { color: #3d789d; font-size: .7rem; font-weight: 650; }
.viewer-file-download {
    display: none;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: #9ba8b2;
    text-decoration: none;
    font-size: .72rem;
}
body.viewer-editing .viewer-file-download { display: grid; }
.viewer-file-download:hover { background: #edf2f5; color: #657784; }
.viewer-file-preview {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    align-items: start;
    justify-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    background: #eef3f6;
}
.viewer-preview-empty,
.viewer-preview-loading,
.viewer-preview-error { padding: 24px; color: #71818d; font-size: .84rem; text-align: center; }
.viewer-preview-error { color: #a34b4b; }
.viewer-file-preview > img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: none;
    margin: 0 auto;
    object-fit: contain;
    box-shadow: 0 6px 24px rgba(31, 47, 59, .12);
}
.viewer-file-preview > iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}
.viewer-office-preview[hidden] { display: none; }
.viewer-text-preview {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 20px;
    overflow: auto;
    background: #fff;
    color: #263540;
    font: 400 .82rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
}
.viewer-text-preview[hidden] { display: none; }
.viewer-pdf-preview {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #dfe5e9;
}
.viewer-pdf-preview[hidden] { display: none; }
.viewer-pdf-page {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    flex: 0 0 auto;
    background: #fff;
    box-shadow: 0 5px 18px rgba(28, 43, 53, .14);
}
.viewer-spreadsheet-preview {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    background: #fff;
}
.viewer-spreadsheet-preview[hidden] { display: none; }
.viewer-sheet-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
    padding: 7px 9px 0;
    overflow-x: auto;
    border-bottom: 1px solid #d7e2e9;
    background: #f5f8fa;
}
.viewer-sheet-tab {
    padding: 6px 11px;
    border: 0;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: #637581;
    font-size: .73rem;
    white-space: nowrap;
    cursor: pointer;
}
.viewer-sheet-tab:hover,
.viewer-sheet-tab.is-active { background: #fff; color: #245f83; }
.viewer-formula-bar {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    min-height: 36px;
    border-bottom: 1px solid #d7e2e9;
    background: #fff;
}
.viewer-formula-bar > span { color: #477b9a; font-style: italic; font-weight: 700; text-align: center; }
.viewer-formula-bar code {
    overflow: hidden;
    padding: 0 9px;
    border-left: 1px solid #e1e8ed;
    color: #34444f;
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewer-sheet-table-wrap {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
}
.viewer-sheet-table {
    border-collapse: separate;
    border-spacing: 0;
    color: #24333e;
    font-size: .76rem;
}
.viewer-sheet-table th,
.viewer-sheet-table td {
    min-width: 82px;
    height: 28px;
    padding: 4px 7px;
    border-right: 1px solid #e0e7ec;
    border-bottom: 1px solid #e0e7ec;
    background: #fff;
    white-space: nowrap;
}
.viewer-sheet-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    min-width: 42px;
    background: #eef3f6;
    color: #647580;
    font-weight: 600;
    text-align: center;
}
.viewer-sheet-table tbody th { left: 0; z-index: 1; }
.viewer-sheet-table td.has-formula { background: #f2f8fc; }
.viewer-sheet-table td.has-formula::after { color: #6aa1c2; content: ' ƒ'; font-size: .62rem; }
.viewer-sheet-table td:hover { background: #eaf5fb; }
.viewer-sheet-table td.is-selected { outline: 2px solid #4f92b9; outline-offset: -2px; }
.viewer-sheet-limit { margin: 8px; color: #7b8992; font-size: .7rem; }

@media (max-width: 820px) {
    .submission-code-row { grid-template-columns: 1fr auto; }
    .submission-code-row > span { grid-column: 1 / -1; }
    .viewer-page { padding: 18px 14px 12px; }
    .viewer-header { padding: 14px; }
    .viewer-context { width: 100%; margin-left: 0; flex-wrap: wrap; white-space: normal; }
    .viewer-table-wrap {
        max-height: calc(100vh - 145px);
        max-height: calc(100dvh - 145px);
    }
    .viewer-files-modal-layout { grid-template-columns: 1fr; grid-template-rows: minmax(110px, 32%) minmax(0, 1fr); }
    .viewer-submission-files { border-right: 0; border-bottom: 1px solid #dce7ef; }
}

@media (prefers-reduced-motion: reduce) {
    .viewer-table tbody tr.is-new-arrival > td {
        animation: none;
        background-color: #fff8cf;
        box-shadow: inset 0 1px 0 #e8bf39, inset 0 -1px 0 #e8bf39;
    }
    .viewer-table tbody tr.is-new-arrival .student-name span,
    .viewer-table tbody tr.is-new-arrival .achievement-icon { animation: none; }
}
