/**
 * Panel de alumnos.
 *
 * Misma identidad que la home y el formulario de ingreso: cian y rosa,
 * Bricolage Grotesque para títulos, Rubik para texto, fondo con degradados
 * suaves y trama de puntos.
 *
 * Mobile-first: una columna, botones grandes, y ninguna tabla que obligue a
 * desplazar en horizontal. Desde 768px se abre a dos columnas donde ayuda.
 */

:root {
    --cyan: #00b4d8;
    --cyan-dark: #008fad;
    --pink: #ff006e;
    --ink: #172033;
    --muted: #657086;
    --surface: #ffffff;
    --line: #dfe7ef;
    --soft-cyan: #eafaff;
    --soft-pink: #fff0f6;
    --soft-warning: #fff8e6;
    --soft-success: #eefaf3;
    --soft-danger: #fdf1f0;
    --warning: #9a6700;
    --danger: #b42318;
    --success: #087443;
    --radius: 16px;
    --radius-lg: 24px;
    /* Ancho de la columna de contenido. Único para todas las páginas, así que
       "Mis clases", "Pagos" y "Mi cuenta" miden siempre lo mismo. */
    --content-max: 720px;
    --shadow: 0 18px 55px rgba(23, 32, 51, 0.1);
    --shadow-sm: 0 6px 18px rgba(23, 32, 51, 0.07);

    --page: #f7fafc;
    --page-tint-cyan: rgba(0, 180, 216, 0.18);
    --page-tint-pink: rgba(255, 0, 110, 0.12);
    --dots: rgba(23, 32, 51, 0.055);
    --surface-raised: #fdfeff;
    --top-bar: rgba(255, 255, 255, 0.92);
    --input-bg: #fbfdff;
    --on-accent: #ffffff;
}

/**
 * Paleta oscura.
 *
 * El atributo lo pone theme.js antes de que se pinte nada, resolviendo la
 * preferencia guardada o, si no hay, la del sistema. Por eso acá alcanza con un
 * solo bloque y no hace falta repetirlo dentro de una media query.
 *
 * El cian y el rosa se levantan un poco: los tonos de la marca sobre fondo
 * oscuro pierden contraste y el texto se vuelve difícil de leer.
 */
:root[data-theme="dark"] {
    --cyan: #38cdea;
    --cyan-dark: #79dcf2;
    --pink: #ff5c9d;
    --ink: #e7eef8;
    --muted: #97a3b8;
    --surface: #161d2b;
    --line: #2a3446;
    --soft-cyan: #123040;
    --soft-pink: #3a1a2a;
    --soft-warning: #3a2f14;
    --soft-success: #12301f;
    --soft-danger: #3a1a19;
    --warning: #f0c060;
    --danger: #ff8a80;
    --success: #6ddba2;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);

    --page: #0e1420;
    --page-tint-cyan: rgba(0, 180, 216, 0.14);
    --page-tint-pink: rgba(255, 0, 110, 0.1);
    --dots: rgba(255, 255, 255, 0.05);
    --surface-raised: #1a2131;
    --top-bar: rgba(14, 20, 32, 0.92);
    --input-bg: #111827;
    --on-accent: #06202b;
}

* {
    box-sizing: border-box;
}

/*
 * El hueco de la barra de desplazamiento queda reservado siempre: si no, una
 * página larga y una corta centran la columna en distinto lugar y parecen tener
 * anchos diferentes al pasar de una a otra.
 */
html {
    scrollbar-gutter: stable;
}

body {
    min-width: 320px;
    margin: 0;
    /* Sin relleno abajo: el shell ya ocupa el alto de la pantalla y cualquier
       agregado acá deja un espacio muerto que se puede desplazar. */
    padding: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 4%, var(--page-tint-cyan), transparent 28rem),
        radial-gradient(circle at 94% 14%, var(--page-tint-pink), transparent 30rem),
        var(--page);
    font-family: "Rubik", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

/* Con un modal abierto, el fondo no se desplaza. */
body.has-modal {
    overflow: hidden;
}

