:root {
    --brand: #6b2b82;
    --brand-dark: #4d1e60;
    --background: #f5f5f8;
    --surface: #ffffff;
    --text: #252334;
    --muted: #6f6b7a;
    --border: #e5e2e9;
    --warning: #a15c00;
    --warning-bg: #fff3d6;
    --danger: #b42318;
    --danger-bg: #fee4e2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--background);
}

button, input, select, textarea { font: inherit; }

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 3px 14px rgba(38, 27, 48, .06);
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--brand-dark);
    font-weight: 800;
}

.brand img {
    width: 205px;
    height: 54px;
    object-fit: contain;
    object-position: left center;
}

.admin {
    color: var(--muted);
    font-size: 14px;
}

.layout {
    min-height: calc(100vh - 76px);
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
}

.sidebar {
    padding: 22px 14px;
    background: #241c2d;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    margin-bottom: 6px;
    padding: 0 14px;
    color: #d9d2de;
    text-decoration: none;
    border-radius: 10px;
}

.menu-item:hover, .menu-item.active {
    color: white;
    background: #3c2a48;
}

.counter {
    margin-left: auto;
    min-width: 27px;
    padding: 3px 8px;
    text-align: center;
    border-radius: 999px;
    background: #e9d5f1;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.content {
    padding: 30px;
}

.heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.heading h1 {
    margin: 0 0 5px;
    font-size: 30px;
    letter-spacing: -.04em;
}

.heading p {
    margin: 0;
    color: var(--muted);
}

.total {
    min-width: 125px;
    padding: 13px 18px;
    text-align: center;
    border: 1px solid #e3c9eb;
    border-radius: 14px;
    background: #faf4fc;
}

.total strong {
    display: block;
    color: var(--brand);
    font-size: 26px;
}

.total span {
    color: var(--muted);
    font-size: 12px;
}

.info, .success {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 12px;
}

.info {
    color: #734800;
    background: var(--warning-bg);
    border: 1px solid #f5d58d;
}

.success {
    color: #176b3a;
    background: #e7f8ee;
    border: 1px solid #a9e2bf;
}

.cards {
    display: grid;
    gap: 16px;
}

.card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 175px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 9px 28px rgba(43, 31, 51, .07);
}

.card-main { padding: 20px; }

.card-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.group {
    color: var(--brand);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
}

.card h2 {
    margin: 5px 0 0;
    font-size: 21px;
}

.status {
    align-self: flex-start;
    padding: 6px 10px;
    color: var(--warning);
    background: var(--warning-bg);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin: 0;
}

.details div {
    padding: 12px;
    border-radius: 10px;
    background: #faf9fb;
    border: 1px solid #efecf1;
}

.details .wide { grid-column: 1 / -1; }

dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

dd {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: 650;
}

.observations {
    white-space: pre-wrap;
    font-weight: 500;
    line-height: 1.45;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #faf9fb;
    border-left: 1px solid var(--border);
}

.actions form { margin: 0; }

.actions button {
    width: 100%;
}

button {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid #d5d0da;
    border-radius: 9px;
    color: #383240;
    background: white;
    font-weight: 750;
    cursor: pointer;
}

