.practice-builder-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 0 64px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Wizard (planificación por pasos) */
.wizard-panel {
    padding: 16px;
}
.wizard-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.wizard-step {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 800;
    color: #0f172a;
}
.wizard-step__num {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.85rem;
}
.wizard-step__text {
    font-size: 0.9rem;
}
.wizard-step.is-active {
    border-color: rgba(99,102,241,0.55);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
.wizard-step.is-active .wizard-step__num {
    background: #4f46e5;
    color: #fff;
}
.wizard-step.is-done {
    border-color: rgba(34,197,94,0.45);
}
.wizard-step.is-done .wizard-step__num {
    background: rgba(34,197,94,0.16);
    color: #166534;
}
.wizard-stepper__arrow {
    width: 22px;
    height: 10px;
    position: relative;
    opacity: 0.7;
}
.wizard-stepper__arrow::before {
    content: "";
    position: absolute;
    left: 0;
    right: 4px;
    top: 50%;
    height: 2px;
    background: #cbd5e1;
    transform: translateY(-50%);
}
.wizard-stepper__arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 6px solid #cbd5e1;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transform: translateY(-50%);
}

.wizard-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(15,23,42,0.06);
}
.wizard-card__title {
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 12px;
}
.wizard-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 14px 0;
}
.wizard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.wizard-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.wizard-hint {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.9rem;
}
.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.wizard-actions--end {
    justify-content: space-between;
}
.wizard-summary {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
}
.wizard-summary__row {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(203,213,225,0.9);
}
.wizard-summary__row:last-child {
    border-bottom: none;
}

@media (max-width: 900px) {
    .wizard-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .wizard-grid-2 { grid-template-columns: 1fr; }
    .wizard-stepper__arrow { display: none; }
}
.practice-builder-hero {
    background: linear-gradient(110deg, #0ea5e9, #2563eb 55%, #7c3aed);
    border-radius: 28px;
    padding: 36px 40px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    box-shadow: 0 35px 65px rgba(37,99,235,0.25);
}
.practice-builder-hero__content {
    flex: 1;
}
.practice-builder-hero__badge {
    display: inline-flex;
	    align-items: center;
	    gap: 8px;
	    text-transform: uppercase;
	    letter-spacing: 0.08em;
	    font-size: 0.75rem;
	    font-weight: 600;
	    padding: 6px 14px;
	    border-radius: 999px;
	    background: rgba(255, 255, 255, 0.18);
}
.practice-builder-hero__title {
    margin: 14px 0 6px;
    font-size: 2rem;
}
.practice-builder-hero__subtitle {
    margin: 0;
    color: rgba(255,255,255,0.92);
}
.practice-select-btn {
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    font-weight: 600;
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 15px 35px rgba(29,78,216,0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.practice-select-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 45px rgba(29,78,216,0.4);
}
.practice-builder-hero__cta {
    display: flex;
    justify-content: flex-end;
}
.practice-builder-hero__cta .exam-action-btn {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 18px 35px rgba(0,0,0,0.18);
}
.practice-builder-hero__cta .exam-action-btn:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-2px);
}
.practice-builder-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

/* Favorites page */

.favorites-page {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.favorites-page .practice-builder-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    border-radius: 24px;
    padding: 32px;
    color: #fff;
    box-shadow: 0 20px 55px rgba(30,64,175,0.25);
}

.favorites-page .practice-builder-hero__title {
    color: #fff;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
}

.favorite-card {
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    border: 1px solid var(--pt-border);
    box-shadow: 0 25px 60px rgba(15,23,42,0.08);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.favorite-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(14,165,233,0.05));
}

.favorite-card:hover::after {
    opacity: 1;
}

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

.favorite-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.favorite-card__header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--pt-text);
}

.favorite-card__body {
    margin: 0;
    color: var(--pt-text);
    line-height: 1.6;
    font-size: 1rem;
}

.favorite-card__note {
    padding: 16px;
    border-radius: 16px;
    background: var(--pt-bg-soft);
    border: 1px dashed rgba(15,23,42,0.12);
}

.favorite-card__note span {
    display: block;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--pt-muted);
    margin-bottom: 6px;
}

.favorite-card__note p {
    margin: 0;
    color: var(--pt-text);
}

.favorite-card__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 30% 30%, #fef3f2, #fee2e2 55%, #fecaca 100%);
    color: #b91c1c;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 25px rgba(248,113,113,0.35);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.favorite-card__remove::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(248,113,113,0.4);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.favorite-card__remove:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 16px 30px rgba(248,113,113,0.4);
    color: #991b1b;
}

.favorite-card__remove:hover::after {
    opacity: 0;
}

.chip--difficulty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chip--difficulty-easy {
    background: rgba(34,197,94,0.15);
    color: #15803d;
}

.chip--difficulty-medium {
    background: rgba(249,115,22,0.15);
    color: #c2410c;
}

.chip--difficulty-hard {
    background: rgba(248,113,113,0.15);
    color: #b91c1c;
}

.chip--difficulty-other {
    background: rgba(59,130,246,0.12);
    color: #1d4ed8;
}

.favorites-empty {
    border-radius: 20px;
    border: 1px dashed var(--pt-border);
    padding: 32px;
    text-align: center;
    background: var(--pt-bg-soft);
}

@media (max-width: 768px) {
    .favorite-card {
        padding: 20px;
    }

    .favorite-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .favorite-card__actions {
        justify-content: center;
    }
}

.practice-summary-card {
    background: #fff;
    border-radius: 22px;
    padding: 22px 24px;
    border: 1px solid var(--pt-border);
    box-shadow: 0 24px 50px rgba(15,23,42,0.08);
}
.practice-summary-card__label {
    font-size: 0.85rem;
    color: var(--pt-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.practice-summary-card__value {
    display: block;
    font-size: 2rem;
    margin: 6px 0;
}
.practice-summary-card__sub {
    color: var(--pt-muted);
}
.practice-alert {
    border-radius: 18px;
    padding: 16px 20px;
    font-weight: 600;
}
.practice-alert--error {
    background: rgba(239,68,68,0.12);
    color: #b91c1c;
    border: 1px solid rgba(239,68,68,0.25);
}
.practice-builder-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.practice-builder-card {
    background: #fff;
    border-radius: 26px;
    padding: 28px 30px;
    border: 1px solid var(--pt-border);
    box-shadow: 0 24px 50px rgba(15,23,42,0.08);
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.practice-card__header h2 {
    margin: 0;
    font-size: 1.3rem;
}
.practice-card__header p {
    margin: 6px 0 0;
    color: var(--pt-muted);
}
.practice-builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}
.practice-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: var(--pt-text);
}
.practice-input {
    border-radius: 16px;
    border: 1px solid var(--pt-border);
    padding: 14px 16px;
    font-size: 1rem;
    background: #f8fafc;
}
.practice-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.practice-toggle {
    flex: 1 1 260px;
    border-radius: 18px;
    border: 1px solid var(--pt-border);
    padding: 16px;
    background: #f8fafc;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.practice-toggle strong {
    display: block;
}
.practice-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.practice-mode-card {
    border: 1px solid var(--pt-border);
    border-radius: 20px;
    padding: 18px;
    background: #f9fafb;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.practice-mode-card input {
    margin-top: 4px;
}
.practice-mode-card strong {
    display: block;
    margin-bottom: 4px;
}
.practice-mode-card p {
    margin: 0;
    color: var(--pt-muted);
}
.practice-mode-card:hover {
    border-color: rgba(37,99,235,0.4);
    box-shadow: 0 20px 40px rgba(15,23,42,0.08);
    background: #fff;
}
.practice-selected-pillbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 42px;
}
.practice-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--pt-bg-soft);
    font-weight: 600;
}
.practice-pill button {
    border: none;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
}
.practice-pill-empty {
    color: var(--pt-muted);
    font-style: italic;
}
.practice-builder-table {
    border: 1px solid var(--pt-border);
    border-radius: 24px;
    overflow: hidden;
}
.practice-table-head {
    display: grid;
    grid-template-columns: 1fr 120px;
    padding: 16px 20px;
    background: var(--pt-bg-soft);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--pt-muted);
}
.practice-table-body {
    max-height: 420px;
    overflow-y: auto;
}
.practice-table-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--pt-border);
    cursor: pointer;
}
.practice-table-row.is-filtered-out {
    display: none !important;
}
.practice-table-row--child {
    background: #fff;
}
.practice-table-row--child:not(.is-visible) {
    display: none;
}
.practice-row-toggle,
.practice-row-toggle-placeholder {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.practice-row-toggle {
    border: 1px solid var(--pt-border);
    border-radius: 999px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.practice-row-toggle:hover {
    background: var(--pt-bg-soft);
}
.practice-row-toggle-icon {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #1f2937;
    transition: transform 0.2s ease;
}
.practice-row-toggle[aria-expanded="true"] .practice-row-toggle-icon {
    transform: rotate(90deg);
}
.practice-row-label {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}
.practice-table-row.is-expanded {
    background: var(--pt-bg-soft);
}
.practice-table-row input {
    margin-right: 12px;
}
.practice-table-row:hover {
    background: var(--pt-bg-soft);
}
.practice-table-main {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.practice-table-count {
    font-weight: 600;
    text-align: right;
}
.practice-table-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--pt-muted);
}
.practice-builder-actions {
    display: flex;
    justify-content: flex-end;
}
.practice-builder-actions .exam-action-btn {
    padding: 14px 26px;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
.modal-panel {
    background: #fff;
    border-radius: 28px;
    width: min(760px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px 30px;
    box-shadow: 0 45px 90px rgba(15,23,42,0.25);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.35rem;
}
.modal-header p {
    margin: 6px 0 0;
    color: var(--pt-muted);
}
.modal-close {
    border: none;
    background: rgba(15,23,42,0.08);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}
.modal-filters {
    display: flex;
    gap: 12px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.modal-actions .exam-action-btn--secondary {
    background: #fff;
    border-color: var(--pt-border);
}
.modal-actions .exam-action-btn--primary {
    background: #1d4ed8;
    box-shadow: 0 18px 45px rgba(29,78,216,0.35);
}

.normativas-modal {
    width: min(820px, 96vw);
    padding: 28px 32px 32px;
}

.normativas-modal__header h3 {
    font-size: 1.4rem;
}

.normativas-modal__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 16px;
}

.normativas-search {
    flex: 1 1 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid rgba(148,163,184,0.6);
    border-radius: 999px;
    background: #f8fafc;
}

.normativas-search__icon {
    width: 18px;
    height: 18px;
    color: #94a3b8;
}

.normativas-search__icon svg {
    width: 18px;
    height: 18px;
}

.normativas-search__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    padding: 12px 0;
}

.normativas-filter__select {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    padding: 10px 16px;
    font-size: 0.9rem;
    background: #fff;
    min-width: 160px;
}

.normativas-modal__table {
    border: 1px solid rgba(148,163,184,0.35);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.normativas-modal__table-head {
    display: grid;
    grid-template-columns: 2fr 110px;
    padding: 14px 22px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid rgba(148,163,184,0.3);
}

.normativas-modal__table-body {
    max-height: 420px;
    overflow-y: auto;
}

.normativas-modal__table-body::-webkit-scrollbar {
    width: 8px;
}

.normativas-modal__table-body::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.4);
    border-radius: 999px;
}

.normativas-row {
    display: grid;
    grid-template-columns: 2fr 110px;
    gap: 12px;
    padding: 16px 22px;
    align-items: center;
    border-bottom: 1px solid rgba(226,232,240,0.7);
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.normativas-row:hover {
    background: rgba(59,130,246,0.05);
}

.normativas-row input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}

.normativas-row__left {
    display: flex;
    align-items: flex-start;
}

.normativas-row__accordion,
.normativas-row__accordion-placeholder {
    width: 26px;
    height: 26px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.6);
    background: #fff;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.normativas-row__accordion-icon {
    width: 10px;
    height: 10px;
    border-left: 2px solid #475569;
    border-bottom: 2px solid #475569;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.normativas-row.is-open .normativas-row__accordion-icon {
    transform: rotate(45deg);
}

.normativas-row__accordion-placeholder {
    border-style: dashed;
    cursor: default;
}

.normativas-row__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.normativas-row__title {
    font-weight: 600;
    color: #0f172a;
}

.normativas-row__meta {
    font-size: 0.85rem;
    color: #475569;
}

.normativas-row__meta--empty {
    color: #94a3b8;
    font-style: italic;
}

.normativas-row__right {
    text-align: right;
    font-weight: 600;
    color: #0f172a;
}