body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image: radial-gradient(var(--dots) 1px, transparent 1px);
    background-size: 22px 22px;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 70%);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 70%);
}

h1, h2, h3 {
    margin: 0;
    font-family: "Bricolage Grotesque", "Rubik", sans-serif;
    font-weight: 700;
    line-height: 1.15;
}

p {
    margin: 0;
}

ul, ol, dl {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: var(--cyan-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--pink);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ===== Íconos ===== */

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    flex: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--soft-cyan);
    color: var(--ink);
}

/* ===== Estructura con menú lateral ===== */

.panel-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--line);
    background: var(--top-bar);
    backdrop-filter: blur(10px);
}

.topbar-brand img {
    display: block;
    height: 30px;
}

.nav-backdrop {
    position: fixed;
    z-index: 40;
    inset: 0;
    background: rgba(8, 13, 22, 0.5);
}

.nav-backdrop[hidden] {
    display: none;
}

/*
 * En el celular el menú es un cajón que entra desde la izquierda. Se mueve con
 * transform y no con `display`, para que la animación no trabe el desplazamiento.
 */
.side-nav {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 280px;
    max-width: 84vw;
    padding: 0.75rem;
    border-right: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
}

.side-nav.is-open {
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .side-nav {
        transition: none;
    }
}

.side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.35rem 0.75rem;
}

.side-brand img {
    display: block;
    height: 32px;
}

.side-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
}

.side-user-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.side-user-name {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-user-meta {
    color: var(--muted);
    font-size: 0.78rem;
}

.side-links {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 1rem;
}

.side-foot {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.side-link {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.75rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.side-link:hover {
    background: var(--soft-cyan);
    color: var(--ink);
    text-decoration: none;
}

.side-link.is-active {
    background: var(--soft-cyan);
    color: var(--cyan-dark);
    font-weight: 600;
}

.side-link.is-danger:hover {
    background: var(--soft-pink);
    color: var(--pink);
}

/* El ícono del tema muestra a dónde se va, no dónde se está. */
.icon-theme-light {
    display: none;
}

:root[data-theme="dark"] .icon-theme-dark {
    display: none;
}

:root[data-theme="dark"] .icon-theme-light {
    display: inline-block;
}

.panel-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.panel-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--pink));
    color: #ffffff;
    font-family: "Bricolage Grotesque", "Rubik", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.panel-avatar.is-lg {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
}

/* ===== Estructura ===== */

/*
 * La columna de contenido: nunca más ancha que --content-max, y todo el ancho
 * disponible cuando la pantalla es más chica que eso.
 */
.panel-main {
    display: flex;
    width: 100%;
    max-width: var(--content-max);
    flex-direction: column;
    gap: 1.25rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 0;
}

.panel-main-bare {
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 2rem;
}

/*
 * Cada bloque toma el ancho entero de la columna. El min-width: 0 es lo que
 * impide que un texto largo sin cortes (un mail, un enlace) estire el bloque
 * más allá de la columna, que es lo que hace un hijo de flex por defecto.
 */
.panel-hero,
.panel-section,
.panel-flash,
.panel-alert,
.panel-empty {
    width: 100%;
    min-width: 0;
}

.panel-hero {
    padding: 1.5rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--soft-cyan), var(--surface) 65%);
    box-shadow: var(--shadow-sm);
}

.panel-hero h1 {
    font-size: 1.6rem;
}

.panel-hero.is-compact {
    padding: 1.15rem 1.25rem;
}

.panel-hero.is-compact h1 {
    font-size: 1.25rem;
}

