@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap");

.er-root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: rgba(37, 99, 235, 0.08);
    --brand-border: rgba(37, 99, 235, 0.2);
    --green: #059669;
    --green-soft: rgba(5, 150, 105, 0.09);
    --green-border: rgba(5, 150, 105, 0.25);
    --amber: #d97706;
    --amber-soft: rgba(217, 119, 6, 0.09);
    --amber-border: rgba(217, 119, 6, 0.25);
    --red: #dc2626;
    --red-soft: rgba(220, 38, 38, 0.08);
    --red-border: rgba(220, 38, 38, 0.22);
    --surface: #ffffff;
    --surface-2: #f5f6fb;
    --surface-3: #eef0f7;
    --border: #e3e6f0;
    --border-dark: #cdd0de;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow:
        0 1px 4px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md:
        0 4px 16px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.05);
    font-family: "Bricolage Grotesque", sans-serif;
    color: var(--text);
}

.dark .er-root {
    --surface: #0f172a;
    --surface-2: #1e293b;
    --surface-3: #334155;
    --border: #334155;
    --border-dark: #475569;
    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --text-3: #64748b;
}

/* ── Banner ── */
.er-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow);
}

.er-banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--brand);
}

.er-banner-icon svg {
    width: 22px;
    height: 22px;
}

.er-banner-info {
    flex: 1;
    min-width: 0;
}

.er-banner-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.er-banner-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.er-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    border: 1px solid;
    white-space: nowrap;
}

.er-pill svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}
.er-pill-blue {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand-border);
}
.er-pill-amber {
    background: var(--amber-soft);
    color: var(--amber);
    border-color: var(--amber-border);
}
.er-pill-green {
    background: var(--green-soft);
    color: var(--green);
    border-color: var(--green-border);
}

/* ── Stats row ── */
.er-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

@media (max-width: 900px) {
    .er-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 520px) {
    .er-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.er-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.er-stat-val {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 3px;
}

.er-stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-3);
}

/* ── Layout: lista + panel ── */
.er-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.er-layout.with-panel {
    grid-template-columns: 380px 1fr;
}

@media (max-width: 900px) {
    .er-layout.with-panel {
        grid-template-columns: 1fr;
    }
}

/* ── Lista de estudiantes ── */
.er-list-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.er-list-head {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.er-list-head-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-3);
}

.er-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 6px 12px;
    font-family: "Bricolage Grotesque", sans-serif;
}

.er-search svg {
    width: 13px;
    height: 13px;
    color: var(--text-3);
    flex-shrink: 0;
}

.er-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.78rem;
    font-family: "Bricolage Grotesque", sans-serif;
    color: var(--text);
    width: 160px;
}

.er-search input::placeholder {
    color: var(--text-3);
}

/* Fila de estudiante */
.er-student-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.13s;
    position: relative;
}

.er-student-row:last-child {
    border-bottom: none;
}

.er-student-row:hover {
    background: var(--surface-2);
}

.er-student-row.active {
    background: var(--brand-soft);
    border-left: 3px solid var(--brand);
}

.er-student-row.active .er-student-name {
    color: var(--brand);
}

/* Avatar */
.er-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}

.er-avatar-approved {
    background: var(--green);
}
.er-avatar-failed {
    background: var(--red);
}

.er-student-info {
    flex: 1;
    min-width: 0;
}

.er-student-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.er-student-email {
    font-size: 0.7rem;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.er-student-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.er-student-score {
    font-family: "DM Mono", monospace;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
}

.er-student-score.approved {
    color: var(--green);
}
.er-student-score.failed {
    color: var(--red);
}

.er-student-time {
    font-family: "DM Mono", monospace;
    font-size: 0.65rem;
    color: var(--text-3);
}

.er-verdict-pill {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    border: 1px solid;
}

.er-verdict-pill.approved {
    background: var(--green-soft);
    color: var(--green);
    border-color: var(--green-border);
}

.er-verdict-pill.failed {
    background: var(--red-soft);
    color: var(--red);
    border-color: var(--red-border);
}

/* Rank badge */
.er-rank {
    font-family: "DM Mono", monospace;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-3);
    min-width: 20px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Panel de detalle ── */
.er-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.er-panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
}