button:hover { background: #f3f0f5; }

button.primary {
    color: white;
    background: var(--brand);
    border-color: var(--brand);
}

button.primary:hover { background: var(--brand-dark); }

button.danger {
    color: var(--danger);
    border-color: #f3b8b4;
    background: var(--danger-bg);
}

.empty {
    padding: 60px 20px;
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.empty div { font-size: 42px; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(22, 15, 27, .58);
}

.modal-backdrop.open { display: flex; }

.modal {
    width: min(570px, 100%);
    padding: 22px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .28);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-header h2 { margin: 0; }
.modal-header p { margin: 4px 0 0; color: var(--muted); }
.modal-header button { border: 0; font-size: 24px; }

label {
    display: block;
    margin: 13px 0 6px;
    font-size: 13px;
    font-weight: 800;
}

select, input, textarea {
    width: 100%;
    border: 1px solid #cec8d2;
    border-radius: 9px;
    outline: none;
}

select, input {
    height: 43px;
    padding: 0 11px;
}

textarea {
    min-height: 95px;
    padding: 11px;
    resize: vertical;
}

select:focus, input:focus, textarea:focus {
    border-color: #9f6db1;
    box-shadow: 0 0 0 4px rgba(107, 43, 130, .11);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
}

@media (max-width: 800px) {
    .brand span, .admin { display: none; }
    .brand img { width: 170px; }

    .layout { grid-template-columns: 1fr; }

    .sidebar {
        display: flex;
        overflow-x: auto;
        padding: 9px;
    }

    .menu-item {
        min-width: max-content;
        margin: 0 5px 0 0;
    }

    .content { padding: 18px; }

    .heading { flex-direction: column; }

    .card { grid-template-columns: 1fr; }

    .actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .details { grid-template-columns: 1fr; }
    .details .wide { grid-column: auto; }
}

.table-card-simple { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 850px; border-collapse: collapse; }
.data-table th {
    padding: 13px 16px; color: var(--muted); background: #faf9fb;
    border-bottom: 1px solid var(--border); font-size: 11px;
    text-align: left; text-transform: uppercase; letter-spacing: .05em;
}
.data-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    vertical-align: top; font-size: 14px;
}
.data-table tbody tr:hover { background: #fcf9fd; }
.import-card { max-width: 700px; padding: 22px; }
.import-card input[type="file"] { padding: 9px; height: auto; }
.filters{display:grid;grid-template-columns:2fr 1fr 1fr auto auto;gap:12px;align-items:center;margin-bottom:20px;padding:18px}.filters input,.filters select,.form-grid input,.form-grid select,.form-grid textarea,.review-card textarea{width:100%;padding:11px;border:1px solid #d5dae1;border-radius:8px;background:#fff}.button-link{padding:10px 14px;border:1px solid #cbd2da;border-radius:8px;text-decoration:none;color:#263238;text-align:center}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:24px;max-width:900px}.form-grid label{display:flex;flex-direction:column;gap:8px;font-weight:600}.form-grid .wide{grid-column:1/-1}.review-list{display:grid;gap:16px}.review-card{padding:20px}.review-head{display:flex;justify-content:space-between;align-items:flex-start}.review-head h2{margin:0}.check-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;margin:18px 0}.check-grid label{padding:10px;border:1px solid #e0e4e8;border-radius:8px;background:#fafbfc}.review-card textarea{margin-bottom:12px;min-height:70px}@media(max-width:900px){.filters{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.check-grid{grid-template-columns:1fr 1fr}}


/* Fichas y acciones de equipos */
.actions { display:flex; gap:8px; flex-wrap:wrap; min-width:180px; }
.small-button, .button-inline {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 11px; border-radius:8px; text-decoration:none; font-weight:700;
  border:1px solid #d6dbe5; background:#fff; color:#24324a; white-space:nowrap;
}
.small-button:hover { background:#f3f6fb; }
.small-button.secondary { background:#f7f8fb; }
.detail-grid { display:grid; grid-template-columns:1.2fr .8fr; gap:18px; margin-bottom:18px; }
.detail-card { padding:22px; margin-bottom:18px; }
.detail-card h2, .table-card-simple h2 { margin:0 0 16px; }
.detail-list { display:grid; grid-template-columns:150px 1fr; gap:10px 16px; margin:0; }
.detail-list dt { font-weight:700; color:#526079; }
.detail-list dd { margin:0; overflow-wrap:anywhere; }
.state-form { display:grid; grid-template-columns:minmax(180px,260px) minmax(260px,1fr) auto; gap:12px; align-items:center; }
.state-form select, .state-form input { width:100%; }
.muted { color:#667085; }
.empty.compact { padding:18px; }
.review-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }
@media (max-width: 900px) {
  .detail-grid { grid-template-columns:1fr; }
  .state-form { grid-template-columns:1fr; }
  .detail-list { grid-template-columns:120px 1fr; }
}


/* Correcciones de maquetación v8 */
.content { min-width: 0; overflow-x: hidden; }
.card.detail-card,
.card.review-card,
.card.table-card-simple { display: block; min-width: 0; }
.detail-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    align-items: start;
}
.detail-card { overflow: visible; }
.detail-list {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    column-gap: 22px;
    row-gap: 14px;
    margin: 0;
}
.detail-list dt,
.detail-list dd { margin: 0; min-width: 0; }
.detail-list dd { overflow-wrap: anywhere; word-break: break-word; }
.state-form {
    display: grid;
    grid-template-columns: minmax(190px, .7fr) minmax(240px, 1.3fr) auto;
    gap: 12px;
    align-items: center;
}
.review-list { min-width: 0; }
.review-card { width: 100%; overflow: visible; }
.review-head { gap: 16px; }
.review-head > div { min-width: 0; }
.review-head h2,
.review-head p { overflow-wrap: anywhere; }
.check-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    width: 100%;
}
.check-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
}
.check-grid input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    padding: 0;
}
.review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.table-card-simple > h2 { padding: 20px 20px 0; }
.empty.compact { padding: 24px 20px; border: 0; }

@media (max-width: 1100px) {
    .layout { grid-template-columns: 210px minmax(0, 1fr); }
    .content { padding: 22px; }
    .detail-grid { grid-template-columns: 1fr; }
    .state-form { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    .detail-list { grid-template-columns: 1fr; row-gap: 6px; }
    .detail-list dd { margin-bottom: 12px; }
    .check-grid { grid-template-columns: 1fr; }
}

/* Gestión académica e importación v10: mantiene la estética v8 */
.filters,.form-grid,.inline-form{display:flex;gap:12px;align-items:end;flex-wrap:wrap}
.form-grid label{display:flex;flex-direction:column;gap:6px;min-width:220px}
.filters input,.filters select,.form-grid input,.form-grid select,.inline-form input{min-height:42px;padding:8px 10px;border:1px solid #bfcbd7;border-radius:8px;background:#fff}
.btn.secondary{background:#e7eef5;color:#18334b}
.actions{display:flex;gap:8px;flex-wrap:wrap;min-width:260px}
.table-wrap{overflow-x:auto}
.mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;white-space:nowrap}
.academic-grid,.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.academic-grid>div,.kpis span{background:#f5f8fb;border-radius:10px;padding:13px}
.academic-grid span{display:block;color:#607084;font-size:.85rem}.academic-grid strong{display:block;margin-top:4px}
.computer-card{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:14px;background:#f5f8fb;border-radius:12px;margin-bottom:12px}
.two-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}
.alert{padding:12px 14px;border-radius:9px;margin-bottom:14px}.alert.ok{background:#e8f7ed;color:#135c2a}.alert.bad{background:#ffe8e8;color:#8b1e1e}
.warning{padding:13px;background:#fff7df;border:1px solid #efd58c;border-radius:9px;margin-bottom:14px}
.row-error{background:#ffe8e8}.row-warning{background:#fff6d9}
.sticky-actions{position:sticky;bottom:0;background:#fff;padding:14px;border-top:1px solid #dbe3eb;display:flex;gap:10px;align-items:center;z-index:20}
.check-inline{display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px}.check-inline input{min-height:auto!important}
.kpis b{font-size:1.5rem;display:block}.section-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
@media(max-width:1050px){.two-cols{grid-template-columns:1fr}.actions{min-width:220px}}
@media(max-width:650px){.form-grid label,.filters input,.filters select{width:100%}.computer-card{align-items:flex-start;flex-direction:column}}

/* v10.3 - Gestión completa de alumnos y maquetación segura */
.management-card {
    display: block;
    width: 100%;
    min-width: 0;
    margin-bottom: 18px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 9px 28px rgba(43,31,51,.06);
}
.heading-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.primary-link { color:#fff; background:var(--brand); border-color:var(--brand); }
.primary-link:hover { color:#fff; background:var(--brand-dark); }
.student-filters {
    display:grid;
    grid-template-columns:repeat(4,minmax(145px,1fr)) minmax(210px,1.4fr) auto;
    gap:14px;
    align-items:end;
}
.student-filters label,.student-edit-form label,.bulk-destination label { margin:0; min-width:0; }
.student-filters select,.student-filters input,.student-edit-form select,.student-edit-form input,.bulk-destination select {
    width:100%; margin-top:7px;
}
.filter-buttons,.bulk-buttons,.form-actions { display:flex; gap:9px; flex-wrap:wrap; align-items:center; }
.bulk-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,.8fr); gap:18px; align-items:center; }
.bulk-panel h2,.create-group-panel h2 { margin:0 0 6px; }
.bulk-panel p,.create-group-panel p { margin:0; color:var(--muted); }
.bulk-help { padding:13px; border-radius:10px; background:#fff7df; border:1px solid #f1d58b; }
.bulk-toolbar { display:flex; justify-content:space-between; gap:18px; align-items:end; }
.bulk-destination { display:grid; grid-template-columns:minmax(180px,1fr) minmax(210px,1.2fr) auto; gap:12px; align-items:end; flex:1; }
.check-option { display:flex!important; flex-direction:row!important; align-items:center; gap:8px; min-height:43px; }
.check-option input { width:20px!important; height:20px!important; margin:0!important; flex:0 0 20px; }
.table-summary { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:0 0 14px; }
.link-button { min-height:auto; padding:4px 8px; border:0; color:var(--brand); background:transparent; }
.student-table { min-width:1180px; }
.select-col { width:44px; }
.student-table input[type=checkbox] { width:20px; height:20px; }
.row-actions { display:flex; gap:7px; flex-wrap:wrap; min-width:210px; }
.badge { display:inline-flex; padding:5px 9px; border-radius:999px; background:#eef1f4; font-size:12px; font-weight:800; }
.badge.ok { color:#176b3a; background:#e7f8ee; }
.badge.off { color:#7a3030; background:#f8e8e8; }
.badge.warning { color:#734800; background:#fff3d6; }
.create-group-panel { display:flex; justify-content:space-between; gap:18px; align-items:center; }
.inline-create { display:flex; gap:10px; min-width:min(420px,100%); }
.inline-create input { flex:1; }
.edit-card { max-width:900px; }
.student-edit-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.student-edit-form .wide { grid-column:1/-1; }
.form-check { align-self:end; }

/* Todas las tarjetas con acciones deben reservar espacio suficiente sin recortarse */
.cards .card {
    grid-template-columns:minmax(0,1fr) minmax(240px,300px);
    align-items:start;
    overflow:visible;
}
.cards .card .actions {
    display:flex;
    flex-direction:column;
    gap:10px;
    min-width:0;
    width:100%;
    padding:16px;
    background:#faf9fb;
    border-left:1px solid var(--border);
}
.cards .card .actions .small-button,.cards .card .actions .button-inline,.cards .card .actions button {
    width:100%; white-space:normal; text-align:center; justify-content:center;
}
.table-scroll { width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.data-table th,.data-table td { white-space:normal; overflow-wrap:anywhere; }
.mono { white-space:nowrap!important; }

@media(max-width:1250px){
    .student-filters { grid-template-columns:repeat(3,minmax(160px,1fr)); }
    .filter-buttons { align-self:end; }
    .bulk-toolbar { align-items:stretch; flex-direction:column; }
}
@media(max-width:980px){
    .student-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .bulk-panel { grid-template-columns:1fr; }
    .bulk-destination { grid-template-columns:1fr 1fr; }
    .create-group-panel { align-items:stretch; flex-direction:column; }
    .inline-create { min-width:0; width:100%; }
    .cards .card { grid-template-columns:1fr; }
    .cards .card .actions { border-left:0; border-top:1px solid var(--border); }
}
@media(max-width:650px){
    .student-filters,.student-edit-form,.bulk-destination { grid-template-columns:1fr; }
    .student-edit-form .wide { grid-column:auto; }
    .filter-buttons,.bulk-buttons,.form-actions,.inline-create { flex-direction:column; align-items:stretch; }
    .filter-buttons > *, .bulk-buttons > *, .form-actions > *, .inline-create > * { width:100%; }
    .management-card { padding:15px; }
}

/* Ajustes v10.4: formularios de alumno y numeración automática */
.auto-number-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 76px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf9fb;
}
.auto-number-box span, .student-edit-form small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.student-edit-form label { min-width: 0; }
@media (max-width: 800px) {
    .student-edit-form, .bulk-destination { grid-template-columns: 1fr !important; }
}


/* Botiquín: acciones y estados sin recortes */
.botiquin-actions {
    display: grid;
    grid-template-columns: minmax(125px, 1fr);
    gap: 8px;
    min-width: 170px;
}
.botiquin-actions form { margin: 0; }
.botiquin-actions button,
.botiquin-actions .small-button {
    width: 100%;
    min-height: 40px;
    white-space: normal;
    text-align: center;
    justify-content: center;
}
.status-available { color: #176b3a; background: #e7f8ee; }
.status-retired { color: #7a271a; background: #fee4e2; }
@media (max-width: 900px) {
    .botiquin-actions { min-width: 145px; }
}


/* Inicio de sesión */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #f5f5f8 0%, #eee6f2 100%);
}
.login-shell { width: min(440px, 100%); }
.login-card {
    padding: 34px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(43, 31, 51, .16);
}
.login-logo {
    display: block;
    width: min(250px, 100%);
    height: 72px;
    margin: 0 auto 22px;
    object-fit: contain;
}
.login-heading { text-align: center; margin-bottom: 24px; }
.login-heading h1 { margin: 0 0 7px; color: var(--brand-dark); font-size: 28px; }
.login-heading p { margin: 0; color: var(--muted); }
.login-form label { margin-top: 15px; }
.login-submit { width: 100%; margin-top: 24px; min-height: 46px; }
.logout-form { margin: 0; }
.logout-button { min-height: 36px; padding: 0 12px; }
@media (max-width: 520px) { .login-card { padding: 24px 20px; } }


/* v10.8 - legibilidad global, ficha de alumno y Botiquín unificado */
.status {
    display:inline-flex!important; align-items:center; justify-content:center;
    min-height:30px; min-width:max-content; max-width:100%; padding:6px 11px!important;
    border-radius:999px; font-size:13px!important; font-weight:800!important;
    line-height:1.15!important; white-space:nowrap!important; overflow-wrap:normal!important;
    background:#fff0cf; color:#8a5200;
}
.status-available { color:#176b3a!important; background:#e7f8ee!important; }
.status-repair { color:#8a5200!important; background:#fff0cf!important; }
.status-retired { color:#8b1e1e!important; background:#ffe4e1!important; }
.student-profile-card,.student-computer-section { overflow:visible; }
.student-profile-card .academic-grid { display:grid; grid-template-columns:repeat(3,minmax(160px,1fr)); gap:14px; }
.student-profile-card .academic-grid>div,.computer-card { padding:18px; border:1px solid var(--border); border-radius:12px; background:#faf9fb; }
.student-computer-section .computer-card { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.assignment-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:end; }
.assignment-form label { display:flex; flex-direction:column; gap:7px; min-width:0; }
.assignment-form .wide,.assignment-actions { grid-column:1/-1; }
.assignment-form select,.assignment-form input,.assignment-form textarea { width:100%; }
.assignment-actions { display:flex; gap:10px; flex-wrap:wrap; }
.botiquin-state-form { display:grid; gap:7px; min-width:230px; }
.botiquin-state-form select,.botiquin-state-form input,.botiquin-state-form button { width:100%; min-height:40px; }
.data-table td { vertical-align:top; }
.data-table th { white-space:nowrap; }
@media(max-width:800px){
 .student-profile-card .academic-grid,.assignment-form{grid-template-columns:1fr;}
 .student-computer-section .computer-card{flex-direction:column;align-items:stretch;}
 .status{white-space:normal!important;text-align:center;}
}

/* Historial de uso 2022-2025 */
.history-highlight { border: 1px solid #d8c5e7; background: #fff; }
.history-highlight h2 { margin-bottom: 6px; }
.history-table { min-width: 980px; table-layout: auto; }
.history-table th { white-space: nowrap; }
.history-table td { vertical-align: top; overflow-wrap: anywhere; }
.history-table .mono { min-width: 135px; white-space: nowrap; }
.history-notes { min-width: 260px; max-width: 520px; line-height: 1.45; }
@media (max-width: 900px) {
  .history-table { min-width: 860px; }
  .history-notes { min-width: 220px; }
}

/* v10.9.1 - navegación uniforme y fichas históricas legibles */
.sidebar { min-width:0; }
.sidebar .menu-item { width:100%; }
.section-header { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; padding:20px 20px 0; }
.section-header h2 { padding:0!important; margin:0 0 5px!important; }
.section-header p { margin:0; }
.history-person-link,.history-equipment-link { color:var(--brand); font-weight:750; text-decoration:none; border-bottom:1px solid transparent; }
.history-person-link:hover,.history-equipment-link:hover { color:var(--brand-dark); border-bottom-color:currentColor; }
.history-table { width:100%; min-width:900px; }
.history-table th,.history-table td { padding:13px 15px; }
.history-table th:nth-child(1){width:105px}.history-table th:nth-child(2){width:110px}
.student-history-table th:nth-child(3){width:145px}.student-history-table th:nth-child(4){width:170px}
.history-notes { min-width:210px; max-width:440px; }
.compact-table { min-width:520px; }
.historical-profile-summary .academic-grid { display:grid; grid-template-columns:repeat(3,minmax(180px,1fr)); gap:14px; }
.historical-profile-summary .academic-grid>div { padding:16px; border:1px solid var(--border); border-radius:12px; background:#faf9fb; }
.historical-profile-summary .academic-grid span { display:block; color:var(--muted); font-size:13px; margin-bottom:7px; }
.historical-note { margin:16px 0 0; }
@media(max-width:800px){
  .historical-profile-summary .academic-grid{grid-template-columns:1fr;}
  .section-header{padding:16px 16px 0;}
  .history-table{min-width:760px;}
}

/* v10.9.2: correo del alumno */
.academic-grid .email-data{min-width:280px;grid-column:span 2}
.academic-grid .email-data a{color:var(--primary,#6f2683);overflow-wrap:anywhere;text-decoration:none}
.academic-grid .email-data a:hover{text-decoration:underline}
@media(max-width:800px){.academic-grid .email-data{grid-column:span 1;min-width:0}}

.teacher-computers-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px;margin:14px 0}.teacher-computers-grid .computer-card{margin:0}.form-card{display:grid;gap:18px;max-width:760px}.form-card label{display:grid;gap:8px;font-weight:700}.form-card input{width:100%}

.active-course-chip { margin-left:auto; margin-right:18px; padding:7px 13px; border:1px solid #dec7e6; border-radius:12px; background:#faf5fc; display:flex; flex-direction:column; line-height:1.1; min-width:118px; }
.active-course-chip span { font-size:11px; color:#6f6375; text-transform:uppercase; letter-spacing:.04em; }
.active-course-chip strong { margin-top:4px; color:var(--brand-dark); font-size:14px; }
.active-course-chip.no-course { background:#fff4e5; border-color:#f0cf92; }
@media (max-width:760px) { .active-course-chip { display:none; } }

/* v10.9.5 · Importación, exportación múltiple y gestión de clases */
.step-title{display:flex;gap:16px;align-items:flex-start;margin-bottom:22px}.step-title>span{display:grid;place-items:center;min-width:38px;height:38px;border-radius:50%;background:#722784;color:#fff;font-weight:800;font-size:18px}.step-title h2{margin:0 0 5px}.step-title p{margin:0;color:#697085}.import-wizard,.export-layout{display:grid;gap:20px}.import-step{padding:26px}.three-fields,.option-grid,.class-create-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.file-drop{border:2px dashed #c7b4ce;border-radius:18px;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;cursor:pointer;background:#fbf9fc;padding:24px}.file-drop:hover{border-color:#722784;background:#f8f1fa}.file-drop input{position:absolute;opacity:0;pointer-events:none}.file-icon{font-size:42px}.file-drop strong{font-size:18px;margin:10px 0 5px}.file-drop small,.option-row small{display:block;color:#6f7485;margin-top:4px}.option-row{display:flex;gap:13px;align-items:flex-start;padding:17px;border:1px solid #ded8e3;border-radius:14px;background:#faf9fb}.option-row input{margin-top:4px}.import-notice{margin-top:16px;padding:16px;border-radius:14px;background:#fff5d8;border:1px solid #edcf74}.wizard-actions,.export-actions{display:flex;justify-content:flex-end;gap:12px}.export-layout{grid-template-columns:minmax(280px,.7fr) minmax(500px,1.3fr)}.export-actions{grid-column:1/-1}.export-settings,.export-classes{padding:26px}.export-settings>label{display:block;margin-bottom:18px}.select-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:18px}.select-tools strong{margin-left:auto;color:#722784}.level-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.level-card{border:1px solid #ded8e3;border-radius:14px;padding:15px;background:#fff}.level-card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.class-checks{display:flex;gap:9px;flex-wrap:wrap}.class-choice input{position:absolute;opacity:0}.class-choice span{display:block;min-width:48px;text-align:center;padding:9px 12px;border:1px solid #cfc6d5;border-radius:10px;cursor:pointer;font-weight:700}.class-choice input:checked+span{background:#722784;color:#fff;border-color:#722784}.export-button{min-width:210px}.class-create-card{padding:26px}.class-create-form{grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end}.promotion-intro,.promotion-action{padding:26px}.promotion-intro{display:grid;grid-template-columns:1.2fr .8fr;gap:24px}.destination-flow{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;gap:14px;align-items:end}.flow-arrow{font-size:24px;font-weight:800;color:#722784;padding-bottom:16px}.field-number{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#ede2f0;color:#722784;margin-right:6px}.compact-option{margin-top:18px}.clear-actions{margin-top:20px;justify-content:flex-end}.muted{color:#777}.create-group-panel{display:none}
@media(max-width:1050px){.export-layout{grid-template-columns:1fr}.export-actions{grid-column:auto}.three-fields,.class-create-form{grid-template-columns:1fr 1fr}.destination-flow{grid-template-columns:1fr}.flow-arrow{display:none}.promotion-intro{grid-template-columns:1fr}}
@media(max-width:700px){.three-fields,.option-grid,.class-create-form,.level-groups{grid-template-columns:1fr}.select-tools strong{margin-left:0;width:100%}}

/* v10.9.6: revisión por curso y clase */
.review-filter-card{background:#fff;border:1px solid #e2dde6;border-radius:18px;padding:24px;margin-bottom:22px;box-shadow:0 8px 24px rgba(31,20,38,.05)}
.review-filter-heading{display:flex;gap:14px;align-items:flex-start;margin-bottom:20px}.review-filter-heading h2{margin:0 0 4px;font-size:20px}.review-filter-heading p{margin:0;color:#6f7485}.filter-step{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#722784;color:#fff;font-weight:800}
.review-filter-grid{display:grid;grid-template-columns:1fr 1fr 1.35fr auto;gap:14px;align-items:end}.review-filter-grid label{display:flex;flex-direction:column;gap:7px;font-weight:700}.review-filter-grid select,.review-filter-grid input{width:100%;min-height:48px;padding:10px 12px;border:1px solid #c9d2dd;border-radius:10px;background:#fff}.review-filter-actions{display:flex;gap:10px;align-items:center}.review-filter-actions .primary,.review-filter-actions .button-link{min-height:48px;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
@media(max-width:1050px){.review-filter-grid{grid-template-columns:1fr 1fr}.review-filter-actions{grid-column:1/-1}}
@media(max-width:650px){.review-filter-grid{grid-template-columns:1fr}.review-filter-actions{grid-column:auto;flex-direction:column;align-items:stretch}}


/* v10.9.8 - sesión, registro de actividad y usuarios */
.session-user {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0 14px;
    border-right: 1px solid #e8e1ec;
}

.session-user span {
    font-size: .72rem;
    color: #786b7c;
}

.session-user strong {
    font-size: .92rem;
    color: #251a2f;
}

/* Filtros del registro: una sola fila, alineados ligeramente a la izquierda */
.audit-filters {
    display: grid;
    grid-template-columns:
        minmax(220px, .9fr)
        minmax(230px, 1fr)
        minmax(360px, 2.1fr)
        auto;
    gap: 18px;
    align-items: end;
    width: 100%;
    min-width: 0;
    margin: 0 0 24px;
    padding: 18px 16px;
    overflow: visible;
}

.audit-filter-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.audit-filter-field label {
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.audit-filter-field input,
.audit-filter-field select {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #ccd3df;
    border-radius: 12px;
    background: #fff;
    font: inherit;
}

.audit-filter-field input:focus,
.audit-filter-field select:focus {
    border-color: #9f6db1;
    box-shadow: 0 0 0 4px rgba(107, 43, 130, .11);
}

.audit-search-main small {
    display: block;
    min-height: 18px;
    margin-top: 2px;
    color: #6f6572;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

.audit-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    padding-bottom: 20px;
    white-space: nowrap;
}

.audit-filter-actions .btn {
    min-height: 48px;
}

.audit-clear-link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    color: var(--brand);
    text-decoration: underline;
}

.audit-table {
    min-width: 1200px;
}

.audit-detail {
    min-width: 340px;
    max-width: 560px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #584e5c;
}

.audit-module {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f0e7f4;
    color: #67247b;
    font-size: .78rem;
    font-weight: 800;
}

.nowrap {
    white-space: nowrap;
}

.status-pill.status-ok {
    background: #e3f6e9;
    color: #186a35;
}

.status-pill.status-error {
    background: #ffe6e3;
    color: #9f2921;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 18px;
}

/* Gestión de usuarios */
.user-create-card {
    margin-bottom: 24px;
}

.user-create-card h2,
.security-note h2 {
    margin-top: 0;
}

.user-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.user-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: 700;
}

.user-form input,
.user-form select {
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #ccd3df;
    border-radius: 12px;
    background: #fff;
    font: inherit;
}

.user-form .check-field {
    flex-direction: row;
    align-items: center;
    padding-bottom: 13px;
}

.user-form .check-field input {
    width: 18px;
    height: 18px;
    min-height: auto;
}

.security-note {
    margin-top: 24px;
}

@media (max-width: 1180px) {
    .audit-filters {
        grid-template-columns: 1fr 1fr;
    }

    .audit-search-main {
        grid-column: 1 / -1;
    }

    .audit-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        padding-bottom: 0;
    }

    .user-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .audit-filters,
    .user-form {
        grid-template-columns: 1fr;
    }

    .audit-search-main,
    .audit-filter-actions {
        grid-column: auto;
    }

    .audit-filter-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .session-user {
        display: none;
    }
}

/* Auditoría detallada v10.10 */
.audit-list{display:grid;gap:18px}.audit-entry{padding:22px}.audit-entry-head{display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}.audit-entry h3{margin:14px 0 8px}.audit-entity{margin:0 0 16px}.audit-change-grid{display:grid;grid-template-columns:1fr 1.2fr 1fr;gap:14px}.audit-state-box{border:1px solid #ddd7e5;border-radius:14px;background:#faf9fc;padding:14px;min-width:0}.audit-state-box h4{margin:0 0 10px}.audit-state-box pre{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-size:.92rem;line-height:1.45}.audit-changes-box{background:#fff8e8;border-color:#efcf87}.audit-technical{margin-top:14px;border-top:1px solid #ece7f0;padding-top:12px}.audit-technical summary{cursor:pointer;font-weight:700;color:#6f2788}.audit-technical p{margin:8px 0;overflow-wrap:anywhere}@media(max-width:1050px){.audit-change-grid{grid-template-columns:1fr}} 

/* Auditoría v10.10.1: las tarjetas generales usan dos columnas; aquí deben ocupar todo el ancho. */
.audit-page { min-width: 0; }
.audit-list { display: grid; gap: 18px; min-width: 0; }
.audit-entry.card { display: block; width: 100%; min-width: 0; padding: 22px; overflow: visible; }
.audit-entry-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.audit-who { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.audit-entry h3 { margin: 14px 0 10px; font-size: 1.25rem; }
.audit-entity { margin: 0 0 16px; padding: 13px 15px; border-radius: 12px; background: #f6f2f8; border: 1px solid #e5dbe9; }
.audit-entity p { margin: 5px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.audit-change-main { width: 100%; min-width: 0; padding: 17px; border: 1px solid #e8bd5d; border-radius: 14px; background: #fff8e8; }
.audit-change-main h4 { margin: 0 0 12px; font-size: 1.05rem; }
.audit-change-main pre,
.audit-state-box pre { margin: 0; white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; font: inherit; line-height: 1.55; }
.audit-snapshots { margin-top: 14px; }
.audit-snapshots > summary,
.audit-technical > summary { cursor: pointer; font-weight: 800; color: #6f2788; padding: 7px 0; }
.audit-before-after { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; margin-top: 10px; }
.audit-state-box { min-width: 0; padding: 15px; border: 1px solid #ddd7e5; border-radius: 14px; background: #faf9fc; }
.audit-state-box h4 { margin: 0 0 10px; }
.audit-technical { margin-top: 14px; border-top: 1px solid #ece7f0; padding-top: 8px; }
.audit-technical p { margin: 8px 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .audit-before-after { grid-template-columns: 1fr; }
}

.heading-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.revision-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; min-width:360px; }
.revision-actions form { display:flex; gap:6px; align-items:center; margin:0; }
.revision-actions input { min-width:170px; }
.equipment-form { display:grid; gap:18px; max-width:900px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.form-grid label,.equipment-form>.wide { display:grid; gap:7px; font-weight:700; }
.check-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.check-grid label { padding:12px; border:1px solid var(--border); border-radius:10px; background:#faf9fb; }
.active-computers-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:14px; }
.active-computers-grid .computer-card { display:flex; justify-content:space-between; gap:16px; border:1px solid var(--border); border-radius:12px; padding:14px; }
.student-old-course { background:#fff8e8; }
.course-warning { display:block; margin-top:4px; color:#9a5b00; font-weight:800; font-size:11px; }
.assignment-search { grid-template-columns:repeat(5,minmax(0,1fr)); }
@media (max-width: 1000px) { .form-grid,.check-grid,.assignment-search { grid-template-columns:1fr 1fr; } .revision-actions { min-width:260px; } }
@media (max-width: 700px) { .form-grid,.check-grid,.assignment-search { grid-template-columns:1fr; } }

/* Curso nuevo 2026-2027: gestión compacta y segura por clases */
.course-progress-card{display:grid;grid-template-columns:150px 190px 180px minmax(260px,1fr);gap:12px;align-items:stretch;margin:0 0 18px}.course-progress-card>div{background:#fff;border:1px solid #e1dce6;border-radius:13px;padding:14px 16px;min-width:0}.course-progress-card span{display:block;color:#707487;font-size:.82rem;margin-bottom:5px}.course-progress-card strong{font-size:1.25rem}.course-progress-card .pending-count{background:#fff8e8;border-color:#efcf87}.course-progress-card .pending-count strong{color:#9b6500}.course-progress-card .course-progress-message{display:flex;align-items:center}.course-progress-card .course-progress-message strong{font-size:.92rem;line-height:1.35}.active-only-filters{grid-template-columns:1fr 1fr .8fr 1.25fr;align-items:end}.pending-filter{grid-column:1/4;display:flex!important;flex-direction:row!important;align-items:center;gap:9px!important;font-weight:600!important}.pending-filter input{width:auto!important}.active-only-filters .filter-buttons{grid-column:4;display:flex;justify-content:flex-end;gap:8px}.compact-student-table{min-width:980px}.compact-student-table th,.compact-student-table td{padding:9px 10px}.class-group-row td{background:#f4eef7!important;border-top:2px solid #d8c5df;padding:8px 10px!important}.class-group-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.class-group-title strong{color:#642473}.student-list-card .table-summary{display:flex;justify-content:space-between;align-items:center;gap:12px}.table-tools{display:flex;gap:8px;flex-wrap:wrap}.course-warning{display:block;margin-top:4px;color:#906b00;max-width:190px}.compact-destination{grid-template-columns:minmax(180px,.8fr) auto minmax(180px,1fr) auto minmax(150px,.7fr)}
@media(max-width:1200px){.course-progress-card{grid-template-columns:repeat(3,1fr)}.course-progress-card .course-progress-message{grid-column:1/-1}.active-only-filters{grid-template-columns:1fr 1fr}.pending-filter,.active-only-filters .filter-buttons{grid-column:auto}.compact-destination{grid-template-columns:1fr}.compact-destination .flow-arrow{display:none}}
@media(max-width:760px){
    .course-progress-card{grid-template-columns:1fr 1fr}
    .course-progress-card .course-progress-message{grid-column:1/-1}
    .active-only-filters{grid-template-columns:1fr}
    .student-list-card .table-summary{align-items:flex-start;flex-direction:column}
}

/* =========================================================
   GESTIÓN DE USUARIOS
   ========================================================= */

.users-page {
    min-width: 0;
}


/* Evita que las tarjetas de usuarios hereden
   la distribución general de dos columnas */
.user-create-card,
.users-table-card {
    display: block !important;
    width: 100%;
    min-width: 0;
    overflow: visible !important;
}


/* CABECERAS DE SECCIÓN */

.users-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 22px 24px;

    border-bottom: 1px solid var(--border);
}

.users-section-title h2 {
    margin: 0 0 5px;
}

.users-section-title p {
    margin: 0;
    color: var(--muted);
}


/* CREAR USUARIO */

.user-create-card {
    margin-bottom: 24px;
}

.user-form {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(180px, 1fr));

    gap: 18px;

    padding: 24px;
}

.user-form label {
    display: flex;
    flex-direction: column;

    gap: 8px;

    min-width: 0;

    margin: 0;

    font-weight: 700;
}

.user-form input,
.user-form select {
    width: 100%;
    min-width: 0;
    height: 46px;

    padding: 0 12px;
}

.user-form .check-field {
    flex-direction: row;
    align-items: center;

    gap: 10px;

    min-height: 46px;

    padding-top: 24px;
}

.user-form .check-field input {
    width: 20px;
    height: 20px;

    min-height: auto;

    margin: 0;
}

.user-create-actions {
    display: flex;
    align-items: end;
}

.user-create-actions button {
    min-width: 160px;
}


/* TABLA */

.users-table-card {
    margin-bottom: 30px;
}

.users-table {
    width: 100%;

    /* Hace que la tabla tenga espacio suficiente.
       Si la pantalla es pequeña aparecerá scroll horizontal. */
    min-width: 1250px;
}

.users-table th,
.users-table td {
    padding: 13px 14px;

    vertical-align: middle;
}


/* Anchos de columnas */

.user-id-column {
    width: 60px;
}

.user-name-column {
    min-width: 130px;
}

.user-fullname-column {
    min-width: 160px;
}

.user-email-column {
    min-width: 200px;
}

.user-role-column {
    min-width: 130px;
}

.user-status-column {
    min-width: 115px;
}

.user-access-column {
    min-width: 165px;
}

.user-actions-column {
    min-width: 260px;
}


/* Usuario */

.user-login {
    white-space: nowrap;
    color: var(--brand-dark);
}


/* Correo */

.user-email {
    min-width: 200px;

    overflow-wrap: anywhere;
}


/* Último acceso */

.user-last-access {
    white-space: nowrap !important;
}


/* Rol */

.user-role {
    display: inline-flex;

    padding: 6px 10px;

    border-radius: 999px;

    background: #eef1f4;

    white-space: nowrap;

    font-size: 12px;

    font-weight: 800;
}

.user-role.admin-role {
    color: var(--brand-dark);

    background: #f0e4f4;
}


/* ACCIONES */

.user-row-actions {
    display: flex;
    flex-direction: column;

    gap: 9px;

    min-width: 230px;
}

.user-row-actions form {
    margin: 0;
}

.user-row-actions > form > button {
    width: 100%;
}


/* CAMBIO DE CONTRASEÑA */

.password-change {
    width: 100%;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: #faf9fb;
}

.password-change summary {
    padding: 10px 12px;

    cursor: pointer;

    color: var(--brand);

    font-size: 13px;

    font-weight: 800;

    user-select: none;
}

.password-change[open] summary {
    border-bottom: 1px solid var(--border);
}

.password-change-form {
    display: grid;

    gap: 12px;

    padding: 13px;
}

.password-change-form label {
    display: grid;

    gap: 6px;

    margin: 0;

    font-size: 12px;

    font-weight: 700;
}

.password-change-form input {
    width: 100%;
    min-width: 0;
    height: 40px;

    padding: 0 10px;
}

.password-change-form button {
    width: 100%;
}


/* TABLET */

@media (max-width: 1050px) {

    .user-form {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* MÓVIL */

@media (max-width: 700px) {

    .users-section-title {
        align-items: flex-start;
        flex-direction: column;

        padding: 18px;
    }

    .user-form {
        grid-template-columns: 1fr;

        padding: 18px;
    }

    .user-form .check-field {
        padding-top: 0;
    }

    .user-create-actions button {
        width: 100%;
    }
}

/* v10.11.1 - visualización de pendientes/colocados y exportación preparada */
.filter-panel { display:block!important; overflow:visible!important; }
.student-view-switch {
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid var(--border);
}
.student-view-label { color:var(--muted); font-size:13px; font-weight:800; margin-right:2px; }
.student-view-button {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:42px;
    padding:8px 13px;
    border:1px solid #d8d0dc;
    border-radius:10px;
    background:#fff;
    color:var(--text);
    text-decoration:none;
    font-weight:750;
    white-space:nowrap;
}
.student-view-button strong {
    display:inline-grid;
    place-items:center;
    min-width:28px;
    min-height:24px;
    padding:2px 7px;
    border-radius:999px;
    background:#f0edf2;
    color:var(--brand-dark);
    font-size:12px;
}
.student-view-button.active {
    color:#fff;
    background:var(--brand);
    border-color:var(--brand);
}
.student-view-button.active strong { background:#fff; color:var(--brand-dark); }
.export-settings label,
.export-classes label { min-width:0; }
.export-settings select { width:100%; }
.export-settings .option-grid { align-items:start; }
.field-help { display:block; margin-top:7px; color:var(--muted); font-size:12px; line-height:1.4; }
.export-layout { width:100%; min-width:0; }
.export-settings,
.export-classes { min-width:0; overflow:visible; }
.level-card { min-width:0; }
.class-checks { min-width:0; }
@media(max-width:900px){
    .student-view-switch { align-items:stretch; }
    .student-view-label { width:100%; }
    .student-view-button { flex:1 1 180px; }
}
@media(max-width:650px){
    .student-view-button { width:100%; flex-basis:100%; }
    .export-actions { flex-direction:column-reverse; align-items:stretch; }
    .export-actions > * { width:100%; }
}


/* v10.11.2 - curso en preparación editable y filtros simplificados */
.active-only-filters { grid-template-columns: 1fr 1fr .8fr 1.25fr; }
.active-only-filters .filter-buttons { grid-column: 1 / -1; justify-content:flex-end; }
.student-view-switch { margin-top: 16px; }
.course-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.course-actions form { margin:0; }
.course-actions .btn { white-space:nowrap; }
@media(max-width:1200px){
  .active-only-filters { grid-template-columns:1fr 1fr; }
  .active-only-filters .filter-buttons { grid-column:1 / -1; }
}
@media(max-width:760px){
  .active-only-filters { grid-template-columns:1fr; }
  .active-only-filters .filter-buttons { grid-column:auto; justify-content:stretch; }
  .active-only-filters .filter-buttons > * { flex:1 1 auto; }
}

/* === Filtros especiales y exportación PDF de ordenadores === */
.equipment-filters{display:grid;grid-template-columns:minmax(220px,1.6fr) minmax(170px,1fr) minmax(170px,1fr) minmax(190px,1fr) auto auto;gap:12px;align-items:end}
.equipment-filters .important-filter{font-weight:700;border-width:2px}
.compact-export-card{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px}
.compact-export-card h2{margin:0 0 4px}
.compact-export-card p{margin:0;color:var(--muted,#64748b)}
.compact-name-class-table{max-width:760px;margin:0 auto}
.compact-name-class-table th:last-child,.compact-name-class-table td:last-child{text-align:right;width:220px}
.parent-alert-check{border:1px solid #f0c36d;border-radius:10px;padding:10px 12px;background:#fffaf0}
.history-edit-details summary{cursor:pointer;font-weight:700;white-space:nowrap}
.history-inline-form{display:grid;grid-template-columns:repeat(2,minmax(140px,1fr));gap:8px;min-width:360px;margin-top:10px}
.history-inline-form label{display:flex;flex-direction:column;gap:4px;font-size:.82rem}
.history-inline-form label:nth-child(3){grid-column:1/-1}
.history-inline-form button{grid-column:1/-1;justify-self:start}
.history-edit-table td{vertical-align:top}
.row-actions form{display:inline-flex;margin:0}

@media (max-width:1100px){.equipment-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.equipment-filters button,.equipment-filters .button-link{width:100%;justify-content:center}.compact-export-card{align-items:flex-start;flex-direction:column}}
@media (max-width:700px){.equipment-filters{grid-template-columns:1fr}.compact-name-class-table th:last-child,.compact-name-class-table td:last-child{width:auto}.history-inline-form{grid-template-columns:1fr;min-width:260px}.history-inline-form label:nth-child(3),.history-inline-form button{grid-column:1}}


/* === Listados WMac y nombres completos en una sola línea === */
.person-name-cell,
.person-name-cell a,
.compact-name-class-table td:first-child,
.compact-name-class-table td:first-child a {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.person-name-cell {
    min-width: 280px;
}

.wmac-list-table,
.wmac-professor-table {
    width: 100%;
    min-width: 760px;
}

.wmac-list-table th,
.wmac-list-table td,
.wmac-professor-table th,
.wmac-professor-table td {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.wmac-list-table .person-name-cell,
.wmac-professor-table .person-name-cell {
    min-width: 300px;
}

.professor-filters {
    display: grid;
    grid-template-columns: minmax(250px,1.5fr) minmax(150px,.8fr) minmax(180px,.9fr) auto auto;
    gap: 12px;
    align-items: end;
}

@media (max-width: 900px) {
    .professor-filters {
        grid-template-columns: 1fr 1fr;
    }
    .professor-filters input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .professor-filters {
        grid-template-columns: 1fr;
    }
    .professor-filters input {
        grid-column: auto;
    }
}