.panel-hero-note {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.panel-hero-note.is-warning {
    color: var(--warning);
    font-weight: 500;
}

.panel-section {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel-section h2 {
    margin-bottom: 0.9rem;
    font-size: 1.1rem;
}

.section-note {
    margin-top: 0.9rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.panel-foot {
    width: 100%;
    max-width: var(--content-max);
    /* El aire de abajo vive acá y no en el body: sólo aparece donde hay algo
       que respirar. */
    margin: 1.5rem auto 0;
    padding: 0 1rem 2.5rem;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

/* ===== Avisos ===== */

.panel-flash,
.panel-alert {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.93rem;
}

.panel-flash ul,
.panel-alert ul {
    margin: 0;
    padding-left: 1.1rem;
    list-style: disc;
}

.panel-flash.is-success,
.panel-alert.is-success {
    border-color: rgba(8, 116, 67, 0.3);
    background: var(--soft-success);
    color: var(--success);
}

.panel-flash.is-warning,
.panel-alert.is-warning {
    border-color: rgba(154, 103, 0, 0.28);
    background: var(--soft-warning);
    color: var(--warning);
}

.panel-flash.is-danger,
.panel-alert.is-danger {
    border-color: rgba(180, 35, 24, 0.28);
    background: var(--soft-danger);
    color: var(--danger);
}

/* ===== Botones ===== */

.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.65rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--cyan);
    color: var(--on-accent);
    box-shadow: 0 10px 24px rgba(0, 180, 216, 0.28);
}

.btn-primary:hover {
    background: var(--cyan-dark);
    color: var(--on-accent);
}

.btn-secondary {
    border-color: var(--cyan);
    background: var(--soft-cyan);
    color: var(--cyan-dark);
}

.btn-ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--muted);
}

.btn-ghost:hover {
    border-color: var(--pink);
    color: var(--pink);
}

.link-back {
    display: inline-block;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ===== Login ===== */

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-logo {
    height: 42px;
    margin-bottom: 1.25rem;
}

.login-card h1 {
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.login-help {
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.login-form,
.panel-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}

.login-form label,
.panel-form label {
    margin-top: 0.6rem;
    font-size: 0.88rem;
    font-weight: 500;
}

.login-form input,
.panel-form input {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 1rem;
}

.login-form input:focus,
.panel-form input:focus {
    border-color: var(--cyan);
    outline: 2px solid rgba(0, 180, 216, 0.18);
}

.login-form button,
.panel-form button {
    margin-top: 1.1rem;
}

.field-help {
    color: var(--muted);
    font-size: 0.8rem;
}

.login-note {
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.chooser-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chooser-item {
    min-height: 52px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.chooser-item:hover {
    border-color: var(--cyan);
    background: var(--soft-cyan);
}

/* ===== Clases ===== */

.class-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.class-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--cyan);
    border-radius: var(--radius);
    background: var(--surface-raised);
}

.class-card.is-absence {
    border-left-color: var(--pink);
    background: var(--soft-pink);
}

.class-when {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.class-date {
    font-family: "Bricolage Grotesque", "Rubik", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.class-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.class-note {
    margin-top: 0.65rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.class-note.is-warning {
    color: var(--warning);
}

.class-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.class-actions form {
    margin: 0;
}

.class-actions .btn-secondary,
.class-actions .btn-ghost {
    flex: 1 1 auto;
    min-width: 140px;
}

/* ===== Historial ===== */

.history-list {
    display: flex;
    flex-direction: column;
}

.history-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    min-width: 5.5rem;
    font-weight: 600;
}

.history-time,
.history-teacher {
    color: var(--muted);
}

.history-teacher {
    flex: 1;
}

.history-tag {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--soft-cyan);
    color: var(--cyan-dark);
    font-size: 0.75rem;
    font-weight: 600;
}

.history-tag.is-absence {
    background: var(--soft-pink);
    color: var(--pink);
}

/* ===== Huecos para reprogramar ===== */

.slot-day + .slot-day {
    margin-top: 1.1rem;
}

.slot-day h3 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-transform: capitalize;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.5rem;
}

.slot-btn {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.slot-btn:hover {
    border-color: var(--cyan);
    background: var(--soft-cyan);
}

.slot-btn.is-selected {
    border-color: var(--cyan);
    background: var(--cyan);
    color: var(--on-accent);
}

.slots-confirm {
    position: sticky;
    bottom: 0.75rem;
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--cyan);
    border-radius: var(--radius);
    background: var(--top-bar);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    text-align: center;
}

.slots-chosen {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* ===== Pagos ===== */

.payment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payment-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
}

.payment-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.payment-amount {
    font-family: "Bricolage Grotesque", "Rubik", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.payment-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.payment-detail {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.payment-invoice {
    margin-top: 0.8rem;
    width: 100%;
    font-size: 0.85rem;
}

/* ===== Datos ===== */

.data-list {
    display: flex;
    flex-direction: column;
}

.data-list > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
}

.data-list > div:last-child {
    border-bottom: none;
}

.data-list dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.data-list dd {
    margin: 0;
    font-weight: 500;
}

/* ===== Vacíos ===== */

.panel-empty {
    padding: 1.5rem 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--input-bg);
    text-align: center;
}

.panel-empty-note {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.panel-empty .btn-secondary {
    margin-top: 1rem;
}

/* ===== Modales ===== */

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 22, 0.55);
    backdrop-filter: blur(2px);
}

/*
 * En el celular sube desde abajo y ocupa casi toda la pantalla, que es donde
 * el pulgar llega. En escritorio se centra como una tarjeta.
 */
.modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-panel {
        animation: none;
    }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--line);
}