.er-panel-student {
    flex: 1;
    min-width: 0;
}

.er-panel-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.er-panel-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.er-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border-dark);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-3);
    flex-shrink: 0;
    transition: all 0.15s;
}

.er-close-btn:hover {
    background: var(--red-soft);
    border-color: var(--red-border);
    color: var(--red);
}

.er-close-btn svg {
    width: 13px;
    height: 13px;
}

/* Scroll del panel */
.er-panel-body {
    overflow-y: auto;
    flex: 1;
    padding: 16px;
}

/* Pregunta en el panel */
.er-q-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

.er-q-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.er-q-card.q-correct::before {
    background: var(--green);
}
.er-q-card.q-wrong::before {
    background: var(--red);
}
.er-q-card.q-unanswered::before {
    background: var(--text-3);
}

.er-q-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 10px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.er-q-num {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    padding: 2px 8px;
    border-radius: 6px;
}

.er-q-pts {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--amber);
    background: var(--amber-soft);
    border: 1px solid var(--amber-border);
    padding: 2px 8px;
    border-radius: 99px;
}

.er-q-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 99px;
    border: 1px solid;
}

.er-q-badge.correct {
    background: var(--green-soft);
    color: var(--green);
    border-color: var(--green-border);
}
.er-q-badge.wrong {
    background: var(--red-soft);
    color: var(--red);
    border-color: var(--red-border);
}
.er-q-badge.unanswered {
    background: var(--surface-3);
    color: var(--text-3);
    border-color: var(--border-dark);
}

.er-q-text {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text);
    padding: 10px 14px;
}

.er-q-options {
    padding: 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.er-opt {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 11px;
    border-radius: 7px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
}

.er-opt.opt-correct {
    border-color: var(--green-border);
    background: var(--green-soft);
    color: var(--green);
    font-weight: 600;
}

.er-opt.opt-wrong {
    border-color: var(--red-border);
    background: var(--red-soft);
    color: var(--red);
    font-weight: 600;
}

.er-opt-letter {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 1.5px solid var(--border-dark);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.er-opt.opt-correct .er-opt-letter {
    background: var(--green-soft);
    border-color: var(--green-border);
    color: var(--green);
}

.er-opt.opt-wrong .er-opt-letter {
    background: var(--red-soft);
    border-color: var(--red-border);
    color: var(--red);
}

.er-opt-hint {
    font-size: 0.6rem;
    font-weight: 700;
    margin-top: 2px;
}

.hint-correct {
    color: var(--green);
}
.hint-wrong {
    color: var(--red);
}

/* Empty state */
.er-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 24px;
    text-align: center;
}

.er-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--text-3);
}

.er-empty-icon svg {
    width: 26px;
    height: 26px;
}
.er-empty-title {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 4px;
}
.er-empty-sub {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* Panel placeholder */
.er-panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
    text-align: center;
    color: var(--text-3);
}

.er-panel-placeholder svg {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    opacity: 0.35;
}
.er-panel-placeholder p {
    font-size: 0.78rem;
    font-weight: 600;
    margin: 0;
}

/* Barra de puntaje en el panel */
.er-score-bar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex-shrink: 0;
}

.er-score-mini {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.er-score-mini-val {
    font-family: "DM Mono", monospace;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1;
}

.er-score-mini-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-top: 3px;
}

/* Back button */
.er-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border-dark);
    background: var(--surface-2);
    color: var(--text-2);
    font-family: "Bricolage Grotesque", sans-serif;
    transition: all 0.15s;
    margin-bottom: 20px;
    text-decoration: none;
}

.er-back-btn:hover {
    border-color: var(--brand-border);
    color: var(--brand);
    background: var(--brand-soft);
}

.er-back-btn svg {
    width: 13px;
    height: 13px;
}

/* Posición medal */
.er-medal {
    font-size: 0.85rem;
    line-height: 1;
}
