/* ─────────────────────────────────────────────────────────
   SenseiPanel · Hoja de estilos única
   ───────────────────────────────────────────────────────── */

:root {
    --bg:        #f5f6fa;
    --card:      #ffffff;
    --text:      #1f2937;
    --muted:     #6b7280;
    --line:      #e5e7eb;
    --primary:   #0f172a;
    --primary-2: #1e293b;
    --ink:       #0f172a;
    /* v4.10.0 · El acento pasa a ser el ROJO DE MARCA (#8e0b1d) y deja de
       confundirse con el rojo de error (--bad). Para usos sobre fondo oscuro
       (sidebar navy) hay una variante más luminosa. */
    --accent:    #8e0b1d;
    --accent-2:  #6e0815;
    --accent-side: #ef3348;
    --good:      #16a34a;
    --warn:      #f59e0b;
    --bad:       #dc2626;
    --radius:    12px;
    --shadow:    0 4px 12px rgba(15,23,42,0.06);
    --shadow-lg: 0 10px 30px rgba(15,23,42,0.10);
    --sidebar-w: 240px;
    --belt:      #cccccc;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 0.6rem; }
.muted { color: var(--muted); }
.small, .tiny { font-size: 0.85rem; }
.tiny { font-size: 0.75rem; }
.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 1rem; }
code { background: #f1f5f9; padding: 1px 4px; border-radius: 4px; font-size: 0.85em; }

.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ─────────── Botones ─────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.05s, background 0.15s, border-color 0.15s;
}
.btn:hover { background: #f9fafb; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,0.04); }
.btn.danger { color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.big { padding: 0.9rem 1.4rem; font-size: 1.05rem; border-radius: 10px; }
.btn.small { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

/* ─────────── Alerts ─────────── */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid;
    background: #f9fafb;
}
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.ok    { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }

/* ─────────── Cards ─────────── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}
.card.no-pad { padding: 0; overflow: hidden; }
.card.panel { margin-bottom: 1rem; }
.panel-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 0.6rem;
}

.empty { color: var(--muted); text-align: center; padding: 1rem 0; }

/* ─────────── Forms ─────────── */
label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
}
label input[type="text"],
label input[type="password"],
label input[type="email"],
label input[type="date"],
label input[type="number"],
label input[type="search"],
label select,
label textarea {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: var(--text);
}
label input:focus, label select:focus, label textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,23,42,0.10);
}
textarea { resize: vertical; }

.row { display: grid; gap: 0.8rem; }
.row.two   { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 600px) {
    .row.two, .row.three { grid-template-columns: 1fr; }
}

.form-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; }

.switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.switch input[type="checkbox"] {
    appearance: none;
    width: 38px; height: 22px;
    background: #d1d5db;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}
.switch input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
}
.switch input[type="checkbox"]:checked { background: var(--good); }
.switch input[type="checkbox"]:checked::after { transform: translateX(16px); }
.switch.inline { font-weight: 400; }

