/*  TABLA DE ASIGNATURAS  */
.asig-header {
    display: grid;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--color-bg-subtle, #f3f4f6);
    border-radius: 8px 8px 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.asig-row {
    display: grid;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    transition: background .15s;
}

.asig-row:hover {
    background: var(--color-bg-subtle, #f9fafb);
}

/* Columnas según modo: simple=3, creditos/porcentaje=4 */
.cols-simple {
    grid-template-columns: 2.5fr 1fr 0.8fr 0.4fr;
}

.cols-peso {
    grid-template-columns: 2.2fr 1fr 0.8fr 0.8fr 0.4fr;
}

.asig-row input[type="text"],
.asig-row input[type="number"] {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border: 1.5px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: var(--color-bg, #fff);
    color: var(--color-text, #1f2937);
    font-family: inherit;
    box-sizing: border-box;
}

.asig-row input:focus {
    outline: none;
    border-color: #2563eb;
}

.nota-cell {
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

.nota-aprobada {
    color: #10b981;
}

.nota-suspensa {
    color: #ef4444;
}

.btn-del {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background .15s;
}

.btn-del:hover {
    background: #fee2e2;
}

.btn-secondary {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1.5px solid #2563eb;
    background: transparent;
    color: #2563eb;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #2563eb;
    color: #fff;
}

/* Detalle */
.det-row {
    display: grid;
    grid-template-columns: 2.5fr 0.8fr 0.8fr 1.2fr;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    font-size: 0.84rem;
    align-items: center;
}

.det-row.det-header {
    background: var(--color-bg-subtle, #f3f4f6);
    border-radius: 6px 6px 0 0;
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--color-text-muted, #6b7280);
    text-transform: uppercase;
}

.det-row.det-total {
    font-weight: 700;
    background: var(--color-bg-subtle, #f3f4f6);
}

.badge-nota {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-aprobado {
    background: #d1fae5;
    color: #065f46;
}

.badge-notable {
    background: #dbeafe;
    color: #1e40af;
}

.badge-sobres {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-suspenso {
    background: #fee2e2;
    color: #991b1b;
}

.badge-mh {
    background: #fef9c3;
    color: #713f12;
}

/* Barra de nota en detalle */
.nota-bar {
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    margin-top: 3px;
}

.nota-bar-fill {
    height: 100%;
    border-radius: 3px;
}

@media (max-width: 600px) {
    .cols-simple {
        grid-template-columns: 2fr 1fr 0.6fr 0.4fr;
    }

    .cols-peso {
        grid-template-columns: 1.8fr 1fr 0.7fr 0.5fr 0.4fr;
    }

    .det-row {
        grid-template-columns: 2fr 0.7fr 1fr;
    }

    .det-row>*:nth-child(3) {
        display: none;
    }
}