.normativas-subpanel {
    grid-column: 1 / -1;
    margin: 10px 0 0;
    padding: 16px 20px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.normativas-subpanel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: #0f172a;
}

.normativas-subpanel__clear {
    border: none;
    background: rgba(14,165,233,0.1);
    color: #0284c7;
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.normativas-subpanel__clear:hover {
    background: rgba(14,165,233,0.2);
    color: #0369a1;
}

.normativas-subpanel__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.normativas-tema-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(203,213,225,0.9);
    font-size: 0.9rem;
}

.normativas-tema-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Planificación admin (mejoras mínimas) */
.plan-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.plan-editor-header__left {
    min-width: 0;
}
.plan-editor-header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-editor-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15,23,42,0.06);
}

.admin-form.admin-form--plan {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 16px;
    box-shadow: none;
}
.admin-form.admin-form--plan .admin-form-grid {
    margin-bottom: 14px;
}
.admin-form.admin-form--plan .form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-form.admin-form--plan .form-field > label {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}
.admin-form.admin-form--plan input[type="text"],
.admin-form.admin-form--plan textarea,
.admin-form.admin-form--plan select {
    border-radius: 12px;
    width: 100%;
    font-size: 0.95rem;
    padding: 10px 12px;
}

.admin-form.admin-form--plan textarea {
    line-height: 1.45;
}

.admin-form.admin-form--plan .form-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.admin-form.admin-form--plan .form-field > label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #0f172a;
}

.plan-items-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 12px;
    background: #fff;
}
.plan-items-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.plan-collapsible {
    margin-top: 14px;
}
.plan-collapsible--inside {
    margin-top: 0;
    border-top: 1px solid #e5e7eb;
    padding: 14px 16px 16px;
    background: #fff;
}
.plan-collapsible__btn {
    width: 100%;
    text-align: left;
    border: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(15,23,42,0.05);
}
.plan-collapsible__btn:hover {
    background: #eef2ff;
}
.plan-collapsible__body {
    margin-top: 10px;
}

.plan-items-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: #fff;
}
.plan-item-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15,23,42,0.06);
}
.plan-item-card:focus-within {
    box-shadow: 0 10px 28px rgba(15,23,42,0.10);
    border-color: rgba(99,102,241,0.45);
}
.plan-item-card__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}
.plan-item-card__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
}
.plan-item-card__label {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.9rem;
}
.plan-item-card__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.plan-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px 10px;
}
.plan-inline:hover {
    border-color: rgba(99,102,241,0.35);
}
.plan-inline span {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 700;
}
.plan-inline input[type="number"] {
    width: 64px;
    border: none;
    outline: none;
    padding: 2px 0;
    background: transparent;
    font-weight: 700;
    color: #0f172a;
}
.plan-inline--check {
    gap: 8px;
    padding-right: 12px;
}
.plan-inline--check input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.plan-item-card__body {
    padding: 12px;
}
.plan-item-card__row + .plan-item-card__row {
    margin-top: 10px;
}
.plan-field2 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.plan-field2 span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}
.plan-field2 input,
.plan-field2 textarea,
.plan-item-card select {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}
.plan-field2 input:focus,
.plan-field2 textarea:focus,
.plan-item-card select:focus {
    outline: none;
    border-color: rgba(99,102,241,0.55);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
.plan-field2 textarea {
    resize: vertical;
    min-height: 62px;
}

.btn-ghost.btn-ghost-danger {
    border-radius: 999px;
    padding: 8px 12px;
}

@media (max-width: 700px) {
    .plan-editor-header {
        flex-direction: column;
    }
    .plan-editor-header__actions {
        width: 100%;
        justify-content: flex-start;
    }
    .plan-items-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 900px) {
    .plan-item-card__left { min-width: 100%; }
}

.normativas-row.is-open {
    background: rgba(59,130,246,0.04);
}

.normativas-modal__empty {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
}

.normativas-modal__actions {
    margin-top: 20px;
}

.normativas-row.is-filtered-out {
    display: none;
}
@media (max-width: 768px) {
    .practice-builder-hero {
        flex-direction: column;
        text-align: left;
    }
    .practice-builder-actions {
        justify-content: center;
    }
}

/* ===== REALIZAR TEST - DISEÑO MINIMALISTA ===== */
.test-runner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 32px 60px;
}