.modal-head h2 {
    font-size: 1.15rem;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--soft-cyan);
    color: var(--ink);
}

.modal-sub {
    padding: 0.9rem 1.25rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.modal-sub strong {
    color: var(--ink);
}

.modal .panel-alert {
    margin: 0.9rem 1.25rem 0;
}

/* Sólo la lista de horarios se desplaza: los botones quedan siempre a la vista. */
.modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.1rem 1.25rem;
}

.modal-foot {
    padding: 0.9rem 1.25rem 1.1rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.modal-buttons {
    display: flex;
    gap: 0.6rem;
}

.modal-buttons .btn-primary,
.modal-buttons .btn-ghost {
    flex: 1;
}

/* El formulario ocupa el alto que queda para que el cuerpo pueda desplazarse. */
.modal-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.modal-foot .slots-chosen {
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
    text-align: center;
}

.btn-primary[disabled] {
    opacity: 0.45;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-primary[disabled]:hover {
    background: var(--cyan);
    transform: none;
}

/* ===== Desktop ===== */

@media (min-width: 768px) {
    .panel-main {
        gap: 1.5rem;
        padding: 2rem 1.5rem 0;
    }

    .panel-hero {
        padding: 2rem;
    }

    .panel-hero h1 {
        font-size: 2rem;
    }

    .panel-section {
        padding: 1.75rem;
    }

    .class-card {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.15rem 1.35rem;
    }

    .class-when {
        flex: 1 1 260px;
    }

    .class-note {
        flex: 1 1 100%;
        margin-top: 0;
    }

    .class-actions {
        margin-top: 0;
    }

    .class-actions .btn-secondary,
    .class-actions .btn-ghost {
        flex: 0 0 auto;
    }

    .payment-invoice {
        width: auto;
    }

    .slot-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }

    .modal {
        align-items: center;
        padding: 2rem 1.5rem;
    }

    .modal-panel {
        max-width: 560px;
        max-height: 84vh;
        border-radius: var(--radius-lg);
    }

    .modal-panel.is-narrow {
        max-width: 440px;
    }

    .modal-buttons {
        justify-content: flex-end;
    }

    .modal-buttons .btn-primary,
    .modal-buttons .btn-ghost {
        flex: 0 0 auto;
        min-width: 140px;
    }
}

/* ===== Escritorio: el menú deja de ser un cajón y queda fijo al costado ===== */

@media (min-width: 1024px) {
    .panel-shell {
        flex-direction: row;
    }

    .topbar,
    .nav-backdrop,
    .side-head .icon-btn {
        display: none;
    }

    .side-nav {
        position: sticky;
        top: 0;
        width: 264px;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        padding: 1rem;
        box-shadow: none;
        transform: none;
        transition: none;
    }

    .panel-content {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .panel-main {
        padding-top: 2.5rem;
    }
}