/* ─────────── Pills ─────────── */
.pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.pill.ok  { background: #dcfce7; color: #166534; }
.pill.off { background: #f3f4f6; color: #4b5563; }
/* v4.10.0 · informativo (se usaba en «Hoy» sin existir) */
.pill.info { background: #dbeafe; color: #1e40af; }
html[data-theme="dark"] .pill.info { background: #1e3a5f; color: #93c5fd; }

.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    background: var(--belt);
}
.dot.big { width: 18px; height: 18px; }

/* Indicador "ausente" (sin venir hace 14+ días) al lado del círculo del cinturón */
.belt-dot-wrap {
    position: relative;
    display: inline-block;
    margin-right: 6px;
}
.belt-dot-wrap .away-flag {
    position: absolute;
    top: -7px;
    right: -7px;
    /* Badge rojo circular con ! blanco: muy visible a un vistazo */
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff, 0 1px 2px rgba(0,0,0,0.15);
    pointer-events: none;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ─────────── Tablas ─────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 0.7rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.data-table th {
    background: #f9fafb;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
}
.data-table tbody tr:hover { background: #fafbfc; }
.data-table .row-name { font-weight: 600; color: var(--text); }
.data-table .row-name:hover { color: var(--accent); text-decoration: none; }
.data-table tr.inactive { opacity: 0.55; }

.link.danger { color: var(--bad); font-size: 0.85rem; }
.link.danger:hover { text-decoration: underline; }

button.btn-as-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--bad);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}
button.btn-as-link:hover { text-decoration: underline; }

.belts-edit input[type="text"],
.belts-edit input[type="number"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    width: 100%;
}
.belts-edit .ord-input { width: 60px; }
.belts-edit .num-input { width: 80px; }
.belts-edit .color-input { width: 50px; height: 32px; padding: 2px; }

.belt-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}
.belt-row:last-child { border-bottom: 0; }
.belt-row form { margin-left: auto; }
.inline-form { display: inline; }

/* ─────────── Paginación ─────────── */
.pagination { display: flex; gap: 0.3rem; justify-content: center; margin-top: 1rem; }
.page-link {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--line);
    color: var(--text);
}
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─────────────────────────────────────────────────────────
   INSTALL / LOGIN (centrado, una columna)
   ───────────────────────────────────────────────────────── */
.install-body {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.install-card {
    background: #fff;
    border-radius: 14px;
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.install-card.narrow { max-width: 380px; }
.install-card h1 { font-size: 1.4rem; }

/* ─────────────────────────────────────────────────────────
   PÁGINA PÚBLICA DE CHECK-IN
   ───────────────────────────────────────────────────────── */
.public-body {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
}
.public-header {
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand-mark { font-size: 1.8rem; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small  { display: block; font-size: 0.75rem; color: #94a3b8; }
.brand.small strong { font-size: 0.95rem; }
.brand.small small  { font-size: 0.7rem; }
.clock {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.1rem;
    color: #e2e8f0;
}

.public-main {
    flex: 1;
    padding: 1.2rem;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

.public-body .card {
    background: #fff;
    color: var(--text);
}

.public-body .muted { color: var(--muted); }

.public-footer {
    text-align: center;
    padding: 1rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* ─────────── Banners de estado (público) ─────────── */
.info-banner, .pending-banner, .error-banner {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}
.info-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
}
.pending-banner {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}
.error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.card-sub {
    background: #f9fafb;
    border-radius: 10px;
    padding: 1rem;
    margin: 0.8rem 0;
}

.btn.block { display: flex; width: 100%; padding: 1rem; font-size: 1.1rem; }

.spinner {
    width: 56px;
    height: 56px;
    border: 5px solid #e5e7eb;
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 1rem auto;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-icon, .info-icon {
    width: 70px; height: 70px;
    margin: 0 auto 1rem;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}
.error-icon { background: #fee2e2; }
.info-icon  { background: #dbeafe; }

/* ─────────── Panel de solicitudes pendientes (admin) ─────────── */
.pending-panel { border-left: 4px solid var(--warn); }
.metric-warn { border-left-color: var(--warn); background: #fffbeb; }

/* ─────────── Sistema de pagos ─────────── */
.payment-summary .metric-good { border-left-color: var(--good); background: #f0fdf4; }
.payment-summary .metric-warn { border-left-color: var(--warn); background: #fffbeb; }

.pill.warn {
    background: #fef3c7;
    color: #92400e;
}

.payment-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border-left: 4px solid;
}
.payment-status-card.paid {
    background: #f0fdf4;
    border-left-color: var(--good);
}
.payment-status-card.pending {
    background: #fffbeb;
    border-left-color: var(--warn);
}
.payment-status-card.inactive {
    background: #f9fafb;
    border-left-color: var(--muted);
}
.payment-status-line {
    margin-top: 0.3rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Navegación entre meses */
.period-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.period-nav strong { padding: 0 0.4rem; }

/* Tabs de filtro */
.filter-tabs {
    display: inline-flex;
    gap: 0.2rem;
    background: #fff;
    padding: 0.3rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    flex-wrap: wrap;
}
.filter-tabs a {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
}
.filter-tabs a:hover { background: #f3f4f6; color: var(--text); }
.filter-tabs a.active {
    background: var(--primary);
    color: #fff;
}

/* Matriz de pagos */
.payment-matrix-wrap { overflow-x: auto; }
.payment-matrix td.actions { white-space: nowrap; }
.payment-matrix .link.danger { color: var(--bad); margin-left: 0.4rem; }

/* Selector visual de forma de pago */
.method-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.method-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 0.6rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
    margin: 0;
}
.method-option:hover { border-color: var(--primary); background: #f9fafb; }
.method-option.selected {
    border-color: var(--primary);
    background: #f0f9ff;
}
.method-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.method-icon-big { font-size: 1.8rem; line-height: 1; }
.method-label-big { font-size: 0.85rem; font-weight: 600; color: var(--text); }

/* Tarjetas de resumen por método */
.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
}
.method-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}
.method-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}
.method-label { font-size: 0.85rem; color: var(--muted); }
.method-amount { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

.request-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}
.request-row:last-child { border-bottom: 0; }
.request-row > div:first-child { flex: 1; }
.request-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.data-table.compact th, .data-table.compact td {
    padding: 0.5rem 0.7rem;
}
.data-table .actions { white-space: nowrap; }
.data-table .actions form { display: inline-block; margin-right: 0.3rem; }

/* ─────────── Tarjeta de éxito (post check-in) ─────────── */
.success-card {
    text-align: center;
    padding: 2rem 1.4rem;
}
.check-icon {
    width: 80px; height: 80px;
    margin: 0 auto 1rem;
    background: var(--good);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: bold;
    animation: pop 0.5s ease;
}
@keyframes pop {
    0%   { transform: scale(0.3); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.success-card h1 { color: var(--good); margin-bottom: 0.3rem; }

.belt-badge {
    display: inline-block;
    margin: 0.6rem 0 1rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--belt) 20%, white);
    border-left: 4px solid var(--belt);
    text-align: left;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin: 1.2rem 0;
}
.stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ─────── Resumen rápido del alumno (check-in) ─────── */
.student-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin: 0.8rem 0;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.9rem 1rem;
}
.student-summary .sum-block {
    padding: 0 0.4rem;
    border-right: 1px solid var(--line);
    text-align: left;
}
.student-summary .sum-block:last-child {
    border-right: 0;
}
.student-summary .sum-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
    font-weight: 600;
}
.student-summary .sum-value {
    font-size: 1.2rem;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 0.15rem;
}
.student-summary .sum-value strong {
    font-weight: 700;
}
.student-summary .sum-value .muted.small {
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: 0.3rem;
    font-weight: 400;
}
.student-summary .badge-wait {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.3rem;
}
@media (max-width: 600px) {
    .student-summary { grid-template-columns: 1fr; }
    .student-summary .sum-block { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
    .student-summary .sum-block:last-child { border-bottom: 0; padding-bottom: 0; }
}

.progress-block {
    margin: 1rem 0;
    text-align: left;
}
.progress-head {
    display: flex; justify-content: space-between;
    font-size: 0.85rem; margin-bottom: 0.4rem;
}
.progress-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 6px;
    transition: width 0.4s ease;
}
.progress-block.big .progress-bar { height: 16px; }
.progress-block.big .progress-fill { background: var(--accent); }
.ready { margin-top: 0.6rem; color: var(--good); font-weight: 600; }

.actions-row {
    display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.2rem;
}

/* ─────────── Lista de alumnos (página de selección) ─────────── */
#search {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1.05rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.6rem;
}
.student-btn {
    background: #fff;
    border: 2px solid var(--line);
    border-left: 6px solid var(--belt);
    padding: 1rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    text-align: left;
    color: var(--text);
    transition: transform 0.05s, border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}
.student-btn:hover {
    background: #f9fafb;
    border-color: var(--primary);
}
.student-btn:active { transform: scale(0.98); }
.student-btn.flash {
    background: var(--good);
    color: #fff;
    border-color: var(--good);
    animation: flash 0.6s ease;
}
@keyframes flash {
    0% { background: var(--good); }
    50% { background: #15803d; }
    100% { background: var(--good); }
}
.sb-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

/* ─────────────────────────────────────────────────────────
   PANEL DE ADMINISTRACIÓN (sidebar + contenido)
   ───────────────────────────────────────────────────────── */
.admin-body {
    background: var(--bg);
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
}
.sidebar {
    background: var(--primary);
    color: #e2e8f0;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar .brand {
    padding: 0.6rem 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.6rem;
}
.sidebar .brand strong { color: #fff; }
.sidebar nav { flex: 1; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--accent-side);
}
.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.sidebar-foot {
    padding: 0.8rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.sidebar-foot .who { color: #cbd5e1; }
.sidebar-foot a { color: #94a3b8; }
.sidebar-foot .logout { color: #fca5a5; }
.sidebar-foot .logout:hover { color: #fecaca; }

.admin-main {
    padding: 1.5rem 2rem;
    max-width: 1300px;
    width: 100%; /* v4.16.0 · sin esto el grid la encoge a fit-content: Hoy se veía más estrecho */
    margin: 0 auto; /* v4.10.0 · contenido centrado en monitores anchos */
}
@media (max-width: 900px) {
    .admin-body { grid-template-columns: 1fr; }
    .sidebar {
        position: static; height: auto;
        flex-direction: row; align-items: center;
        padding: 0.5rem 0.5rem;
        overflow-x: auto;
    }
    .sidebar .brand { border-bottom: 0; padding: 0.5rem; flex-shrink: 0; }
    .sidebar nav { display: flex; flex: 1; }
    .sidebar nav a { padding: 0.5rem 0.8rem; border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
    .sidebar nav a.active { border-left: 0; border-bottom-color: var(--accent-side); }
    .sidebar-foot { display: none; }
    .admin-main { padding: 1rem; }
}

.page-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.page-head h1 { font-size: 1.6rem; }
.page-head-actions { display: flex; gap: 0.5rem; }

.section-title { margin: 1.6rem 0 0.5rem; }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}
.metrics-grid.four { grid-template-columns: repeat(4, 1fr); }
.metric {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--ink);
}
.metric-num { font-size: 1.8rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.metric-num small { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.metric-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.3rem; }

@media (max-width: 800px) {
    .metrics-grid, .metrics-grid.four { grid-template-columns: repeat(2, 1fr); }
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.today-list, .belt-progress-list { list-style: none; margin: 0; padding: 0; }
.today-list li, .belt-progress-list li {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}
.today-list li:last-child, .belt-progress-list li:last-child { border-bottom: 0; }
.today-list li a, .belt-progress-list li a { font-weight: 600; color: var(--text); }
.today-list li a:hover, .belt-progress-list li a:hover { color: var(--accent); }

.mini-progress {
    margin-left: auto; display: flex; align-items: center; gap: 0.4rem;
    flex: 0 0 auto;
}
.mini-progress .bar {
    width: 100px; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;
}
.mini-progress .fill { height: 100%; background: var(--accent); border-radius: 3px; }

.filter-bar {
    display: flex; gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center; /* evita que una pastilla activa se estire a la altura del vecino más alto (bug filtros de facturas) */
}
.filter-bar input[type="search"] {
    flex: 1; min-width: 200px;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}
.filter-bar select {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

/* ─────────── Student detail page ─────────── */
.belt-current {
    display: flex; gap: 1rem; align-items: center;
    padding: 1rem;
    border-left: 6px solid var(--belt);
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.belt-name { font-size: 1.4rem; font-weight: 700; }
.belt-next { margin-left: auto; text-align: right; }

.notes-box {
    background: #f9fafb;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin: 0.8rem 0;
}

.manual-checkin { margin-top: 1rem; }
.manual-checkin summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 0.4rem 0; }
.manual-checkin form { margin-top: 0.6rem; }

/* ─────────── Charts (DOW + months) ─────────── */
.dow-chart, .month-chart {
    display: flex; align-items: flex-end; gap: 0.6rem;
    height: 140px;
    padding: 1rem 0.4rem 0.2rem;
    border-bottom: 1px solid var(--line);
}
.dow-col, .month-col {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    height: 100%; min-width: 0;
}
.dow-bar {
    width: 60%;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    display: flex; align-items: flex-start; justify-content: center;
    color: #fff; font-size: 0.7rem; font-weight: 700;
    padding-top: 2px;
}
.dow-label, .month-label {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--muted);
    text-align: center;
}
.month-bar {
    width: 80%;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 4px 4px 0 0;
    min-height: 2px;
}

.days-grid {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.day-chip {
    background: #f1f5f9;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text);
}

.danger-zone {
    border: 1px solid #fecaca;
    background: #fff5f5;
}
.danger-zone h3 { color: var(--bad); }

/* ─────────── Mobile tweaks ─────────── */
@media (max-width: 600px) {
    h1 { font-size: 1.3rem; }
    .install-card { padding: 1.4rem; }
    .public-header { flex-wrap: wrap; }
    .check-icon { width: 64px; height: 64px; font-size: 2rem; }
}

/* ─────────── Selector de modo de registro ─────────── */
.register-mode-picker {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.3rem;
}
.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
    margin: 0;
}
.mode-option:hover { border-color: var(--primary); background: #f9fafb; }
.mode-option.selected {
    border-color: var(--primary);
    background: #f0f9ff;
}
.mode-option input[type="radio"] {
    margin-top: 0.3rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.mode-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--text);
}
.mode-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}

/* ─────────── Tarjeta de alumno solo-lectura (modo manual) ─────────── */
.student-card-readonly {
    background: #f9fafb;
    border: 2px solid var(--line);
    border-left: 6px solid var(--belt);
    padding: 1rem 0.8rem;
    border-radius: 10px;
    text-align: left;
    color: var(--muted);
    font-weight: 600;
}
.student-card-readonly .sb-name { color: var(--text); }

/* ─────────── Logo del dojo ─────────── */
.brand-logo {
    height: 56px;             /* alto fijo para no comerse la pantalla */
    width: auto;
    max-width: 200px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.brand-logo.small {
    height: 36px;
    width: auto;
    max-width: 120px;
}
.login-logo {
    display: block;
    height: 100px;            /* alto fijo */
    width: auto;
    max-width: 240px;
    margin: 0 auto 0.8rem;
    object-fit: contain;
}
.install-card .login-logo + h1 {
    text-align: center;
    margin-top: 0;
}

.logo-field { margin-top: 0.4rem; }
.logo-upload { margin-top: 0.3rem; }
.logo-upload input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fafbfc;
    font: inherit;
    cursor: pointer;
}
.logo-preview {
    margin-top: 0.6rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fafb;
    text-align: center;
}
.logo-preview-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    margin-bottom: 0.4rem;
}
.logo-preview img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.logo-tips {
    margin-top: 0.4rem;
    padding: 0.6rem 0.8rem;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #2563eb;
    font-size: 0.85rem;
    color: #1e40af;
}
.logo-tips ul {
    margin: 0.3rem 0 0 1rem;
    padding: 0;
}
.logo-tips li {
    margin-bottom: 0.15rem;
}

.logo-current {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
    margin: 0.8rem 0;
}
.logo-current-img {
    height: 80px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    background: #fff;
    padding: 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--line);
}
.logo-placeholder {
    width: 80px; height: 80px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}

.logo-form { margin-top: 0.6rem; }
.logo-delete-form { margin-top: 0.4rem; }

.sheet-logo {
    display: block;
    height: 100px;
    width: auto;
    max-width: 280px;
    margin: 0 auto 1rem;
    object-fit: contain;
}

/* ─────────── Recordatorio de cuota pendiente ─────────── */
.payment-reminder-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-left: 6px solid #f59e0b;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    color: #78350f;
    animation: pulse-attention 2.5s ease-in-out infinite;
}
@keyframes pulse-attention {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}
.payment-reminder-banner .muted { color: #92400e; opacity: 0.8; }

.payment-reminder-inline {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin: 0.8rem 0;
    color: #78350f;
    text-align: left;
}
.payment-reminder-inline .muted { color: #92400e; opacity: 0.85; }

/* ─────────── Tarjetas grandes de método de pago ─────────── */
.method-grid-big {
    gap: 1rem;
}
.method-card-big {
    padding: 1.2rem 1.4rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-left: 4px solid var(--primary);
}
.method-card-big .method-icon { font-size: 2.4rem; }
.method-card-big .method-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* ─────────── Resumen anual ─────────── */
.year-summary {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 800px) {
    .year-summary { grid-template-columns: 1fr; }
}

.year-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    height: 180px;
    padding: 1.6rem 0.4rem 0.2rem;
    border-bottom: 1px solid var(--line);
}
.year-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
}
.year-bar-value {
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
    text-align: center;
    min-height: 1rem;
}
.year-bar {
    width: 80%;
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}
.year-bar-label {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

.year-method-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}
.year-method-row:last-child { border-bottom: 0; }
.year-method-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}
.year-method-body { flex: 1; min-width: 0; }
.year-method-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}
.year-method-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.year-method-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
}
.year-method-numbers {
    text-align: right;
    flex-shrink: 0;
}
.year-method-numbers small {
    display: block;
    font-size: 0.75rem;
}

/* ─────── Sección de contraseña secundaria (no bloqueante) ─────── */
.pwd-section-secondary {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    text-align: center;
}
.pwd-section-secondary details summary {
    color: var(--muted);
    font-size: 0.85rem;
    list-style: none;
    cursor: pointer;
    padding: 0.4rem 0;
}
.pwd-section-secondary details summary::-webkit-details-marker {
    display: none;
}
.pwd-section-secondary details summary::before {
    content: "▸ ";
    margin-right: 0.3rem;
}
.pwd-section-secondary details[open] summary::before {
    content: "▾ ";
}

/* ─────── Tabs de disciplinas (filtro de alumnos) ─────── */
.discipline-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.6rem 0 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
}
.disc-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.12s;
}
.disc-tab:hover {
    background: #f3f4f6;
    border-color: #cbd5e1;
}
.disc-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.disc-tab-icon {
    font-size: 1.05rem;
    line-height: 1;
}
.disc-tab-label {
    font-weight: 500;
}
.disc-tab-count {
    background: rgba(0,0,0,0.08);
    color: inherit;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.disc-tab.active .disc-tab-count {
    background: rgba(255,255,255,0.2);
}

.filter-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
}

/* ─────── Multi-disciplina: selector + progress ─────── */
.disc-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 1rem 0;
}
.disc-btn {
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 0.7rem;
    cursor: pointer;
    text-align: center;
    font: inherit;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    --disc: #94a3b8;
}
.disc-btn:hover { border-color: var(--disc); background: #f8fafc; }
.disc-btn.selected {
    border-color: var(--accent);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.disc-btn .disc-icon-big { font-size: 2rem; line-height: 1; }
.disc-btn strong { display: block; font-size: 1rem; }
.disc-btn small { color: var(--muted); font-size: 0.8rem; }
.disc-btn .badge.primary { background:#fef3c7; color:#92400e; padding:0.1rem 0.4rem; border-radius:999px; font-size:0.65rem; font-weight:600; margin-top:0.2rem; }
.disc-btn.small { padding: 0.5rem 0.4rem; }
.disc-btn.small .disc-icon-big { font-size: 1.3rem; }

.multi-progress {
    display: grid;
    gap: 0.7rem;
}
.mini-progress {
    --belt: #94a3b8;
    border-left: 3px solid var(--belt);
    padding: 0.5rem 0.7rem;
    background: #fafbfc;
    border-radius: 0 6px 6px 0;
}
.mp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.3rem; }
.mp-head small { font-size: 0.8rem; }
.progress-bar.mini { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-bottom: 0.2rem; }

/* ─────────── Móvil: tablas legibles sin solapes ─────────── */
.admin-body,
.admin-main,
.card { min-width: 0; }

.data-table,
.table { width: 100%; max-width: 100%; }

.pill,
.badge-rule,
.badge-manual,
.badge-cancelled { white-space: nowrap; }

@media (max-width: 700px) {
    .admin-main {
        width: 100%;
        max-width: 100%;
        padding: 0.65rem;
    }
    .card {
        padding: 0.75rem;
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }
    .card.no-pad { padding: 0; overflow: visible; }
    .page-head { gap: 0.45rem; margin-bottom: 0.75rem; }
    .page-head h1 { font-size: 1.18rem; }
    .page-head-actions { gap: 0.4rem; flex-wrap: wrap; }

    .sidebar { padding: 0.35rem; }
    .sidebar .brand { padding: 0.35rem; }
    .sidebar nav a {
        font-size: 0.78rem;
        padding: 0.42rem 0.55rem;
        gap: 0.35rem;
    }

    .metrics-grid,
    .metrics-grid.four,
    .kpi-grid { gap: 0.5rem; }
    .metric,
    .kpi { padding: 0.7rem; }
    .metric-num,
    .kpi-num { font-size: 1.3rem; }
    .metric-label,
    .kpi-label { font-size: 0.64rem; letter-spacing: 0.02em; }

    .data-table,
    .table {
        table-layout: auto;
        font-size: 0.82rem;
    }
    .data-table th,
    .data-table td,
    .table th,
    .table td {
        padding: 0.45rem 0.4rem;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
        line-height: 1.28;
        vertical-align: top;
    }
    .data-table th,
    .table th {
        font-size: 0.66rem;
        letter-spacing: 0.01em;
    }

    .btn,
    .btn.small,
    .btn-sm,
    .btn.btn-sm,
    .btn-ghost,
    .btn-primary,
    .btn-danger {
        padding: 0.34rem 0.5rem;
        font-size: 0.78rem;
        border-radius: 7px;
        gap: 0.22rem;
        white-space: nowrap;
    }

    .filter-bar { gap: 0.35rem; }
    .filter-bar input[type="search"] { min-width: 120px; }
    .filter-bar select,
    .filter-bar input[type="search"],
    .filter-bar .btn {
        font-size: 0.84rem;
        padding: 0.48rem 0.58rem;
    }

    /* Alumnos: en móvil cada alumno pasa a una tarjeta compacta.
       Se ve todo sin cortar ni montar campos. */
    .students-table,
    .students-table thead,
    .students-table tbody,
    .students-table tr,
    .students-table th,
    .students-table td {
        display: block;
    }
    .students-table thead { display: none; }
    .students-table tbody { width: 100%; }
    .students-table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.38rem;
        padding: 0.65rem;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }
    .students-table tr.inactive { opacity: 0.72; }
    .students-table td {
        border-bottom: 0;
        padding: 0.35rem 0.42rem;
        min-width: 0;
    }
    .students-table td:first-child {
        grid-column: 1 / -1;
        padding: 0 0 0.15rem;
        font-size: 0.95rem;
        font-weight: 700;
        background: transparent;
    }
    .students-table td:not(:first-child) {
        background: #f9fafb;
        border: 1px solid var(--line);
        border-radius: 8px;
    }
    .students-table td:not(:first-child)::before {
        display: block;
        margin-bottom: 0.1rem;
        color: var(--muted);
        font-size: 0.58rem;
        line-height: 1.1;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .students-table td:nth-child(2)::before { content: 'Cinturón'; }
    .students-table td:nth-child(3)::before { content: 'Horas'; }
    .students-table td:nth-child(4)::before { content: 'Ses.'; }
    .students-table td:nth-child(5)::before { content: 'Última'; }
    .students-table td:nth-child(6)::before { content: 'Pago'; }
    .students-table td:nth-child(7)::before { content: 'Estado'; }
    .students-table td:nth-child(3),
    .students-table td:nth-child(4),
    .students-table td:nth-child(5),
    .students-table td:nth-child(6),
    .students-table td:nth-child(7) {
        text-align: left;
        white-space: nowrap;
    }
    .students-table .row-name {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        gap: 0.2rem;
        line-height: 1.2;
    }
    .students-table .belt-dot-wrap { flex: 0 0 auto; margin-right: 2px; }
    .students-table .dot { margin-right: 0; }
    .students-table .pill { font-size: 0.72rem; }

    /* Sesiones y reservas: tarjetas compactas para que acciones y botones no se solapen. */
    .session-table:not(.sessions-list-table),
    .session-table:not(.sessions-list-table) thead,
    .session-table:not(.sessions-list-table) tbody,
    .session-table:not(.sessions-list-table) tr,
    .session-table:not(.sessions-list-table) th,
    .session-table:not(.sessions-list-table) td,
    .reservations-table,
    .reservations-table thead,
    .reservations-table tbody,
    .reservations-table tr,
    .reservations-table th,
    .reservations-table td {
        display: block;
    }
    .session-table:not(.sessions-list-table) thead,
    .reservations-table thead { display: none; }
    .session-table:not(.sessions-list-table) tr,
    .reservations-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.38rem;
        padding: 0.65rem;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }
    .session-table:not(.sessions-list-table) td,
    .reservations-table td {
        border-bottom: 0;
        padding: 0.35rem 0.42rem;
        min-width: 0;
        background: #f9fafb;
        border: 1px solid var(--line);
        border-radius: 8px;
    }
    .session-table:not(.sessions-list-table) td:first-child,
    .reservations-table td:nth-child(2) {
        grid-column: 1 / -1;
        background: transparent;
        border: 0;
        padding: 0 0 0.1rem;
        font-weight: 700;
    }
    .session-table:not(.sessions-list-table) td.actions,
    .reservations-table td:last-child {
        grid-column: 1 / -1;
    }
    .session-table:not(.sessions-list-table) td.actions form,
    .reservations-table td:last-child form {
        display: inline-flex !important;
        flex-wrap: wrap;
        gap: 0.25rem;
        margin: 0.1rem 0.15rem 0.1rem 0;
        vertical-align: top;
    }
    .session-table:not(.sessions-list-table) td.actions .muted.small { display: inline-block; margin-top: 0.25rem; }

    .reservations-table td:first-child { display: none; }
    .reservations-table td:nth-child(3)::before,
    .reservations-table td:last-child::before,
    .session-table:not(.sessions-list-table) td:not(:first-child)::before {
        display: block;
        margin-bottom: 0.12rem;
        color: var(--muted);
        font-size: 0.58rem;
        line-height: 1.1;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .reservations-table td:nth-child(3)::before { content: 'Fecha'; }
    .reservations-table td:last-child::before { content: 'Gestión'; }
    .session-table:not(.sessions-list-table) td:nth-child(2)::before { content: 'Título'; }
    .session-table:not(.sessions-list-table) td:nth-child(3)::before { content: 'Disciplina'; }
    .session-table:not(.sessions-list-table) td:nth-child(4)::before { content: 'Ocupación'; }
    .session-table:not(.sessions-list-table) td:nth-child(5)::before { content: 'Espera'; }
    .session-table:not(.sessions-list-table) td:nth-child(6)::before { content: 'Estado'; }
    .session-table:not(.sessions-list-table) td:nth-child(7)::before { content: 'Acciones'; }
}

@media (max-width: 420px) {
    .admin-main { padding: 0.55rem; }
    .students-table tr,
    .session-table:not(.sessions-list-table) tr,
    .reservations-table tr {
        gap: 0.32rem;
        padding: 0.55rem;
    }
    .students-table td,
    .session-table:not(.sessions-list-table) td,
    .reservations-table td {
        padding: 0.32rem 0.38rem;
    }
    .students-table { font-size: 0.78rem; }
    .students-table .pill { font-size: 0.68rem; }
}

/* Más tablas en móvil con el mismo patrón de tarjetas compactas */
@media (max-width: 700px) {
    .payment-matrix-wrap { overflow: visible; }

    .payment-matrix,
    .payment-matrix thead,
    .payment-matrix tbody,
    .payment-matrix tr,
    .payment-matrix th,
    .payment-matrix td,
    .payments-recent-table,
    .payments-recent-table thead,
    .payments-recent-table tbody,
    .payments-recent-table tr,
    .payments-recent-table th,
    .payments-recent-table td,
    .invoices-table,
    .invoices-table thead,
    .invoices-table tbody,
    .invoices-table tr,
    .invoices-table th,
    .invoices-table td,
    .discipline-students-table,
    .discipline-students-table thead,
    .discipline-students-table tbody,
    .discipline-students-table tr,
    .discipline-students-table th,
    .discipline-students-table td,
    .disciplines-edit,
    .disciplines-edit thead,
    .disciplines-edit tbody,
    .disciplines-edit tr,
    .disciplines-edit th,
    .disciplines-edit td,
    .belts-edit,
    .belts-edit thead,
    .belts-edit tbody,
    .belts-edit tr,
    .belts-edit th,
    .belts-edit td {
        display: block;
    }

    .payment-matrix thead,
    .payments-recent-table thead,
    .invoices-table thead,
    .discipline-students-table thead,
    .disciplines-edit thead,
    .belts-edit thead {
        display: none;
    }

    .payment-matrix tr,
    .payments-recent-table tr,
    .invoices-table tr,
    .discipline-students-table tr,
    .disciplines-edit tr,
    .belts-edit tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.38rem;
        padding: 0.65rem;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    .payment-matrix td,
    .payments-recent-table td,
    .invoices-table td,
    .discipline-students-table td,
    .disciplines-edit td,
    .belts-edit td {
        border-bottom: 0;
        padding: 0.38rem 0.44rem;
        min-width: 0;
        background: #f9fafb;
        border: 1px solid var(--line);
        border-radius: 8px;
        text-align: left !important;
        white-space: normal;
    }

    .payment-matrix td:first-child,
    .payments-recent-table td:nth-child(2),
    .invoices-table td:first-child,
    .discipline-students-table td:first-child,
    .disciplines-edit td:nth-child(3),
    .belts-edit td:nth-child(2) {
        grid-column: 1 / -1;
        background: transparent;
        border: 0;
        padding: 0 0 0.1rem;
        font-weight: 700;
    }

    .payment-matrix td.actions,
    .payments-recent-table td.actions,
    .invoices-table td.actions,
    .disciplines-edit td:nth-child(5),
    .belts-edit td:nth-child(3) {
        grid-column: 1 / -1;
    }

    .payment-matrix td.actions,
    .payments-recent-table td.actions,
    .invoices-table td.actions {
        background: #fff;
    }
    .payment-matrix td.actions form,
    .payments-recent-table td.actions form,
    .invoices-table td.actions form,
    .payment-matrix td.actions a,
    .payments-recent-table td.actions a,
    .invoices-table td.actions a {
        display: inline-flex !important;
        flex-wrap: wrap;
        margin: 0.1rem 0.2rem 0.1rem 0;
        vertical-align: top;
    }

    .payment-matrix td::before,
    .payments-recent-table td::before,
    .invoices-table td::before,
    .discipline-students-table td::before,
    .disciplines-edit td::before,
    .belts-edit td::before {
        display: block;
        margin-bottom: 0.12rem;
        color: var(--muted);
        font-size: 0.58rem;
        line-height: 1.1;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .payment-matrix td:first-child::before,
    .payments-recent-table td:nth-child(2)::before,
    .invoices-table td:first-child::before,
    .discipline-students-table td:first-child::before,
    .disciplines-edit td:nth-child(3)::before,
    .belts-edit td:nth-child(2)::before { display: none; }

    .payment-matrix td:nth-child(2)::before { content: 'Cuota'; }
    .payment-matrix td:nth-child(3)::before { content: 'Estado'; }
    .payment-matrix td:nth-child(4)::before { content: 'Pago'; }
    .payment-matrix td:nth-child(5)::before { content: 'Acción'; }
    .payment-matrix td:nth-child(2),
    .payment-matrix td:nth-child(3) { white-space: nowrap; }

    .payments-recent-table td:nth-child(1)::before { content: 'Fecha'; }
    .payments-recent-table td:nth-child(3)::before { content: 'Importe'; }
    .payments-recent-table td:nth-child(4)::before { content: 'Forma'; }
    .payments-recent-table td:nth-child(5)::before { content: 'Nota'; }
    .payments-recent-table td:nth-child(6)::before { content: 'Acción'; }
    .payments-recent-table td:nth-child(1),
    .payments-recent-table td:nth-child(3) { white-space: nowrap; }

    .invoices-table td:nth-child(2)::before { content: 'Fecha'; }
    .invoices-table td:nth-child(3)::before { content: 'Periodo'; }
    .invoices-table td:nth-child(4)::before { content: 'Alumno'; }
    .invoices-table td:nth-child(5)::before { content: 'Concepto'; }
    .invoices-table td:nth-child(6)::before { content: 'Base'; }
    .invoices-table td:nth-child(7)::before { content: 'IVA'; }
    .invoices-table td:nth-child(8)::before { content: 'Total'; }
    .invoices-table td:nth-child(9)::before { content: 'Estado'; }
    .invoices-table td:nth-child(10)::before { content: 'Acciones'; }
    .invoices-table td:nth-child(5),
    .invoices-table td:nth-child(10) { grid-column: 1 / -1; }
    .invoices-table td:nth-child(2),
    .invoices-table td:nth-child(3),
    .invoices-table td:nth-child(6),
    .invoices-table td:nth-child(7),
    .invoices-table td:nth-child(8),
    .invoices-table td:nth-child(9) { white-space: nowrap; }

    .discipline-students-table td:nth-child(2)::before { content: 'Disciplinas'; }
    .discipline-students-table td:nth-child(3)::before { content: 'Nivel'; }
    .discipline-students-table td:nth-child(4)::before { content: 'Horas'; }
    .discipline-students-table td:nth-child(5)::before { content: 'Sesiones'; }
    .discipline-students-table td:nth-child(6)::before { content: 'Última'; }
    .discipline-students-table td:nth-child(7)::before { content: 'Pago'; }
    .discipline-students-table td:nth-child(8)::before { content: 'Estado / asistencia'; }
    .discipline-students-table td:nth-child(9)::before { content: 'Asistencia'; }
    .discipline-students-table td:nth-child(4),
    .discipline-students-table td:nth-child(5),
    .discipline-students-table td:nth-child(6),
    .discipline-students-table td:nth-child(7),
    .discipline-students-table td:nth-child(8),
    .discipline-students-table td:nth-child(9) { white-space: nowrap; }

    .disciplines-edit td:nth-child(1)::before { content: 'Orden'; }
    .disciplines-edit td:nth-child(2)::before { content: 'Icono'; }
    .disciplines-edit td:nth-child(4)::before { content: 'Precio base'; }
    .disciplines-edit td:nth-child(5)::before { content: 'Suplemento'; }
    .disciplines-edit td:nth-child(6)::before { content: 'Alumnos'; }
    .disciplines-edit td:nth-child(7)::before { content: 'Niveles'; }
    .disciplines-edit td:nth-child(8)::before { content: 'Activo'; }

    .belts-edit td:nth-child(1)::before { content: 'Orden'; }
    .belts-edit td:nth-child(3)::before { content: 'Interno'; }
    .belts-edit td:nth-child(4)::before { content: 'Color'; }
    .belts-edit td:nth-child(5)::before { content: 'Horas'; }
    .belts-edit td:nth-child(6)::before { content: 'Alumnos'; }
    .belts-edit td:nth-child(7)::before { content: 'Activo'; }

    .disciplines-edit input,
    .disciplines-edit select,
    .belts-edit input,
    .belts-edit select {
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .payment-matrix tr,
    .payments-recent-table tr,
    .invoices-table tr,
    .discipline-students-table tr,
    .disciplines-edit tr,
    .belts-edit tr {
        gap: 0.32rem;
        padding: 0.55rem;
    }
    .payment-matrix td,
    .payments-recent-table td,
    .invoices-table td,
    .discipline-students-table td,
    .disciplines-edit td,
    .belts-edit td {
        padding: 0.34rem 0.38rem;
    }
}

/* Alertas de alumno */
.student-alert-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,0.18);
    vertical-align: middle;
}
.student-alert-dot.tiny {
    width: 15px;
    height: 15px;
    font-size: 10px;
    margin-left: 0.25rem;
}
.student-alert-line {
    margin-top: 0.25rem;
    color: #dc2626;
    font-size: 0.86rem;
    font-weight: 700;
}
.student-alert-line .student-alert-dot {
    margin-right: 0.3rem;
}
.alerted-block {
    position: relative;
    border-left-color: #dc2626 !important;
    box-shadow: 0 0 0 1px rgba(220,38,38,0.15), var(--shadow);
}
.alerted-block .alert-block-note {
    margin-top: 0.35rem;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 700px) {
    .admin-main { overflow-x: hidden; }
    .two-col { grid-template-columns: minmax(0, 1fr); }
    .payment-status-card { flex-wrap: wrap; align-items: flex-start; }
    .payment-status-card > div { min-width: 0; max-width: 100%; }
    .metric-num { overflow-wrap: normal; word-break: normal; }
}

.legal-notice-box {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-left: 4px solid #64748b;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}
.legal-notice-box.warn {
    background: #fff7ed;
    border-color: #fed7aa;
    border-left-color: #f97316;
    color: #9a3412;
}
.legal-notice-box strong { color: var(--text); }

/* Panel Hoy / comunicaciones */
.today-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.quick-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:0.6rem; }
.quick-card, .alert-row { display:flex; align-items:center; gap:0.5rem; justify-content:space-between; padding:0.55rem 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.quick-card { border:1px solid var(--line); border-radius:10px; padding:0.7rem; background:#f9fafb; }
.alert-row:last-child { border-bottom:0; }
@media (max-width:900px){ .today-grid { grid-template-columns:1fr; } }

.quick-actions-grid { display:flex; flex-wrap:wrap; gap:0.5rem; align-items:center; }
.quick-actions-panel code { overflow-wrap:anywhere; }


.quick-attendance-inline { display:inline-flex; align-items:center; gap:0.35rem; margin-left:0.35rem; flex-wrap:wrap; }
@media (max-width:700px){ .quick-attendance-inline { margin-left:0; margin-top:0.25rem; display:flex; } }

/* Limpieza interfaz */
.alert-chip{display:inline-block;background:#fee2e2;color:#991b1b;border-radius:999px;padding:.15rem .45rem;font-size:.72rem;font-weight:800;margin:.08rem .12rem .08rem 0}.mini-select{max-width:95px;padding:.25rem .35rem;border:1px solid var(--line);border-radius:7px;background:#fff}.more-filters{display:inline-block}.more-filters summary{list-style:none}.more-filters summary::-webkit-details-marker{display:none}.more-filters-body{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.45rem;padding:.65rem;border:1px solid var(--line);border-radius:10px;background:#fff}.student-actions{white-space:normal!important}.student-actions form{margin-top:.2rem}.selected-card{box-shadow:0 0 0 2px var(--accent), var(--shadow)}
@media(max-width:700px){.alert-chip{font-size:.68rem}.student-actions{display:flex!important;gap:.3rem;flex-wrap:wrap}.student-actions form{display:flex!important}.more-filters{width:100%}.more-filters summary{width:100%}.more-filters-body select{width:100%}.mini-select{max-width:120px}}

/* Ajustes tipo menú móvil */
.settings-menu-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:.85rem}.settings-menu-card{display:flex;align-items:center;gap:.85rem;padding:1rem 1.1rem;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);text-decoration:none;color:var(--text);transition:transform .08s, box-shadow .15s, border-color .15s}.settings-menu-card:hover{transform:translateY(-1px);box-shadow:var(--shadow-lg);border-color:#cbd5e1;text-decoration:none}.settings-menu-icon{font-size:1.6rem;flex:0 0 auto}.settings-menu-body{display:flex;flex-direction:column;gap:.15rem;min-width:0}.settings-menu-body strong{font-size:1rem;color:var(--ink)}.settings-menu-body small{color:var(--muted);line-height:1.35}.settings-menu-arrow{margin-left:auto;color:var(--muted);font-size:1.8rem;line-height:1}@media(max-width:700px){.settings-menu-grid{grid-template-columns:1fr}.settings-menu-card{padding:.9rem}.settings-menu-body small{font-size:.8rem}}

/* Portal del alumno */
.student-portal-welcome{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem;padding-bottom:1rem;border-bottom:1px solid var(--line)}
.student-portal-welcome h1{margin-bottom:.15rem}.student-portal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;margin-bottom:1rem}.portal-card{background:#f8fafc;border:1px solid var(--line);border-left:4px solid var(--primary);border-radius:12px;padding:.85rem;display:flex;flex-direction:column;gap:.35rem;min-width:0}.portal-card-title{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:800}.portal-card strong{color:var(--ink);line-height:1.2}.portal-card.is-warn{border-left-color:var(--warn);background:#fffbeb}.portal-card.is-ok{border-left-color:var(--good);background:#f0fdf4}.portal-card.is-primary{border-left-color:var(--accent);background:#fff7ed}.portal-card .btn{align-self:flex-start;margin-top:.25rem}
@media(max-width:600px){.student-portal-welcome{display:block}.student-portal-welcome .btn{margin-top:.5rem}.student-portal-grid{grid-template-columns:1fr}.portal-card{padding:.75rem}}

.check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.5rem;margin-top:.75rem}.check-option{display:flex;align-items:center;gap:.5rem;padding:.65rem .75rem;border:1px solid var(--line);border-radius:10px;background:#fff}.check-option input{width:auto;margin:0}
.portal-useful-section{margin:1.2rem 0 1rem;padding:1rem;border:1px solid var(--line);border-radius:20px;background:linear-gradient(180deg,#fff 0%,#f8fafc 100%)}.portal-useful-head{display:flex;justify-content:space-between;gap:.7rem;align-items:flex-end;margin-bottom:.75rem}.portal-useful-head strong{color:var(--navy);font-size:1.05rem}.portal-useful-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.75rem}.portal-useful-card{display:flex;gap:.75rem;align-items:flex-start;text-decoration:none;background:#fff;border:1px solid var(--line);border-radius:16px;padding:.9rem;box-shadow:0 6px 18px rgba(15,23,42,.06);transition:.15s transform,.15s box-shadow}.portal-useful-card:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(15,23,42,.10)}.portal-useful-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:14px;background:#eef2ff;font-size:1.25rem;flex:0 0 auto}.portal-useful-card strong{display:block;color:var(--navy)}.portal-useful-card small{display:block;color:var(--muted);margin-top:.15rem;line-height:1.35}.student-doc-card{max-width:820px;margin:0 auto}.student-doc-content{margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:16px;background:#fff;line-height:1.65;color:#1f2937}@media(max-width:560px){.portal-useful-head{display:block}.portal-useful-grid{grid-template-columns:1fr}}
.teacher-group-grid .check-option{align-items:flex-start}.teacher-group-grid .check-option span{display:flex;flex-direction:column;gap:.15rem}.onboarding-list .quick-card{align-items:center}
/* Tablas extensas: nunca desbordan la tarjeta, especialmente en móvil. */
.table-scroll { width:100%; max-width:100%; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; border:1px solid var(--line); border-radius:9px; }
.table-scroll .data-table { min-width:760px; margin:0; }

/* ════════════════════════════════════════════════════════════════
   Navegación 1.2h: cabecera, buscador global y barra móvil
   ════════════════════════════════════════════════════════════════ */
.sidebar { z-index: 60; }
.sidebar-close,
.sidebar-overlay,
.mobile-bottom-nav,
.admin-menu-button { display: none; }
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: -1.5rem -2rem 1.15rem;
    padding: 0.75rem 2rem;
    background: rgba(248,250,252,0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}
.global-search { position: relative; flex: 1; max-width: 680px; }
.global-search input {
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 4rem 0.65rem 2.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    font-size: 0.92rem;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.global-search input:focus { outline: 3px solid rgba(37,99,235,.13); border-color: var(--accent); }
.global-search-icon { position: absolute; left: 0.8rem; top: 0.53rem; z-index: 1; font-size: 1.25rem; color: #64748b; }
.global-search kbd { position: absolute; right: 0.65rem; top: 0.58rem; padding: .2rem .4rem; border: 1px solid #dbe1e8; border-radius: 6px; color: #64748b; background:#f8fafc; font: 11px ui-monospace,monospace; }
.global-search-results {
    position: absolute;
    top: calc(100% + .45rem);
    left: 0;
    right: 0;
    max-height: min(520px,70vh);
    overflow: auto;
    background: #fff;
    border: 1px solid #dbe1e8;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15,23,42,.18);
    padding: .4rem;
    z-index: 100;
}
.global-search-result { display:flex; align-items:center; gap:.7rem; padding:.65rem .7rem; border-radius:10px; color:var(--text); text-decoration:none; }
.global-search-result:hover,.global-search-result.is-selected { background:#eff6ff; }
.global-search-result-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:9px; background:#f1f5f9; font-size:1.05rem; flex:0 0 auto; }
.global-search-result-body { min-width:0; flex:1; }
.global-search-result-body strong,.global-search-result-body small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.global-search-result-body small { color:var(--muted); margin-top:.1rem; }
.global-search-result-type { font-size:.65rem; text-transform:uppercase; color:#64748b; letter-spacing:.05em; }
.global-search-empty { padding:1rem; text-align:center; color:var(--muted); }
.admin-topbar-user { margin-left:auto; text-align:right; line-height:1.15; }
.admin-topbar-user span,.admin-topbar-user strong { display:block; }
.admin-topbar-user span { color:var(--muted); font-size:.68rem; text-transform:uppercase; letter-spacing:.05em; }
.admin-topbar-user strong { font-size:.82rem; margin-top:.15rem; }

@media (max-width: 900px) {
    .admin-body { display:block; padding-bottom:68px; }
    .admin-main { padding: .75rem; }
    .admin-topbar { margin:-.75rem -.75rem .8rem; padding:.55rem .7rem; top:0; }
    .admin-menu-button { display:grid; place-items:center; flex:0 0 42px; height:42px; border:1px solid #cbd5e1; border-radius:11px; background:#fff; font-size:1.2rem; color:var(--primary); }
    .admin-topbar-user,.global-search kbd { display:none; }
    .global-search input { padding-right:.7rem; font-size:.84rem; }
    .sidebar {
        display:flex;
        position:fixed;
        inset:0 auto 0 0;
        width:min(310px,88vw);
        height:100dvh;
        padding:1rem 0;
        flex-direction:column;
        align-items:stretch;
        overflow-y:auto;
        overflow-x:hidden;
        transform:translateX(-105%);
        transition:transform .22s ease;
        box-shadow:16px 0 40px rgba(15,23,42,.22);
    }
    .sidebar .brand { padding:.6rem 1rem 1rem; border-bottom:1px solid rgba(255,255,255,.08); margin-bottom:.5rem; }
    .sidebar nav { display:block; flex:1; }
    .sidebar nav a { padding:.72rem 1rem; border-left:3px solid transparent; border-bottom:0; white-space:normal; font-size:.9rem; }
    .sidebar nav a.active { border-left-color:var(--accent-side); border-bottom:0; }
    .sidebar-foot { display:flex; }
    .sidebar-close { display:grid; place-items:center; position:absolute; right:.65rem; top:.6rem; width:36px; height:36px; border:0; border-radius:9px; background:rgba(255,255,255,.1); color:#fff; font-size:1.5rem; }
    .sidebar-overlay { position:fixed; inset:0; z-index:55; border:0; background:rgba(15,23,42,.48); opacity:0; pointer-events:none; transition:opacity .2s; }
    .admin-body.sidebar-open .sidebar { transform:translateX(0); }
    .admin-body.sidebar-open .sidebar-overlay { display:block; opacity:1; pointer-events:auto; }
    .mobile-bottom-nav {
        position:fixed;
        display:grid;
        grid-template-columns:repeat(5,1fr);
        left:0; right:0; bottom:0;
        z-index:50;
        min-height:62px;
        padding:5px max(5px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left));
        background:rgba(255,255,255,.97);
        border-top:1px solid #dbe1e8;
        box-shadow:0 -8px 24px rgba(15,23,42,.08);
        backdrop-filter:blur(14px);
    }
    .mobile-bottom-nav a,.mobile-bottom-nav button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; border:0; background:transparent; color:#64748b; text-decoration:none; font:inherit; border-radius:9px; }
    .mobile-bottom-nav a span,.mobile-bottom-nav button span { font-size:1.15rem; line-height:1.2; }
    .mobile-bottom-nav small { font-size:.62rem; font-weight:700; }
    .mobile-bottom-nav a.active { color:var(--accent); background:#eff6ff; }
}

/* ════════════════════════════════════════════════════════════════
   Panel Hoy 1.2h
   ════════════════════════════════════════════════════════════════ */
.eyebrow { margin:0 0 .15rem; color:var(--accent); font-weight:800; font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; }
.today-page-head h1 { margin:0; }
.today-page-head p:last-child { margin:.2rem 0 0; }
.today-quick-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.65rem; margin-bottom:1rem; }
.today-quick-actions a { display:flex; align-items:center; gap:.65rem; padding:.75rem .9rem; background:#fff; border:1px solid var(--line); border-radius:12px; color:var(--text); text-decoration:none; box-shadow:0 2px 8px rgba(15,23,42,.04); }
.today-quick-actions a:hover { border-color:#bfdbfe; background:#eff6ff; transform:translateY(-1px); }
.today-quick-actions span { font-size:1.25rem; }
.today-quick-actions strong { font-size:.84rem; }
.today-metrics .metric { text-decoration:none; color:inherit; position:relative; }
.metric-icon { position:absolute; right:.75rem; top:.65rem; font-size:1.25rem; opacity:.65; }
.today-workspace { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(300px,.8fr); gap:1rem; align-items:start; }
.today-task-column { display:grid; gap:1rem; }
.today-session-list { display:grid; gap:.65rem; }
.today-session-card { display:grid; grid-template-columns:72px minmax(0,1fr) auto; align-items:center; gap:.8rem; border:1px solid var(--line); border-radius:13px; padding:.75rem; background:#fff; }
.today-session-card:hover { border-color:#bfdbfe; box-shadow:0 5px 16px rgba(15,23,42,.06); }
.today-session-time { text-align:center; border-right:1px solid var(--line); padding-right:.7rem; }
.today-session-time strong,.today-session-time small { display:block; }
.today-session-time strong { color:var(--ink); font-size:1.12rem; }
.today-session-time small { color:var(--muted); margin-top:.15rem; font-size:.7rem; }
.today-session-title { display:flex; align-items:center; gap:.55rem; }
.today-session-title>span { font-size:1.45rem; }
.today-session-title strong,.today-session-title small { display:block; }
.today-session-title small { color:var(--muted); margin-top:.1rem; }
.today-capacity { margin-top:.5rem; }
.today-capacity>div:first-child { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; font-size:.75rem; color:var(--muted); }
.today-capacity .capacity-bar { display:block; width:100%; height:6px; margin-top:.35rem; }
.empty-state { display:grid; justify-items:center; gap:.5rem; padding:2rem 1rem; color:var(--muted); text-align:center; }
.empty-state>span { font-size:2rem; }
.today-task-list { display:grid; gap:.55rem; }
.today-task { display:flex; justify-content:space-between; align-items:center; gap:.65rem; padding:.6rem; border:1px solid var(--line); border-radius:10px; background:#fff; }
.today-task>div:first-child strong,.today-task>div:first-child small,.today-task summary span strong,.today-task summary span small { display:block; }
.today-task small { color:var(--muted); margin-top:.1rem; }
.today-task-actions { display:flex; gap:.3rem; flex-wrap:wrap; justify-content:flex-end; }
.today-task-actions form { margin:0; }
details.today-task { display:block; }
details.today-task summary { display:flex; justify-content:space-between; align-items:center; list-style:none; cursor:pointer; }
details.today-task summary::-webkit-details-marker { display:none; }
details.today-task.attention { border-color:#fecaca; background:#fff7ed; }
details.today-task.attention summary b { color:#dc2626; font-size:1.2rem; }
details.today-task p { padding:.55rem 0 0; margin:.35rem 0; border-top:1px solid rgba(239,68,68,.18); color:#7f1d1d; }
.today-secondary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.today-compact-list { display:grid; gap:.35rem; }
.today-compact-list>div { display:flex; align-items:center; gap:.45rem; min-height:38px; padding:.35rem 0; border-bottom:1px solid #f1f5f9; }
.today-compact-list>div:last-child { border-bottom:0; }
.today-compact-list>div>:first-child { margin-right:auto; }
.today-compact-list small { color:var(--muted); }
@media(max-width:1050px){.today-workspace{grid-template-columns:1fr}.today-task-column{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){
 .today-quick-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem;padding-bottom:0}.today-quick-actions a{padding:.62rem .7rem}.today-quick-actions strong{font-size:.78rem}
 .today-task-column,.today-secondary-grid{grid-template-columns:1fr}.today-session-card{grid-template-columns:58px minmax(0,1fr);gap:.55rem}.today-session-card>.btn{grid-column:1/-1;width:100%;justify-content:center}.today-session-time{padding-right:.45rem}.today-capacity .capacity-bar{width:100%}
}

/* Ficha de alumno: navegación por secciones */
.student-section-tabs { position:sticky; top:66px; z-index:28; display:flex; gap:.35rem; overflow-x:auto; padding:.45rem; margin:0 0 1rem; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.96); box-shadow:0 5px 18px rgba(15,23,42,.06); backdrop-filter:blur(12px); scrollbar-width:none; }
.student-section-tabs::-webkit-scrollbar{display:none}.student-section-tabs a{flex:0 0 auto;padding:.5rem .72rem;border-radius:9px;color:#475569;text-decoration:none;font-size:.8rem;font-weight:750;white-space:nowrap}.student-section-tabs a:hover{background:#f1f5f9}.student-section-tabs a.active{background:var(--accent);color:#fff}.student-anchor{scroll-margin-top:132px;height:1px}.student-reservation-cards{display:grid;gap:.55rem}.student-reservation-card{display:grid;grid-template-columns:88px minmax(0,1fr) auto;align-items:center;gap:.7rem;padding:.65rem;border:1px solid var(--line);border-radius:11px;color:var(--text);text-decoration:none}.student-reservation-card:hover{background:#f8fafc;border-color:#bfdbfe}.student-reservation-card>span:nth-child(2) strong,.student-reservation-card>span:nth-child(2) small,.student-reservation-date strong,.student-reservation-date small{display:block}.student-reservation-card small{color:var(--muted);margin-top:.12rem}.student-reservation-date{padding-right:.65rem;border-right:1px solid var(--line)}
@media(max-width:900px){.student-section-tabs{top:54px;margin-left:-.2rem;margin-right:-.2rem}.student-anchor{scroll-margin-top:118px}}
@media(max-width:600px){.student-reservation-card{grid-template-columns:68px minmax(0,1fr)}.student-reservation-card>.pill{grid-column:1/-1;justify-self:start}.student-section-tabs a{font-size:.73rem;padding:.45rem .6rem}}

/* Pasar lista: barra de búsqueda y controles táctiles */
.attendance-toolbar { position:sticky; top:66px; z-index:24; display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin:0 0 1rem; padding:.65rem; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.97); box-shadow:0 5px 16px rgba(15,23,42,.06); backdrop-filter:blur(10px); }
.attendance-search { position:relative; display:flex; align-items:center; flex:1; min-width:220px; }
.attendance-search>span { position:absolute; left:.7rem; }
.attendance-search input { width:100%; min-height:40px; padding:.55rem .65rem .55rem 2.15rem; border:1px solid #cbd5e1; border-radius:9px; }
.attendance-filters { display:flex; gap:.3rem; }
.attendance-filters button { border:1px solid #cbd5e1; border-radius:999px; padding:.45rem .65rem; background:#fff; color:#475569; font:inherit; font-size:.75rem; font-weight:750; }
.attendance-filters button.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.reservations-table button[name="attendance"] { min-height:38px; padding:.5rem .7rem; }
@media(max-width:700px){.attendance-toolbar{top:54px;align-items:stretch}.attendance-search{min-width:100%;}.attendance-filters{overflow-x:auto}.attendance-toolbar>[data-attendance-visible]{margin-left:auto;align-self:center}.reservations-table button[name="attendance"]{min-height:44px;flex:1}}
.group-communication-cta{display:flex;align-items:center;justify-content:space-between;gap:1rem}.group-communication-cta>div{min-width:0}@media(max-width:600px){.group-communication-cta{align-items:stretch;flex-direction:column}.group-communication-cta .btn{justify-content:center}}

/* Panel del alumno: edición segura de datos personales */
.student-profile-editor{margin:1rem 0;border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}.student-profile-editor>summary{display:flex;align-items:center;justify-content:space-between;gap:1rem;list-style:none;cursor:pointer;padding:1rem}.student-profile-editor>summary::-webkit-details-marker{display:none}.student-profile-editor>summary span:first-child strong,.student-profile-editor>summary span:first-child small{display:block}.student-profile-editor>summary span:first-child small{color:var(--muted);margin-top:.15rem}.student-profile-summary-action{padding:.38rem .65rem;border:1px solid #cbd5e1;border-radius:8px;color:var(--ink);font-size:.78rem;font-weight:800}.student-profile-editor[open] .student-profile-summary-action{background:#eff6ff;border-color:#bfdbfe}.student-profile-editor-body{padding:0 1rem 1rem;border-top:1px solid var(--line)}.student-profile-readonly{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin:1rem 0}.student-profile-readonly>div{padding:.7rem;border:1px solid var(--line);border-radius:10px;background:#f8fafc}.student-profile-readonly small,.student-profile-readonly strong{display:block}.student-profile-readonly small{color:var(--muted);margin-bottom:.15rem}.student-profile-form{display:grid;gap:1rem}.student-profile-form fieldset{margin:0;padding:1rem;border:1px solid var(--line);border-radius:12px;background:#fff}.student-profile-form legend{padding:0 .45rem;color:var(--ink);font-weight:850}.student-profile-form label{margin-bottom:.65rem}.student-profile-form fieldset label:last-child{margin-bottom:0}.student-profile-confirm{background:#fffbeb!important;border-color:#fde68a!important}.student-profile-form .form-actions{margin-top:0}
@media(max-width:600px){.student-profile-editor>summary{padding:.8rem}.student-profile-editor-body{padding:0 .75rem .75rem}.student-profile-readonly{grid-template-columns:1fr}.student-profile-form fieldset{padding:.75rem}}
.profile-change-list{display:grid;gap:1rem}.profile-change-card{border-left:4px solid #94a3b8}.profile-change-card.is-pending{border-left-color:#f59e0b;background:#fffbeb}.profile-change-card .panel-head form{margin:0}@media(max-width:600px){.profile-change-card .panel-head{align-items:stretch;flex-direction:column}.profile-change-card .panel-head .btn{width:100%;justify-content:center}}

/* Estado inactivo en el panel del alumno */
.student-inactive-banner{display:flex;align-items:center;gap:.85rem;margin:0 0 1rem;padding:1rem;border:1px solid #fecaca;border-left:5px solid #dc2626;border-radius:13px;background:#fef2f2;color:#7f1d1d}.student-inactive-icon{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:50%;background:#dc2626;color:#fff;font-size:1.35rem;font-weight:900}.student-inactive-banner strong{display:block;font-size:1.05rem}.student-inactive-banner p{margin:.18rem 0 0}.portal-card.is-inactive{border-left-color:#dc2626;background:#fef2f2}.portal-card.is-inactive strong{color:#991b1b}.student-inactive-checkin{text-align:center;padding:1.5rem;border:1px solid #fecaca;border-radius:14px;background:#fef2f2}.student-inactive-checkin .student-inactive-icon{margin:0 auto .75rem}.student-inactive-checkin h1{color:#991b1b}
.student-login-error{margin:.8rem 0;text-align:left;border-left:5px solid #dc2626;background:#fef2f2;color:#7f1d1d}.password-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.4rem;align-items:stretch}.password-input-row input{width:100%}.password-input-row .btn{min-width:46px;justify-content:center;padding:.5rem}
/* Evaluaciones publicadas y planes */
.evaluation-publish-bar{display:flex;gap:.6rem;align-items:center;justify-content:flex-end;flex-wrap:wrap;margin-bottom:1rem}.evaluation-publish-form{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}.evaluation-publish-form input{width:auto;min-height:38px}.published-evaluations{padding:.8rem;border:1px solid var(--line);border-radius:12px;background:#f8fafc;margin-bottom:1rem}.published-evaluations>strong{display:block;margin-bottom:.4rem}.published-evaluations>div{display:flex;align-items:center;gap:.5rem;padding:.45rem 0;border-top:1px solid var(--line)}.published-evaluations>div>span{flex:1}.published-evaluations small,.published-evaluations b{display:block}.published-evaluations small{color:var(--muted)}.published-evaluations form{margin:0}.portal-evaluation-reports{margin:1rem 0}.plan-usage-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.6rem}.plan-usage-grid>div{padding:.65rem;border:1px solid var(--line);border-radius:10px;background:#f8fafc}.plan-usage-grid small,.plan-usage-grid strong{display:block}.plan-usage-grid strong{margin:.15rem 0 .35rem}.attendance-plan-summary .capacity-bar{display:block;width:100%}
@media(max-width:650px){.evaluation-publish-bar,.evaluation-publish-form{align-items:stretch;flex-direction:column}.evaluation-publish-form input,.evaluation-publish-form .btn{width:100%}.published-evaluations>div{align-items:stretch;flex-direction:column}.plan-usage-grid{grid-template-columns:1fr}}
/* Grupos: pasar lista y alta de miembros */
#pasar-lista,#miembros{scroll-margin-top:80px}.group-attendance-all{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}.group-attendance-all label{margin:0}.group-member-search-form{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:.6rem;align-items:end;max-width:760px}.group-member-search-form label{margin:0}.group-member-search-form small{grid-column:1/-1}.group-member-search-form input[type="search"]{width:100%}
@media(max-width:650px){.group-member-search-form{grid-template-columns:1fr}.group-member-search-form .btn{width:100%;justify-content:center}.group-member-search-form small{grid-column:auto}.group-attendance-all{align-items:stretch;flex-direction:column}}
/* Las confirmaciones siguen visibles cuando una acción redirige a un ancla. */
.admin-main>.alert{position:sticky;top:66px;z-index:34;box-shadow:0 8px 24px rgba(15,23,42,.12)}@media(max-width:900px){.admin-main>.alert{top:54px}}

/* ── Campana de avisos de Formación en el panel del alumno (2.7.1) ── */
.portal-head-actions{display:flex;gap:.5rem;align-items:center}
.np-bell{position:relative;background:#fff;border:1px solid #e2e8f0;border-radius:999px;width:40px;height:40px;font-size:1.1rem;cursor:pointer;box-shadow:0 1px 2px rgba(15,23,42,.08);line-height:1}
.np-bell:hover{background:#f8fafc}
.np-badge{position:absolute;top:-6px;right:-6px;background:#dc2626;color:#fff;border-radius:999px;min-width:18px;height:18px;font-size:.68rem;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 4px;box-shadow:0 1px 3px rgba(220,38,38,.4)}
.np-drop{position:fixed;top:70px;right:12px;width:min(360px,92vw);background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 12px 30px rgba(15,23,42,.18);z-index:9999;overflow:hidden;display:none}
.np-drop-head{display:flex;justify-content:space-between;align-items:center;padding:.65rem .9rem;border-bottom:1px solid #eef2f7;font-weight:700;font-size:.95rem}
.np-link{background:none;border:0;color:#2563eb;font-size:.8rem;cursor:pointer;padding:0}
.np-link:hover{text-decoration:underline}
.np-drop-body{max-height:320px;overflow:auto}
.np-item{display:flex;gap:.55rem;align-items:flex-start;padding:.6rem .9rem;border-bottom:1px solid #f1f5f9;font-size:.9rem;color:#0f172a;text-decoration:none}
.np-item:last-child{border-bottom:0}
.np-item.unread{background:#fefce8}
.np-item .np-time{display:block;color:#64748b;font-size:.72rem;margin-top:.15rem}
.np-section{padding:.45rem .9rem;background:#f8fafc;color:#475569;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em}
.np-empty{padding:1rem;text-align:center;color:#64748b;font-size:.9rem}
.np-drop-foot{display:flex;gap:.5rem;padding:.6rem .9rem;border-top:1px solid #eef2f7}

/* Botón de cierre de la campana (2.8.1) */
.np-close{background:#f1f5f9;border:0;color:#475569;border-radius:999px;width:24px;height:24px;font-size:.72rem;cursor:pointer;line-height:1;display:flex;align-items:center;justify-content:center}
.np-close:hover{background:#e2e8f0;color:#0f172a}

/* ════════════════════════════════════════════════════════════════
   Sistema de diseño 3.0 · piezas unificadas
   ════════════════════════════════════════════════════════════════ */

/* Buscador vivo unificado: caja 🔍 + contador «N resultados» */
.live-filter-wrap { display:flex; align-items:center; gap:.45rem; flex-wrap:nowrap; }
.live-filter { position:relative; display:flex; align-items:center; }
.live-filter>span { position:absolute; left:.6rem; font-size:.82rem; pointer-events:none; opacity:.75; }
.live-filter input { min-height:38px; padding:.48rem .6rem .48rem 1.95rem; border:1px solid #cbd5e1; border-radius:9px; font:inherit; font-size:.84rem; width:min(280px,52vw); background:#fff; }
.live-filter input:focus { outline:3px solid rgba(37,99,235,.13); border-color:var(--accent); }
.live-filter-count { font-size:.74rem; color:var(--muted); font-weight:700; white-space:nowrap; }
.invoice-live-filter { margin:0 0 .7rem; }
@media(max-width:700px){
    .live-filter input { width:100%; max-width:none; }
    .live-filter { flex:1; }
    .panel-head .live-filter-wrap { width:100%; order:3; }
}

/* Sub-pestañas dentro del hub Cobros (Matriz) */
.matrix-filter-tabs { margin:0 0 .9rem; }

/* Menú: zona inferior (Mi cuenta · Ayuda · Ver pública · Salir) */
.sidebar-foot-links { display:grid; grid-template-columns:1fr 1fr; gap:.35rem; }
.sidebar-foot-links a { display:flex; align-items:center; gap:.4rem; padding:.45rem .55rem; border:1px solid rgba(255,255,255,.12); border-radius:9px; color:#cbd5e1; font-size:.8rem; font-weight:600; }
.sidebar-foot-links a:hover { background:rgba(255,255,255,.08); color:#fff; }
.sidebar-foot-links a.active { background:rgba(255,255,255,.14); color:#fff; }

/* Estado vacío coherente en toda la app */
p.empty { padding:1.2rem 1rem; text-align:center; color:var(--muted); }

/* Resumen anual (Cobros → Matriz) sin estilos inline */
.year-chart h3, .year-methods h3 { margin-top:0; }
.year-total-note { margin-top:.6rem; }
.mt-sm { margin-top:.5rem; }

/* 3.0 · panel-head con varios elementos (título + filtro + acciones) */
.panel-head { flex-wrap: wrap; gap: .35rem .6rem; }
.panel-head .live-filter-wrap { align-self: center; }

/* ════════════════════════════════════════════════════════════════
   Sistema de diseño 3.1 · Cobros completo + Comunicados con pestañas
   ════════════════════════════════════════════════════════════════ */

/* Etiquetas de estado de factura (antes inline en la lista vieja) */
.status-pill { display:inline-block; padding:.2rem .6rem; border-radius:999px; font-size:.75rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.status-pill.status-issued    { background:#fef3c7; color:#92400e; }
.status-pill.status-paid      { background:#d1fae5; color:#065f46; }
.status-pill.status-cancelled { background:#fee2e2; color:#991b1b; }

/* KPIs y filtros de la pestaña Facturas */
.invoice-kpis { margin-bottom:1rem; }
.invoice-filters { margin-bottom:.8rem; }
.invoice-disclaimer { margin-bottom:1rem; }

/* Bienvenida de alumnos (pestaña de Comunicados) */
.code-textarea { font-family: ui-monospace,Menlo,Consolas,monospace; }
.card-sub-soft { background:#f8fafc; }
.welcome-preview { white-space:pre-wrap; line-height:1.6; padding:1rem; border:1px solid var(--line); border-radius:12px; background:#fff; }
.comm-tabs-bar { margin-bottom:1rem; }

/* ── v3.2 · Ajustes agrupados + páginas unidas ── */
.settings-section-title{display:flex;align-items:center;gap:.5rem;font-size:1.05rem;font-weight:800;color:var(--text);margin:1.6rem 0 .7rem}.settings-section-title:first-of-type{margin-top:.4rem}.settings-section-title span{font-size:1.25rem}
.pricing-tabs{margin-bottom:1rem}
@media(max-width:700px){.settings-section-title{font-size:.98rem}}

/* ── v3.3 · Tema oscuro del panel (Ajustes → General e identidad) ── */
html[data-theme="dark"]{--bg:#0c1322;--card:#131e30;--text:#e6ebf4;--muted:#8fa0b8;--line:#263451;--ink:#f1f5f9;--shadow:0 4px 12px rgba(0,0,0,.35);--shadow-lg:0 10px 30px rgba(0,0,0,.45)}
html[data-theme="dark"]{color-scheme:dark} /* v4.10.0 · barras de scroll y controles nativos también en oscuro */
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] .btn{background:#182741;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .btn:hover{background:#1f3155}
html[data-theme="dark"] .btn.primary{background:var(--ink);border-color:var(--ink);color:#0f172a}
html[data-theme="dark"] .btn.primary:hover{background:#fff;border-color:#fff}
html[data-theme="dark"] .btn.ghost{background:transparent}
html[data-theme="dark"] .btn.ghost:hover{background:rgba(255,255,255,.07)}
html[data-theme="dark"] .btn.danger{color:#f87171;border-color:#7f1d1d}
html[data-theme="dark"] .btn.danger:hover{background:rgba(220,38,38,.14)}
html[data-theme="dark"] label input[type="text"],html[data-theme="dark"] label input[type="password"],html[data-theme="dark"] label input[type="email"],html[data-theme="dark"] label input[type="date"],html[data-theme="dark"] label input[type="month"],html[data-theme="dark"] label input[type="number"],html[data-theme="dark"] label input[type="search"],html[data-theme="dark"] label input[type="url"],html[data-theme="dark"] label select,html[data-theme="dark"] label textarea{background:#0f1a2c;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{color-scheme:dark}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#64748b}
html[data-theme="dark"] label input:focus,html[data-theme="dark"] label select:focus,html[data-theme="dark"] label textarea:focus{border-color:var(--ink);box-shadow:0 0 0 3px rgba(255,255,255,.10)}
html[data-theme="dark"] .live-filter input,html[data-theme="dark"] .mini-select,html[data-theme="dark"] .global-search input{background:#0f1a2c;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] code{background:#1d2c47;color:#dbe4f3}
html[data-theme="dark"] .settings-menu-card,html[data-theme="dark"] .quick-card,html[data-theme="dark"] .check-option,html[data-theme="dark"] .plan-usage-grid>div,html[data-theme="dark"] .published-evaluations,html[data-theme="dark"] .student-profile-editor,html[data-theme="dark"] .more-filters-body,html[data-theme="dark"] .welcome-preview,html[data-theme="dark"] .card-sub-soft,html[data-theme="dark"] .global-search-results,html[data-theme="dark"] .empty-state{background:#131e30;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .card-sub,html[data-theme="dark"] .form-section-head{background:#131e30!important;border-color:var(--line)!important;color:var(--text)}
html[data-theme="dark"] .global-search-result:hover,html[data-theme="dark"] .global-search-result.is-selected{background:rgba(255,255,255,.07)}
html[data-theme="dark"] .data-table tbody tr:hover{background:rgba(255,255,255,.035)}
html[data-theme="dark"] .filter-tabs a{background:#182741;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .filter-tabs a:hover{background:#1f3155}
html[data-theme="dark"] .filter-tabs a.active,html[data-theme="dark"] .page-link.active{background:var(--ink);border-color:var(--ink);color:#0f172a}
html[data-theme="dark"] .payment-summary .metric-good,html[data-theme="dark"] .metric-good{background:rgba(22,163,74,.16)}
html[data-theme="dark"] .payment-summary .metric-warn,html[data-theme="dark"] .metric-warn{background:rgba(245,158,11,.15)}
html[data-theme="dark"] .portal-card.is-ok{background:rgba(22,163,74,.16)}
html[data-theme="dark"] .portal-card.is-warn{background:rgba(245,158,11,.16)}
html[data-theme="dark"] .portal-card.is-primary{background:rgba(37,99,235,.18)}
html[data-theme="dark"] .alert.ok{background:rgba(22,163,74,.14);border-color:rgba(74,222,128,.35);color:#86efac}
html[data-theme="dark"] .alert.error{background:rgba(220,38,38,.14);border-color:rgba(248,113,113,.35);color:#fca5a5}
html[data-theme="dark"] .alert-chip{background:rgba(220,38,38,.16);color:#fca5a5}
html[data-theme="dark"] .alert:not(.ok):not(.error){background:#131e30;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .np-close:hover{background:#263451;color:#f1f5f9}
html[data-theme="dark"] .admin-topbar{background:rgba(12,19,34,.94)}
html[data-theme="dark"] .admin-menu-button{background:var(--card);border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .global-search kbd{background:var(--bg);border-color:var(--line);color:var(--muted)}
html[data-theme="dark"] .global-search-icon,html[data-theme="dark"] .global-search-result-type{color:var(--muted)}
html[data-theme="dark"] .global-search-result-icon{background:var(--bg)}
html[data-theme="dark"] .mobile-bottom-nav{background:rgba(19,30,48,.97);border-top-color:var(--line)}
html[data-theme="dark"] .mobile-bottom-nav a,html[data-theme="dark"] .mobile-bottom-nav button{color:var(--muted)}
html[data-theme="dark"] .mobile-bottom-nav a.active{color:var(--accent);background:rgba(37,99,235,.18)}
html[data-theme="dark"] .session-detail-actions{background:rgba(37,99,235,.13);border-color:rgba(59,130,246,.35)}
html[data-theme="dark"] .session-stat{background:#182741;border-color:var(--line)}
html[data-theme="dark"] .reservations-table tr[data-status="attended"] td{background:rgba(22,163,74,.13)}
html[data-theme="dark"] .reservations-table tr[data-status="no_show"] td{background:rgba(245,158,11,.13)}
html[data-theme="dark"] .reservations-table tr[data-attention="1"] td{border-top-color:#7f1d1d;border-bottom-color:#7f1d1d}
html[data-theme="dark"] .reservations-table tr[data-attention="1"] td:first-child{border-left-color:#7f1d1d}

/* v4.9.2 · Firma legal (gate de primer acceso y altas web) */
.legal-opts{display:flex;flex-direction:column;gap:.5rem;margin:.35rem 0 .9rem}
.legal-opt{display:flex;gap:.65rem;align-items:flex-start;padding:.7rem .9rem;border:1.5px solid var(--line);border-radius:12px;background:var(--card);cursor:pointer;transition:border-color .15s,box-shadow .15s}
.legal-opt:hover,.legal-opt:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.legal-opt input[type=radio],.legal-opt input[type=checkbox]{margin-top:.25rem;accent-color:var(--accent);width:1.05rem;height:1.05rem;flex:none}
.legal-opt span{line-height:1.45}
.legal-opt small{display:block;color:var(--muted);margin-top:.15rem}
.legal-legend{font-weight:700;margin:1rem 0 .3rem}
html[data-theme="dark"] .legal-opt{background:#131e30}

/* ═══════════ v4.10.0 · Pulido visual y nuevas pantallas ═══════════ */

/* Migas de pan bajo la topbar (páginas de ajustes y secciones anidadas) */
.breadcrumbs{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;margin:0 0 .8rem;font-size:.8rem;color:var(--muted)}
.breadcrumbs a{color:var(--muted);text-decoration:none;padding:.15rem .4rem;border-radius:6px}
.breadcrumbs a:hover{color:var(--accent);background:rgba(142,11,29,.07);text-decoration:none}
.breadcrumbs .sep{color:var(--line);user-select:none}
.breadcrumbs .here{color:var(--text);font-weight:650;padding:.15rem .4rem}

/* Botón de tema claro/oscuro en la topbar */
.theme-toggle{flex:0 0 auto;width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:var(--card);cursor:pointer;font-size:1.05rem;line-height:1;padding:0;color:var(--text)}
.theme-toggle:hover{border-color:var(--accent);box-shadow:0 0 0 3px rgba(142,11,29,.10)}
html[data-theme="dark"] .theme-toggle{background:#182741;border-color:var(--line)}
@media(max-width:900px){.theme-toggle{width:36px;height:36px}}

/* Barra de acciones en lote (lista de alumnos y matriz de cobros) */
.bulkbar{position:sticky;bottom:.8rem;z-index:30;display:none;align-items:center;gap:.55rem;margin:.9rem 0 0;padding:.6rem .8rem;background:var(--primary);color:#fff;border-radius:12px;box-shadow:var(--shadow-lg);flex-wrap:wrap}
.bulkbar.on{display:flex}
.bulkbar strong{font-size:.9rem}
.bulkbar select,.bulkbar input{font-size:.85rem;border:0;border-radius:8px;padding:.4rem .55rem;background:rgba(255,255,255,.12);color:#fff}
.bulkbar select option{color:#0f172a}
.bulkbar .btn{border:0}
html[data-theme="dark"] .bulkbar{background:#233657}
.row-check{width:1.05rem;height:1.05rem;accent-color:var(--accent);cursor:pointer}

/* Selector de plantillas al redactar un comunicado */
.tpl-picker{display:flex;gap:.5rem;align-items:center;margin-bottom:.5rem;flex-wrap:wrap}
.tpl-picker select{max-width:340px}
.tpl-picker .muted{font-size:.78rem}

/* Tarjetas iCal (suscripción a calendario) */
.ical-box{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center;padding:.8rem 1rem;border:1px dashed var(--line);border-radius:12px;background:linear-gradient(180deg,rgba(142,11,29,.03),transparent)}
.ical-box code{word-break:break-all;font-size:.75rem;background:var(--bg);border:1px solid var(--line);padding:.3rem .55rem;border-radius:8px;flex:1;min-width:220px}
html[data-theme="dark"] .ical-box code{background:#0c1322}
@media print{.breadcrumbs,.theme-toggle,.bulkbar{display:none!important}}

/* ═══ v4.10.1 · Alineación de rejillas en la ficha + hub del alumno ═══ */

/* Ficha del alumno: acciones rápidas — los <form> ya no rompen la rejilla:
   sus botones pasan a ser hijos flex directos y TODOS tienen la misma altura. */
.quick-actions-grid{align-items:stretch}
.quick-actions-grid>.inline-form{display:flex;margin:0}
.quick-actions-grid>.inline-form>.btn{width:100%;height:100%}
.quick-actions-grid>.btn{height:auto;min-height:2.4rem;display:inline-flex;align-items:center}
@media(min-width:900px){.quick-actions-grid>.btn{height:100%}}

/* Métricas: contenido centrado y sin desbordes aunque una tarjeta tenga enlace */
.metrics-grid .metric{display:flex;flex-direction:column;justify-content:center;min-width:0}
.metrics-grid .metric>*{min-width:0}

/* Portal del alumno · subtítulos del hub «Evaluación e informes» */
.portal-hub-sub{margin:1rem 0 .45rem;font-size:.95rem;color:var(--ink)}
.portal-evaluation-reports .quick-cards .quick-card{align-items:center}
html[data-theme="dark"] .portal-hub-sub{color:#e5e9f2}

/* ═══ v4.10.2 · Lupas centradas + rejilla del alumno compacta ═══ */

/* La lupa de los filtros en vivo quedaba ligeramente alta/baja según la fuente:
   centrado matemático (no depende de métricas del emoji) */
.live-filter>span{top:50%;transform:translateY(-50%);line-height:1;display:inline-flex;align-items:center}
.global-search-icon{display:inline-flex;align-items:center;line-height:1}
.global-search-icon svg{display:block}

/* Portal del alumno: las tarjetas ya no se estiran dejando huecos vacíos
   (grilla «menú del alumno» compacta, alineadas arriba) */
.student-portal-grid{align-items:start}
.portal-card .btn{margin-top:.25rem}

/* ═══ v4.11.0 · Búsqueda con la lupa FUERA del campo + sidebar compacto ═══ */

/* La lupa ya no flota DENTRO del input (se veía horrible y desalineada):
   ahora es una pestaña unida al campo, como un buscador clásico. */
.live-filter{display:inline-flex;align-items:stretch;border:1px solid #cbd5e1;border-radius:10px;background:#fff;overflow:hidden}
.live-filter>span{position:static;transform:none;opacity:.75;font-size:.95rem;padding:0 .6rem;background:#f1f5f9;border-right:1px solid #e2e8f0;display:inline-flex;align-items:center}
.live-filter input{border:0;background:transparent;padding:.5rem .7rem .5rem .55rem;min-height:38px;box-shadow:none}
.live-filter input:focus{outline:none}
.live-filter:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(142,11,29,.12)}
html[data-theme="dark"] .live-filter{background:#182741;border-color:var(--line)}
html[data-theme="dark"] .live-filter>span{background:#0c1322;border-right-color:var(--line)}
html[data-theme="dark"] .live-filter input{background:transparent;color:var(--text)}

/* Sidebar escritorio más compacto (los ítems no flotan con tanto aire) */
@media(min-width:901px){
  .sidebar .brand{padding:.6rem 1rem .9rem;margin-bottom:.35rem}
  .sidebar nav a{padding:.52rem 1rem;gap:.55rem}
  .sidebar nav a>span:first-child{width:1.15rem;text-align:center}
}

/* Portal del alumno · botón «Evaluación e informes» */
.portal-informes-cta{display:flex;gap:.7rem;align-items:center;flex-wrap:wrap;margin:0 0 1rem;padding:.8rem 1rem;border:1px solid var(--line);border-radius:12px;background:linear-gradient(180deg,rgba(142,11,29,.04),transparent)}
html[data-theme="dark"] .portal-informes-cta{background:rgba(142,11,29,.08)}
.portal-hub-title{margin:1.1rem 0 .5rem;font-size:1.02rem}

/* ═══════════════ v4.13.0 · PILOTO «Nuevo Cobros» (A en escritorio · B en móvil) ═══════════════
   Decisión de Jorge: la seriedad de la propuesta A (tabla clara, KPIs con franja)
   en pantallas grandes y el dinamismo de la B (hero con progreso + tarjetas) en
   el móvil. MISMO markup, dos trajes: @media <=920px transforma las filas en tarjetas. */
.colv2 { }
.cv2-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:.8rem; margin:.9rem 0 1.1rem; }
.cv2-kpi { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:.85rem 1rem .9rem 1.15rem; position:relative; overflow:hidden; }
.cv2-kpi::before { content:""; position:absolute; left:0; top:12px; bottom:12px; width:4px; border-radius:4px; background:var(--line); }
.cv2-kpi.ok::before { background:var(--good); } .cv2-kpi.warn::before { background:var(--warn); }
.cv2-kpi.bad::before { background:var(--bad); } .cv2-kpi.info::before { background:var(--primary); }
.cv2-kpi small { color:var(--muted); font-size:.7rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; display:block; }
.cv2-kpi .cv2-n { font-size:1.4rem; font-weight:800; letter-spacing:-.02em; margin-top:.15rem; }
.cv2-kpi.ok .cv2-n { color:var(--good); } .cv2-kpi.warn .cv2-n { color:var(--warn); } .cv2-kpi.bad .cv2-n { color:var(--bad); }
.cv2-kpi .cv2-s { font-size:.72rem; color:var(--muted); margin-top:.1rem; }
.cv2-hero-bar { display:none; }
.cv2-actions { display:flex; gap:.55rem; flex-wrap:wrap; margin-bottom:1.15rem; }
.cv2-panel { background:var(--card); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.cv2-panel-head { padding:.85rem 1.05rem; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:.8rem; flex-wrap:wrap; }
.cv2-panel-head h2 { font-size:1rem; margin:0; }
.cv2-chips { display:inline-flex; background:var(--bg); border-radius:999px; padding:.22rem; gap:.15rem; flex-wrap:wrap; }
.cv2-chips a { padding:.32rem .8rem; border-radius:999px; font-size:.78rem; text-decoration:none; color:var(--muted); font-weight:600; }
.cv2-chips a.on { background:var(--card); color:var(--primary); box-shadow:var(--shadow); }
.cv2-group { padding:.35rem 1.05rem; font-size:.7rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); background:color-mix(in srgb, var(--bg) 70%, transparent); border-bottom:1px solid var(--line); }
.cv2-group.bad { color:var(--bad); } .cv2-group.warn { color:#b45309; } .cv2-group.ok { color:var(--good); }
.cv2-mv { display:grid; grid-template-columns:40px minmax(0,1.5fr) minmax(0,1.7fr) auto auto auto; gap:.8rem; align-items:center; padding:.6rem 1.05rem; border-bottom:1px solid var(--line); }
.cv2-mv:last-child { border-bottom:0; }
.cv2-mv:hover { background:color-mix(in srgb, var(--bg) 55%, transparent); }
.cv2-av { width:36px; height:36px; border-radius:50%; background:var(--primary); color:#fff; font-size:.72rem; font-weight:800; display:grid; place-items:center; }
.cv2-mv.is-overdue .cv2-av { background:var(--accent); }
.cv2-who b { font-size:.9rem; display:block; line-height:1.2; }
.cv2-who small, .cv2-concept small { color:var(--muted); font-size:.73rem; font-weight:400; }
.cv2-who a { color:inherit; text-decoration:none; } .cv2-who a:hover { text-decoration:underline; }
.cv2-concept { font-size:.85rem; line-height:1.25; }
.cv2-concept small { display:block; }
.cv2-pill { font-size:.68rem; font-weight:800; padding:.2rem .6rem; border-radius:999px; white-space:nowrap; justify-self:start; }
.cv2-pill.ok { background:color-mix(in srgb, var(--good) 14%, transparent); color:var(--good); }
.cv2-pill.warn { background:color-mix(in srgb, var(--warn) 16%, transparent); color:#b45309; }
.cv2-pill.bad { background:color-mix(in srgb, var(--bad) 12%, transparent); color:var(--bad); }
.cv2-imp { font-weight:800; font-variant-numeric:tabular-nums; text-align:right; font-size:.95rem; }
.cv2-imp small { display:block; font-weight:400; color:var(--muted); font-size:.7rem; }
.cv2-acts { display:flex; gap:.35rem; }
.cv2-acts .btn, .cv2-mini { height:32px; min-width:32px; padding:0 .5rem; border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--text); cursor:pointer; font-size:.82rem; display:inline-flex; align-items:center; justify-content:center; gap:.25rem; text-decoration:none; line-height:1; }
.cv2-acts .btn:hover, .cv2-mini:hover { border-color:var(--primary); }
.cv2-mini.go { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:700; }
.cv2-empty { padding:1.6rem 1rem; text-align:center; color:var(--muted); }
.cv2-note { margin-top:.7rem; font-size:.78rem; color:var(--muted); }
.cv2-note a { color:var(--primary); font-weight:600; }
/* ——— MÓVIL: traje B (hero grande + tarjetas) ——— */
@media (max-width: 920px) {
    .cv2-kpis { grid-template-columns:1fr 1fr; gap:.6rem; }
    .cv2-kpi.hero { grid-column:1 / -1; background:linear-gradient(135deg,#0b1a39,#1d3570); color:#fff; border:none; border-radius:18px; padding:1.15rem 1.25rem; }
    .cv2-kpi.hero::before { display:none; }
    .cv2-kpi.hero small { color:#b9c6e8; }
    .cv2-kpi.hero .cv2-n { color:#fff; font-size:2.2rem; }
    .cv2-kpi.hero .cv2-s { color:#cdd8f2; }
    .cv2-hero-bar { display:block; height:6px; background:rgba(255,255,255,.2); border-radius:99px; margin-top:.7rem; overflow:hidden; }
    .cv2-hero-bar i { display:block; height:100%; background:#4ade80; border-radius:99px; }
    .cv2-mv { grid-template-columns:44px minmax(0,1fr) minmax(0,auto); grid-template-areas:
        "av who imp"
        "av concept imp"
        "av state acts"; row-gap:.3rem; padding:.7rem .9rem; }
    .cv2-av { grid-area:av; align-self:start; }
    .cv2-who { grid-area:who; } .cv2-concept { grid-area:concept; }
    .cv2-pill { grid-area:state; }
    .cv2-imp { grid-area:imp; text-align:right; font-size:1.05rem; }
    .cv2-acts { grid-area:acts; justify-self:end; flex-direction:column; }
    .cv2-acts .cv2-mini { width:38px; height:38px; border-radius:12px; font-size:.95rem; }
}

/* ─────────── v4.15.0 · Sesiones: formularios de alta solo bajo demanda ─────────── */
/* Los botones de arriba («+ Sesión puntual» / «🔁 Clase semanal») abren su formulario;
   el <summary> suelto parecía un segundo botón y despistaba (Jorge, 4.14.0 feedback). */
.rule-form-details:not([open]) > summary { display:none; }

/* ─────────── v4.15.0 · Ficha de alumno reinventada: secciones plegadas ─────────── */
.card.panel.ficha-section { padding:0; overflow:hidden; }
.card.panel.ficha-section > summary {
    display:flex; align-items:center; gap:.55rem;
    list-style:none; cursor:pointer; user-select:none;
    padding:.92rem 1rem; font-weight:800; color:var(--ink); font-size:.97rem;
}
.card.panel.ficha-section > summary::-webkit-details-marker { display:none; }
.card.panel.ficha-section > summary .pill { margin-left:.1rem; }
.card.panel.ficha-section > summary::after {
    content:"\25B8"; margin-left:auto; color:var(--muted);
    transition:transform .15s; font-size:.85rem;
}
.card.panel.ficha-section[open] > summary::after { transform:rotate(90deg); }
.card.panel.ficha-section > summary:hover { background:#f8fafc; }
.ficha-body { padding:.9rem 1rem 1rem; border-top:1px solid var(--line); }
.ficha-actions { margin:.1rem 0 .75rem; }
.ficha-subs { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:.7rem; align-items:start; }
.ficha-sub-card { border:1px solid var(--line); border-radius:11px; padding:.75rem .9rem; background:#fbfdff; }

/* ═══ v4.16.0 · Rediseño portal del alumno: acciones a un toque + acordeones ═══ */
.student-portal-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem;margin-bottom:1rem}
.spa-tile{display:flex;flex-direction:column;align-items:flex-start;gap:.12rem;padding:.7rem .8rem;background:var(--card);border:1px solid var(--line);border-radius:13px;color:var(--text);text-decoration:none;box-shadow:0 2px 8px rgba(15,23,42,.05);min-width:0;text-align:left}
a.spa-tile:hover{border-color:#bfdbfe;background:#eff6ff;transform:translateY(-1px)}
.spa-tile .spa-ico{font-size:1.2rem;line-height:1.2}
.spa-tile strong{font-size:.85rem;line-height:1.25;color:var(--ink)}
.spa-tile small{color:var(--muted);font-size:.72rem;line-height:1.2}
.spa-tile.is-action{border-color:var(--primary);background:#eff6ff}
.spa-tile.is-done{border-color:var(--good);background:#f0fdf4}
.spa-tile.is-disabled{opacity:.8;background:var(--bg)}
.spa-badge{display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:#dc2626;color:#fff;font-size:.68rem;font-weight:800}
.portal-sec{margin:0 0 .75rem;padding:0;border:1px solid var(--line);border-radius:13px;background:var(--card);overflow:hidden;text-align:left}
.portal-sec>summary{display:flex;align-items:center;justify-content:space-between;gap:.6rem;padding:.8rem .95rem;cursor:pointer;list-style:none}
.portal-sec>summary::-webkit-details-marker{display:none}
.portal-sec>summary::after{content:"\25B8";color:var(--muted);font-size:.85rem;transition:transform .15s;flex:0 0 auto}
.portal-sec[open]>summary::after{transform:rotate(90deg)}
.portal-sec>summary>span{min-width:0}
.portal-sec>summary small{display:block;color:var(--muted);font-size:.72rem;margin-top:.1rem;font-weight:400}
.portal-sec .portal-sec-body{padding:.8rem .95rem .95rem;border-top:1px solid var(--line)}
.student-profile-editor.portal-sec>summary::after{content:none}
html[data-theme="dark"] .spa-tile.is-action{background:rgba(37,99,235,.18)}
html[data-theme="dark"] .spa-tile.is-done{background:rgba(22,163,74,.16)}
html[data-theme="dark"] a.spa-tile:hover{background:rgba(37,99,235,.14);border-color:#3b82f6}
@media(max-width:700px){.student-portal-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.spa-tile{padding:.62rem .7rem}}

/* ═══ PROPIETARIO 4.16.1-piloto · acceso recordado, grupos y tema oscuro ═══ */
.remember-device-option{display:flex;align-items:flex-start;gap:.65rem;padding:.75rem .85rem;border:1px solid var(--line);border-radius:10px;background:var(--card);font-weight:400;cursor:pointer}
.remember-device-option input{width:1.05rem;height:1.05rem;margin:.2rem 0 0;accent-color:var(--accent);flex:0 0 auto}
.remember-device-option span{display:block}.remember-device-option strong,.remember-device-option small{display:block}.remember-device-option small{color:var(--muted);font-size:.76rem;line-height:1.4;margin-top:.15rem}
.group-member-heading{display:flex;align-items:center;gap:.45rem;margin-top:1rem}.group-members-list{margin:.55rem 0 1rem}.group-inactive-block{margin:1rem 0;padding:.8rem 1rem;border:1px solid var(--line);border-radius:12px;background:var(--bg)}
.group-inactive-block>summary{cursor:pointer;font-weight:800;color:var(--text);list-style:none}.group-inactive-block>summary::-webkit-details-marker{display:none}.group-inactive-block[open]>summary{margin-bottom:.75rem}.quick-card.is-inactive{opacity:.82;border-style:dashed}.group-inactive-count{color:var(--muted)}
.group-add-members{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1.25rem;padding-top:1.1rem;border-top:1px solid var(--line)}.group-add-members>div{padding:1rem;border:1px solid var(--line);border-radius:12px;background:var(--card)}.group-add-inactive{border-style:dashed!important}.group-member-search-form .btn{margin-right:.35rem}.group-member-search-form small{display:block;margin-top:.45rem}.attendance-inactive-block{margin-top:1.25rem}
@media(max-width:760px){.group-add-members{grid-template-columns:1fr}}

/* El primario oscuro deja de ser blanco brillante: contraste cómodo y coherente. */
html[data-theme="dark"] .btn.primary{background:#2b4a73;border-color:#3d6598;color:#f8fafc}
html[data-theme="dark"] .btn.primary:hover{background:#365c8d;border-color:#4b75aa;color:#fff}
html[data-theme="dark"] .btn.primary:focus-visible{outline:3px solid rgba(96,165,250,.4);outline-offset:2px}
html[data-theme="dark"] .page-link.active,html[data-theme="dark"] .filter-tabs a.active{background:#2b4a73;border-color:#3d6598;color:#f8fafc}
html[data-theme="dark"] .remember-device-option,
html[data-theme="dark"] .today-quick-actions a,
html[data-theme="dark"] .today-session-card,
html[data-theme="dark"] .today-task,
html[data-theme="dark"] .attendance-filters button,
html[data-theme="dark"] .student-profile-editor,
html[data-theme="dark"] .student-profile-form fieldset,
html[data-theme="dark"] .student-profile-readonly>div,
html[data-theme="dark"] .np-bell,
html[data-theme="dark"] .np-drop,
html[data-theme="dark"] .live-filter,
html[data-theme="dark"] .portal-useful-card,
html[data-theme="dark"] .student-doc-content,
html[data-theme="dark"] .group-add-members>div{background:#131e30;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .portal-useful-section{background:linear-gradient(180deg,#131e30 0%,#101a2b 100%);border-color:var(--line)}
html[data-theme="dark"] .portal-useful-card strong,html[data-theme="dark"] .portal-useful-head strong,html[data-theme="dark"] .student-doc-content{color:var(--text)}
html[data-theme="dark"] .portal-useful-icon{background:#1c3151}
html[data-theme="dark"] .student-profile-summary-action{background:#182741;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .student-profile-editor[open] .student-profile-summary-action{background:#20395f;border-color:#365c8d}
html[data-theme="dark"] .student-profile-confirm,html[data-theme="dark"] details.today-task.attention,html[data-theme="dark"] .profile-change-card.is-pending{background:rgba(245,158,11,.12)!important;border-color:rgba(245,158,11,.35)!important}
html[data-theme="dark"] .group-communication-cta{background:#152b49!important;border-color:#315c8e!important}
html[data-theme="dark"] .group-inactive-block{background:#0f1a2c;border-color:var(--line)}
html[data-theme="dark"] .quick-card.is-inactive{background:#111b2c}
html[data-theme="dark"] .pill.off{background:#263451;color:#cbd5e1}
html[data-theme="dark"] .np-drop-head,html[data-theme="dark"] .np-drop-foot{background:#101a2b;border-color:var(--line)}
html[data-theme="dark"] .np-item:hover{background:rgba(255,255,255,.05)}

/* ═══ PROPIETARIO 4.16.2-piloto · móvil limpio y oscuro completo ═══ */
.students-mobile-cards{display:none}
.collection-mobile-nav{display:none}
.settings-url-row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:.55rem 0}.settings-url-row code{overflow-wrap:anywhere;flex:1;min-width:200px}
.settings-shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.7rem}.settings-mini-link{display:flex;flex-direction:column;gap:.18rem;padding:.85rem;border:1px solid var(--line);border-radius:11px;background:var(--card);color:var(--text)}.settings-mini-link span{font-size:.8rem;color:var(--muted)}

@media(max-width:700px){
  html,body,.admin-body,.admin-main{max-width:100%;overflow-x:hidden}
  .students-desktop-table{display:none!important}
  .students-mobile-cards{display:grid;gap:.65rem;width:100%;min-width:0}
  .student-mobile-card{display:grid;gap:.55rem;padding:.75rem;background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);min-width:0}
  .student-mobile-card.inactive{opacity:.72}
  .student-mobile-main{display:flex;align-items:center;gap:.45rem;min-width:0}.student-mobile-main>a{display:flex;align-items:center;min-width:0;flex:1;color:var(--text)}.student-mobile-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.student-mobile-main .pill{flex:none}
  .student-mobile-alerts{display:flex;gap:.25rem;flex-wrap:wrap}
  .student-mobile-grid{display:grid;grid-template-columns:minmax(110px,.8fr) minmax(0,1.2fr);gap:.5rem}.student-mobile-grid>div{padding:.55rem;border:1px solid var(--line);border-radius:9px;background:var(--bg);min-width:0}.student-mobile-grid small,.student-mobile-grid strong{display:block}.student-mobile-grid small{font-size:.6rem;text-transform:uppercase;font-weight:800;color:var(--muted);margin-bottom:.18rem}.student-mobile-grid strong{font-size:.82rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .student-mobile-open{width:100%;min-height:38px}
  .filter-bar{width:100%;min-width:0}.filter-bar>.live-filter-wrap{width:100%;min-width:0}.filter-bar input[type="search"]{width:100%;min-width:0}.filter-bar>select{flex:1;min-width:0}.filter-bar>.btn{flex:1}
  .collection-tabs-desktop{display:none!important}.collection-mobile-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.35rem;width:100%}.collection-mobile-nav>a,.collection-mobile-nav summary{display:flex;align-items:center;justify-content:center;min-height:40px;padding:.45rem .3rem;border:1px solid var(--line);border-radius:9px;background:var(--card);color:var(--text);font-size:.76rem;font-weight:750;text-decoration:none;list-style:none}.collection-mobile-nav>a.active,.collection-mobile-nav summary.active{background:var(--primary);border-color:var(--primary);color:#fff}.collection-mobile-nav details{position:relative}.collection-mobile-nav summary::-webkit-details-marker{display:none}.collection-mobile-nav details>div{position:absolute;z-index:40;right:0;top:45px;width:170px;padding:.4rem;background:var(--card);border:1px solid var(--line);border-radius:11px;box-shadow:var(--shadow-lg);display:grid;gap:.2rem}.collection-mobile-nav details>div a{padding:.55rem .65rem;border-radius:7px;color:var(--text);text-decoration:none;font-size:.82rem}.collection-mobile-nav details>div a.active,.collection-mobile-nav details>div a:hover{background:var(--bg)}
  .collections-nav-wrap{display:grid!important;gap:.55rem}.collections-nav-wrap .period-nav{width:100%;justify-content:center}.collections-nav-wrap .period-nav strong{flex:1;text-align:center}
  .cv2-actions{display:grid!important;grid-template-columns:1fr 1fr;gap:.45rem}.cv2-actions .btn{width:100%}.cv2-actions .btn:first-child{grid-column:1/-1}
  .page-head>.page-head-actions .btn[title*="vista"],.page-head>.page-head-actions a[href*="tab=reports"]{display:none}
}

/* Modo oscuro: tablas, buscadores y formularios sin superficies blancas. */
html[data-theme="dark"] .data-table,html[data-theme="dark"] .table{background:var(--card);color:var(--text)}
html[data-theme="dark"] .data-table th,html[data-theme="dark"] .table th{background:#182741!important;color:#cbd5e1;border-color:var(--line)}
html[data-theme="dark"] .data-table td,html[data-theme="dark"] .table td{background:var(--card);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .data-table tbody tr:hover td,html[data-theme="dark"] .table tbody tr:hover td{background:#18243a!important}
html[data-theme="dark"] .filter-bar,html[data-theme="dark"] .bulk-bar{background:#131e30!important;border-color:var(--line)!important;color:var(--text)}
html[data-theme="dark"] .filter-bar input,html[data-theme="dark"] .filter-bar select,html[data-theme="dark"] .bulk-bar select{background:#0f1a2c!important;border-color:var(--line)!important;color:var(--text)!important}
html[data-theme="dark"] .bulk-bar .bulk-count{color:var(--muted)!important}
html[data-theme="dark"] .student-mobile-card,html[data-theme="dark"] .student-mobile-grid>div{background:#131e30;border-color:var(--line)}
html[data-theme="dark"] .student-mobile-grid>div{background:#0f1a2c}
html[data-theme="dark"] .collection-mobile-nav>a,html[data-theme="dark"] .collection-mobile-nav summary,html[data-theme="dark"] .collection-mobile-nav details>div{background:#131e30;border-color:var(--line);color:var(--text)}
html[data-theme="dark"] .collection-mobile-nav>a.active,html[data-theme="dark"] .collection-mobile-nav summary.active{background:#2b4a73;color:#fff}
html[data-theme="dark"] .collection-mobile-nav details>div a.active,html[data-theme="dark"] .collection-mobile-nav details>div a:hover{background:#1c2c47}
html[data-theme="dark"] .collapsible-toggle,html[data-theme="dark"] .aud-box,html[data-theme="dark"] .req-level-row,html[data-theme="dark"] .session-stat,html[data-theme="dark"] .pay-inline-form,html[data-theme="dark"] .rule-inline-card,html[data-theme="dark"] .rule-edit-inline>td{background:#131e30!important;border-color:var(--line)!important;color:var(--text)!important}
html[data-theme="dark"] .rule-inline-card{background:linear-gradient(180deg,#172238 0%,#131e30 100%)!important}
html[data-theme="dark"] .qr-preview{background:#131e30!important;border-color:var(--line)!important}
html[data-theme="dark"] .session-row.is-selected td{background:#1d2d49!important}
html[data-theme="dark"] .aud-filter,html[data-theme="dark"] .req-level-row select,html[data-theme="dark"] .pay-inline-form select{background:#0f1a2c!important;border-color:var(--line)!important;color:var(--text)!important}
html[data-theme="dark"] .settings-mini-link{background:#131e30;border-color:var(--line)}
@media(max-width:700px){.cv2-actions{display:block!important}.cv2-actions .btn{display:none}.cv2-actions .btn:first-child{display:flex;width:100%}}

/* ═══ PROPIETARIO 4.16.3-piloto · ayuda contextual ═══ */
.context-help{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.8rem;align-items:start;margin:0 0 1rem;padding:.9rem 1rem;border:1px solid #bfdbfe;border-left:5px solid #2563eb;border-radius:13px;background:#eff6ff;color:#1e3a8a}
.context-help-icon{font-size:1.3rem}.context-help-body>strong{display:block;color:#172554;margin-bottom:.25rem}.context-help ol{margin:.3rem 0 .15rem;padding-left:1.2rem}.context-help li{margin:.18rem 0;line-height:1.4;font-size:.86rem}.context-help p{margin:.35rem 0 0;font-size:.8rem}.context-help-manage{font-size:.72rem;font-weight:750;white-space:nowrap;color:#1d4ed8}
.help-master-switch{align-items:flex-start;padding:1rem;border:1px solid var(--line);border-radius:12px;background:var(--bg)}.help-master-switch span strong,.help-master-switch span small{display:block}.help-area-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.65rem;margin:.7rem 0 1rem}.help-area-card{display:flex;align-items:flex-start;gap:.6rem;padding:.8rem;border:1px solid var(--line);border-radius:11px;background:var(--card);cursor:pointer}.help-area-card>input{margin-top:.25rem;accent-color:var(--accent)}.help-area-icon{font-size:1.25rem}.help-area-card strong,.help-area-card small{display:block}.help-area-card small{font-size:.75rem;color:var(--muted);line-height:1.35;margin-top:.1rem}
html[data-theme="dark"] .context-help{background:#142944;border-color:#315d8d;border-left-color:#60a5fa;color:#bfdbfe}html[data-theme="dark"] .context-help-body>strong{color:#dbeafe}html[data-theme="dark"] .context-help-manage{color:#93c5fd}html[data-theme="dark"] .help-master-switch,html[data-theme="dark"] .help-area-card{background:#131e30;border-color:var(--line)}
@media(max-width:700px){.context-help{grid-template-columns:auto 1fr}.context-help-manage{grid-column:2;white-space:normal}.context-help li{font-size:.82rem}}
html[data-theme="dark"] .info-banner{background:#142944!important;border-color:#315d8d!important;color:#bfdbfe!important}
html[data-theme="dark"] .help-guide li{margin:.45rem 0;line-height:1.45}
@media(max-width:700px){
  #campaignsTable,#campaignsTable tbody,#campaignsTable tr,#campaignsTable td{display:block;width:100%}#campaignsTable thead{display:none}#campaignsTable tr{margin:0 0 .65rem;padding:.7rem;border:1px solid var(--line);border-radius:11px;background:var(--card)}#campaignsTable td{padding:.28rem 0;border:0}#campaignsTable td:nth-child(1){font-size:.72rem;color:var(--muted)}#campaignsTable td:nth-child(2){font-size:.9rem}#campaignsTable td:nth-child(3)::before{content:'Destino: ';font-size:.68rem;font-weight:800;color:var(--muted)}#campaignsTable td:nth-child(n+4):nth-child(-n+7){display:inline-block;width:auto;margin:.12rem .25rem .12rem 0}#campaignsTable td:nth-child(8){display:none}
}

/* ═══ PROPIETARIO 4.16.4-piloto · alertas agrupadas por alumno ═══ */
.alerts-summary{margin:-.25rem 0 .8rem}.alert-grouped{align-items:flex-start;padding:.8rem .2rem}.alert-student-block{flex:1;min-width:240px}.alert-student-head{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}.alert-reasons{list-style:none;margin:.4rem 0 0;padding:0;display:grid;gap:.3rem}.alert-reason{display:flex;align-items:flex-start;gap:.45rem;padding:.42rem .55rem;border:1px solid var(--line);border-radius:9px;background:var(--bg);font-size:.82rem;line-height:1.35}.alert-reason.alert-payment{border-left:4px solid var(--warn)}.alert-reason.alert-away{border-left:4px solid var(--bad)}.alert-reason.alert-birthday{border-left:4px solid #8b5cf6}.alert-reason.alert-level{border-left:4px solid var(--good)}.alert-reason.alert-data{border-left:4px solid #64748b}.alert-grouped .alert-actions{display:flex;gap:.35rem;flex-wrap:wrap;justify-content:flex-end}
html[data-theme="dark"] .alert-reason{background:#0f1a2c;border-color:var(--line)}
@media(max-width:700px){.alert-grouped{display:block;padding:.75rem}.alert-student-block{min-width:0}.alert-grouped .alert-actions{margin-top:.65rem;justify-content:stretch}.alert-grouped .alert-actions>*{flex:1}.alert-grouped .alert-actions .btn{width:100%}}
.portal-visibility-setting{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;padding:.8rem;border:1px solid var(--line);border-radius:11px;background:var(--bg)}.portal-visibility-setting .switch{margin:0}.form-separator{border:0;border-top:1px solid var(--line);margin:1.25rem 0}
html[data-theme="dark"] .portal-visibility-setting{background:#0f1a2c;border-color:var(--line)}
.student-count-summary{display:flex;gap:.55rem;flex-wrap:wrap;margin:-.2rem 0 .85rem}.student-count-summary a{display:flex;align-items:center;gap:.45rem;padding:.45rem .7rem;background:var(--card);border:1px solid var(--line);border-radius:10px;color:var(--text);text-decoration:none;box-shadow:var(--shadow)}.student-count-summary a span{font-size:.72rem;color:var(--muted);font-weight:700}.student-count-summary a strong{font-size:1rem}.student-count-summary .is-active{border-left:4px solid var(--good)}.student-count-summary .is-inactive{border-left:4px solid #94a3b8}html[data-theme="dark"] .student-count-summary a{background:#131e30;border-color:var(--line)}@media(max-width:500px){.student-count-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:.35rem}.student-count-summary a{display:grid;gap:0;text-align:center;padding:.45rem .3rem}}

/* ═══ PROPIETARIO 4.16.8-piloto · asistente de cierres ═══ */
.closure-stepper{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.35rem;margin-bottom:1rem}.closure-stepper span{display:flex;align-items:center;gap:.3rem;padding:.4rem;border:1px solid var(--line);border-radius:9px;color:var(--muted);font-size:.68rem;min-width:0}.closure-stepper b{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--bg);flex:none}.closure-stepper span.active{background:#eff6ff;border-color:#93c5fd;color:#1e3a8a;font-weight:800}.closure-wizard-form fieldset{margin:0;padding:1rem;border:1px solid var(--line);border-radius:13px;background:var(--card);min-height:280px}.closure-wizard-form legend{padding:0 .4rem;font-size:1.05rem;font-weight:850;color:var(--ink)}.closure-wizard-nav{display:flex;justify-content:space-between;gap:.6rem;margin-top:1rem}.closure-scope-box{margin:.7rem 0}.closure-scope-box select{width:100%}.closure-preview details{margin-top:1rem}.closure-money{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem;margin:1rem 0}.closure-money>div{padding:.8rem;border:1px solid var(--line);border-radius:11px;background:var(--bg)}.closure-money span,.closure-money strong{display:block}.closure-money span{color:var(--muted);font-size:.7rem;text-transform:uppercase;font-weight:800}.closure-money strong{font-size:1.15rem;margin-top:.2rem}
html[data-theme="dark"] .closure-stepper span.active{background:#1d3659;border-color:#3d6598;color:#dbeafe}html[data-theme="dark"] .closure-wizard-form fieldset,html[data-theme="dark"] .closure-money>div{background:#131e30;border-color:var(--line)}
@media(max-width:800px){.closure-stepper{display:flex;overflow-x:auto;padding-bottom:.25rem}.closure-stepper span{flex:0 0 auto}.closure-stepper span:not(.active){font-size:0}.closure-stepper span:not(.active) b{font-size:.68rem}.closure-money{grid-template-columns:1fr 1fr}.closure-wizard-form fieldset{min-height:0;padding:.75rem}}
.closure-all-day{margin:.7rem 0 .25rem}.closure-date-grid label small{display:block;font-weight:400;margin:.1rem 0}.closure-date-grid .closure-time{margin-top:.4rem}.closure-date-help{margin-top:.8rem}.closure-date-help p{margin:.25rem 0 0}
.closure-operation-form,.closure-operation-state,.closure-draft-actions{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}.closure-operation-form select{max-width:230px;padding:.35rem .5rem;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text)}html[data-theme="dark"] .closure-operation-form select{background:#0f1a2c;border-color:var(--line);color:var(--text)}@media(max-width:700px){.closure-list .quick-card{align-items:flex-start}.closure-operation-form,.closure-operation-state,.closure-draft-actions{width:100%}.closure-operation-form select,.closure-operation-form .btn{width:100%;max-width:none}}
.closure-notification-state{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap}.closure-notification-state form{margin:0}@media(max-width:700px){.closure-notification-state{width:100%}}

/* ═══ PROPIETARIO 4.16.12-piloto · detalle y auditoría de cierres ═══ */
.closure-detail-status{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:-.2rem 0 .9rem}.closure-detail-status>span:not(.pill){padding:.25rem .55rem;border:1px solid var(--line);border-radius:999px;background:var(--card);font-size:.78rem}.closure-audit-list{display:grid;gap:.45rem;margin-top:.8rem}.closure-audit-list>div{display:flex;justify-content:space-between;gap:.7rem;padding:.6rem;border:1px solid var(--line);border-radius:9px;background:var(--bg)}.closure-audit-list span{font-size:.76rem;color:var(--muted);text-align:right}
html[data-theme="dark"] .closure-detail-status>span:not(.pill),html[data-theme="dark"] .closure-audit-list>div{background:#131e30;border-color:var(--line)}
@media(max-width:700px){.closure-detail-status{gap:.3rem}.closure-audit-list>div{display:block}.closure-audit-list span{display:block;text-align:left;margin-top:.15rem}.closure-detail-status+ .metrics-grid{grid-template-columns:1fr 1fr}}
.closure-preview-actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}.closure-send-now{margin:0}@media(max-width:700px){.closure-preview-actions{display:grid}.closure-preview-actions .btn{width:100%}.closure-send-now{width:100%}.closure-send-now .btn{width:100%}}

/* ═══ PROPIETARIO 4.16.12.2 · cierre simplificado en una pantalla ═══ */
.closure-simple-section{padding:.9rem 0;border-top:1px solid var(--line)}.closure-simple-section:first-of-type{border-top:0;padding-top:0}.closure-simple-section h3{font-size:1rem;color:var(--ink);margin-bottom:.65rem}.closure-simple [data-scope] select[multiple]{width:100%}.closure-final-actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--line)}.closure-compact-actions{display:flex;gap:.3rem;align-items:center;flex-wrap:wrap}.closure-compact-actions form{margin:0}.closure-advanced{margin-top:1rem}.closure-advanced>summary{cursor:pointer}.closure-simple .check-grid{margin:.4rem 0 .75rem}
@media(max-width:700px){.closure-final-actions{display:grid}.closure-final-actions .btn{width:100%}.closure-list .quick-card{display:grid}.closure-compact-actions,.closure-compact-actions form{width:100%}.closure-compact-actions .btn{width:100%}}
.closure-remove-cancelled{margin:0}.closure-remove-cancelled .btn{color:var(--bad);border-color:color-mix(in srgb,var(--bad) 35%,var(--line))}@media(max-width:700px){.closure-remove-cancelled,.closure-remove-cancelled .btn{width:100%}}