/* Header */
.test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.test-header__info { flex: 1; min-width: 200px; }
.test-header__type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 2px;
}
.test-header__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--pt-text);
}
.test-header__meta {
    display: flex;
    align-items: center;
    gap: 20px;
}
.test-header__timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    background: #1d4ed8;
    padding: 10px 16px;
    border-radius: 12px;
    font-variant-numeric: tabular-nums;
}
.test-header__timer::before {
    content: '⏱';
    font-size: 1.1rem;
}
.test-header__progress {
    display: flex;
    align-items: center;
    gap: 10px;
}
.test-header__progress span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}
.progress-bar {
    width: 100px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar__fill {
    height: 100%;
    background: #1d4ed8;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Body grid */
.test-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 32px;
    align-items: start;
}
.question-info-card,
.question-card {
    grid-column: 1 / 2;
}
.test-sidebar {
    grid-column: 2 / 3;
    grid-row: 1 / span 2;
}
@media (max-width: 900px) {
    .test-body { grid-template-columns: 1fr; }
    .question-info-card,
    .question-card,
    .test-sidebar { grid-column: 1 / -1; grid-row: auto; }
    .test-sidebar { order: -1; }
}

/* Question card */
.question-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.question-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.question-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.fav-btn:hover { border-color: #f87171; color: #f87171; }
.fav-btn.is-active { background: #fef2f2; border-color: #fca5a5; color: #ef4444; }
.question-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--pt-text);
    margin: 0 0 28px;
}

/* Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.12s ease;
    position: relative;
    background: #fff;
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__letter {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.12s ease;
}
.option__text {
    flex: 1;
    font-size: 1rem;
    color: var(--pt-text);
    line-height: 1.55;
}
.option__tag {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.option__tag--ok { background: #dcfce7; color: #16a34a; }
.option__tag--fail { background: #fee2e2; color: #dc2626; }
.option:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}
.option.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.option.is-selected .option__letter {
    background: #2563eb;
    color: #fff;
}
.option.is-correct {
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}
.option.is-correct .option__letter {
    background: #16a34a;
    color: #fff;
}
.option.is-incorrect {
    border-color: #dc2626;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}
.option.is-incorrect .option__letter {
    background: #dc2626;
    color: #fff;
}

/* Actions */
.question-actions {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.question-actions__main {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
button.btn {
    border-radius: 10px;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
button.btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* Navegación (Anterior) - Gris neutro */
button.btn.btn--nav {
    background-color: #64748b !important;
    color: #fff !important;
}
button.btn.btn--nav:hover { background-color: #475569 !important; }

/* Omitir - Gris claro */
button.btn.btn--skip {
    background-color: #94a3b8 !important;
    color: #fff !important;
}
button.btn.btn--skip:hover { background-color: #64748b !important; }

/* Guardar respuesta - Azul */
button.btn.btn--save {
    background-color: #2563eb !important;
    color: #fff !important;
}
button.btn.btn--save:hover { background-color: #1d4ed8 !important; }

/* Impugnar - Naranja */
button.btn.btn--report {
    background-color: #f59e0b !important;
    color: #fff !important;
}
button.btn.btn--report:hover { background-color: #d97706 !important; }

/* Siguiente - Verde */
button.btn.btn--next {
    background-color: #22c55e !important;
    color: #fff !important;
}
button.btn.btn--next:hover { background-color: #16a34a !important; }

/* Finalizar - Negro */
button.btn.btn--done {
    background-color: #0f172a !important;
    color: #fff !important;
}
button.btn.btn--done:hover { background-color: #1e293b !important; }

/* Legacy support */
.btn--ghost {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
}
.btn--ghost:hover { background: #f8fafc; }
.btn--muted {
    background: #f1f5f9;
    color: #475569;
}
.btn--muted:hover { background: #e2e8f0; }
.btn--primary {
    background: #1d4ed8;
    color: #fff;
}
.btn--primary:hover { background: #1e40af; }
.btn--warning {
    background: #fbbf24;
    color: #78350f;
}
.btn--warning:hover { background: #f59e0b; }
.btn--success {
    background: #22c55e;
    color: #fff;
}
.btn--success:hover { background: #16a34a; }
.btn--finish {
    background: #1d4ed8;
    color: #fff;
}
.btn--finish:hover { background: #1e40af; }

/* Sidebar */
.test-sidebar {
    position: sticky;
    top: 16px;
}
.sidebar-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}
.qmap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}
.map-btn {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s ease;
}
.map-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.map-btn.is-current {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
.map-btn.is-answered {
    background: #f1f5f9;
    color: #475569;
}
.map-btn.is-correct {
    background: #dcfce7;
    border-color: #86efac;
    color: #16a34a;
}
.map-btn.is-wrong {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}
.finish-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: #1e293b;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.finish-btn:hover { background: #0f172a; }

/* ===== PÁGINA DE RESULTADO DEL TEST ===== */
.result-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}
.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.result-header__info { flex: 1; min-width: 200px; }
.result-header__type {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 4px;
}
.result-header h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--pt-text);
}
.result-header__date {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}
.result-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    text-align: center;
}
.result-score.is-pass {
    background: #dcfce7;
    color: #16a34a;
}
.result-score.is-fail {
    background: #fee2e2;
    color: #dc2626;
}
.result-score__value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}
.result-score__label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}
.result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
@media (max-width: 600px) {
    .result-stats { grid-template-columns: repeat(2, 1fr); }
}
.result-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
}
.result-stat__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}
.result-stat--correct .result-stat__icon { background: #dcfce7; color: #16a34a; }
.result-stat--wrong .result-stat__icon { background: #fee2e2; color: #dc2626; }
.result-stat--blank .result-stat__icon { background: #f1f5f9; color: #64748b; }
.result-stat--total .result-stat__icon { background: #eff6ff; color: #2563eb; }
.result-stat div { display: flex; flex-direction: column; }
.result-stat strong { font-size: 1.3rem; color: var(--pt-text); }
.result-stat span { font-size: 0.85rem; color: #64748b; }
.result-actions {
    margin-bottom: 40px;
}
.result-detail h2 {
    font-size: 1.2rem;
    margin: 0 0 20px;
    color: var(--pt-text);
}
.result-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.result-question {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 2px solid #e2e8f0;
}
.result-question.is-correct { border-color: #86efac; background: #f0fdf4; }
.result-question.is-wrong { border-color: #fca5a5; background: #fef2f2; }
.result-question.is-blank { border-color: #e2e8f0; }
.result-question__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.result-question__num {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}
.result-question__status {
    font-size: 0.85rem;
    font-weight: 600;
}
.result-question.is-correct .result-question__status { color: #16a34a; }
.result-question.is-wrong .result-question__status { color: #dc2626; }
.result-question.is-blank .result-question__status { color: #64748b; }
.result-question__text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--pt-text);
    margin: 0 0 16px;
}
.result-question__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.result-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.result-option.is-correct {
    background: #dcfce7;
    border-color: #86efac;
}
.result-option.is-wrong {
    background: #fee2e2;
    border-color: #fca5a5;
}
.result-option__letter {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.result-option.is-correct .result-option__letter {
    background: #16a34a;
    color: #fff;
}
.result-option.is-wrong .result-option__letter {
    background: #dc2626;
    color: #fff;
}
.result-option__text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--pt-text);
}
.result-option__tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}
.result-option__tag--ok {
    background: #16a34a;
    color: #fff;
}
.result-option__tag--fail {
    background: #dc2626;
    color: #fff;
}
.result-question__feedback {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
}
.result-question__feedback strong {
    display: block;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 6px;
}
.result-question__feedback p {
    margin: 0;
    font-size: 0.9rem;
    color: #78350f;
    line-height: 1.5;
}

.sidebar-list {
    margin: 0;
    padding-left: 20px;
    color: var(--pt-muted);
    line-height: 1.5;
}
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
}
.toast__panel {
    background: #0f172a;
    color: #fff;
    padding: 16px 20px;
    border-radius: 18px;
    box-shadow: 0 25px 45px rgba(15,23,42,0.2);
    display: flex;
    gap: 16px;
    align-items: center;
}
.toast__title {
    font-weight: 700;
}
.toast__msg {
    font-size: 0.9rem;
    opacity: 0.85;
}
.toast__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}
.impugnar-modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.impugnar-modal__panel {
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    width: min(520px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.impugnar-modal__panel textarea {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--pt-border);
    padding: 12px 14px;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}
.impugnar-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.impugnar-modal__header button {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
}
.impugnar-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.test-alert {
    border-radius: 18px;
    padding: 16px 20px;
    font-weight: 600;
}
.test-alert--error {
    background: rgba(239,68,68,0.12);
    color: #b91c1c;
    border: 1px solid rgba(239,68,68,0.25);
}
.justification-card {
    margin-top: 18px;
    border-radius: 16px;
    border: 1px solid rgba(16,185,129,0.25);
    background: rgba(16,185,129,0.05);
    padding: 16px 18px;
}
.justification-card__body {
    margin-top: 8px;
    color: var(--pt-text);
}
@media (max-width: 992px) {
    .test-body {
        grid-template-columns: 1fr;
    }
    .test-hero {
        flex-direction: column;
    }
    .test-hero-stats {
        width: 100%;
        flex-wrap: wrap;
    }
}
@media (max-width: 640px) {
    .stat-card {
        min-width: 120px;
    }
    .question-card,
    .sidebar-card {
        padding: 22px;
    }
    .question-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    .question-actions__main {
        width: 100%;
        justify-content: flex-start;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
}

.exam-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pt-muted);
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 6px;
}
.exam-name strong {
    display:block;
    color: var(--pt-text);
    margin-bottom: 4px;
    font-size: 1rem;
}
.exam-name span {
    color: var(--pt-muted);
    font-size: 0.85rem;
}
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f4f5f7;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

h1 {
    margin-top: 0;
}

.status {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 4px;
}

.status.ok {
    background: #e6ffed;
    color: #046c4e;
}

.status.error {
    background: #ffebeb;
    color: #a12626;
}

/* Layout panel */

.app-body {
    background: #eef1f5;
}

.layout {
    display: flex;
    min-height: 100vh;
    margin-top: 6px; /* pequeño espacio bajo la cabecera */
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 3px solid #f97316; /* naranja */
    padding: 28px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(180deg, rgba(4, 6, 12, 0.2) 0%, rgba(2, 6, 23, 0.78) 100%),
        url('../img/sidebar-day.png');
    background-size: cover;
    background-position: center;
    opacity: 0.9;
    z-index: 0;
    transition: opacity 0.3s ease, filter 0.3s ease, background-image 0.3s ease;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-logo {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 12px;
}

.sidebar-section {
    margin-bottom: 18px;
}

.sidebar-section-title {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #4ade80; /* verde claro */
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.sidebar-section-sub {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fb923c; /* naranja */
    color: #ffffff;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    border-radius: 4px;
    color: rgba(248, 250, 252, 0.92);
    text-decoration: none;
    font-size: 0.9rem;
}

.sidebar-parent > a {
    justify-content: flex-start;
}

.sidebar-menu li:not(.sidebar-parent) > a .sidebar-item-icon {
    display: none;
}

.sidebar-submenu {
    list-style: none;
    margin: 2px 0 4px 18px;
    padding-left: 12px;
    border-left: 1px solid #e5e7eb;
    display: none;
}

.sidebar-parent.is-open > .sidebar-submenu {
    display: block;
}

.sidebar-submenu li {
    margin: 2px 0;
}

.sidebar-submenu a {
    font-size: 0.8rem;
    padding: 3px 4px 3px 8px;
    color: rgba(248, 250, 252, 0.92);
}

.sidebar-parent.is-open > a .sidebar-item-icon {
    transform: rotate(135deg);
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.sidebar-item-icon {
    width: 7px;
    height: 7px;
    border-left: 2px solid rgba(255, 255, 255, 0.6);
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    transform: rotate(-45deg);
    margin-left: 2px;
}

.sidebar-logout a {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: #22c55e;
    color: #ffffff;
    font-weight: 600;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 15px 35px rgba(34, 197, 94, 0.25);
}

.sidebar-logout a:hover {
    background: #16a34a;
}

.sidebar-image {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    justify-content: center;
    max-width: 190px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

.sidebar-image-img {
    width: 190px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.sidebar-image-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: linear-gradient(to top, #111827, #020617);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #facc15;
    font-size: 0.85rem;
    font-weight: 700;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-gradient {
    height: 8px;
    background: linear-gradient(
        to right,
        #2563eb 0%,      /* azul inicio, menos ancho */
        #2563eb 18%,
        #6366f1 45%,     /* morado ocupa más */
        #ef4444 100%     /* rojo final dominante */
    );
    border-bottom: 2px solid #f97316;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.topbar-logo img,
.topbar-logo-img {
    width: 200px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Modo oscuro (panel) */

body.app-body.dark-mode,
body.dark-mode.app-body {
    background: #020617;
}

body.dark-mode .layout {
    background: transparent;
}

body.dark-mode .topbar {
    background: #020617;
    border-bottom-color: #111827;
    color: #e5e7eb;
}

body.dark-mode .topbar-logo {
    color: #e5e7eb;
}

body.dark-mode .topbar-expiration {
    color: #9ca3af;
}

body.dark-mode .sidebar {
    background: #030712;
    border-right-color: #f97316;
    color: #e5e7eb;
}

body.dark-mode .sidebar::before {
    background-image:
        linear-gradient(200deg, rgba(2, 6, 23, 0.35) 0%, rgba(15, 15, 15, 0.8) 100%),
        url('../img/sidebar-night.png');
    opacity: 0.95;
    filter: saturate(1.05);
}

body.dark-mode .sidebar-section-title {
    background: #22c55e;
    color: #052e16;
}

body.dark-mode .sidebar-section-sub {
    background: #ea580c;
    color: #111827;
}

body.dark-mode .sidebar-menu a {
    color: #e5e7eb;
}

body.dark-mode .sidebar-menu a:hover {
    background: #111827;
}

body.dark-mode .sidebar-submenu {
    border-left-color: #1f2937;
}

body.dark-mode .sidebar-item-icon {
    border-color: #9ca3af;
}

body.dark-mode .sidebar-logout a {
    background: #22c55e;
}

body.dark-mode .sidebar-image-placeholder {
    background: linear-gradient(to top, #111827, #020617);
    color: #facc15;
}

body.dark-mode .content {
    color: #e5e7eb;
}

body.dark-mode .btn-secondary {
    border-color: #4b5563;
    background: #111827;
    color: #e5e7eb;
}

.btn-secondary {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #111827;
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.topbar-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.topbar-expiration {
    font-size: 0.75rem;
    color: #6b7280;
}

.content {
    padding: 20px;
}

/* Perfil alumno */

.profile-layout {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 20px;
    align-items: flex-start;
}

.profile-column-left,
.profile-column-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 22px 22px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.profile-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.18);
    transform: translateY(-2px);
}

.profile-avatar-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.profile-avatar-initials {
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #38bdf8, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    font-size: 3rem;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
}

.profile-avatar-img {
    width: 140px;
    height: 140px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
}

.profile-name {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.profile-btn-full {
    width: 100%;
    margin-top: 4px;
}

.profile-change-photo-link {
    display: block;
    margin: 2px auto 0;
    text-align: center;
    font-size: 0.8rem;
    color: #3b82f6;
}

.profile-change-photo-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.profile-card-title {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.profile-card-options {
    padding-top: 14px;
    border-left: 4px solid #22c55e;
}

.profile-options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-option-item::after {
    content: '\203A';
    font-size: 1.1rem;
    color: #9ca3af;
}

.profile-option-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 10px;
}

.profile-option-text {
    flex: 1;
}

.profile-option-item:nth-child(1) .profile-option-icon {
    background: #fef3c7;
    color: #b45309;
}

.profile-option-item:nth-child(2) .profile-option-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.profile-option-item:nth-child(3) .profile-option-icon {
    background: #fee2e2;
    color: #b91c1c;
}

.profile-option-item:hover {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.profile-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
}

.profile-info-value {
    font-size: 0.9rem;
}

.profile-card-stats {
    padding-bottom: 16px;
    border-left: 4px solid #3b82f6;
}

.profile-stats-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.profile-stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.profile-stat-pill {
    min-width: 72px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}

.profile-stat-pill-total {
    background: #0ea5e9;
}

.profile-stat-pill-correct {
    background: #22c55e;
}

.profile-stat-pill-wrong {
    background: #ef4444;
}

.profile-stat-pill-blank {
    background: #f59e0b;
}

.profile-stat-label {
    color: #4b5563;
}

.profile-stats-chart {
    flex: 0 0 220px;
    display: flex;
    justify-content: center;
}

.profile-chart-circle {
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background:
        conic-gradient(#22c55e 0 55%, #f97316 55% 80%, #eab308 80% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.profile-chart-circle::before {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 999px;
    background: #ffffff;
}

.profile-chart-center {
    position: relative;
    text-align: center;
}

.profile-chart-title {
    font-size: 0.9rem;
    color: #6b7280;
}

.profile-chart-value {
    font-size: 1.4rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-stats-layout {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-stats-chart {
        align-self: center;
    }
}

/* Mis Libros (panel alumno) */

.books-page {
    max-width: 980px;
    margin: 0 auto;
}

.books-header {
    margin-bottom: 16px;
}

.books-title {
    margin: 0 0 4px 0;
    font-size: 1.4rem;
}

.books-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
}

.book-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.book-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.18);
    transform: translateY(-2px);
}

.book-cover-wrapper {
    background: #0f172a;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-cover-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 10px;
}

.book-cover-placeholder {
    width: 100%;
    height: 210px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
}

.book-cover-initials {
    font-size: 2.6rem;
    font-weight: 600;
}

.book-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.book-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.book-card-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.book-card-link {
    margin-top: 6px;
    align-self: flex-start;
    font-size: 0.8rem;
    color: #2563eb;
}

.book-card-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.admin-form {
    max-width: 980px;
    margin: 0 auto 24px auto;
}

/* Admin dashboard */

.admin-header {
    margin-bottom: 24px;
}

.admin-title {
    margin: 0 0 4px 0;
    font-size: 1.6rem;
}

.admin-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #6b7280;
}

.admin-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.admin-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.admin-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.admin-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
}

.admin-card-icon-questions {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.admin-card-icon-users {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.admin-card-icon-books {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.admin-card-icon-settings {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.admin-card-icon-questions::before {
    content: 'P'; /* Preguntas */
}

.admin-card-icon-users::before {
    content: 'U'; /* Usuarios */
}

.admin-card-icon-books::before {
    content: 'L'; /* Libros */
}

.admin-card-icon-settings::before {
    content: 'C'; /* Configuración */
}

.admin-card-body {
    flex: 1;
}

.admin-card-title {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
}

.admin-card-text {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

@media (max-width: 640px) {
    .admin-title {
        font-size: 1.4rem;
    }

    .admin-dashboard {
        gap: 14px;
    }

    .admin-card {
        padding: 14px 16px;
    }
}

/* Admin preguntas */

.admin-section-header {
    margin-bottom: 20px;
}

.admin-section-header-with-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.admin-toolbar-filters {
    margin-bottom: 18px;
    justify-content: flex-end;
}

.admin-toolbar-left {
    flex: 0 1 840px; /* ancho máximo del buscador en escritorio */
}

.admin-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.admin-filters-panel {
    width: 100%;
    padding: 10px 12px 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    display: none;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.admin-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-filters-row-top {
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 6px;
}

.admin-filters-row-bottom {
    padding-top: 2px;
}

.admin-filters-search {
    flex: 1 1 420px;
}

.admin-filters-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.admin-filters-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.admin-filters-group-main {
    flex: 1 1 500px;
}

.admin-filters-group-secondary {
    flex: 0 0 auto;
}

.admin-filters-panel.is-open {
    display: flex;
}

.admin-search-input {
    width: 100%;
    max-width: 840px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}

.admin-filter-select {
    padding: 7px 9px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    background: #ffffff;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.icon-btn-primary {
    border: none;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(37,99,235,0.7);
}

.icon-btn-secondary {
    background: #f9fafb;
}

.icon-plus {
    font-size: 1.3rem;
    line-height: 1;
    margin-top: -1px;
}

.icon-filter {
    position: relative;
    display: block;
    width: 16px;
    height: 12px;
}

.icon-filter::before,
.icon-filter::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background: #4b5563;
}

.icon-filter::before {
    top: 0;
    box-shadow: 0 6px 0 #4b5563;
}

.icon-filter::after {
    bottom: 0;
}

.btn-primary {
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(37,99,235,0.7);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: linear-gradient(to right, #1d4ed8, #1d4ed8);
}

.admin-table-wrapper {
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    background: #ffffff;
}

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

.admin-table thead {
    background: #f9fafb;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table col.col-id {
    width: 70px;
}

.admin-table col.col-tema {
    width: 30%;
}

.admin-table col.col-codigo {
    width: 120px;
}

.admin-table col.col-preguntas {
    width: 120px;
}

.admin-table col.col-subtemas {
    width: 220px;
}

.admin-table col.col-acciones {
    width: 220px;
}

.tema-info-card {
    margin-top: 18px;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(37,99,235,0.2);
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(37,99,235,0.05));
    box-shadow: 0 20px 45px rgba(15,23,42,0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tema-info-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.tema-info-card__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    margin: 0;
    color: #2563eb;
    font-weight: 700;
}

.tema-info-card__title {
    margin: 4px 0 0;
    font-size: 1.45rem;
    color: #0f172a;
}

.tema-info-card__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tema-info-card__badge {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(37,99,235,0.12);
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.85rem;
}

.tema-info-card__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.7);
}

.tema-info-card__meta span {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 6px;
}

.tema-info-card__meta strong {
    font-size: 1.1rem;
    color: #0f172a;
}

.tema-info-card__description {
    border-top: 1px solid rgba(148,163,184,0.4);
    padding-top: 16px;
    color: #1f2937;
    line-height: 1.6;
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .tema-info-card {
        padding: 20px;
    }
    .tema-info-card__actions {
        width: 100%;
        justify-content: space-between;
    }
}

.subtema-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subtema-count {
    font-weight: 600;
    color: #1d4ed8;
}

.chip-muted {
    background: rgba(148,163,184,0.2);
    color: #475569;
}

.admin-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.admin-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.admin-table-accordion .exam-year-row td {
    padding: 0;
    border-bottom: none;
    background: #eef2ff;
}

.admin-table-accordion .exam-year-row + .exam-year-item td {
    border-top: none;
}

.exam-year-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e1b4b;
    text-align: left;
}

.exam-year-toggle:hover {
    background: rgba(99,102,241,0.08);
}

.exam-year-count {
    color: #4b5563;
    font-weight: 500;
    font-size: 0.85rem;
}

.exam-year-caret {
    width: 12px;
    height: 12px;
    border-right: 2px solid #4338ca;
    border-bottom: 2px solid #4338ca;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.exam-year-toggle[aria-expanded="false"] .exam-year-caret {
    transform: rotate(-45deg);
}

.exam-year-item.is-hidden {
    display: none;
}

.admin-table-question {
    max-width: 420px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-level-easy {
    background: #dcfce7;
    color: #166534;
}

.badge-level-medium {
    background: #fef9c3;
    color: #854d0e;
}

.badge-level-difficult {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-status-active {
    background: #dcfce7;
    color: #166534;
}

.badge-status-inactive {
    background: #e5e7eb;
    color: #4b5563;
}

.table-actions {
    display: block;
    text-align: right;
}

.admin-table td.table-actions {
    width: 220px;
    min-width: 220px;
    white-space: nowrap;
    text-align: right;
}

.table-actions > * {
    display: inline-flex;
    margin-left: 6px;
    margin-bottom: 6px;
}

.btn-ghost {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-ghost:hover {
    background: #f3f4f6;
}

.btn-ghost-danger {
    border-color: #fecaca;
    color: #b91c1c;
}

@media (max-width: 768px) {
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar-right {
        justify-content: flex-start;
    }

    .admin-filters-row-top {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-filters-actions {
        justify-content: flex-start;
        gap: 6px;
    }

    .table-actions {
        flex-direction: column;
    }
}

/* Admin preguntas - modo oscuro */

body.dark-mode .admin-search-input {
    background: #020617;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .admin-filter-select {
    background: #020617;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .admin-filters-panel {
    background: #020617;
    border-color: #111827;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

body.dark-mode .admin-table-wrapper {
    border-color: #111827;
    background: #020617;
}

body.dark-mode .admin-table thead {
    background: #020617;
}

body.dark-mode .admin-table tbody tr:nth-child(even) {
    background: #020617;
}

body.dark-mode .admin-table th,
body.dark-mode .admin-table td {
    border-bottom-color: #111827;
}

body.dark-mode .btn-ghost {
    background: #020617;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .btn-ghost:hover {
    background: #0f172a;
}

/* Admin formularios (preguntas) */

.admin-form {
    margin-top: 8px;
    max-width: 900px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-form-group-span-2 {
    grid-column: span 2;
}

.admin-form-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.admin-form-input,
.admin-form-textarea {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.admin-form-input:focus,
.admin-form-textarea:focus {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.admin-tree-panel {
    border: 1px solid rgba(148,163,184,0.5);
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    box-shadow: inset 0 1px 3px rgba(15,23,42,0.06);
}

.admin-tree-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(148,163,184,0.35);
}

.admin-tree-search {
    flex: 1 1 280px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5);
    background: #fff;
}

.admin-tree-search-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: #94a3b8;
}

.admin-tree-search-icon svg {
    width: 18px;
    height: 18px;
}

.admin-tree-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.92rem;
    padding: 10px 0;
    color: #0f172a;
}

.admin-tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-tree-action {
    border-radius: 10px;
    border: 1px solid rgba(59,130,246,0.4);
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.admin-tree-action:hover {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    box-shadow: 0 6px 16px rgba(59,130,246,0.15);
}

.admin-tree-action--ghost {
    border-color: rgba(100,116,139,0.4);
    color: #475569;
    background: #fff;
}

.admin-tree-box {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px 0 16px;
}

.admin-tree-box::-webkit-scrollbar {
    width: 8px;
}

.admin-tree-box::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.5);
    border-radius: 999px;
}

.admin-tree-item {
    --indent: calc(var(--tree-level, 0) * 18px);
    padding-left: calc(16px + var(--indent));
}

.admin-tree-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 0;
}

.admin-tree-accordion,
.admin-tree-accordion-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.admin-tree-accordion {
    border: 1px solid rgba(148,163,184,0.7);
    background: #fff;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-tree-accordion-icon {
    width: 10px;
    height: 10px;
    border-left: 2px solid #475569;
    border-bottom: 2px solid #475569;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.admin-tree-item.is-open > .admin-tree-header .admin-tree-accordion-icon {
    transform: rotate(45deg);
}

.admin-tree-accordion-placeholder {
    cursor: default;
}

.admin-tree-label {
    font-size: 0.92rem;
    color: #0f172a;
}

.admin-tree-children {
    display: none;
}

.admin-tree-item.is-open > .admin-tree-children {
    display: block;
}

.admin-tree-empty {
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed rgba(148,163,184,0.6);
    color: #475569;
    background: rgba(248,250,252,0.6);
}

.admin-tree-item:not(.is-hidden) + .admin-tree-item {
    border-top: 1px solid rgba(226,232,240,0.6);
}

.admin-tree-item.is-hidden {
    display: none;
}

.admin-tree-item.is-match > .admin-tree-header .admin-tree-label {
    color: #0ea5e9;
    font-weight: 600;
}

.admin-tree-box.is-filtering .admin-tree-item {
    border-top: none;
}

.admin-form-textarea {
    resize: vertical;
}

.admin-subsection-title {
    margin: 18px 0 4px 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.admin-subsection-help {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.admin-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-answer-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.admin-answer-correct {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.admin-form-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.impugnar-modal__actions {
    display:flex;
    justify-content:flex-end;
    gap:10px;
}

/* ---------- Exam overview layout ---------- */
.panel-section {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--pt-border);
    box-shadow: 0 20px 50px rgba(15,23,42,0.08);
}
.panel-section--padded {
    padding: 32px;
}
.assessment-hero {
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:flex-start;
    gap: 24px;
    margin-bottom: 24px;
}
.panel-empty {
    text-align:center;
    padding: 36px;
    border: 1px dashed var(--pt-border);
    border-radius: 20px;
    background: var(--pt-bg-soft);
    color: var(--pt-muted);
}
.assessment-table-wrapper {
    overflow-x:auto;
}
.assessment-table {
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    background:#fff;
    border-radius:22px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}
.assessment-table thead {
    background: linear-gradient(90deg, rgba(241,245,249,1), rgba(226,232,240,0.9));
}
.assessment-table th {
    padding: 16px 20px;
    text-transform:uppercase;
    letter-spacing:0.05em;
    font-size:0.78rem;
    font-weight:700;
    color: var(--pt-text);
    border-bottom: 1px solid rgba(148,163,184,0.4);
    text-align:center;
}
.assessment-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(226,232,240,0.8);
}
.assessment-table .col-index,
.assessment-table .col-questions,
.assessment-table .col-score,
.assessment-table .col-view,
.assessment-table .col-status,
.assessment-table .col-actions {
    text-align:center;
}
.assessment-table tbody tr:last-child td {
    border-bottom:none;
}
.view-links {
    display:flex;
    justify-content:center;
    gap:10px;
}
.chip {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-width:110px;
    padding:8px 14px;
    border-radius:999px;
    font-weight:600;
    font-size:0.82rem;
    letter-spacing:0.02em;
    text-decoration:none;
    border:1px solid transparent;
    transition:transform 0.15s ease;
}
.chip__icon {
    font-size:0.95rem;
    line-height:1;
}
.chip--ghost {
    background:rgba(148,163,184,0.12);
    color:var(--pt-muted);
    border-color:rgba(148,163,184,0.25);
}
.chip--ghost:not(.chip--disabled):hover {
    transform:translateY(-1px);
}
.chip--info {
    color:var(--pt-primary);
    background:rgba(37,99,235,0.12);
    border-color:rgba(37,99,235,0.25);
}
.chip--rank {
    color:var(--pt-warning-dark);
    background:rgba(245,158,11,0.18);
    border-color:rgba(245,158,11,0.28);
}
.chip--review {
    color:var(--pt-success-dark);
    background:rgba(34,197,94,0.18);
    border-color:rgba(34,197,94,0.28);
}
.chip--disabled {
    opacity:0.4;
    cursor:not-allowed;
}
.chip--score {
    min-width:120px;
}
.chip--score-high {
    background:rgba(34,197,94,0.18);
    border-color:rgba(34,197,94,0.3);
    color:var(--pt-success-dark);
}
.chip--score-mid {
    background:rgba(245,158,11,0.18);
    border-color:rgba(245,158,11,0.28);
    color:var(--pt-warning-dark);
}
.chip--score-low {
    background:rgba(248,113,113,0.18);
    border-color:rgba(248,113,113,0.35);
    color:#b91c1c;
}
.chip--score-muted {
    background:rgba(148,163,184,0.18);
    border-color:rgba(148,163,184,0.3);
    color:var(--pt-muted);
}
.chip--state {
    min-width:130px;
}
.chip--state-open {
    background:rgba(59,130,246,0.1);
    border-color:rgba(59,130,246,0.28);
    color:var(--pt-primary);
}
.chip--state-progress {
    background:rgba(245,158,11,0.18);
    border-color:rgba(245,158,11,0.3);
    color:var(--pt-warning-dark);
}
.chip--state-completed {
    background:rgba(34,197,94,0.18);
    border-color:rgba(34,197,94,0.32);
    color:var(--pt-success-dark);
}
.exam-action-form {
    display:flex;
    flex-direction:column;
    gap:8px;
}
.exam-note {
    font-size:0.8rem;
    color:var(--pt-warning-dark);
}
.badge {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:100px;
    padding:6px 12px;
    border-radius:999px;
    font-weight:600;
    font-size:0.82rem;
    text-transform:uppercase;
}
.badge-success {
    background:rgba(34,197,94,0.16);
    color:var(--pt-success-dark);
}
.badge-warning {
    background:rgba(245,158,11,0.18);
    color:var(--pt-warning-dark);
}
.badge-muted {
    background:rgba(148,163,184,0.2);
    color:var(--pt-muted);
}
.exam-table-wrapper::-webkit-scrollbar {
    height:8px;
}
.exam-table-wrapper::-webkit-scrollbar-track {
    background:#e2e8f0;
    border-radius:999px;
}
.exam-table-wrapper::-webkit-scrollbar-thumb {
    background:#94a3b8;
    border-radius:999px;
}
/* ---------- Mis Test Modern Layout ---------- */
.mytests-page {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.mytests-hero {
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 50%, #14b8a6 100%);
    border-radius: 28px;
    padding: 36px 40px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    box-shadow: 0 20px 55px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
}
.mytests-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    pointer-events: none;
}
.mytests-hero > div {
    position: relative;
    z-index: 1;
}
.mytests-hero h1 {
    margin: 8px 0 4px;
    font-size: 2rem;
}
.mytests-hero p {
    margin: 0;
    opacity: 0.9;
}
.mytests-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 600;
}
.mytests-hero__cta .exam-action-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.mytests-hero__cta .exam-action-btn:hover {
    background: rgba(255,255,255,0.3);
}
.mytests-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.mytests-mode-card {
    background: #fff;
    border: 1px solid var(--pt-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    text-decoration: none;
    color: var(--pt-text);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}
.mytests-mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(15,23,42,0.12);
}
.mytests-mode-card__icon {
    font-size: 1.8rem;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--pt-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mytests-mode-card__label {
    font-weight: 600;
    font-size: 1.05rem;
}
.mytests-mode-card p {
    margin: 4px 0 0;
    color: var(--pt-muted);
    font-size: 0.9rem;
}
.mytests-history-card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid var(--pt-border);
    padding: 28px;
    box-shadow: 0 18px 40px rgba(15,23,42,0.1);
}
.mytests-history-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.mytests-history-card__header h2 {
    margin: 0;
    font-size: 1.4rem;
}
.mytests-history-card__header p {
    margin: 4px 0 0;
    color: var(--pt-muted);
}
.mytests-table-wrapper {
    overflow-x: auto;
}
.mytests-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.mytests-table th,
.mytests-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--pt-border);
}
.mytests-table th {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.78rem;
    color: var(--pt-muted);
}
.mytests-table tbody tr:last-child td {
    border-bottom: none;
}
.mytests-table tbody tr:hover {
    background: var(--pt-bg-soft);
}
.mytests-table-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--pt-primary);
    background: #fff;
    border: 1px solid rgba(37,99,235,0.25);
    box-shadow: 0 8px 18px rgba(15,23,42,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.mytests-table-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15,23,42,0.12);
    color: #0f172a;
}
@media (max-width: 768px) {
    .mytests-hero {
        flex-direction: column;
    }
    .mytests-hero__cta {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .mytests-mode-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}
/* ---------- Exam Detail Modern Layout ---------- */
.exam-detail-modern {
    max-width: 1200px;
    margin: 0 auto;
}
.exam-detail-hero {
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 45%, #14b8a6 100%);
    border-radius: 24px;
    padding: 48px 40px;
    margin-bottom: 32px;
    color: #fff;
    box-shadow: 0 20px 50px rgba(37,99,235,0.25);
    position: relative;
    overflow: hidden;
}
.exam-detail-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}
.exam-detail-hero__content {
    position: relative;
    z-index: 1;
}
.exam-detail-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}
.exam-detail-title {
    font-size: 2.5rem;
    margin: 0 0 12px;
    font-weight: 700;
}
.exam-detail-desc {
    font-size: 1.05rem;
    margin: 0;
    opacity: 0.95;
}
.exam-detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.exam-summary-card {
    background: #fff;
    border: 1px solid var(--pt-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.exam-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(15,23,42,0.12);
}
.appeals-page {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.appeals-hero {
    flex-wrap: wrap;
    align-items: stretch;
}
.appeals-hero__meta {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 16px 20px;
    color: #fff;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
}
.appeals-hero__meta strong {
    font-size: 1rem;
}
.appeals-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.appeals-summary__wide {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .appeals-summary__wide {
        grid-column: span 1;
    }
}
.impugnaciones-filters {
    background: #fff;
    border: 1px solid var(--pt-border);
    border-radius: 20px;
    padding: 18px 22px;
    box-shadow: 0 20px 45px rgba(15,23,42,0.08);
}
.impugnaciones-filters__form {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}
.impugnaciones-filters__info {
    flex: 1 1 240px;
    min-width: 200px;
}
.impugnaciones-filters__info h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 600;
}
.impugnaciones-filters__info p {
    margin: 0;
    color: var(--pt-muted);
    font-size: 0.9rem;
}
.impugnaciones-filters__fields {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.impugnaciones-select {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--pt-muted);
}
.appeals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.appeal-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 80%);
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 24px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 15px 35px rgba(15,23,42,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.appeal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px rgba(15,23,42,0.12);
}
.appeal-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}
.appeal-card__kicker {
    margin: 0;
    color: var(--pt-muted);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.appeal-card__header h3 {
    margin: 4px 0;
    font-size: 1.05rem;
    line-height: 1.3;
}
.appeal-card__header p {
    margin: 0;
    color: var(--pt-muted);
    font-size: 0.85rem;
}
.appeal-card__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.appeal-card__section span {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pt-muted);
    display: block;
    margin-bottom: 6px;
}
.appeal-card__section p {
    margin: 0;
    line-height: 1.4;
}
.appeal-card__section--highlight {
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 18px;
    padding: 14px;
}
.appeal-card__section--answer {
    background: rgba(34,197,94,0.05);
    border: 1px solid rgba(34,197,94,0.15);
    border-radius: 18px;
    padding: 14px;
}
.appeal-card__muted {
    color: var(--pt-muted);
    font-style: italic;
}
.appeals-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 999px;
    border: 2px solid var(--pt-text);
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.appeals-filter-btn:hover {
    background: var(--pt-text);
    color: #fff;
    transform: translateY(-1px);
}
.appeals-filter-btn__icon {
    font-size: 1rem;
    line-height: 1;
}
.exam-summary-card--highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}
.exam-summary-card__icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pt-bg-soft);
    border-radius: 16px;
    flex-shrink: 0;
}
.exam-summary-card--highlight .exam-summary-card__icon {
    background: rgba(255,255,255,0.6);
}
.exam-summary-card__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.exam-summary-card__label {
    font-size: 0.85rem;
    color: var(--pt-muted);
    font-weight: 500;
}
.exam-summary-card__value {
    font-size: 1.5rem;
    color: var(--pt-text);
    font-weight: 700;
}
.exam-detail-status-banner {
    background: #fff;
    border: 2px solid var(--pt-border);
    border-radius: 20px;
    padding: 28px 32px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 32px;
}
.exam-detail-status-banner--info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
}
.exam-detail-status-banner--warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}
.exam-detail-status-banner--success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #34d399;
}
.exam-detail-status-banner__icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}
.exam-detail-status-banner__content h3 {
    margin: 0 0 8px;
    font-size: 1.3rem;
    color: var(--pt-text);
}
.exam-detail-status-banner__content p {
    margin: 0;
    color: var(--pt-muted);
    line-height: 1.6;
}
.exam-class-highlight__meta {
    margin: 0;
    color: var(--pt-muted);
}
.exam-class-table-panel .assessment-table tr.is-current td {
    background: rgba(59,130,246,0.08);
}
.exam-class-table-panel .assessment-table {
    border-radius: 18px;
    overflow: hidden;
}
.exam-class-page .panel-empty {
    margin: 0;
}
.exam-class-table th,
.exam-class-table td {
    text-align: center;
}
.review-modern {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 28px;
    padding: 40px;
    border: 1px solid var(--pt-border);
    box-shadow: 0 25px 60px rgba(15,23,42,0.12);
}
.review-hero {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    align-items: center;
    margin-bottom: 32px;
}
.review-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(16,185,129,0.18);
    color: var(--pt-success-dark);
    padding: 6px 16px;
    border-radius: 999px;
    font-weight: 600;
}
.review-hero h1 {
    margin: 12px 0 6px;
    font-size: 2rem;
}
.review-hero p {
    margin: 0;
    color: var(--pt-muted);
}
.review-hero__stats {
    display: flex;
    gap: 22px;
    background: var(--pt-bg-soft);
    border-radius: 20px;
    padding: 18px 24px;
    border: 1px solid var(--pt-border);
}
.review-hero__stats span {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pt-muted);
}
.review-hero__stats strong {
    display: block;
    font-size: 1.5rem;
    color: var(--pt-text);
    margin-top: 4px;
}
.review-hero__stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.review-hero__stat-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: var(--pt-muted);
    font-weight: 600;
}
.review-hero__stat-icon {
    font-size: 1rem;
}
.review-hero__stat-label {
    display: inline;
}
.review-hero__stat-value {
    font-size: 1.5rem;
    color: var(--pt-text);
}
.review-hero__stat-sub {
    font-size: 0.85rem;
    color: var(--pt-muted);
}
.review-section {
    width: 100%;
}
.review-sidebar-col,
.review-panel-col {
    width: 100%;
}
@media (min-width: 1200px) {
    .review-sidebar-col {
        flex: 0 0 22%;
        max-width: 22%;
    }
    .review-panel-col {
        flex: 0 0 78%;
        max-width: 78%;
    }
}
.review-sidebar {
    border: 1px solid var(--pt-border);
    border-radius: 18px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}
.review-sidebar__title {
    margin: 0 0 16px;
    font-weight: 600;
    color: var(--pt-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.review-sidebar__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.review-nav-chip {
    border: 1px solid var(--pt-border);
    border-radius: 12px;
    padding: 8px;
    font-weight: 600;
    background: var(--pt-bg-soft);
    color: var(--pt-text);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.review-nav-chip.is-correct {
    border-color: rgba(34,197,94,0.35);
    background: rgba(34,197,94,0.12);
    color: var(--pt-success-dark);
}
.review-nav-chip.is-wrong {
    border-color: rgba(248,113,113,0.35);
    background: rgba(248,113,113,0.12);
    color: #b91c1c;
}
.review-nav-chip.is-active {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15,23,42,0.12);
    border-width: 2px;
}
.review-question-stack {
    position: relative;
}
.review-panel {
    display: none;
    border: 1px solid var(--pt-border);
    border-radius: 24px;
    padding: 32px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(15,23,42,0.12);
}
.review-panel.is-visible {
    display: block;
}
.review-panel__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}
.review-panel__kicker {
    display: block;
    color: var(--pt-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    margin-bottom: 6px;
}
.review-panel__header h2 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--pt-text);
}
.review-options {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.review-option {
    border: 1px solid var(--pt-border);
    border-radius: 18px;
    padding: 8px;
    background: var(--pt-bg-soft);
}
.review-option.is-correct {
    border-color: rgba(34,197,94,0.4);
    background: rgba(16,185,129,0.08);
}
.review-option.is-user {
    box-shadow: inset 0 0 0 2px rgba(37,99,235,0.3);
}
.review-option__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.review-option__label {
    font-size: 0.85rem;
    color: var(--pt-muted);
    font-weight: 600;
}
.review-option__pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(16,185,129,0.18);
    color: var(--pt-success-dark);
}
.review-option__pill--user {
    background: rgba(59,130,246,0.18);
    color: var(--pt-primary);
}
.review-feedback {
    margin-top: 24px;
    border: 1px solid rgba(245,158,11,0.4);
    border-radius: 18px;
    padding: 18px;
    background: rgba(254,243,199,0.45);
}
.review-feedback strong {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    color: var(--pt-warning-dark);
}
@media (max-width: 1024px) {
    .review-section {
        grid-template-columns: 260px 1fr;
        gap: 24px;
    }
}
.exam-detail-grid {
margin-bottom: 32px;
}
.exam-detail-section {
    background: #fff;
    border: 1px solid var(--pt-border);
    border-radius: 20px;
    padding: 32px;
}
.exam-detail-section--split {
    display: grid;
    grid-template-columns: 1.55fr 0.45fr;
    gap: 24px;
}
.exam-detail-split-col {
    display: flex;
    flex-direction: column;
}
.exam-detail-section__title {
    font-size: 1.3rem;
    margin: 0 0 20px;
    color: var(--pt-text);
    font-weight: 600;
}
.exam-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.exam-timeline-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.exam-timeline-item__marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pt-primary);
    border: 3px solid #dbeafe;
    flex-shrink: 0;
    margin-top: 4px;
}
.exam-timeline-item__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.exam-timeline-item__label {
    font-size: 0.9rem;
    color: var(--pt-muted);
    font-weight: 500;
}
.exam-timeline-item__date {
    font-size: 1.1rem;
    color: var(--pt-text);
    font-weight: 600;
}
.exam-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.exam-stat-item {
    background: var(--pt-bg-soft);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.exam-stat-item__label {
    font-size: 0.85rem;
    color: var(--pt-muted);
    font-weight: 500;
}
.exam-stat-item__value {
    font-size: 1.8rem;
    color: var(--pt-text);
    font-weight: 700;
}
.exam-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 36px;
}
.exam-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}
.exam-action-btn:hover {
    transform: translateY(-2px);
}
.exam-action-btn--primary {
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 14px 28px rgba(29,78,216,0.25);
    border-color: transparent;
}
.exam-action-btn--primary:hover {
    box-shadow: 0 18px 38px rgba(29,78,216,0.32);
}
.exam-action-btn--secondary {
    background: #fff;
    color: var(--pt-text);
    border-color: var(--pt-border);
}
.exam-action-btn--secondary:hover {
    background: var(--pt-bg-soft);
    box-shadow: 0 8px 20px rgba(15,23,42,0.1);
}
.exam-action-btn__icon {
    font-size: 1.2rem;
}
.exam-action-btn__text {
    font-weight: 600;
}
@media (max-width: 768px) {
    .exam-detail-hero {
        padding: 32px 24px;
    }
    .exam-detail-title {
        font-size: 1.8rem;
    }
    .exam-detail-summary {
        grid-template-columns: 1fr;
    }
    .exam-detail-section--split {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .exam-detail-actions {
        flex-direction: column;
    }
    .exam-action-btn {
        width: 100%;
        justify-content: center;
    }
    .review-modern {
        padding: 24px;
    }
    .review-hero,
    .review-panel__header {
        flex-direction: column;
        align-items: flex-start;
    }
    .review-hero__stats {
        width: 100%;
        flex-wrap: wrap;
    }
    .review-section {
        grid-template-columns: 1fr;
    }
    .review-sidebar__grid {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    }
}

@media (max-width: 900px) {
    .assessment-hero {
        flex-direction:column;
    }
    .col-view,
    .col-status {
        display:none;
    }
}

@media (max-width: 768px) {
    .admin-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-form-group-span-2 {
        grid-column: span 1;
    }

    .admin-answer-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: flex-start;
    }
}

/* Dark mode ajustes para formularios */

body.dark-mode .admin-form-input,
body.dark-mode .admin-form-textarea {
    background: #020617;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .admin-form-label {
    color: #9ca3af;
}

/* Login screen */

.login-body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.35), transparent 55%),
        radial-gradient(circle at bottom right, rgba(239,68,68,0.28), transparent 55%),
        linear-gradient(rgba(2,6,23,0.78), rgba(2,6,23,0.86)),
        url("../img/portada.png") center center / cover no-repeat;
    color: #e5e7eb;
}

.login-overlay {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-wrapper {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.login-title {
    font-size: 3.2rem;
    letter-spacing: 0.22em;
    color: #38bdf8;
    text-shadow:
        0 0 5px rgba(56,189,248,1),
        0 0 15px rgba(56,189,248,0.9),
        0 0 35px rgba(59,130,246,0.9),
        0 0 60px rgba(37,99,235,0.9);
    margin-bottom: 36px;
}

.login-card {
    background: rgba(15,23,42,0.78);
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7);
    border: 1px solid rgba(148,163,184,0.35);
    backdrop-filter: blur(12px);
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"] {
    width: 100%;
    padding: 11px 14px;
    box-sizing: border-box;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(51,65,85,0.9);
    background: transparent;
    color: #e5e7eb;
    font-size: 0.95rem;
}

.login-form input::placeholder {
    color: #6b7280;
}

.btn-login {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(37,99,235,0.8);
}

.btn-login:hover {
    background: linear-gradient(to right, #1d4ed8, #1d4ed8);
}

.login-error {
    margin-bottom: 16px;
}

.login-recover {
    margin-top: 16px;
    text-align: center;
}

.login-recover a {
    color: #f9fafb;
    font-size: 0.85rem;
    text-decoration: none;
    opacity: 0.8;
}

.login-recover a:hover {
    opacity: 1;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .login-wrapper {
        width: 85%;
    }
}

@media (min-width: 1024px) {
    .login-wrapper {
        width: 45%;
    }
}

/* Recuperar contraseña */

.recover-header {
    text-align: center;
    margin-bottom: 24px;
}

.recover-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    margin-bottom: 16px;
}

.recover-icon-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.recover-icon-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.recover-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 8px 0;
}

.recover-subtitle {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

.recover-subtitle strong {
    color: #e2e8f0;
}

.recover-info {
    background: rgba(51, 65, 85, 0.4);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.recover-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
}

.recover-info p + p {
    margin-top: 8px;
}

.recover-info strong {
    color: #e2e8f0;
}

.dev-notice {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.dev-notice p {
    margin: 0 0 12px 0;
    font-size: 0.8rem;
    color: #eab308;
}

/* Responsive */

@media (max-width: 640px) {
    .login-title {
        font-size: 2rem;
        letter-spacing: 0.22em;
    }

    .login-card {
        padding: 24px 18px;
    }

    .recover-title {
        font-size: 1.2rem;
    }

    .recover-subtitle {
        font-size: 0.85rem;
    }

    .recover-icon {
        width: 60px;
        height: 60px;
    }

    .recover-icon svg {
        width: 36px;
        height: 36px;
    }
}

/* Modal */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-container {
    background: #ffffff;
    border-radius: 16px;
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #e5e7eb;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .modal-container {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 18px;
    }

    .modal-title {
        font-size: 1.1rem;
    }
}

body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .modal-container {
    background: #020617;
    border-color: #111827;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #111827;
}

body.dark-mode .modal-title {
    color: #e5e7eb;
}

body.dark-mode .modal-close {
    background: #111827;
    color: #9ca3af;
}

body.dark-mode .modal-close:hover {
    background: #1f2937;
}

/* ===== MODO OSCURO - PÁGINA DE RESULTADOS ===== */
body.dark-mode .result-page {
    color: #e5e7eb;
}

body.dark-mode .result-header h1 {
    color: #e5e7eb;
}

body.dark-mode .result-header__type,
body.dark-mode .result-header__date {
    color: #9ca3af;
}

body.dark-mode .result-score.is-pass {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

body.dark-mode .result-score.is-fail {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

body.dark-mode .result-stat {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .result-stat strong {
    color: #e5e7eb;
}

body.dark-mode .result-stat span {
    color: #9ca3af;
}

body.dark-mode .result-stat--correct .result-stat__icon {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

body.dark-mode .result-stat--wrong .result-stat__icon {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

body.dark-mode .result-stat--blank .result-stat__icon {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .result-stat--total .result-stat__icon {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

body.dark-mode .result-detail h2 {
    color: #e5e7eb;
}

body.dark-mode .result-question {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .result-question.is-correct {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.4);
}

body.dark-mode .result-question.is-wrong {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.4);
}

body.dark-mode .result-question.is-blank {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .result-question__num {
    color: #9ca3af;
}

body.dark-mode .result-question.is-correct .result-question__status {
    color: #4ade80;
}

body.dark-mode .result-question.is-wrong .result-question__status {
    color: #f87171;
}

body.dark-mode .result-question.is-blank .result-question__status {
    color: #9ca3af;
}

body.dark-mode .result-question__text {
    color: #e5e7eb;
}

body.dark-mode .result-option {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .result-option.is-correct {
    background: rgba(22, 163, 74, 0.15);
    border-color: rgba(22, 163, 74, 0.5);
}

body.dark-mode .result-option.is-wrong {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.5);
}

body.dark-mode .result-option__letter {
    background: #334155;
    color: #9ca3af;
}

body.dark-mode .result-option.is-correct .result-option__letter {
    background: #16a34a;
    color: #fff;
}

body.dark-mode .result-option.is-wrong .result-option__letter {
    background: #dc2626;
    color: #fff;
}

body.dark-mode .result-option__text {
    color: #e5e7eb;
}

body.dark-mode .result-question__feedback {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

body.dark-mode .result-question__feedback strong {
    color: #fbbf24;
}

body.dark-mode .result-question__feedback p {
    color: #fcd34d;
}

/* ===== MODO OSCURO - REVISAR TEST / RESULTADO TEST ===== */
body.dark-mode .exam-detail-modern {
    color: #e5e7eb;
}

body.dark-mode .exam-detail-summary {
    gap: 16px;
}

body.dark-mode .exam-summary-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .exam-summary-card:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

body.dark-mode .exam-summary-card--highlight {
    background: linear-gradient(135deg, rgba(251,191,36,0.15) 0%, rgba(245,158,11,0.2) 100%);
    border-color: rgba(251,191,36,0.4);
}

body.dark-mode .exam-summary-card--highlight .exam-summary-card__icon {
    background: rgba(251,191,36,0.2);
}

body.dark-mode .exam-summary-card__icon {
    background: #1e293b;
}

body.dark-mode .exam-summary-card__label {
    color: #9ca3af;
}

body.dark-mode .exam-summary-card__value {
    color: #e5e7eb;
}

body.dark-mode .exam-summary-card__sub {
    color: #9ca3af;
}

body.dark-mode .exam-detail-status-banner {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .exam-detail-status-banner--info {
    background: rgba(37,99,235,0.1);
    border-color: rgba(37,99,235,0.3);
}

body.dark-mode .exam-detail-status-banner__content h3 {
    color: #e5e7eb;
}

body.dark-mode .exam-detail-status-banner__content p {
    color: #9ca3af;
}

body.dark-mode .review-section {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .review-sidebar {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .review-sidebar__title {
    color: #e5e7eb;
}

body.dark-mode .review-nav-chip {
    background: #1e293b;
    border-color: #334155;
    color: #9ca3af;
}

body.dark-mode .review-nav-chip:hover {
    background: #334155;
}

body.dark-mode .review-nav-chip.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

body.dark-mode .review-nav-chip.is-correct {
    background: rgba(22,163,74,0.2);
    border-color: rgba(22,163,74,0.5);
    color: #4ade80;
}

body.dark-mode .review-nav-chip.is-wrong {
    background: rgba(220,38,38,0.2);
    border-color: rgba(220,38,38,0.5);
    color: #f87171;
}

body.dark-mode .review-nav-chip.is-blank {
    background: #1e293b;
    border-color: #334155;
    color: #64748b;
}

body.dark-mode .review-panel {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .review-panel__header {
    border-color: #1e293b;
}

body.dark-mode .review-panel__kicker {
    color: #9ca3af;
}

body.dark-mode .review-panel__header h2 {
    color: #e5e7eb;
}

body.dark-mode .review-option {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .review-option.is-correct {
    background: rgba(22,163,74,0.15);
    border-color: rgba(22,163,74,0.5);
}

body.dark-mode .review-option.is-user:not(.is-correct) {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.5);
}

body.dark-mode .review-option__label {
    color: #9ca3af;
}

body.dark-mode .review-option__pill {
    background: #16a34a;
    color: #fff;
}

body.dark-mode .review-option__pill--user {
    background: #dc2626;
}

body.dark-mode .review-option p {
    color: #e5e7eb;
}

body.dark-mode .review-feedback {
    background: rgba(251,191,36,0.1);
    border-color: rgba(251,191,36,0.3);
}

body.dark-mode .review-feedback strong {
    color: #fbbf24;
}

body.dark-mode .review-feedback p {
    color: #fcd34d;
}

body.dark-mode .exam-detail-actions {
    border-color: #1e293b;
}

body.dark-mode .exam-action-btn--secondary {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .exam-action-btn--secondary:hover {
    background: #1e293b;
}

/* ===== MODO OSCURO - REALIZAR TEST ===== */
body.dark-mode .test-runner {
    color: #e5e7eb;
}

body.dark-mode .test-header__title {
    color: #e5e7eb;
}

body.dark-mode .test-header__type {
    color: #9ca3af;
}

body.dark-mode .test-header__timer {
    background: #2563eb;
}

body.dark-mode .test-header__progress span {
    color: #9ca3af;
}

body.dark-mode .progress-bar {
    background: #1e293b;
}

body.dark-mode .question-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .question-number {
    color: #9ca3af;
}

body.dark-mode .question-text {
    color: #e5e7eb;
}

body.dark-mode .fav-btn {
    background: #1e293b;
    border-color: #334155;
    color: #9ca3af;
}

body.dark-mode .fav-btn:hover {
    border-color: #f87171;
    color: #f87171;
}

body.dark-mode .fav-btn.is-active {
    background: rgba(239,68,68,0.15);
    border-color: #f87171;
    color: #f87171;
}

body.dark-mode .option {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .option:hover {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .option__letter {
    background: #334155;
    color: #9ca3af;
}

body.dark-mode .option__text {
    color: #e5e7eb;
}

body.dark-mode .option.is-selected {
    background: rgba(37,99,235,0.15);
    border-color: #2563eb;
}

body.dark-mode .option.is-selected .option__letter {
    background: #2563eb;
    color: #fff;
}

body.dark-mode .option.is-correct {
    background: rgba(22,163,74,0.15);
    border-color: #16a34a;
}

body.dark-mode .option.is-correct .option__letter {
    background: #16a34a;
    color: #fff;
}

body.dark-mode .option.is-incorrect {
    background: rgba(220,38,38,0.15);
    border-color: #dc2626;
}

body.dark-mode .option.is-incorrect .option__letter {
    background: #dc2626;
    color: #fff;
}

body.dark-mode .sidebar-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .map-btn {
    background: #1e293b;
    border-color: #334155;
    color: #9ca3af;
}

body.dark-mode .map-btn:hover {
    background: #334155;
}

body.dark-mode .map-btn.is-current {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

body.dark-mode .map-btn.is-answered {
    background: #334155;
    color: #e5e7eb;
}

body.dark-mode .map-btn.is-correct {
    background: rgba(22,163,74,0.2);
    border-color: rgba(22,163,74,0.5);
    color: #4ade80;
}

body.dark-mode .map-btn.is-wrong {
    background: rgba(220,38,38,0.2);
    border-color: rgba(220,38,38,0.5);
    color: #f87171;
}

body.dark-mode .finish-btn {
    background: #e5e7eb;
    color: #0f172a;
}

body.dark-mode .finish-btn:hover {
    background: #fff;
}

body.dark-mode .justification-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .justification-card strong {
    color: #e5e7eb;
}

body.dark-mode .justification-card p {
    color: #9ca3af;
}

body.dark-mode .justification-card__body {
    background: rgba(251,191,36,0.1);
    border-color: rgba(251,191,36,0.3);
}

body.dark-mode .justification-card__body span {
    color: #fbbf24;
}

body.dark-mode .justification-card__body p {
    color: #fcd34d;
}

body.dark-mode .toast__panel {
    background: #1e293b;
}

body.dark-mode .impugnar-modal__content {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .impugnar-modal__content h3 {
    color: #e5e7eb;
}

body.dark-mode .impugnar-modal__content textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

/* ===== MODO OSCURO - PÁGINAS DE PRÁCTICA ===== */
body.dark-mode .practice-builder {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .practice-builder h2 {
    color: #e5e7eb;
}

body.dark-mode .practice-builder p {
    color: #9ca3af;
}

body.dark-mode .practice-builder-actions .btn {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .practice-builder-actions .btn:hover {
    background: #334155;
}

/* ===== MODO OSCURO - PERFIL ===== */
body.dark-mode .profile-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .profile-card h3,
body.dark-mode .profile-card h4 {
    color: #e5e7eb;
}

body.dark-mode .profile-card p {
    color: #9ca3af;
}

body.dark-mode .profile-stat {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .profile-stat strong {
    color: #e5e7eb;
}

body.dark-mode .profile-stat span {
    color: #9ca3af;
}

body.dark-mode .profile-option {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .profile-option:hover {
    background: #334155;
}

/* ===== MODO OSCURO - CARDS GENÉRICAS ===== */
body.dark-mode .panel-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .panel-card h2,
body.dark-mode .panel-card h3 {
    color: #e5e7eb;
}

body.dark-mode .panel-card p {
    color: #9ca3af;
}

body.dark-mode .panel-empty {
    color: #64748b;
}

body.dark-mode .chip {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .chip--state-completed {
    background: rgba(22,163,74,0.2);
    color: #4ade80;
}

body.dark-mode .chip--state-progress {
    background: rgba(220,38,38,0.2);
    color: #f87171;
}

body.dark-mode .chip--state-pending {
    background: #1e293b;
    color: #64748b;
}

/* ===== MODO OSCURO - PÁGINAS DE PRÁCTICA (test-rapidos, test-tema, etc.) ===== */
body.dark-mode .practice-builder-page {
    color: #e5e7eb;
}

body.dark-mode .practice-builder-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

body.dark-mode .practice-builder-hero__badge {
    background: rgba(34,197,94,0.2);
    color: #4ade80;
}

body.dark-mode .practice-builder-hero__title {
    color: #e5e7eb;
}

body.dark-mode .practice-builder-hero__subtitle {
    color: #9ca3af;
}

body.dark-mode .practice-summary-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .practice-summary-card__label {
    color: #9ca3af;
}

body.dark-mode .practice-summary-card__value {
    color: #e5e7eb;
}

body.dark-mode .practice-summary-card__sub {
    color: #64748b;
}

body.dark-mode .practice-alert--error {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.4);
    color: #f87171;
}

body.dark-mode .practice-builder-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .practice-card__header h2 {
    color: #e5e7eb;
}

body.dark-mode .practice-card__header p {
    color: #9ca3af;
}

body.dark-mode .practice-field span {
    color: #9ca3af;
}

body.dark-mode .practice-input {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .practice-input:focus {
    border-color: #2563eb;
}

body.dark-mode .practice-toggle {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .practice-toggle:hover {
    background: #334155;
}

body.dark-mode .practice-toggle strong {
    color: #e5e7eb;
}

body.dark-mode .practice-toggle small {
    color: #9ca3af;
}

body.dark-mode .practice-mode-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .practice-mode-card:hover {
    background: #334155;
}

body.dark-mode .practice-mode-card strong {
    color: #e5e7eb;
}

body.dark-mode .practice-mode-card p {
    color: #9ca3af;
}

body.dark-mode .practice-mode-card input:checked + div {
    background: rgba(37,99,235,0.15);
}

body.dark-mode .exam-action-btn--secondary {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .exam-action-btn--secondary:hover {
    background: #1e293b;
}

body.dark-mode .exam-action-btn--primary {
    background: #2563eb;
    color: #fff;
}

body.dark-mode .exam-action-btn--primary:hover {
    background: #1d4ed8;
}

/* ===== MODO OSCURO - MIS TEST (historial) ===== */
body.dark-mode .history-page {
    color: #e5e7eb;
}

body.dark-mode .history-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .history-card:hover {
    border-color: #334155;
}

body.dark-mode .history-card__title {
    color: #e5e7eb;
}

body.dark-mode .history-card__meta {
    color: #9ca3af;
}

body.dark-mode .history-card__score {
    color: #e5e7eb;
}

body.dark-mode .history-card__badge--pass {
    background: rgba(22,163,74,0.2);
    color: #4ade80;
}

body.dark-mode .history-card__badge--fail {
    background: rgba(220,38,38,0.2);
    color: #f87171;
}

body.dark-mode .history-empty {
    color: #64748b;
}

/* ===== MODO OSCURO - EXÁMENES OFICIALES ===== */
body.dark-mode .exams-page {
    color: #e5e7eb;
}

body.dark-mode .exam-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .exam-card:hover {
    border-color: #334155;
}

body.dark-mode .exam-card__title {
    color: #e5e7eb;
}

body.dark-mode .exam-card__meta {
    color: #9ca3af;
}

body.dark-mode .exam-card__badge {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .exam-detail-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

body.dark-mode .exam-detail-badge {
    background: rgba(251,191,36,0.2);
    color: #fbbf24;
}

body.dark-mode .exam-detail-title {
    color: #e5e7eb;
}

body.dark-mode .exam-detail-desc {
    color: #9ca3af;
}

/* ===== MODO OSCURO - PREGUNTAS FAVORITAS ===== */
body.dark-mode .favorites-page {
    color: #e5e7eb;
}

body.dark-mode .favorite-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .favorite-card:hover {
    border-color: #334155;
}

body.dark-mode .favorite-card__text {
    color: #e5e7eb;
}

body.dark-mode .favorite-card__meta {
    color: #9ca3af;
}

body.dark-mode .favorite-card__btn {
    background: #1e293b;
    border-color: #334155;
    color: #9ca3af;
}

body.dark-mode .favorite-card__btn:hover {
    background: #334155;
    color: #f87171;
}

/* ===== MODO OSCURO - IMPUGNACIONES ===== */
body.dark-mode .impugnaciones-page {
    color: #e5e7eb;
}

body.dark-mode .impugnacion-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .impugnacion-card__title {
    color: #e5e7eb;
}

body.dark-mode .impugnacion-card__text {
    color: #9ca3af;
}

body.dark-mode .impugnacion-card__status {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .impugnacion-card__status--pending {
    background: rgba(251,191,36,0.2);
    color: #fbbf24;
}

body.dark-mode .impugnacion-card__status--resolved {
    background: rgba(22,163,74,0.2);
    color: #4ade80;
}

/* ===== MODO OSCURO - TABLAS GENÉRICAS ===== */
body.dark-mode table {
    border-color: #1e293b;
}

body.dark-mode th {
    background: #0f172a;
    color: #9ca3af;
    border-color: #1e293b;
}

body.dark-mode td {
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode tr:hover td {
    background: #1e293b;
}

body.dark-mode tbody tr:nth-child(even) td {
    background: rgba(15,23,42,0.5);
}

/* ===== MODO OSCURO - FORMULARIOS GENÉRICOS ===== */
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="time"],
body.dark-mode select,
body.dark-mode textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: #2563eb;
    outline: none;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #64748b;
}

body.dark-mode label {
    color: #9ca3af;
}

/* ===== MODO OSCURO - ALERTAS Y MENSAJES ===== */
body.dark-mode .alert,
body.dark-mode .notice {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .alert--success {
    background: rgba(22,163,74,0.15);
    border-color: rgba(22,163,74,0.4);
    color: #4ade80;
}

body.dark-mode .alert--error {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.4);
    color: #f87171;
}

body.dark-mode .alert--warning {
    background: rgba(251,191,36,0.15);
    border-color: rgba(251,191,36,0.4);
    color: #fbbf24;
}

body.dark-mode .alert--info {
    background: rgba(37,99,235,0.15);
    border-color: rgba(37,99,235,0.4);
    color: #60a5fa;
}

/* ===== MODO OSCURO - MIS TEST PAGE ===== */
body.dark-mode .mytests-page {
    color: #e5e7eb;
}

body.dark-mode .mytests-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

body.dark-mode .mytests-hero__badge {
    background: rgba(34,197,94,0.2);
    color: #4ade80;
}

body.dark-mode .mytests-hero h1 {
    color: #e5e7eb;
}

body.dark-mode .mytests-hero p {
    color: #9ca3af;
}

body.dark-mode .mytests-mode-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .mytests-mode-card:hover {
    border-color: #334155;
    background: #1e293b;
}

body.dark-mode .mytests-mode-card__icon {
    background: #1e293b;
}

body.dark-mode .mytests-mode-card__label {
    color: #e5e7eb;
}

body.dark-mode .mytests-mode-card p {
    color: #9ca3af;
}

body.dark-mode .mytests-history-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .mytests-history-card__header h2 {
    color: #e5e7eb;
}

body.dark-mode .mytests-history-card__header p {
    color: #9ca3af;
}

body.dark-mode .mytests-table-wrapper {
    border-color: #1e293b;
}

body.dark-mode .mytests-table {
    border-color: #1e293b;
}

body.dark-mode .mytests-table thead {
    background: #0f172a;
}

body.dark-mode .mytests-table th {
    color: #9ca3af;
    border-color: #1e293b;
}

body.dark-mode .mytests-table td {
    color: #e5e7eb;
    border-color: #1e293b;
}

body.dark-mode .mytests-table tbody tr:hover {
    background: #1e293b;
}

body.dark-mode .mytests-table-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .mytests-table-btn:hover {
    background: #334155;
}

body.dark-mode .chip--ghost {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .chip--score {
    background: #1e293b;
}

body.dark-mode .chip--score-high {
    background: rgba(22,163,74,0.2);
    color: #4ade80;
}

body.dark-mode .chip--score-mid {
    background: rgba(251,191,36,0.2);
    color: #fbbf24;
}

body.dark-mode .chip--score-low {
    background: rgba(220,38,38,0.2);
    color: #f87171;
}

/* ===== MODO OSCURO - MODALES ===== */
body.dark-mode .modal-overlay {
    background: rgba(0,0,0,0.8);
}

body.dark-mode .modal-panel {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .modal-header {
    border-color: #1e293b;
}

body.dark-mode .modal-header h3 {
    color: #e5e7eb;
}

body.dark-mode .modal-header p {
    color: #9ca3af;
}

body.dark-mode .modal-close {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .modal-close:hover {
    background: #334155;
    color: #e5e7eb;
}

body.dark-mode .modal-filters {
    background: #0f172a;
}

body.dark-mode .modal-actions {
    border-color: #1e293b;
    background: #0f172a;
}

body.dark-mode .practice-table-head {
    background: #0f172a;
    border-color: #1e293b;
    color: #9ca3af;
}

body.dark-mode .practice-table-row {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .practice-table-row:hover {
    background: #334155;
}

body.dark-mode .practice-table-main span {
    color: #e5e7eb;
}

body.dark-mode .practice-table-count {
    color: #9ca3af;
}

body.dark-mode .practice-table-empty {
    color: #64748b;
}

body.dark-mode .practice-pill {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .practice-pill button {
    color: #9ca3af;
}

body.dark-mode .practice-pill button:hover {
    color: #f87171;
}

body.dark-mode .practice-pill-empty {
    color: #64748b;
}

/* ===== MODO OSCURO - PERFIL ===== */
body.dark-mode .profile-layout {
    color: #e5e7eb;
}

body.dark-mode .profile-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .profile-avatar-initials {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    color: #e5e7eb;
}

body.dark-mode .profile-name {
    color: #e5e7eb;
}

body.dark-mode .profile-subtitle {
    color: #9ca3af !important;
}

body.dark-mode .profile-change-photo-link {
    color: #60a5fa;
}

body.dark-mode .profile-change-photo-link:hover {
    color: #93c5fd;
}

body.dark-mode .profile-card-title {
    color: #e5e7eb;
}

body.dark-mode .profile-options-list {
    border-color: #1e293b;
}

body.dark-mode .profile-option-item {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .profile-option-item:hover {
    background: #334155;
}

body.dark-mode .profile-option-icon {
    color: #9ca3af;
}

body.dark-mode .profile-option-text {
    color: #e5e7eb;
}

body.dark-mode .profile-info-grid {
    border-color: #1e293b;
}

body.dark-mode .profile-info-row {
    border-color: #1e293b;
}

body.dark-mode .profile-info-label {
    color: #9ca3af;
}

body.dark-mode .profile-info-value {
    color: #e5e7eb;
}

body.dark-mode .profile-stats-layout {
    color: #e5e7eb;
}

body.dark-mode .profile-stat-row {
    color: #e5e7eb;
}

body.dark-mode .profile-stat-label {
    color: #9ca3af;
}

body.dark-mode .profile-stat-pill {
    background: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .profile-stat-pill-total {
    background: rgba(37,99,235,0.2);
    color: #60a5fa;
}

body.dark-mode .profile-stat-pill-correct {
    background: rgba(22,163,74,0.2);
    color: #4ade80;
}

body.dark-mode .profile-stat-pill-wrong {
    background: rgba(220,38,38,0.2);
    color: #f87171;
}

body.dark-mode .profile-stat-pill-blank {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .profile-chart-circle {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .profile-chart-title {
    color: #9ca3af;
}

body.dark-mode .profile-chart-value {
    color: #e5e7eb;
}

body.dark-mode .status.success {
    background: rgba(22,163,74,0.15);
    border-color: rgba(22,163,74,0.4);
    color: #4ade80;
}

body.dark-mode .status.error {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.4);
    color: #f87171;
}

/* ===== MODO OSCURO - BOOTSTRAP MODALES ===== */
body.dark-mode .modal-content {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .modal-header {
    border-color: #1e293b;
}

body.dark-mode .modal-title {
    color: #e5e7eb;
}

body.dark-mode .modal-body {
    color: #e5e7eb;
}

body.dark-mode .modal-footer {
    border-color: #1e293b;
}

body.dark-mode .form-label {
    color: #9ca3af;
}

body.dark-mode .form-control {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

body.dark-mode .btn-close {
    filter: invert(1);
}

body.dark-mode .btn-secondary {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .btn-secondary:hover {
    background: #334155;
}

body.dark-mode .btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

body.dark-mode .btn-primary:hover {
    background: #1d4ed8;
}

body.dark-mode .btn-danger {
    background: #dc2626;
    border-color: #dc2626;
}

body.dark-mode .btn-danger:hover {
    background: #b91c1c;
}

body.dark-mode .btn-outline-primary {
    border-color: #2563eb;
    color: #60a5fa;
}

body.dark-mode .btn-outline-primary:hover {
    background: #2563eb;
    color: #fff;
}

/* ===== MODO OSCURO - ADMINISTRACIÓN ===== */
body.dark-mode .admin-section-header {
    color: #e5e7eb;
}

body.dark-mode .admin-title {
    color: #e5e7eb;
}

body.dark-mode .admin-subtitle {
    color: #9ca3af;
}

body.dark-mode .admin-table-wrapper {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-table {
    border-color: #1e293b;
}

body.dark-mode .admin-table thead {
    background: #0f172a;
}

body.dark-mode .admin-table th {
    background: #0f172a;
    color: #9ca3af;
    border-color: #1e293b;
}

body.dark-mode .admin-table td {
    color: #e5e7eb;
    border-color: #1e293b;
}

body.dark-mode .admin-table tbody tr:hover {
    background: #1e293b;
}

body.dark-mode .admin-table tbody tr:nth-child(even) {
    background: rgba(15,23,42,0.5);
}

body.dark-mode .admin-table-question {
    color: #e5e7eb;
}

body.dark-mode .admin-table-empty {
    color: #64748b;
}

body.dark-mode .admin-filters {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-filters-group {
    color: #e5e7eb;
}

body.dark-mode .admin-filter-select {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .admin-filter-select:focus {
    border-color: #2563eb;
}

body.dark-mode .admin-filter-input {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .admin-filter-input:focus {
    border-color: #2563eb;
}

body.dark-mode .admin-form {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-form-group {
    color: #e5e7eb;
}

body.dark-mode .admin-form-label {
    color: #9ca3af;
}

body.dark-mode .admin-form-input {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .admin-form-input:focus {
    border-color: #2563eb;
}

body.dark-mode .admin-form-textarea {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .admin-form-textarea:focus {
    border-color: #2563eb;
}

body.dark-mode .admin-form-input::placeholder,
body.dark-mode .admin-form-textarea::placeholder {
    color: #64748b;
}

body.dark-mode .admin-form-hint {
    color: #64748b;
}

body.dark-mode .admin-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-card-header {
    border-color: #1e293b;
}

body.dark-mode .admin-card-title {
    color: #e5e7eb;
}

body.dark-mode .admin-card-body {
    color: #e5e7eb;
}

body.dark-mode .btn-ghost {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .btn-ghost:hover {
    background: #334155;
}

body.dark-mode .btn-ghost-danger {
    color: #f87171;
}

body.dark-mode .btn-ghost-danger:hover {
    background: rgba(220,38,38,0.2);
    border-color: rgba(220,38,38,0.4);
}

body.dark-mode .badge {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .badge-status-active,
body.dark-mode .badge-success {
    background: rgba(22,163,74,0.2);
    color: #4ade80;
}

body.dark-mode .badge-status-inactive,
body.dark-mode .badge-secondary {
    background: #1e293b;
    color: #9ca3af;
}

body.dark-mode .badge-warning {
    background: rgba(251,191,36,0.2);
    color: #fbbf24;
}

body.dark-mode .badge-danger {
    background: rgba(220,38,38,0.2);
    color: #f87171;
}

body.dark-mode .badge-info {
    background: rgba(37,99,235,0.2);
    color: #60a5fa;
}

body.dark-mode .badge-facil {
    background: rgba(22,163,74,0.2);
    color: #4ade80;
}

body.dark-mode .badge-media {
    background: rgba(251,191,36,0.2);
    color: #fbbf24;
}

body.dark-mode .badge-dificil {
    background: rgba(220,38,38,0.2);
    color: #f87171;
}

body.dark-mode .table-actions {
    color: #e5e7eb;
}

body.dark-mode .admin-pagination {
    color: #e5e7eb;
}

body.dark-mode .admin-pagination a {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .admin-pagination a:hover {
    background: #334155;
}

body.dark-mode .admin-pagination .active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

body.dark-mode .admin-stats-grid {
    color: #e5e7eb;
}

body.dark-mode .admin-stat-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-stat-card:hover {
    border-color: #334155;
}

body.dark-mode .admin-stat-value {
    color: #e5e7eb;
}

body.dark-mode .admin-stat-label {
    color: #9ca3af;
}

body.dark-mode .admin-stat-icon {
    background: #1e293b;
}

body.dark-mode .admin-actions {
    border-color: #1e293b;
}

body.dark-mode .admin-actions-left,
body.dark-mode .admin-actions-right {
    color: #e5e7eb;
}

body.dark-mode .admin-breadcrumb {
    color: #9ca3af;
}

body.dark-mode .admin-breadcrumb a {
    color: #60a5fa;
}

body.dark-mode .admin-breadcrumb a:hover {
    color: #93c5fd;
}

body.dark-mode .admin-alert {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .admin-alert--success {
    background: rgba(22,163,74,0.15);
    border-color: rgba(22,163,74,0.4);
    color: #4ade80;
}

body.dark-mode .admin-alert--error {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.4);
    color: #f87171;
}

body.dark-mode .admin-alert--warning {
    background: rgba(251,191,36,0.15);
    border-color: rgba(251,191,36,0.4);
    color: #fbbf24;
}

body.dark-mode .admin-alert--info {
    background: rgba(37,99,235,0.15);
    border-color: rgba(37,99,235,0.4);
    color: #60a5fa;
}

body.dark-mode .admin-empty-state {
    color: #64748b;
}

body.dark-mode .admin-empty-state-icon {
    color: #334155;
}

body.dark-mode .admin-tabs {
    border-color: #1e293b;
}

body.dark-mode .admin-tab {
    color: #9ca3af;
    border-color: transparent;
}

body.dark-mode .admin-tab:hover {
    color: #e5e7eb;
}

body.dark-mode .admin-tab.active {
    color: #60a5fa;
    border-color: #2563eb;
}

body.dark-mode .admin-panel {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-panel-header {
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .admin-panel-body {
    color: #e5e7eb;
}

body.dark-mode .admin-detail-row {
    border-color: #1e293b;
}

body.dark-mode .admin-detail-label {
    color: #9ca3af;
}

body.dark-mode .admin-detail-value {
    color: #e5e7eb;
}

body.dark-mode .admin-checkbox-group label {
    color: #e5e7eb;
}

body.dark-mode .admin-radio-group label {
    color: #e5e7eb;
}

body.dark-mode .admin-file-input {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .admin-file-input:hover {
    background: #334155;
}

body.dark-mode .admin-preview {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .admin-preview-text {
    color: #e5e7eb;
}

body.dark-mode .admin-help-text {
    color: #64748b;
}

body.dark-mode .admin-divider {
    border-color: #1e293b;
}

body.dark-mode .admin-section {
    border-color: #1e293b;
}

body.dark-mode .admin-section-title {
    color: #e5e7eb;
}

body.dark-mode .admin-list {
    border-color: #1e293b;
}

body.dark-mode .admin-list-item {
    border-color: #1e293b;
    color: #e5e7eb;
}

body.dark-mode .admin-list-item:hover {
    background: #1e293b;
}

body.dark-mode .admin-dropdown {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-dropdown-item {
    color: #e5e7eb;
}

body.dark-mode .admin-dropdown-item:hover {
    background: #1e293b;
}

body.dark-mode .admin-confirm-box {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-confirm-title {
    color: #e5e7eb;
}

body.dark-mode .admin-confirm-text {
    color: #9ca3af;
}

body.dark-mode .admin-confirm-warning {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.4);
    color: #f87171;
}

body.dark-mode .admin-header {
    color: #e5e7eb;
}

body.dark-mode .admin-dashboard {
    color: #e5e7eb;
}

body.dark-mode .admin-card-icon {
    background: #1e293b;
}

body.dark-mode .admin-card-text {
    color: #9ca3af;
}

body.dark-mode .admin-toolbar {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .admin-search-input {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .admin-search-input:focus {
    border-color: #2563eb;
}

body.dark-mode .admin-search-input::placeholder {
    color: #64748b;
}

body.dark-mode .content {
    color: #e5e7eb;
}

body.dark-mode .main {
    background: #020617;
}

body.dark-mode .panel-empty {
    color: #64748b;
}

body.dark-mode .login-error {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.4);
    color: #f87171;
}

body.dark-mode .login-error.success {
    background: rgba(22,163,74,0.15);
    border-color: rgba(22,163,74,0.4);
    color: #4ade80;
}

body.dark-mode .btn-secondary {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .btn-secondary:hover {
    background: #334155;
}

/* ── Sidebar responsive: hamburger, close, backdrop ── */

.topbar-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.topbar-menu-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #334155;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

body.dark-mode .topbar-menu-btn span {
    background: #e5e7eb;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    transition: background 0.2s;
}

.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.32);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-backdrop.is-visible {
    display: block;
}

/* ── Tablet & Mobile: sidebar as overlay (<=1024px) ── */

@media (max-width: 1024px) {
    .topbar-menu-btn {
        display: inline-flex;
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 95;
        transform: translateX(-100%);
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        max-width: 300px;
        width: 82vw;
        border-radius: 0 24px 24px 0;
        box-shadow: none;
    }

    .sidebar.is-open {
        transform: translateX(0);
        pointer-events: auto;
        box-shadow: 8px 0 30px rgba(0,0,0,0.18);
    }

    .layout {
        flex-direction: column;
    }

    .main {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 0 12px;
    }

    .topbar-profile-text {
        display: none;
    }

    .topbar-right .btn-secondary {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}
