/* ============================================================
   ACADEMIA VILAMIR
   STYLE.CSS
   Identidad: Negro / Rojo / Gris
   ============================================================ */


/* ============================================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL
   ============================================================ */

:root {
    /* Fuentes del sistema: 'Segoe UI' para Windows, fallbacks para
       macOS / Linux / Android y genérica sans-serif al final. */
    --font-sans: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    --font-mono: 'Cascadia Code', 'Consolas', 'SF Mono', Menlo, monospace;

    --brand: #d00000;
    --brand-dark: #9d0000;
    --brand-light: #ff2a2a;

    --bg: #666666;
    --bg-dark: #0b0b0d;

    --surface: #171717;
    --surface-2: #211818;
    --surface-light: #242424;

    --white: #ffffff;
    --text: #eeeeee;
    --text-light: #d0d0d0;
    --muted: #a7a7a7;

    --line: rgba(255, 255, 255, 0.08);

    --success: #39d98a;
    --warning: #ffc857;
    --danger: #ff5b5b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 22px;

    --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.35);

    --transition: 0.25s ease;
}


/* ============================================================
   2. RESET GENERAL
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(179, 0, 0, 0.35), transparent 35%),
        radial-gradient(circle at bottom left, rgba(120, 0, 0, 0.25), transparent 30%), #666666;
    background-attachment: fixed;
    color: var(--white);
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

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


/* ============================================================
   3. TÍTULOS GENERALES
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--white);
}

h2 {
    text-align: center;
    margin-bottom: 20px;
}


/* ============================================================
   4. NAVBAR
   ============================================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 4%;

    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(12px);

    border-bottom: 2px solid rgba(208, 0, 0, 0.45);

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
}

.logo {
    color: var(--brand-light);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    text-decoration: none;
}

.navbar nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.navbar nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;

    padding: 8px 10px;
    border-radius: var(--radius-sm);

    transition: var(--transition);
}

.navbar nav a:hover {
    color: var(--white);
    background: rgba(208, 0, 0, 0.15);
}


/* ============================================================
   5. CONTENEDORES GENERALES
   ============================================================ */

.container {
    width: 100%;
    min-height: 85vh;

    display: flex;
    justify-content: center;
    align-items: center;
}

.about-container,
.portal,
.admin {
    width: min(1180px, 92%);
    margin: 36px auto;
}

.about-container {
    text-align: center;
}

.about-container h1 {
    margin-bottom: 40px;
    color: var(--white);
}

.about-page {
    background:
        radial-gradient(
            circle at top right,
            rgba(179, 0, 0, 0.35),
            transparent 35%
        ),
        radial-gradient(
            circle at bottom left,
            rgba(120, 0, 0, 0.25),
            transparent 30%
        ),
        #666666;
}


/* ============================================================
   6. BOTONES GENERALES
   ============================================================ */

button,
.btn {
    display: inline-block;

    border: none;
    border-radius: var(--radius-sm);

    background: var(--brand);
    color: var(--white);

    padding: 11px 16px;

    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
    text-decoration: none;

    transition: var(--transition);
}

button {
    width: 100%;
    margin-top: 20px;
}

button:hover,
.btn:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn.secondary {
    background: #6b7280;
}

.btn.secondary:hover {
    background: #4b5563;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-actions a,
.quick-actions button {
    width: auto;
    margin: 0;
    padding: 10px 14px;
}

.logout-button {
    display: inline-block;

    background: var(--brand);
    color: white;

    padding: 10px 20px;

    border-radius: 6px;

    text-decoration: none;
    font-weight: bold;
}

.logout {
    background: #8b0000 !important;
}

.danger {
    background: #8b0000;
}


/* ============================================================
   7. FORMULARIOS
   ============================================================ */

.login-card {
    width: 420px;

    background: linear-gradient(145deg, #171717, #0b0b0d 72%, #26090b);

    padding: 35px;

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-md);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #ff2a2a;
}

.login-card p {
    text-align: center;
    margin-bottom: 25px;
    color: #ffffff;
}

label {
    display: block;

    margin-top: 15px;
    margin-bottom: 6px;

    font-weight: bold;
    color: #000000;
}

input,
select,
textarea {
    width: 100%;

    padding: 12px;

    border: 1px solid #cccccc;
    border-radius: 7px;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;

    border-color: var(--brand);

    box-shadow:
        0 0 10px rgba(179, 0, 0, 0.20);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.input,
.select,
.textarea {
    background: #ffffff;
    color: #111111;
    border-radius: 9px;
    border: 1px solid #cccccc;
}

.form {
    display: grid;

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

    gap: 10px;
}

.form label {
    color: white !important;

    display: flex;
    flex-direction: column;

    gap: 5px;
}

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

.form-grid-two {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}

.form-grid-spaced {
    gap: 15px;
    margin-top: 20px;
}

.form-stack {
    display: grid;
    gap: 12px;
}

.wide-field {
    grid-column: span 2;
}


/* ============================================================
   8. LOGIN / REGISTRO
   ============================================================ */

.register-link {
    text-align: center;

    margin-top: 20px;

    font-size: 14px;
}

.register-link a {
    color: var(--brand);

    text-decoration: none;
    font-weight: bold;
}

.register-link a:hover {
    text-decoration: underline;
}

#mensaje {
    margin-top: 18px;

    text-align: center;

    font-weight: bold;
}


/* ============================================================
   9. INFORMACIÓN DEL PROYECTO
   ============================================================ */

.project-info {
    background:
        linear-gradient(
            125deg,
            #2c2c2c,
            #151515
        );

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

    padding: 30px;

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-md);

    max-width: 950px;

    margin: 0 auto 30px;
}

.project-info h2 {
    margin-bottom: 20px;

    color: var(--brand);

    text-align: left;
}

.project-info p {
    line-height: 1.8;

    color: var(--text-light);

    text-align: justify;
}


/* ============================================================
   10. INICIO
   ============================================================ */

.contenedor-inicio {
    width: 800px;

    margin: 50px auto;

    background: #2c2c2c;

    padding: 40px;

    border-radius: var(--radius-lg);

    text-align: center;

    color: var(--white);

    box-shadow: var(--shadow-md);
}


/* ============================================================
   11. TARJETAS GENERALES
   ============================================================ */

.card,
.project-info {
    background:
        linear-gradient(
            145deg,
            #2c2c2c,
            #151515
        );

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

    border-radius: var(--radius-lg);

    padding: 22px;

    box-shadow: var(--shadow-md);
}

.card {
    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-4px);

    border-color: rgba(208, 0, 0, 0.45);

    box-shadow: var(--shadow-lg);
}

.card h2,
.card h3 {
    color: var(--white);
    margin-bottom: 12px;
}

.card p {
    color: #c1c1c1;
    line-height: 1.6;
}

.card .money {
    font-weight: 800;
    color: var(--white);
}


/* ============================================================
   12. EQUIPO / PERFILES
   ============================================================ */

.team {
    display: flex;

    justify-content: center;

    gap: 30px;

    flex-wrap: wrap;

    margin-bottom: 50px;
}

.member {
    width: 320px;

    background: #241212;

    border-top: 6px solid var(--brand);

    border-radius: 15px;

    padding: 30px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);

    transition: var(--transition);
}

.member:hover {
    transform: translateY(-8px);

    box-shadow:
        0 15px 35px rgba(179, 0, 0, 0.35);
}

.member img {
    width: 150px;
    height: 150px;

    object-fit: cover;

    border-radius: 50%;

    margin-bottom: 20px;

    border: 4px solid var(--brand);
}

.member h2 {
    color: #d1d0d0;

    font-size: 24px;

    margin-bottom: 10px;
}

.member h3 {
    color: var(--brand);

    margin-bottom: 15px;

    font-size: 18px;
}

.member p {
    color: #bbbaba;

    line-height: 1.6;

    text-align: justify;
}

.role {
    display: block;

    color: var(--brand);

    font-weight: bold;

    margin-bottom: 15px;

    font-size: 18px;
}


/* ============================================================
   13. PANELES Y OPCIONES
   ============================================================ */

.panel {
    display: flex;

    justify-content: center;

    gap: 25px;

    flex-wrap: wrap;

    margin-top: 40px;
}

.opcion {
    width: 250px;

    background: #1e1e1e;

    color: var(--white);

    padding: 25px;

    border-radius: 15px;

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

.opcion:hover {
    transform: translateY(-10px);
}

.opcion h2 {
    color: var(--brand-light);

    margin-bottom: 15px;
}


/* ============================================================
   14. GRUPOS Y TARJETAS DINÁMICAS
   ============================================================ */

.group-card {
    width: 280px;

    min-height: 200px;

    text-align: center;

    padding: 25px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    background: #241212;

    border-top: 6px solid var(--brand);

    border-radius: 15px;

    box-shadow: var(--shadow-md);

    transition: var(--transition);
}

.group-card:hover {
    transform: translateY(-5px);
}

.group-card h2 {
    font-size: 22px;

    color: var(--white);

    margin-bottom: 10px;
}

.group-card p {
    font-size: 14px;

    color: #aaa;

    line-height: 1.6;

    text-align: justify;
}

.dynamic-card {
    width: 100%;

    padding: 24px;

    text-align: left;

    min-height: 190px;
}

.dynamic-card.compact {
    min-height: 0;
}


/* ============================================================
   15. GRILLAS
   ============================================================ */

.grid,
.cards-grid,
.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(250px, 1fr));

    gap: 18px;
}

.cards-grid {
    gap: 25px;
}

.full-grid {
    grid-column: 1 / -1;
}

.cards {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(200px, 1fr));

    gap: 14px;
}


/* ============================================================
   16. DASHBOARD
   ============================================================ */

.dashboard-card {
    width: 800px;

    margin-top: 40px;
}

.dashboard-wide {
    width: 800px;
}

.dash-stat {
    position: relative;

    padding: 22px;

    border-radius: var(--radius-lg);

    background: var(--surface);

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

    overflow: hidden;
}

.dash-stat::after {
    content: "";

    position: absolute;

    width: 90px;
    height: 90px;

    border-radius: 50%;

    right: -30px;
    top: -30px;

    background: rgba(208, 0, 0, 0.16);
}

.dash-stat span {
    display: block;

    color: var(--muted);

    font-size: 13px;

    text-transform: uppercase;

    letter-spacing: 0.08em;
}

.dash-stat b {
    display: block;

    font-size: 30px;

    margin-top: 7px;

    color: var(--white);
}

.dash-icon {
    font-size: 25px;
}


/* ============================================================
   17. ADMINISTRACIÓN
   ============================================================ */

.admin {
    max-width: 1250px;

    padding: 0 18px;
}

.hero,
.module {
    background: #151515;

    border: 1px solid #333;

    border-radius: var(--radius-md);

    padding: 20px;

    margin-bottom: 18px;
}

.hero {
    background:
        linear-gradient(
            135deg,
            #000000,
            #390606
        );

    border-radius: var(--radius-xl);

    padding: 32px;

    box-shadow: var(--shadow-lg);
}

.hero h1 {
    color: var(--white);

    font-size: clamp(28px, 4vw, 42px);

    margin-bottom: 8px;
}

.hero p {
    color: #e0e0e0;

    line-height: 1.7;
}


/* ============================================================
   17.1. PULIDO DEL PANEL DE ADMINISTRACIÓN
   ============================================================ */

.admin .hero {
    position: relative;
    overflow: hidden;
}

.admin .hero::after {
    content: 'V';
    position: absolute;
    right: 28px;
    bottom: -38px;
    font-size: 190px;
    font-weight: 900;
    line-height: 1;
    color: rgba(255, 255, 255, .035);
    pointer-events: none;
}

.admin .hero p {
    max-width: 850px;
}

.stats .stat {
    transition: transform .2s, border-color .2s, background .2s;
}

.stats .stat:hover {
    transform: translateY(-2px);
    border-color: rgba(208, 0, 0, .35);
    background: #1d1d1d;
}

.stats .stat b {
    color: #fff;
}

.stats .stat span {
    color: #bdbdbd;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
}

.tabs {
    position: sticky;
    top: 68px;
    z-index: 20;
    padding: 10px;
    background: rgba(21, 21, 21, .94);
    backdrop-filter: blur(10px);
    border: 1px solid #303030;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .18);
}

.tabs button {
    border: 1px solid #383838;
    color: #ddd;
}

.tabs button.active {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 5px 15px rgba(208, 0, 0, .2);
}

.module {
    box-shadow: var(--shadow-md);
}

.module > h2 {
    text-align: left;
    margin-bottom: 5px;
}

.module > .small {
    color: #aaa;
    margin-bottom: 18px;
}

.module > .small a {
    color: #ff7373;
    text-decoration: none;
    font-weight: 700;
}

.admin-loading,
.admin-error {
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    border: 1px dashed #444;
    color: #bbb;
    background: #111;
}

.admin-error {
    color: #ff8585;
    border-color: rgba(255, 91, 91, .35);
}

.table-wrap {
    border: 1px solid #303030;
    border-radius: 12px;
}

.admin table {
    min-width: 700px;
}

.admin tbody tr {
    transition: background .15s;
}

.admin tbody tr:hover {
    background: #1d1d1d;
}

.admin td button {
    margin: 0;
    width: auto;
    padding: 7px 10px;
    font-size: 12px;
}

.admin .search {
    margin-top: 18px;
    background: #101010;
    color: #fff;
    border-color: #3a3a3a;
}

.admin .search::placeholder {
    color: #888;
}

/* ============================================================
   17.2. DASHBOARD ADMINISTRATIVO
   ============================================================ */

.stat-button {
    width: 100%;
    border: 1px solid var(--line);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dashboard-extra {
    display: grid;
    gap: 16px;
    margin: 18px 0 24px;
}

.dashboard-alerts {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(250px, 1fr)) !important;
    gap: 20px !important;
    width: 100%;
    margin: 25px 0;
}

.dashboard-alerts > * {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.dashboard-card,
.dashboard-panel,
.dashboard-quick-actions {
    background: #171717;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.dashboard-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dashboard-card-label {
    color: #bbb;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.dashboard-card strong {
    font-size: 28px;
    color: #fff;
}

.dashboard-card small {
    color: #999;
}

.dashboard-card-warning { border-left: 4px solid #d6a800; }
.dashboard-card-danger { border-left: 4px solid var(--brand); }
.dashboard-card-success { border-left: 4px solid #4caf50; }

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

.dashboard-panel {
    padding: 18px;
}

.dashboard-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-panel-head h3,
.dashboard-quick-actions h3 {
    margin: 0 0 4px;
    color: #fff;
}

.dashboard-panel-head p,
.dashboard-quick-actions p {
    margin: 0;
    color: #999;
    font-size: 13px;
}

.dashboard-panel-head button,
.dashboard-panel-head a {
    width: auto;
    margin: 0;
    padding: 7px 10px;
    font-size: 12px;
    text-decoration: none;
}

.dashboard-list {
    display: grid;
    gap: 8px;
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    background: #101010;
    border: 1px solid #292929;
    border-radius: 10px;
}

.dashboard-list-item strong,
.dashboard-list-item span {
    display: block;
}

.dashboard-list-item strong {
    color: #eee;
    font-size: 14px;
}

.dashboard-list-item span,
.dashboard-list-item small {
    color: #888;
    font-size: 12px;
    margin-top: 3px;
}

.dashboard-list-item button {
    width: auto;
    margin: 0;
    padding: 6px 9px;
    font-size: 11px;
}

.dashboard-quick-actions {
    padding: 18px;
}

.quick-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.quick-action-buttons button,
.quick-action-buttons a {
    width: auto;
    margin: 0;
    padding: 9px 12px;
    font-size: 12px;
    text-decoration: none;
}

@media (max-width: 1000px) {
    .dashboard-alerts {
        grid-template-columns: repeat(2, minmax(220px, 1fr)) !important;
    }
}

@media (max-width: 650px) {
    .dashboard-alerts {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   17.3. DASHBOARD ADMINISTRATIVO - RESPONSIVE
   ============================================================ */

@media (max-width: 850px) {
    .dashboard-alerts,
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard-panel-head,
    .dashboard-list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-panel-head button,
    .dashboard-panel-head a,
    .dashboard-list-item button {
        width: 100%;
    }
}

/* ============================================================
   18. ESTADÍSTICAS
   ============================================================ */

.stats {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(150px, 1fr));

    gap: 12px;

    margin: 18px 0;
}

.stat {
    background: #171717;

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

    border-radius: 14px;

    padding: 15px;
}

.stat span {
    display: block;

    color: #ffffff;

    font-size: 12px;
}

.stat b {
    display: block;

    font-size: 25px;
}


/* ============================================================
   19. TABS
   ============================================================ */

.tabs {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin: 20px 0;
}

.tabs button {
    width: auto;

    margin: 0;

    padding: 10px 14px;

    border-radius: 9px;

    background: #242424;
}

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


/* ============================================================
   20. ACCIONES
   ============================================================ */

.actions {
    display: flex;

    gap: 8px;

    flex-wrap: wrap;
}

.actions button,
.print {
    width: auto;
}

.print {
    float: right;
}


/* ============================================================
   21. TABLAS
   ============================================================ */

.table-wrap,
.table-scroll {
    overflow-x: auto;

    margin-top: 20px;
}

.admin table,
.report-table,
.report-panel table {
    width: 100%;

    border-collapse: collapse;
}

.admin th,
.admin td,
.report-table th,
.report-table td,
.report-panel th,
.report-panel td {
    padding: 9px;

    border-bottom: 1px solid #333;

    text-align: left;

    white-space: nowrap;
}

.admin th,
.report-table th {
    background: #242424;
}

.report-panel th {
    color: #ff4a42;
}

.report-panel td {
    color: #d5d5d9;
}


/* ============================================================
   22. MENSAJES Y ESTADOS
   ============================================================ */

.ok,
.success {
    color: var(--success);
}

.err,
.error {
    color: #ff7373;
}

.message-center {
    text-align: center;

    font-weight: bold;
}

.message-top {
    margin-top: 12px;
}

.message-top-lg {
    margin-top: 18px;
}

.account-message {
    padding: 12px 16px;

    border-radius: 11px;

    margin-bottom: 15px;
}

.account-message.success {
    background: rgba(45, 180, 70, 0.12);

    border: 1px solid rgba(45, 180, 70, 0.25);

    color: #82e898;
}

.account-message.error {
    background: rgba(220, 40, 40, 0.12);

    border: 1px solid rgba(220, 40, 40, 0.30);

    color: #ff8585;
}


/* ============================================================
   23. BADGES
   ============================================================ */

.badge {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 5px 10px;

    border-radius: 999px;

    background: rgba(208, 0, 0, 0.15);

    color: #ff8b8b;

    border: 1px solid rgba(208, 0, 0, 0.30);

    font-size: 12px;

    font-weight: 700;
}

.badge.success {
    color: #75e28a;

    background: rgba(55, 180, 75, 0.12);

    border-color: rgba(55, 180, 75, 0.25);
}

.badge.warning {
    color: #ffd166;

    background: rgba(255, 190, 50, 0.10);

    border-color: rgba(255, 190, 50, 0.25);
}

.badge.danger {
    color: #ff9a9a;

    background: rgba(255, 91, 91, 0.12);

    border-color: rgba(255, 91, 91, 0.25);
}


/* ============================================================
   24. UTILIDADES
   ============================================================ */

.section-spaced {
    margin-bottom: 30px;
}

.section-accent {
    margin-bottom: 35px;

    border-bottom: 4px solid var(--brand);
}

.no-bottom-margin {
    margin-bottom: 0;
}

.no-top-margin {
    margin-top: 0 !important;
}

.top-spaced {
    margin-top: 40px;
}

.top-small {
    margin-top: 10px;
}

.spaced-bottom {
    margin-bottom: 30px;
}

.text-center {
    text-align: center;
}

.muted-center {
    text-align: center;

    color: var(--white);
}

.muted {
    color: var(--muted) !important;
}

.small {
    font-size: 13px;

    color: var(--muted);
}

.intro-text {
    color: #cfcfcf;
}

.intro-short {
    margin-bottom: 10px;
}

.money {
    font-size: 22px;

    font-weight: bold;
}

.empty-state {
    text-align: center;

    padding: 30px;

    color: var(--muted);
}


/* ============================================================
   25. PORTAL DEL ALUMNO
   ============================================================ */

.portal {
    max-width: 1150px;

    padding: 0 18px;
}

.portal .hero,
.portal .card {
    background: #151515;

    border: 1px solid #333;

    border-radius: var(--radius-md);

    padding: 22px;

    margin-bottom: 18px;
}

.portal .grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));

    gap: 14px;
}

.portal .card h2 {
    margin-top: 0;
}

.item {
    background: #101010;

    border: 1px solid #333;

    border-radius: 9px;

    padding: 15px;

    margin: 10px 0;
}

.warn {
    color: #ffd166;
}

.portal button {
    width: auto;

    margin: 4px 0;
}


/* ============================================================
   25.1. MIS CLASES DEL ALUMNO
   ============================================================ */

.mis-clases-card {
    text-align: left;
}

.mis-clases-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.mis-clases-title h2 {
    text-align: left;
    margin: 0 0 4px;
}

.mis-clases-title p {
    margin: 0;
    color: var(--text-light);
}

.mis-clases-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(208, 0, 0, .15);
    font-size: 24px;
    flex: 0 0 48px;
}

.mis-clases-title .badge {
    margin-left: auto;
}

.mis-clases-date {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 14px;
}

.mis-clases-groups {
    display: grid;
    gap: 10px;
}

.mis-clases-group {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: rgba(0, 0, 0, .12);
}

.mis-clases-group-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.mis-clases-group-head div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mis-clases-group-head span {
    font-size: 12px;
    color: var(--muted);
}

.mis-clases-group-head b {
    font-size: 11px;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.mis-clases-schedules {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.mis-clases-schedules span {
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: var(--text-light);
    font-size: 12px;
}

.mis-clases-unassigned {
    padding: 11px 12px;
    border-radius: 9px;
    background: rgba(255, 200, 87, .08);
    border: 1px solid rgba(255, 200, 87, .18);
    color: #ffe0a0;
    font-size: 13px;
}

.small-note {
    font-size: 12px;
    margin: 8px 0 0;
}

.ajax-loading {
    opacity: .65;
    pointer-events: none;
}

/* ============================================================
   26. CALENDARIO
   ============================================================ */

.calendar-toolbar {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;
}

.calendar-toolbar h2 {
    margin: 0;

    text-transform: capitalize;
}

.calendar,
.calendar-full {
    display: grid;

    grid-template-columns:
        repeat(7, minmax(120px, 1fr));

    gap: 10px;

    overflow-x: auto;

    margin-bottom: 24px;
}

.calendar-day {
    min-height: 180px;

    background: #111111;

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

    border-radius: 14px;

    padding: 12px;
}

.calendar-day h3,
.calendar-day h4 {
    color: var(--white);

    margin-top: 0;

    margin-bottom: 12px;
}

.calendar-event {
    display: flex;

    flex-direction: column;

    gap: 3px;

    padding: 10px;

    margin: 7px 0;

    border-radius: 9px;

    background: rgba(208, 0, 0, 0.13);

    border-left: 4px solid var(--brand);
}

.calendar-event strong {
    display: block;

    color: var(--white);
}

.calendar-event span {
    display: block;

    color: #bbb;

    margin-top: 3px;
}

.calendar-event small {
    color: #aaa;
}


/* ============================================================
   26.1. MEJORAS DEL CALENDARIO
   ============================================================ */

/* Calendario mensual */
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.calendar-toolbar h2 {
    min-width: 210px;
    text-align: center;
    text-transform: none;
    margin: 0;
}

.calendar-toolbar button.secondary {
    background: #efefef;
    color: #222;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-left: 1px solid #e5e5e5;
    border-top: 1px solid #e5e5e5;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #171717;
    color: #fff;
    font-weight: 800;
    text-align: center;
}

.calendar-weekdays div {
    padding: 11px;
    border-right: 1px solid #333;
}

.month-cell {
    min-height: 125px;
    background: #fff;
    border-right: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    padding: 9px;
    overflow: hidden;
}

.month-cell.outside {
    background: #f5f5f5;
    color: #aaa;
}

.month-cell.today {
    box-shadow: inset 0 0 0 2px #c62828;
}

.month-number {
    font-weight: 900;
    margin-bottom: 7px;
}

.month-cell.outside .calendar-event {
    opacity: .55;
}

.month-cell .calendar-event {
    margin-bottom: 5px;
    padding: 6px 7px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}

.month-cell .class-event {
    border-left: 3px solid #c62828;
    background: #fff4f4;
}

.month-cell .event-event {
    border-left: 3px solid #171717;
    background: #f2f2f2;
}

.month-cell .calendar-event strong {
    font-size: 11px;
}

.month-cell .calendar-event span {
    font-weight: 800;
}

.month-cell .calendar-event small {
    font-size: 10px;
    color: #666;
}

/* Calendario semanal */
.calendar-full {
    width: 100%;
    overflow-x: auto;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    min-width: 1050px;
    border: 1px solid #dedede;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .06);
}

.week-day {
    min-height: 330px;
    border-right: 1px solid #e5e5e5;
    background: #fff;
}

.week-day:last-child {
    border-right: 0;
}

.week-day > header {
    height: 62px;
    background: #181818;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 13px;
    font-weight: 800;
}

.week-day > header span {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .5px;
}

.week-day > header b {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #333;
    font-size: 15px;
}

.week-day.today > header {
    background: #b51f2a;
}

.week-day.today > header b {
    background: #fff;
    color: #b51f2a;
}

.week-day-body {
    padding: 10px;
    min-height: 265px;
    background: #fafafa;
}

.week-event {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .05);
}

.week-event strong {
    font-size: 12px;
}

.week-event span {
    font-weight: 800;
    font-size: 13px;
}

.week-event small {
    font-size: 11px;
    color: #666;
}

.week-event.class-event {
    border-left: 4px solid #b51f2a;
    background: #fff2f3;
}

.week-event.event-event {
    border-left: 4px solid #222;
    background: #f0f0f0;
}

.calendar-empty {
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 35px 8px;
}

.upcoming-card {
    border-top: 3px solid #b51f2a;
}

/* ============================================================
   27. PROMOCIONES
   ============================================================ */

.promo-card {
    background:
        linear-gradient(
            135deg,
            rgba(208, 0, 0, 0.22),
            #171717
        );

    border: 1px solid rgba(208, 0, 0, 0.25);
}

.promo-value {
    font-size: 34px;

    font-weight: 900;

    color: var(--white);

    margin: 12px 0;
}

.promo-date {
    font-size: 12px;

    color: #aaa;
}


/* ============================================================
   28. TIMELINE
   ============================================================ */

.timeline {
    display: grid;

    gap: 10px;
}

.timeline-item {
    display: grid;

    grid-template-columns: 90px 1fr;

    gap: 14px;

    padding: 14px;

    border-left: 3px solid var(--brand);

    background: #151515;

    border-radius: 0 12px 12px 0;
}

.timeline-time {
    font-weight: 800;

    color: var(--white);
}

.timeline-body strong {
    color: var(--white);

    display: block;
}

.timeline-body small {
    color: #999;
}


/* ============================================================
   29. ASISTENCIA
   ============================================================ */

.attendance-toolbar {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    align-items: center;

    margin-bottom: 18px;
}

.attendance-toolbar select,
.attendance-toolbar input,
.attendance-row select,
.attendance-row input {
    padding: 10px;

    border: 1px solid #d1d5db;

    border-radius: 8px;

    background: #fff;
}

.attendance-list {
    color:#000000;
    display: grid;
    gap: 8px;
}

.attendance-row {
    display: grid;

    grid-template-columns:
        1.5fr 180px 1fr;

    gap: 10px;

    align-items: center;

    padding: 12px;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    background: #fff;
}

.attendance-row input {
    width: 100%;

    box-sizing: border-box;
}


/* ============================================================
   30. PROFESOR
   ============================================================ */

.professor-discipline-option {
    color: white;

    display: flex;

    flex-direction: column;

    gap: 8px;

    cursor: pointer;
}

.professor-discipline-option input {
    width: 20px;
    height: 20px;
}


/* ============================================================
   31. JAVASCRIPT / LISTAS DINÁMICAS
   ============================================================ */

.js-list {
    list-style: none;

    padding: 0;
    margin: 0;
}

.js-list-item {
    background: #241212;

    margin: 10px 0;

    padding: 15px;

    border-radius: 8px;

    border-left: 4px solid var(--brand);
}

.js-muted {
    color: #aaa;
}

.js-empty {
    text-align: center;

    padding: 40px;

    color: #777;

    width: 100%;
}

.js-card {
    background: #1e1e1e;

    padding: 20px;

    border-radius: 12px;

    border-top: 4px solid var(--brand);

    box-shadow: var(--shadow-sm);

    text-align: left;
}

.js-card h3 {
    color: #fff;

    margin: 0 0 5px;

    font-size: 20px;
}

.js-card .role {
    font-size: 14px;

    display: block;

    margin-bottom: 12px;

    font-weight: bold;
}

.js-card .email {
    color: #aaa;

    font-size: 13px;

    font-family: var(--font-mono);
}


/* ============================================================
   32. REPORTES
   ============================================================ */

.reports-page {
    background:
        radial-gradient(
            circle at top right,
            rgba(179, 0, 0, 0.18),
            transparent 28%
        ),
        #141416;

    color: #eee;

    min-height: 100vh;
}

.reports-wrap {
    width: min(1250px, 92%);

    margin: 38px auto 70px;
}

.reports-head {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    background:
        linear-gradient(
            135deg,
            #211214,
            #17171a
        );

    border: 1px solid #3b2527;

    border-radius: 18px;

    padding: 30px;

    margin-bottom: 22px;
}

.reports-head h1 {
    color: white;

    margin: 8px 0;
}

.reports-head p {
    color: #aaa;
}

.report-print {
    width: auto;

    margin: 0;

    padding: 11px 18px;

    background: var(--brand);
}

.report-stats,
.report-finance {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;
}

.report-finance {
    margin: 18px 0;
}

.report-stat {
    display: flex;

    gap: 15px;

    align-items: center;

    background: #1c1c20;

    border: 1px solid #2b2b30;

    border-radius: 15px;

    padding: 18px;
}

.report-icon {
    font-size: 1.8rem;
}

.report-stat small,
.report-stat em {
    display: block;

    color: #96969d;

    font-style: normal;
}

.report-stat strong {
    display: block;

    font-size: 1.8rem;

    color: #fff;

    margin: 3px 0;
}

.report-finance article {
    background: #19191d;

    border: 1px solid #2d2d32;

    border-left: 4px solid var(--brand);

    border-radius: 13px;

    padding: 18px;
}

.report-finance span {
    display: block;

    color: #aaa;
}

.report-finance strong {
    display: block;

    color: #fff;

    font-size: 1.45rem;

    margin-top: 7px;
}

.report-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 18px;
}

.report-panel {
    background: #19191d;

    border: 1px solid #2d2d32;

    border-radius: 15px;

    padding: 22px;

    overflow: hidden;
}

.report-panel h2 {
    font-size: 1.2rem;

    text-align: left;

    margin-bottom: 16px;
}

.report-list {
    display: grid;

    gap: 8px;
}

.report-list > div {
    display: flex;

    justify-content: space-between;

    padding: 12px;

    background: #222227;

    border-radius: 9px;
}

.report-list b {
    color: #ff3b32;
}

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

.status-pill {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 999px;

    background: #3c1618;

    color: #ffb0ac;
}

.empty-report {
    color: #999;

    padding: 15px 0;
}


/* ============================================================
   33. MI CUENTA DEL ALUMNO
   ============================================================ */

.account-page {
    background: #0b0b0b;

    color: #f5f5f5;

    min-height: 100vh;
}

.account-shell {
    width: min(1180px, 92%);

    margin: 34px auto 60px;
}

.account-welcome {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 25px;

    padding: 34px;

    border-radius: 24px;

    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(208, 0, 0, 0.28),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #181818,
            #090909
        );

    border: 1px solid #343434;

    box-shadow: var(--shadow-lg);

    margin-bottom: 20px;
}

.account-eyebrow,
.panel-kicker {
    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.18em;

    color: #e24646;
}

.account-welcome h1 {
    margin: 7px 0;

    font-size: clamp(30px, 4vw, 46px);

    color: #fff;
}

.account-welcome p {
    margin: 0;

    color: #bdbdbd;

    line-height: 1.6;
}

.account-actions {
    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

.account-btn {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    background: #c40000;

    color: #fff !important;

    border: 1px solid #e00000;

    border-radius: 10px;

    padding: 11px 15px;

    text-decoration: none;

    font-weight: 700;
}

.account-btn:hover {
    background: #e00000;

    transform: translateY(-1px);
}

.account-btn-dark {
    background: #242424;

    border-color: #454545;
}

.account-btn-small {
    padding: 8px 12px;

    font-size: 13px;

    margin-left: auto;
}

.account-stats {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-bottom: 20px;
}

.account-stat {
    position: relative;

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 19px;

    background: #151515;

    border: 1px solid #2e2e2e;

    border-radius: 17px;

    overflow: hidden;
}

.account-stat::after {
    content: "";

    position: absolute;

    right: -32px;

    top: -32px;

    width: 85px;

    height: 85px;

    background: rgba(196, 0, 0, 0.12);

    border-radius: 50%;
}

.stat-icon {
    font-size: 25px;
}

.account-stat div {
    display: flex;

    flex-direction: column;
}

.account-stat span:not(.stat-icon) {
    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 0.08em;

    color: #9e9e9e;
}

.account-stat strong {
    font-size: 25px;

    margin-top: 3px;
}

.account-stat small {
    color: #777;

    margin-top: 2px;
}

.account-layout {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 18px;

    margin-bottom: 18px;
}

.account-layout-wide {
    grid-template-columns: 1.1fr 0.9fr;
}

.account-panel {
    background:
        linear-gradient(
            145deg,
            #171717,
            #101010
        );

    border: 1px solid #2e2e2e;

    border-radius: 20px;

    padding: 22px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.20);

    margin-bottom: 18px;
}

.account-panel-head {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 18px;
}

.account-panel-head h2 {
    margin: 4px 0;

    color: #fff;

    font-size: 21px;
}

.panel-subtitle {
    margin: 3px 0 0;

    color: #888;

    font-size: 13px;
}

.profile-mark {
    width: 40px;

    height: 40px;

    border-radius: 12px;

    background: #260b0b;

    display: grid;

    place-items: center;
}

.profile-name {
    font-size: 24px;

    font-weight: 800;

    margin-bottom: 18px;
}

.profile-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 13px;
}

.profile-grid > div {
    background: #101010;

    border: 1px solid #292929;

    border-radius: 12px;

    padding: 12px;
}

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

.profile-grid small {
    display: block;

    color: #777;

    font-size: 11px;

    text-transform: uppercase;

    margin-bottom: 4px;
}

.profile-grid b {
    display: block;

    color: #eee;

    word-break: break-word;
}


/* ============================================================
   33.1. HISTORIAL DEL ALUMNO Y ESTADOS FINANCIEROS
   ============================================================ */

.account-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 8px;
}

.account-history-grid > div {
    min-width: 0;
}

.account-history-grid h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.account-history-grid .account-list {
    max-height: 430px;
    overflow: auto;
    padding-right: 4px;
}

.badge.danger {
    border-color: rgba(220, 70, 70, .45);
    background: rgba(160, 25, 25, .18);
    color: #ff9b9b;
}

/* ============================================================
   34. QR DEL ALUMNO
   ============================================================ */

.account-qr {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-top: 18px;
}

.account-qr h3 {
    margin: 4px 0;
}

.account-qr p {
    font-size: 12px;

    color: #888;

    max-width: 270px;
}

.account-qr #qrAlumno {
    background: #fff;

    padding: 8px;

    border-radius: 10px;

    min-width: 161px;

    min-height: 161px;

    display: flex;

    align-items: center;

    justify-content: center;
}

.qr-unavailable {
    color: #777;

    font-size: 12px;

    padding: 20px;
}


/* ============================================================
   35. ACTIVIDAD DEL ALUMNO
   ============================================================ */

.activity-summary {
    padding: 4px 0;
}

.activity-row {
    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 12px 0;

    color: #bbb;

    border-bottom: 1px solid #292929;
}

.activity-row b {
    color: #fff;
}

.progress {
    height: 8px;

    background: #292929;

    border-radius: 99px;

    overflow: hidden;

    margin: 12px 0 8px;
}

.progress i {
    display: block;

    height: 100%;

    background:
        linear-gradient(
            90deg,
            #900000,
            #e00000
        );

    border-radius: 99px;
}

.activity-note {
    color: #777;
}

.account-link {
    color: #ef5555;

    text-decoration: none;

    font-size: 13px;

    font-weight: 700;
}


/* ============================================================
   36. LISTAS DE MI CUENTA
   ============================================================ */

.account-list {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.account-row {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px;

    background: #101010;

    border: 1px solid #292929;

    border-radius: 12px;
}

.class-time {
    min-width: 63px;

    text-align: center;
}

.class-time b {
    display: block;

    color: #fff;

    font-size: 16px;
}

.class-time span,
.row-main small {
    display: block;

    color: #777;

    font-size: 11px;
}

.row-main {
    flex: 1;

    min-width: 0;
}

.row-main strong {
    display: block;

    color: #eee;

    line-height: 1.35;
}

.row-icon,
.payment-icon {
    width: 36px;

    height: 36px;

    border-radius: 10px;

    background: #220909;

    display: grid;

    place-items: center;
}

.notification-dot {
    width: 9px;

    height: 9px;

    border-radius: 50%;

    background: #d40000;

    flex: none;
}

.account-cards {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));

    gap: 12px;
}

.account-mini-card {
    display: flex;

    align-items: flex-start;

    gap: 12px;

    padding: 15px;

    background: #101010;

    border: 1px solid #292929;

    border-radius: 14px;
}

.mini-icon {
    width: 38px;

    height: 38px;

    display: grid;

    place-items: center;

    border-radius: 10px;

    background: #250909;

    flex: none;
}

.account-mini-card strong {
    color: #fff;
}

.account-mini-card p {
    color: #999;

    font-size: 13px;

    line-height: 1.45;

    margin: 5px 0 9px;
}

.event-card .event-date {
    min-width: 48px;

    text-align: center;

    background: #260909;

    border-radius: 10px;

    padding: 7px;
}

.event-date b {
    display: block;

    font-size: 20px;
}

.event-date span {
    font-size: 10px;

    color: #e66;
}

.payment-value {
    text-align: right;

    display: flex;

    flex-direction: column;

    gap: 4px;
}

.payment-value b {
    font-size: 15px;
}

.account-cancel {
    width: auto !important;

    margin: 0 !important;

    padding: 6px 9px !important;

    font-size: 11px !important;

    background: #3a1010 !important;
}

.certificate-card {
    align-items: center;
}

.account-empty {
    padding: 25px;

    text-align: center;

    border: 1px dashed #343434;

    border-radius: 13px;

    color: #777;
}

.account-empty span {
    font-size: 25px;

    color: #a00;
}

.account-empty p {
    margin: 7px 0 0;
}

.account-loading {
    color: #777;

    padding: 20px;
}


/* ============================================================
   37. PORTAL DEL PROFESOR
   ============================================================ */

/* Los estilos específicos del portal docente se mantienen aquí.
   Los estilos generales de .professor-discipline-option están
   definidos en la sección 30 para evitar duplicados. */


/* ============================================================
   37.1. MEJORAS VISUALES - PORTAL DEL PROFESOR
   ============================================================ */

.professor-stats .dash-stat {
    background: linear-gradient(145deg, #171717, #242424);
    border: 1px solid rgba(220, 38, 38, .22);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
    border-radius: 18px;
    padding: 20px;
    transition: transform .2s, box-shadow .2s;
}

.professor-stats .dash-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, .2);
}

.professor-panel {
    border: 1px solid #e7e7e7;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .07);
    overflow: hidden;
}

.professor-panel .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 4px 0 12px;
}

.professor-panel h2 {
    margin: 4px 0 0;
}

.eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: .14em;
    font-weight: 800;
    color: #c62828;
    margin-bottom: 2px;
}

.quick-link {
    font-size: 14px;
    font-weight: 700;
    color: #c62828;
    text-decoration: none;
    white-space: nowrap;
}

.quick-link:hover {
    text-decoration: underline;
}

.professor-main-panel {
    min-height: 260px;
}

.professor-discipline-option {
    display: flex;
    flex-direction: column;
    gap: 7px;
    cursor: pointer;
}

.professor-discipline-option input {
    accent-color: #c62828;
    transform: scale(1.1);
    margin-right: 7px;
}

.professor-discipline-option strong {
    font-size: 16px;
}

.professor-discipline-option span {
    font-size: 13px;
    color: #777;
}

.attendance-panel {
    margin-top: 22px;
}

.attendance-panel .attendance-toolbar {
    background: #f7f7f7;
    border-radius: 14px;
    padding: 14px;
}

.attendance-row {
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fafafa;
}

.professor-panel .calendar-day {
    min-height: 125px;
    background: #fafafa;
    border: 1px solid #ececec;
}

.professor-panel .calendar-event {
    border-left: 4px solid #c62828;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

/* ============================================================
   38. BÚSQUEDA
   ============================================================ */

.search {
    width: 100%;

    margin-top: 12px;
}

.search-bar {
    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 12px;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    flex: 1;
}

.search-results {
    display: grid;

    gap: 8px;

    margin-top: 15px;
}

.search-result,
.list-row {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    padding: 12px;

    background: #fff;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    color: #111;
}


/* ============================================================
   39. EXPORTACIONES / QR / GALERÍA
   ============================================================ */

.export-grid {
    display: grid;

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

    gap: 15px;
}

.export-card {
    padding: 18px;

    border: 1px solid #e5e7eb;

    border-radius: 12px;
}

.qr-box {
    margin-top: 18px;

    text-align: center;

    padding: 15px;

    border: 1px dashed #d1d5db;

    border-radius: 12px;
}

.qr-box #qrAlumno {
    display: flex;

    justify-content: center;

    margin: 10px;
}

.gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));

    gap: 18px;
}

.gallery-card {
    background: #fff;

    border-radius: 14px;

    overflow: hidden;

    border: 1px solid #e5e7eb;
}

.gallery-card img {
    width: 100%;

    height: 220px;

    object-fit: cover;
}

.gallery-card div {
    padding: 15px;
}


/* ============================================================
   40. WEB PÚBLICA
   ============================================================ */

.public-page {
    /* Deja visible el fondo radial definido en body también en la web pública. */
    background: transparent;

    color: #eee;

    min-height: 100vh;
}

.public-page .navbar {
    position: sticky;

    top: 0;

    z-index: 50;

    background: rgba(10, 10, 12, 0.96);

    backdrop-filter: blur(10px);
}

.public-page .navbar nav a {
    padding: 9px 2px;
}

.public-page .navbar nav a:hover {
    color: #e10600;
}

.public-hero {
    min-height: 650px;

    display: flex;

    align-items: center;

    padding: 80px 8%;

    position: relative;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 80% 25%,
            rgba(190, 0, 0, 0.38),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #08080a 0%,
            #17171b 55%,
            #310708 100%
        );

    border-bottom: 1px solid #5d1111;
}

.public-hero::before {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            110deg,
            rgba(0, 0, 0, 0.3),
            transparent 55%,
            rgba(150, 0, 0, 0.12)
        );

    pointer-events: none;
}

.public-hero > div {
    position: relative;

    z-index: 1;

    max-width: 900px;
}

.public-hero .eyebrow {
    color: #ff2b22;

    font-size: 0.9rem;
}

.public-hero h1 {
    font-weight: 900;

    line-height: 0.98;

    margin: 16px 0 24px;

    text-shadow:
        0 8px 30px rgba(0, 0, 0, 0.4);
}

.public-hero p {
    color: #d2d2d5;

    line-height: 1.8;

    margin-bottom: 30px;
}

.public-hero .btn {
    background: #c90000;

    border: 1px solid #ff3b32;

    box-shadow:
        0 10px 30px rgba(200, 0, 0, 0.28);

    color: #fff;

    padding: 13px 22px;
}

.public-hero .btn:hover {
    background: #e10600;

    transform: translateY(-2px);
}

.public-section {
    padding: 78px 7%;

    background: #101013;

    color: #f4f4f5;

    position: relative;
}

.public-section.alt {
    background: #17171b;

    border-top: 1px solid #25252a;

    border-bottom: 1px solid #25252a;
}

.public-section h2 {
    color: #fff;

    font-size: clamp(1.7rem, 3vw, 2.5rem);

    margin-bottom: 34px;
}

.public-section h2::after {
    content: "";

    display: block;

    width: 55px;

    height: 4px;

    background: #d90000;

    margin: 13px auto 0;

    border-radius: 3px;
}

.public-card {
    background:
        linear-gradient(
            145deg,
            #1b1b20,
            #121216
        );

    border: 1px solid #2d2d33;

    border-top: 3px solid #b90000;

    border-radius: 16px;

    padding: 25px;

    color: #e9e9eb;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.22);

    transition: var(--transition);
}

.public-card:hover {
    transform: translateY(-6px);

    box-shadow:
        0 18px 38px rgba(0, 0, 0, 0.35);

    border-color: #8d1818;
}

.public-card h3 {
    color: #fff;

    margin-bottom: 12px;
}

.public-card p {
    color: #bcbcc2;

    line-height: 1.65;
}

.public-card strong {
    display: block;

    color: #ff3a32;

    margin-top: 15px;

    font-size: 1.05rem;
}

.public-card .badge {
    background: #5d0b0b;

    color: #ffb0ac;

    border: 1px solid #8f1717;
}

.public-page .gallery-grid {
    max-width: 1250px;

    margin: 0 auto;
}

.public-page .gallery-card {
    background: #18181c;

    border: 1px solid #2d2d33;

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.25);
}

.public-page .gallery-card div {
    background: #18181c;
}

.public-page .gallery-card h3 {
    color: #fff;
}


/* ============================================================
   41. PERFIL PÚBLICO
   ============================================================ */

.public-profile {
    max-width: 650px;

    margin: 70px auto;

    padding: 30px;

    background: #fff;

    border-radius: 18px;

    text-align: center;

    color: #111;
}

.profile-avatar {
    font-size: 4rem;
}

.eyebrow {
    letter-spacing: 2px;

    font-weight: 700;
}


/* ============================================================
   42. FOOTER
   ============================================================ */

footer {
    text-align: center;

    padding: 18px;

    color: #ffffff;

    font-size: 13px;

    width: 100%;
}

.public-page footer {
    background: #08080a;

    color: #999;

    border-top: 2px solid #a50000;

    padding: 30px 7%;
}

.public-page footer a {
    color: #ff3a32;
}


/* ============================================================
   43. CANCELAR EDICIÓN
   ============================================================ */

.cancel {
    display: none;
}

.cancel.is-visible {
    display: inline-block;
}


/* ============================================================
   44. RESPONSIVE - TABLETS
   ============================================================ */

@media (max-width: 900px) {

    .navbar {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;

        padding: 16px;
    }

    .navbar nav {
        width: 100%;

        overflow-x: auto;

        flex-wrap: nowrap;

        justify-content: flex-start;
    }

    .contenedor-inicio,
    .login-card {
        width: 92%;

        max-width: 100%;
    }

    .project-info {
        padding: 22px;
    }

    .dashboard-wide,
    .dashboard-card {
        width: 92%;

        max-width: 100%;
    }

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

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

    .wide-field {
        grid-column: 1;
    }

    .calendar-full {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-toolbar {
        flex-wrap: wrap;
    }

    .attendance-row {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        grid-template-columns: 70px 1fr;
    }

    .account-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .account-welcome {
        align-items: flex-start;

        flex-direction: column;
    }

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

    .report-stats,
    .report-finance {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .report-wide {
        grid-column: auto;
    }

    .reports-head {
        align-items: flex-start;

        flex-direction: column;
    }

    .calendar {
        grid-template-columns: repeat(7, 180px);
    }
}


/* ============================================================
   45. RESPONSIVE - MÓVILES
   ============================================================ */

@media (max-width: 600px) {

    .logo {
        font-size: 22px;
    }

    .navbar nav a {
        font-size: 14px;
    }

    .about-container {
        width: 95%;

        margin: 30px auto;
    }

    .opcion {
        width: 100%;
    }

    .team {
        gap: 20px;
    }

    .member {
        width: 100%;

        max-width: 360px;
    }

    .group-card {
        width: 100%;
    }

    .dashboard-wide,
    .dashboard-card {
        width: 94%;
    }

    .calendar-full {
        grid-template-columns: 1fr;
    }

    .search-result,
    .list-row {
        flex-direction: column;
    }

    .public-hero {
        min-height: 560px;

        padding: 70px 6%;
    }

    .public-section {
        padding: 55px 6%;
    }

    .reports-wrap {
        width: 94%;
    }

    .report-stats,
    .report-finance {
        grid-template-columns: 1fr;
    }

    .account-shell {
        width: 94%;

        margin-top: 20px;
    }

    .account-welcome {
        padding: 24px;
    }

    .account-stats {
        grid-template-columns: 1fr 1fr;

        gap: 9px;
    }

    .account-stat {
        padding: 14px;
    }

    .account-stat strong {
        font-size: 20px;
    }

    .account-panel {
        padding: 17px;
    }

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

    .profile-grid .profile-wide {
        grid-column: auto;
    }

    .account-qr {
        align-items: center;

        flex-direction: column;

        text-align: center;
    }

    .account-actions {
        width: 100%;
    }

    .account-btn {
        flex: 1;
    }

    .account-row {
        align-items: flex-start;
    }

    .payment-value {
        margin-left: auto;
    }

    .account-cards {
        grid-template-columns: 1fr;
    }

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

    .wide-field {
        grid-column: 1;
    }
}


/* ============================================================
   46. IMPRESIÓN DE REPORTES
   ============================================================ */

@media print {

    .navbar,
    .report-print,
    footer {
        display: none !important;
    }

    .reports-page {
        background: #fff;

        color: #111;
    }

    .report-stat,
    .report-finance article,
    .report-panel,
    .reports-head {
        color: #111;

        box-shadow: none;

        border: 1px solid #ddd;
    }

    .report-stat strong,
    .report-finance strong,
    .report-panel td,
    .report-panel h2,
    .reports-head h1 {
        color: #111;
    }

    .report-grid {
        display: block;
    }

    .report-panel {
        margin-bottom: 15px;
    }
}

/* ============================================================
   47. RESPONSIVE - AJUSTES COMPLEMENTARIOS
   ============================================================ */

/* Componentes compartidos del portal y la web pública */
.account-actions,
.teacher-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.account-btn,
.teacher-btn {
    white-space: nowrap;
}

.public-card {
    transition: transform .2s, border-color .2s, box-shadow .2s;
}

.public-card:hover {
    transform: translateY(-4px);
    border-color: rgba(208, 0, 0, .35);
    box-shadow: 0 15px 35px rgba(0, 0, 0, .18);
}

.account-panel {
    transition: border-color .2s, box-shadow .2s;
}

.account-panel:hover {
    border-color: rgba(208, 0, 0, .18);
    box-shadow: 0 14px 35px rgba(0, 0, 0, .10);
}

/* Navegación adaptable */
@media (max-width: 900px) {
    .navbar {
        align-items: flex-start;
        gap: 10px;
    }

    .navbar nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        max-width: 100%;
        padding-bottom: 3px;
    }

    .navbar nav a {
        white-space: nowrap;
    }

    .tabs {
        top: 64px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tabs button {
        white-space: nowrap;
    }
}

/* Portal del profesor */
@media (max-width: 800px) {
    .professor-panel .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-link {
        align-self: flex-start;
    }

    .professor-stats {
        grid-template-columns: 1fr 1fr !important;
    }

    .calendar-month-grid {
        min-width: 720px;
    }

    .calendar-full {
        overflow-x: auto;
    }

    .month-cell {
        min-height: 105px;
    }

    .calendar-weekdays {
        min-width: 720px;
    }

    .calendar-week-grid {
        min-width: 1050px;
    }

    .calendar-toolbar {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #fff;
    }

    .week-day {
        min-height: 300px;
    }
}

/* Mis clases */
@media (max-width: 600px) {
    .mis-clases-title {
        align-items: flex-start;
    }

    .mis-clases-title .badge {
        margin-left: 0;
    }

    .mis-clases-group-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .mis-clases-schedules {
        flex-direction: column;
    }
}

/* Administración */
@media (max-width: 900px) {
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

@media (max-width: 600px) {
    .navbar {
        position: relative;
        display: block;
        padding: 13px 16px;
    }

    .navbar .logo {
        display: block;
        margin-bottom: 9px;
    }

    .navbar nav {
        gap: 6px;
    }

    .navbar nav a {
        font-size: 13px;
        padding: 8px 9px;
    }

    .admin {
        width: 100%;
        padding: 0 12px;
        margin-top: 20px;
    }

    .hero {
        padding: 22px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .stat {
        padding: 12px;
    }

    .stat b {
        font-size: 22px;
    }

    .tabs {
        margin: 14px 0;
        padding: 7px;
    }

    .module {
        padding: 15px;
    }

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

    .form .wide {
        grid-column: 1;
    }

    .actions button {
        flex: 1;
        min-width: 120px;
    }

    .admin table {
        min-width: 620px;
    }
}

/* Portal alumno / portal profesor / web pública */
.public-page .navbar nav a:hover,
.account-page .navbar nav a:hover {
    background: rgba(208, 0, 0, .14);
}

.public-section {
    scroll-margin-top: 85px;
}

@media (max-width: 700px) {
    .account-shell,
    .teacher-shell {
        width: calc(100% - 24px);
        margin-left: auto;
        margin-right: auto;
    }

    .account-welcome,
    .teacher-welcome {
        padding: 20px !important;
        border-radius: 16px !important;
    }

    .account-welcome h1,
    .teacher-welcome h1 {
        font-size: 28px !important;
    }

    .account-actions,
    .teacher-actions {
        width: 100%;
    }

    .account-btn,
    .teacher-btn {
        flex: 1;
        text-align: center;
    }

    .account-layout,
    .teacher-layout {
        grid-template-columns: 1fr !important;
    }

    .account-stats,
    .teacher-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .account-panel,
    .teacher-panel {
        padding: 17px !important;
        border-radius: 16px !important;
    }

    .account-panel-head {
        align-items: flex-start !important;
        gap: 10px;
    }

    .account-panel-head h2 {
        font-size: 20px;
    }

    .account-row {
        gap: 9px;
    }

    .row-main {
        min-width: 0;
    }

    .row-main strong {
        overflow-wrap: anywhere;
    }

    .public-page main {
        overflow: hidden;
    }

    .public-hero {
        min-height: 520px !important;
        padding: 80px 20px 55px !important;
    }

    .public-hero h1 {
        font-size: clamp(34px, 10vw, 54px) !important;
    }

    .public-hero p {
        font-size: 16px !important;
    }

    .public-section {
        padding: 52px 16px !important;
    }

    .public-section h2 {
        font-size: 27px !important;
    }

    .public-card {
        padding: 18px !important;
    }
}

@media (max-width: 420px) {
    .account-stats,
    .teacher-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .account-stat {
        padding: 13px !important;
    }

    .account-stat strong {
        font-size: 20px !important;
    }

    .account-actions,
    .teacher-actions {
        flex-direction: column;
    }

    .account-btn,
    .teacher-btn {
        width: 100%;
        flex: none;
    }

    .navbar .logo {
        font-size: 20px;
    }

    .navbar nav a {
        font-size: 12px;
    }
}

/* Historial del alumno */
@media (max-width: 980px) {
    .account-history-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .account-history-grid {
        grid-template-columns: 1fr;
    }

    .account-history-grid .account-list {
        max-height: none;
    }
}

/* ============================================================
   33.2 PROMOCIONES Y PRÓXIMAS ACTIVIDADES - MI CUENTA
   ============================================================ */

.promotion-card {
    min-height: 112px;
}

.promotion-card p {
    margin-bottom: 8px;
}

.promotion-card .badge.success {
    border-color: rgba(45, 190, 105, .35);
    background: rgba(30, 130, 70, .15);
    color: #8ce5ad;
}

#proximosEventos .account-link {
    white-space: nowrap;
}

@media (max-width: 600px) {
    #proximosEventos .account-row {
        align-items: center;
    }
}

/* ============================================================
   18. REPORTES AVANZADOS
   ============================================================ */

.report-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 22px;
    padding: 16px;
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-md);
}

.report-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--white);
    font-weight: 700;
    font-size: .9rem;
}

.report-filters select {
    min-width: 150px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-sm);
    background: #222;
    color: var(--white);
}

.report-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 15px;
    border-radius: var(--radius-sm);
    background: #333;
    color: var(--white);
    text-decoration: none;
    font-weight: 700;
}

.report-export:hover { background: var(--brand); }

.report-advanced { margin-bottom: 24px; }

.monthly-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(30px, 1fr));
    gap: 10px;
    align-items: end;
    min-height: 230px;
    padding: 12px 4px 0;
}

.month-column {
    display: flex;
    min-width: 0;
    height: 210px;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    gap: 7px;
}

.month-column strong {
    font-size: .75rem;
    color: #ddd;
}

.month-value {
    min-height: 16px;
    font-size: .65rem;
    color: #bbb;
    white-space: nowrap;
}

.month-track {
    width: 100%;
    max-width: 38px;
    height: 150px;
    display: flex;
    align-items: end;
    overflow: hidden;
    border-radius: 8px 8px 3px 3px;
    background: rgba(255,255,255,.08);
}

.month-fill {
    width: 100%;
    min-height: 2px;
    border-radius: 8px 8px 0 0;
    background: var(--brand);
}

.report-table-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.mini-report-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 55px;
    gap: 8px 12px;
    align-items: center;
}

.mini-report-row > div:first-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mini-report-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-report-row small { color: #aaa; }
.mini-report-row > span { text-align: right; font-weight: 800; }

.mini-track {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255,255,255,.09);
}

.mini-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

@media (max-width: 800px) {
    .monthly-chart { gap: 5px; }
    .month-value { display: none; }
    .month-column { height: 180px; }
    .month-track { height: 130px; }
}

@media (max-width: 560px) {
    .report-filters { align-items: stretch; }
    .report-filters label,
    .report-filters select,
    .report-filters button,
    .report-export { width: 100%; }
    .monthly-chart { grid-template-columns: repeat(6, 1fr); row-gap: 18px; }
    .month-column { height: 145px; }
    .month-track { height: 90px; }
}


/* acciones del centro de notificaciones y avisos docentes */
.quick-action-buttons button { cursor: pointer; }
.teacher-notice-row { grid-template-columns: minmax(140px, .8fr) minmax(220px, 2fr) auto; }
.teacher-notice-row.notice-unread { border-color: rgba(201,35,50,.75); background: #281b1d; }
.teacher-notice-row.notice-read { opacity: .82; }
.teacher-notice-row button { white-space: nowrap; }
@media (max-width: 760px) { .teacher-notice-row { grid-template-columns: 1fr; } .teacher-notice-row button { width: 100%; } }

/* ============================================================
   32. CALENDARIO INTELIGENTE
   ============================================================ */
.calendar-filters {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.calendar-filter { display:flex; flex-direction:column; gap:6px; min-width:190px; }
.calendar-filter label { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; }
.calendar-filter select { min-height:42px; border:1px solid #d8d8d8; border-radius:9px; padding:9px 12px; background:#fff; }
.calendar-filters .secondary { min-height:42px; }
@media (max-width:700px){ .calendar-filters{align-items:stretch;} .calendar-filter{width:100%;min-width:0;} .calendar-filters button{width:100%;} }


/* ============================================================
   39. PAGOS AVANZADOS - V13
   ============================================================ */
.payment-tools {
    margin: 18px 0 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(0,0,0,.18);
}

.payment-tool-row {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-tool-row label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 135px;
    font-size: 11px;
    font-weight: 800;
    color: #aaa;
    text-transform: uppercase;
}

.payment-tool-row input,
.payment-tool-row select {
    min-height: 40px;
    padding: 8px 10px;
}

.payment-tool-row button {
    min-height: 40px;
}

.payment-summary {
    margin-top: 16px;
}

.payment-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.payment-summary-head h3 {
    margin: 3px 0;
}

.payment-summary-head p {
    color: #888;
    font-size: 12px;
}

.payment-summary-total {
    font-size: 22px;
    font-weight: 900;
    color: var(--success);
    text-align: right;
}

.payment-summary-total small {
    display: block;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.payment-summary-grid > div {
    padding: 13px;
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    background: #111;
}

.payment-summary-grid span,
.payment-summary-grid small {
    display: block;
    color: #888;
    font-size: 11px;
}

.payment-summary-grid b {
    display: block;
    margin: 4px 0;
    font-size: 20px;
}

.payment-summary-grid small {
    color: #aaa;
}

.table-action-link,
.payment-receipt-link {
    color: #ff7777;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.payment-account-summary {
    margin-bottom: 12px;
}

.payment-account-head {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.payment-account-head > div {
    padding: 11px;
    border-radius: 11px;
    border: 1px solid #292929;
    background: #0e0e0e;
}

.payment-account-head span,
.payment-account-head b {
    display: block;
}

.payment-account-head span {
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
}

.payment-account-head b {
    margin-top: 4px;
    font-size: 17px;
}

.payment-receipt-link {
    display: inline-block;
    margin-top: 4px;
}

.payment-receipt-page {
    background: #ececec;
    color: #111;
}

.payment-receipt {
    width: min(760px, calc(100% - 28px));
    margin: 40px auto;
}

.receipt-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.receipt-top h1 {
    margin-top: 5px;
}

.receipt-card {
    padding: 28px;
    border-radius: 18px;
    background: #fff;
    color: #111;
    box-shadow: var(--shadow-md);
}

.receipt-status {
    display: flex;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid #ddd;
}

.receipt-status span,
.receipt-grid span,
.receipt-amount small {
    display: block;
    color: #777;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.receipt-amount {
    padding: 25px 0;
    text-align: center;
}

.receipt-amount strong {
    display: block;
    margin-top: 5px;
    font-size: 38px;
}

.receipt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.receipt-grid b {
    display: block;
    margin-top: 4px;
}

.receipt-note {
    margin-top: 18px;
    color: #777;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .payment-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .payment-account-head { grid-template-columns: 1fr; }
    .receipt-top { align-items: flex-start; flex-direction: column; }
    .receipt-grid { grid-template-columns: 1fr; }
}

@media print {
    .payment-receipt-page { background: #fff; }
    .payment-receipt { width: 100%; margin: 0; }
    .receipt-card { box-shadow: none; border: 1px solid #ddd; }
    .receipt-top .account-btn { display: none; }
}

/* ============================================================
   33. EXPERIENCIA MÓVIL
   ------------------------------------------------------------
   Mejoras sin modificar la lógica del sistema:
   - menú móvil
   - áreas táctiles más cómodas
   - tablas desplazables
   - formularios y botones adaptables
   - tarjetas y calendario optimizados
   ============================================================ */

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.mobile-menu-toggle:focus-visible,
.navbar nav a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(208,0,0,.35);
    outline-offset: 2px;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-scroll table { min-width: 620px; }

.cards-grid,
.team.cards-grid { min-width: 0; }

@media (max-width: 900px) {
    .navbar {
        position: relative;
        z-index: 1000;
        gap: 12px;
    }

    .navbar .mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .navbar nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 10px;
        margin-top: 4px;
        background: rgba(15,15,15,.98);
        border: 1px solid rgba(255,255,255,.10);
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(0,0,0,.25);
    }

    .navbar.nav-open nav { display: flex; }

    .navbar nav a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 12px;
    }

    .navbar .logo {
        min-width: 0;
        max-width: calc(100% - 58px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .about-container,
    .portal,
    .admin,
    .wrap,
    .account-shell {
        width: min(100% - 24px, 1180px);
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .hero,
    .card,
    .project-info,
    .report-panel {
        max-width: 100%;
        box-sizing: border-box;
    }

    input,
    select,
    textarea,
    button,
    .btn {
        font-size: 16px;
    }

    .form-stack input,
    .form-stack select,
    .form-stack textarea,
    form input,
    form select,
    form textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .calendar-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .calendar-toolbar h2 {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
        margin: 4px 0;
        order: -1;
    }

    .calendar-toolbar button { width: 100%; }
}

@media (max-width: 600px) {
    .navbar {
        padding: 10px 12px;
    }

    .navbar .logo { font-size: 15px; }

    .about-container,
    .portal,
    .admin,
    .wrap,
    .account-shell {
        width: calc(100% - 20px);
    }

    .hero h1,
    .about-container h1 { font-size: clamp(24px, 8vw, 34px); line-height: 1.1; }

    .hero p { line-height: 1.5; }

    .cards-grid,
    .team.cards-grid,
    .stats-grid,
    .dashboard-grid,
    .payment-summary-grid {
        grid-template-columns: 1fr !important;
    }

    .card,
    .project-info,
    .report-panel {
        padding: 16px;
    }

    button,
    .btn,
    .account-btn,
    .table-action-link {
        min-height: 44px;
    }

    .calendar-full {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calendar-week-grid {
        min-width: 700px;
    }

    .calendar-month-grid {
        min-width: 650px;
    }

    .calendar-filters {
        padding: 14px;
    }

    .calendar-filter select,
    .calendar-filters button {
        min-height: 46px;
        width: 100%;
    }

    .report-table-list,
    .table-scroll {
        margin-left: -2px;
        margin-right: -2px;
        width: calc(100% + 4px);
    }

    .table-scroll::after {
        content: 'Desliza horizontalmente para ver más →';
        display: block;
        padding: 7px 2px 0;
        color: #777;
        font-size: 11px;
    }

    .table-scroll table { min-width: 680px; }

    .payment-summary-grid { gap: 10px; }

    .receipt-card,
    .payment-account-head,
    .receipt-top {
        width: 100%;
        box-sizing: border-box;
    }

    footer {
        padding: 20px 12px;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .navbar .logo { font-size: 14px; }
    .mobile-menu-toggle { width: 42px; height: 42px; }
    .calendar-toolbar { grid-template-columns: 1fr; }
    .calendar-toolbar h2 { grid-column: 1; }
    .calendar-toolbar button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   46. WEB PÚBLICA PULIDA
   ------------------------------------------------------------
   Presentación pública, jerarquía visual, tarjetas, eventos,
   promociones, galería y CTA final.
   ============================================================ */

.public .public-logo { color: #fff; text-decoration: none; }
.public .public-navbar nav { align-items: center; gap: 18px; }
.public .public-navbar nav a { text-decoration: none; }
.public .public-nav-cta { padding: 9px 15px !important; border: 1px solid #b91616; border-radius: 9px; background: #a90000; color: #fff !important; }
.public .public-nav-cta:hover { background: #d60000; }

.public-hero { min-height: 720px; }
.public-hero .public-hero-content { max-width: 960px; }
.public-hero h1 { font-size: clamp(3rem, 7vw, 6.5rem); max-width: 1000px; }
.public-hero p { max-width: 760px; font-size: 1.08rem; }
.public-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.public-btn-secondary { background: transparent !important; border-color: #555 !important; box-shadow: none !important; }
.public-btn-secondary:hover { background: #25252a !important; border-color: #888 !important; }
.public-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 42px; }
.public-hero-stats > div { min-width: 130px; padding: 13px 16px; border: 1px solid #34343a; border-radius: 12px; background: rgba(10,10,12,.72); }
.public-hero-stats strong, .public-hero-stats span { display: block; }
.public-hero-stats strong { font-size: 1.35rem; color: #fff; }
.public-hero-stats span { margin-top: 2px; color: #aaa; font-size: .8rem; }

.public-section-heading { max-width: 820px; margin: 0 auto 38px; text-align: center; }
.public-section-heading .eyebrow { color: #ef3129; font-size: .78rem; }
.public-section-heading h2 { margin: 8px 0 10px; }
.public-section-heading h2::after { margin: 13px auto 0; }
.public-section-heading p { color: #aaa; line-height: 1.7; margin: 0 auto; }
.public-intro { background: #0b0b0d; }
.public-feature-grid { max-width: 1250px; margin: 0 auto; display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.public-feature { padding: 24px; border: 1px solid #2a2a30; border-radius: 16px; background: linear-gradient(145deg,#17171b,#101013); }
.public-feature > span { font-size: 1.8rem; }
.public-feature h3 { margin: 15px 0 8px; color: #fff; }
.public-feature p { color: #aaa; line-height: 1.65; margin: 0; }

.public-cards { max-width: 1250px; margin: 0 auto; }
.public-discipline-card, .public-prof-card, .public-event-card, .public-promo-card { min-height: 100%; }
.public-card-icon { font-size: 1.7rem; margin-bottom: 14px; }
.public-prof-card { display: flex; align-items: center; gap: 18px; }
.public-prof-avatar { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 50%; background: #2a0b0b; border: 1px solid #671818; font-size: 1.5rem; }
.public-prof-card h3 { margin: 0 0 5px; }
.public-prof-card p { margin: 0; }
.public-event-card { position: relative; padding-top: 76px; }
.public-event-date { position: absolute; top: 5px; left: 25px; width: 50px; padding: 5px 5px; text-align: center; border-radius: 10px; background: #7d0909; border: 1px solid #b71d1d; }
.public-event-date strong, .public-event-date span { display: block; color: #fff; }
.public-event-date strong { font-size: 1.25rem; line-height: 1; }
.public-event-date span { margin-top: 4px; font-size: .63rem; }
.public-event-meta { display: grid; gap: 5px; margin-top: 14px; color: #aaa; font-size: .82rem; }
.public-promo-card { border-top-color: #e12b22; }
.public-promo-tag { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #420909; border: 1px solid #711414; color: #ff9e99; font-size: .66rem; font-weight: 800; letter-spacing: .5px; }
.public-empty { grid-column: 1 / -1; padding: 28px; text-align: center; color: #999; border: 1px dashed #39393f; border-radius: 14px; }

.public-gallery { max-width: 1250px; margin: 0 auto; display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; }
.public-gallery-item { overflow: hidden; border: 1px solid #2e2e34; border-radius: 15px; background: #151519; }
.public-gallery-item img { display: block; width: 100%; height: 230px; object-fit: cover; }
.public-gallery-item div { padding: 14px 16px; }
.public-gallery-item h3 { margin: 0 0 5px; color: #fff; font-size: 1rem; }
.public-gallery-item small { color: #888; }
.public-gallery-empty { grid-column: 1 / -1; padding: 42px 20px; text-align: center; color: #888; border: 1px dashed #38383e; border-radius: 15px; }

.public-contact { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 70px 7%; background: linear-gradient(120deg,#260606,#0e0e10 65%); border-top: 1px solid #5d1111; }
.public-contact .eyebrow { color: #ff3930; font-size: .78rem; }
.public-contact h2 { margin: 8px 0 10px; color: #fff; font-size: clamp(2rem,4vw,3.5rem); }
.public-contact p { max-width: 700px; margin: 0; color: #bbb; line-height: 1.7; }
.public-contact-actions { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.public-footer { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 34px 7%; }
.public-footer > div:first-child strong, .public-footer > div:first-child span { display: block; }
.public-footer > div:first-child strong { color: #fff; }
.public-footer > div:first-child span { margin-top: 5px; color: #777; }
.public-footer > div:nth-child(2) { display: flex; flex-wrap: wrap; gap: 14px; }
.public-footer a { color: #aaa !important; text-decoration: none; }
.public-footer a:hover { color: #ff3a32 !important; }
.public-footer small { grid-column: 1 / -1; color: #666; }

@media (max-width: 900px) {
    .public .public-navbar nav { gap: 8px; }
    .public-feature-grid { grid-template-columns: repeat(2,1fr); }
    .public-gallery { grid-template-columns: repeat(2,1fr); }
    .public-contact { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
    .public-hero { min-height: 650px; padding: 60px 7%; }
    .public-hero h1 { font-size: clamp(2.6rem, 13vw, 4.2rem); }
    .public-hero-actions, .public-contact-actions { width: 100%; }
    .public-hero-actions .btn, .public-contact-actions .btn { flex: 1; text-align: center; }
    .public-hero-stats { display: grid; grid-template-columns: repeat(3,1fr); }
    .public-hero-stats > div { min-width: 0; padding: 11px 8px; text-align: center; }
    .public-hero-stats strong { font-size: 1.1rem; }
    .public-hero-stats span { font-size: .68rem; }
    .public-feature-grid, .public-gallery { grid-template-columns: 1fr; }
    .public-gallery-item img { height: 220px; }
    .public-footer { grid-template-columns: 1fr; }
    .public-footer > div:nth-child(2) { justify-content: flex-start; }
}

/* Ajuste visual del comprobante */
.receipt-brand { display: flex; align-items: center; gap: 11px; }
.receipt-brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #111; border: 1px solid #333; }
.receipt-brand strong, .receipt-brand span { display: block; }
.receipt-brand strong { letter-spacing: .8px; }
.receipt-brand div span { margin-top: 2px; color: #777; font-size: 11px; }
.receipt-heading { margin-bottom: 18px; }
.receipt-heading h1 {color:#000000; margin: 5px 0 5px; }
.receipt-heading p { margin: 0; color: #777; font-size: 12px; }
.receipt-state { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; }
.receipt-state-pagado { background: #e4f6e8; color: #176b2c; }
.receipt-state-pendiente { background: #fff3d6; color: #875800; }
.receipt-state-vencido { background: #fde5e5; color: #a20f0f; }
.receipt-state-anulado { background: #eee; color: #555; }
.receipt-total-line { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 18px; }
.receipt-total-line span { color: #777; font-size: 12px; text-transform: uppercase; }
.receipt-total-line strong { font-size: 20px; }
@media print {
    .receipt-heading p { color: #555; }
    .receipt-brand-mark { border-color: #aaa; }
}

/* ============================================================
   34. V18 - COMPROBANTES Y VERIFICACIÓN DE PAGOS
   ============================================================ */
.payment-receipt .receipt-verify {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.payment-receipt .receipt-verify span {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .7;
}
.payment-receipt .receipt-verify a {
    font-weight: 700;
    color: var(--brand, #d00000);
    text-decoration: none;
}
.payment-receipt .receipt-verify a:hover { text-decoration: underline; }
.verification-page .receipt-card { max-width: 900px; margin-inline: auto; }
@media print {
    .receipt-verify { display: none !important; }
    .payment-receipt-page { background: #fff !important; }
    .payment-receipt { max-width: 900px !important; margin: 0 auto !important; }
}

/* ============================================================
   39. V19 - LOGO OFICIAL Y ASISTENCIA AVANZADA
   ============================================================ */
.navbar .logo.logo-image,
.logo.logo-image {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-width: 145px;
    height: 52px;
    color: transparent;
    overflow: hidden;
}
.logo-image img {
    display: block;
    width: 120px;
    height: 52px;
    object-fit: contain;
    object-position: left center;
    border-radius: 8px;
}
.logo-image .logo-text {
    display: none;
}
.attendance-summary {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 10px;
}
.attendance-summary-card {
    min-width: 130px;
    padding: 12px 15px;
    border: 1px solid #3a3a3a;
    border-radius: 11px;
    background: #222;
}
.attendance-summary-card strong,
.attendance-summary-card span { display: block; }
.attendance-summary-card strong { font-size: 1.15rem; color: #fff; }
.attendance-summary-card span { margin-top: 3px; color: #aaa; font-size: .82rem; }
.attendance-summary-card.success strong { color: #8ee6a1; }
.attendance-summary-note { align-self: center; color: #aaa; font-size: .86rem; }
.attendance-student small { display:block; margin-top:4px; color:#777; }
.attendance-student small b { color:#d00000; }
.attendance-row { display:grid; grid-template-columns:minmax(180px,1.2fr) 170px minmax(180px,1fr); gap:10px; align-items:center; padding:12px; margin-bottom:8px; border:1px solid #ddd; border-radius:10px; background:#fff; color:#111; }
.attendance-row select,.attendance-row input { width:100%; box-sizing:border-box; padding:9px 10px; border:1px solid #ccc; border-radius:8px; }
@media(max-width:650px){
 .navbar .logo.logo-image,.logo.logo-image{min-width:100px;height:46px}
 .logo-image img{width:100px;height:46px}
 .attendance-row{grid-template-columns:1fr}
 .attendance-summary-card{flex:1;min-width:100px}
}

/* Logo oficial V19 */
.navbar .logo-img,
.logo-img {
    display:block;
    width:120px;
    height:52px;
    object-fit:contain;
    object-position:left center;
    border-radius:8px;
}
.public-logo .logo-img { width:132px; height:58px; }
@media(max-width:650px){ .navbar .logo-img,.logo-img{width:100px;height:46px}.public-logo .logo-img{width:108px;height:48px;} }
.receipt-brand-mark { overflow:hidden; }
.receipt-brand-mark img { width:42px; height:42px; display:block; object-fit:contain; border-radius:9px; }

/* ============================================================
   50. V19.1 — CENTRALIZACIÓN Y CORRECCIONES VISUALES
   Todo el estilo específico de profesor, reportes y exportaciones
   se mantiene aquí para evitar CSS incrustado en las páginas.
   ============================================================ */

/* ---------- Portal docente ---------- */
.teacher-shell {
    max-width: 1240px;
    margin: 34px auto 64px;
    padding: 0 22px;
    color: var(--text-color, #f5f5f5);
}

.teacher-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px;
    margin-bottom: 22px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 22px;
    background: linear-gradient(120deg, #171717 0%, #262626 70%, #4b1015 100%);
    box-shadow: 0 16px 40px rgba(0,0,0,.18);
}

.teacher-welcome h1 {
    margin: 8px 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.teacher-welcome p {
    max-width: 650px;
    margin: 0;
    color: #ddd;
}

.teacher-eyebrow,
.teacher-kicker {
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .14em;
    color: #ff6b73;
}

.teacher-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.teacher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 15px;
    border: 1px solid #c92332;
    border-radius: 10px;
    background: #c92332;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.teacher-btn:hover {
    background: #e02d3d;
    border-color: #e02d3d;
}

.teacher-btn.secondary {
    border-color: #555;
    background: #202020;
}

.teacher-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0 24px;
}

.teacher-stat {
    padding: 20px;
    border: 1px solid #343434;
    border-radius: 17px;
    background: #191919;
    box-shadow: 0 8px 24px #0002;
}

.teacher-stat .stat-icon { font-size: 1.45rem; }
.teacher-stat strong { display: block; margin: 8px 0 4px; color: #fff; font-size: 1.8rem; }
.teacher-stat span { color: #c6c6c6; font-size: .92rem; }

.teacher-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.teacher-panel {
    min-width: 0;
    padding: 23px;
    border: 1px solid #333;
    border-radius: 18px;
    background: #191919;
    box-shadow: 0 8px 26px #0002;
}

.teacher-panel.full { margin-bottom: 20px; }

.teacher-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.teacher-panel-head h2 { margin: 5px 0 0; font-size: 1.25rem; }
.teacher-link { color: #ff747d; font-weight: 700; text-decoration: none; white-space: nowrap; }
.teacher-link:hover { text-decoration: underline; }
.teacher-subtitle { margin: 8px 0 16px; color: #bcbcbc; font-size: .92rem; }
.teacher-empty { padding: 18px; border: 1px dashed #454545; border-radius: 12px; background: #222; color: #c9c9c9; }

.teacher-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.teacher-toolbar select,
.teacher-toolbar input {
    padding: 10px 12px;
    border: 1px solid #484848;
    border-radius: 9px;
    background: #242424;
    color: #fff;
}

.teacher-panel button { cursor: pointer; }
.teacher-panel .cards-grid,
.teacher-panel .timeline,
.teacher-panel .calendar { min-width: 0; }
.teacher-panel .section-head { margin-bottom: 15px; }
.teacher-panel .attendance-list { margin-top: 16px; color: #000; }
.teacher-panel #mensajeProfesorPortal,
.teacher-panel #mensajeAsistencia { color: #ff8b92; }
.teacher-panel #btnGuardarDisciplinasProfesor { margin-top: 14px; }

.teacher-calendar-wrap { overflow-x: auto; padding-bottom: 5px; }
.teacher-calendar-wrap .calendar { min-width: 650px; }
.teacher-notifications { display: grid; gap: 10px; }
.teacher-notification { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid #383838; border-radius: 12px; background: #222; }
.teacher-notification.read { opacity: .72; }
.teacher-notification strong { display: block; }
.teacher-notification p { margin: 5px 0; color: #ccc; }
.teacher-notification small { color: #aaa; }
.teacher-notification button { padding: 8px 10px; border: 1px solid #555; border-radius: 8px; background: #333; color: #fff; }
.teacher-summary-layout { margin-bottom: 20px; }
.teacher-summary-card { padding: 22px; border: 1px solid #333; border-radius: 18px; background: #191919; box-shadow: 0 8px 26px #0002; }
.teacher-summary-card h2 { margin: 6px 0; }
.teacher-summary-card p { color: #bbb; }
.teacher-summary-icon { font-size: 1.7rem; }
.teacher-progress { height: 9px; margin: 12px 0 8px; overflow: hidden; border-radius: 99px; background: #303030; }
.teacher-progress span { display: block; height: 100%; border-radius: inherit; background: #c92332; }
.teacher-group-summary { display: grid; gap: 12px; }
.teacher-group-row { display: grid; grid-template-columns: minmax(180px,1.5fr) minmax(130px,2fr) auto; align-items: center; gap: 16px; padding: 15px; border: 1px solid #383838; border-radius: 12px; background: #222; }
.teacher-group-row strong { display: block; }
.teacher-group-row small { display: block; margin-top: 4px; color: #aaa; }
.teacher-capacity { font-weight: 700; white-space: nowrap; }
.teacher-capacity.ok { color: #8ee6a1; }
.teacher-capacity.full { color: #ff7c84; }
.attendance-save-button[hidden] { display: none; }
.attendance-save-button.is-visible { display: inline-flex; }

/* ---------- Vista semanal ---------- */
.weekly-view-title {
    margin: 28px 0 14px;
}

/* ---------- Exportaciones ---------- */
.export-page {
    min-height: 100vh;
    padding: 30px;
    background: #f5f5f5;
    color: #111;
    font-family: var(--font-sans);
}

.export-page h1 { color:#000; margin: 0 0 20px; }
.export-table { width: 100%; border-collapse: collapse; background: #fff; }
.export-table th,
.export-table td { padding: 7px; border: 1px solid #aaa; text-align: left; }
.export-table th { background: #eee; }
.export-print-button { margin-bottom: 20px; }

/* ---------- Barras sin estilos inline ---------- */
.progress-fill { display: block; height: 100%; border-radius: inherit; }
.progress-fill,
.teacher-progress span { background: #c92332; }

.report-fill,
.mini-track i,
.report-bar-fill {
    display: block;
}

/* Las clases de porcentaje permiten que los valores dinámicos sigan
   viviendo en style.css, sin style="width/height" en las páginas. */
.progress-pct-0 { width: 0%; }
.report-pct-0 { width: 0%; }
.report-height-0 { height: 0%; }
.progress-pct-5 { width: 5%; }
.report-pct-5 { width: 5%; }
.report-height-5 { height: 5%; }
.progress-pct-10 { width: 10%; }
.report-pct-10 { width: 10%; }
.report-height-10 { height: 10%; }
.progress-pct-15 { width: 15%; }
.report-pct-15 { width: 15%; }
.report-height-15 { height: 15%; }
.progress-pct-20 { width: 20%; }
.report-pct-20 { width: 20%; }
.report-height-20 { height: 20%; }
.progress-pct-25 { width: 25%; }
.report-pct-25 { width: 25%; }
.report-height-25 { height: 25%; }
.progress-pct-30 { width: 30%; }
.report-pct-30 { width: 30%; }
.report-height-30 { height: 30%; }
.progress-pct-35 { width: 35%; }
.report-pct-35 { width: 35%; }
.report-height-35 { height: 35%; }
.progress-pct-40 { width: 40%; }
.report-pct-40 { width: 40%; }
.report-height-40 { height: 40%; }
.progress-pct-45 { width: 45%; }
.report-pct-45 { width: 45%; }
.report-height-45 { height: 45%; }
.progress-pct-50 { width: 50%; }
.report-pct-50 { width: 50%; }
.report-height-50 { height: 50%; }
.progress-pct-55 { width: 55%; }
.report-pct-55 { width: 55%; }
.report-height-55 { height: 55%; }
.progress-pct-60 { width: 60%; }
.report-pct-60 { width: 60%; }
.report-height-60 { height: 60%; }
.progress-pct-65 { width: 65%; }
.report-pct-65 { width: 65%; }
.report-height-65 { height: 65%; }
.progress-pct-70 { width: 70%; }
.report-pct-70 { width: 70%; }
.report-height-70 { height: 70%; }
.progress-pct-75 { width: 75%; }
.report-pct-75 { width: 75%; }
.report-height-75 { height: 75%; }
.progress-pct-80 { width: 80%; }
.report-pct-80 { width: 80%; }
.report-height-80 { height: 80%; }
.progress-pct-85 { width: 85%; }
.report-pct-85 { width: 85%; }
.report-height-85 { height: 85%; }
.progress-pct-90 { width: 90%; }
.report-pct-90 { width: 90%; }
.report-height-90 { height: 90%; }
.progress-pct-95 { width: 95%; }
.report-pct-95 { width: 95%; }
.report-height-95 { height: 95%; }
.progress-pct-100 { width: 100%; }
.report-pct-100 { width: 100%; }
.report-height-100 { height: 100%; }


@media (max-width: 850px) {
    .teacher-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-layout { grid-template-columns: 1fr; }
    .teacher-welcome { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 650px) {
    .teacher-group-row { grid-template-columns: 1fr; }
    .teacher-capacity { white-space: normal; }
    .teacher-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attendance-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .teacher-shell { margin-top: 20px; padding: 0 13px; }
    .teacher-welcome,
    .teacher-panel { padding: 18px; }
    .teacher-stats { gap: 10px; }
    .teacher-stat { padding: 15px; }
    .teacher-stat strong { font-size: 1.5rem; }
    .teacher-actions { width: 100%; }
    .teacher-btn { flex: 1; }
}

@media print {
    .export-page { padding: 10px; background: #fff; }
    .export-print-button { display: none; }
    .export-table { font-size: 11px; }
}


/* Campos complementarios de seminarios/eventos */
.form-grid-inline-fields {
    gap: 10px;
    margin-top: 2px;
}
.form-grid-inline-fields > * {
    min-width: 0;
}

/* Perfil público generado por el QR del alumno */
.public-profile {
    width: min(520px, calc(100% - 32px));
    margin: 70px auto;
    padding: 32px;
    text-align: center;
    border: 1px solid #333;
    border-radius: 22px;
    background: #171717;
    box-shadow: 0 18px 45px rgba(0,0,0,.25);
}
.public-profile h1 { margin: 14px 0 8px; color: #fff; }
.public-profile h2 { margin: 22px 0 8px; color: #fff; }
.public-profile p { color: #bbb; }
.profile-logo { display: flex; justify-content: center; }
.profile-logo-img { width: 110px; height: 110px; object-fit: contain; border-radius: 50%; }
.profile-avatar { margin-top: 10px; font-size: 2rem; }
.profile-status { margin-top: 18px; }


/* ============================================================
   V20. CUPOS Y LISTAS DE ESPERA
   ============================================================ */
.waitlist-info {
    display: block;
    margin-top: 8px;
    color: var(--muted, #aaa);
    font-size: .9rem;
}

.group-card .waitlist-info,
.dynamic-card .waitlist-info {
    padding: 7px 10px;
    border-left: 3px solid var(--brand, #d00000);
    background: rgba(208, 0, 0, .08);
    border-radius: 4px;
}

.group-card button.btn-secondary,
.dynamic-card button.btn-secondary {
    margin-top: 8px;
}

@media (max-width: 600px) {
    .group-card .waitlist-info,
    .dynamic-card .waitlist-info {
        font-size: .82rem;
    }
}

/* ============================================================
   34. PANEL DE ESTADÍSTICAS V21
   Indicadores generales y reportes de asistencia por período.
   ============================================================ */
.v21-statistics-wrap {
    width: min(1440px, calc(100% - 32px));
    margin: 32px auto 64px;
}

.v21-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.v21-kpi,
.v21-stat-panel {
    background: var(--surface, #171717);
    border: 1px solid var(--line, rgba(255,255,255,.08));
    border-radius: var(--radius-lg, 18px);
    box-shadow: var(--shadow-sm, 0 5px 15px rgba(0,0,0,.2));
}

.v21-kpi {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
}

.v21-kpi span,
.v21-kpi small {
    color: var(--text-light, #d0d0d0);
}

.v21-kpi strong {
    color: var(--white, #fff);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    overflow-wrap: anywhere;
}

.v21-stat-panel {
    margin: 20px 0;
    padding: 22px;
    overflow: hidden;
}

.v21-stat-panel h2 {
    text-align: left;
    margin-bottom: 18px;
}

.v21-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 18px;
}

.v21-panel-heading h2 { text-align: left; margin: 5px 0 0; }
.v21-panel-heading p { color: var(--muted, #a7a7a7); }

.v21-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.v21-filter-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-light, #d0d0d0);
}

.v21-filter-grid input,
.v21-filter-grid select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line, rgba(255,255,255,.12));
    border-radius: var(--radius-sm, 8px);
    background: var(--surface-2, #211818);
    color: var(--white, #fff);
}

.v21-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.v21-filter-actions a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--line, rgba(255,255,255,.12));
    text-decoration: none;
}

.v21-stat-panel .table-wrap { overflow-x: auto; }
.v21-stat-panel table { width: 100%; border-collapse: collapse; }
.v21-stat-panel th,
.v21-stat-panel td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.v21-stat-panel th { color: var(--white, #fff); background: rgba(208,0,0,.16); }
.v21-stat-panel td { color: var(--text-light, #d0d0d0); }

@media (max-width: 900px) {
    .v21-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .v21-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .v21-statistics-wrap { width: min(100% - 20px, 1440px); margin-top: 20px; }
    .v21-kpi-grid,
    .v21-filter-grid { grid-template-columns: 1fr; }
    .v21-stat-panel { padding: 15px; }
    .v21-panel-heading { flex-direction: column; }
}


/* ============================================================
   PORTAL DEL ALUMNO — EDICIÓN DE DATOS PERSONALES
   ============================================================ */
.profile-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.profile-edit-form {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #333;
    border-radius: 14px;
    background: #121212;
}
.profile-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.profile-edit-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #ddd;
    font-size: 13px;
    font-weight: 600;
}
.profile-edit-grid input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #444;
    border-radius: 9px;
    background: #1b1b1b;
    color: #fff;
    font: inherit;
}
.profile-edit-grid input:focus {
    outline: 2px solid #d00000;
    outline-offset: 1px;
}
.profile-edit-wide { grid-column: 1 / -1; }
.profile-edit-note {
    margin: 15px 0 0;
    color: #aaa;
    font-size: 12px;
    line-height: 1.6;
}
.profile-edit-form button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 600px) {
    .profile-edit-grid { grid-template-columns: 1fr; }
    .profile-edit-wide { grid-column: auto; }
    .profile-edit-form { padding: 13px; }
}


/* ============================================================
   PERFIL DEL ALUMNO: CAMBIO DE CONTRASEÑA
   ============================================================ */
.password-change-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(128, 128, 128, .28);
}
.password-change-section .profile-edit-form {
    margin-top: 12px;
}
.password-change-section input[type="password"] {
    width: 100%;
}


/* ============================================================
   35. DETALLE FINANCIERO EN REPORTES
   ============================================================ */

.report-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.report-panel-heading h2 { margin-bottom: 6px; }
.report-panel-heading p { margin: 0; color: #bdbdbd; font-size: .9rem; }
.report-payments-detail .table-scroll { overflow-x: auto; }
.report-payments-detail table { width: 100%; min-width: 850px; border-collapse: collapse; }
.report-payments-detail th,
.report-payments-detail td { padding: 11px 10px; border-bottom: 1px solid rgba(255,255,255,.09); text-align: left; vertical-align: middle; }
.report-payments-detail th { color: #f1f1f1; background: rgba(0,0,0,.22); white-space: nowrap; }
.report-payments-detail td { color: #ddd; }
.report-payments-detail tbody tr:hover { background: rgba(255,255,255,.035); }
.report-payments-detail .table-action-link { display: inline-flex; white-space: nowrap; }

@media print {
    .report-payments-detail .table-scroll { overflow: visible; }
    .report-payments-detail table { min-width: 0; font-size: 9pt; }
    .report-payments-detail th,
    .report-payments-detail td { padding: 5px; }
}

/* ============================================================
   28. ESPACIO DOCENTE V21 — LISTAS DE GRUPOS Y ALUMNOS
   ============================================================ */
.teacher-assigned-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.teacher-assigned-group h3,
.teacher-assigned-group p {
    margin-top: 0;
    margin-bottom: 0;
}

.teacher-group-schedules,
.teacher-roster ul {
    margin: 0;
    padding-left: 22px;
}

.teacher-group-schedules li,
.teacher-roster li {
    margin: 5px 0;
    line-height: 1.45;
}

.teacher-roster {
    padding: 11px 12px;
    border: 1px solid #444;
    border-radius: 9px;
    background: #191919;
}

.teacher-roster-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(208, 0, 0, .55);
    border-radius: 7px;
    background: #242424;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.teacher-roster-toggle:hover,
.teacher-roster-toggle:focus-visible {
    background: #351818;
    border-color: var(--brand, #d00000);
}

.teacher-roster-toggle span {
    color: var(--brand-light, #ff2a2a);
    font-size: 1.2rem;
}

.teacher-roster-content {
    padding: 12px 4px 2px;
}

.teacher-roster-content[hidden] {
    display: none !important;
}

.teacher-assigned-group .teacher-btn {
    align-self: flex-start;
    margin-top: 2px;
}

@media (max-width: 640px) {
    .teacher-assigned-group .teacher-btn {
        width: 100%;
    }
}

/* ============================================================
   29. GESTIÓN DE ALUMNOS V21 — BÚSQUEDA, EDICIÓN Y EXPORTACIÓN
   ============================================================ */
.student-management-panel { min-width: 0; }
.student-management-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.student-management-toolbar h2 { margin-bottom: 6px; }
.student-management-help { margin: 0; color: var(--text-light); font-size: .92rem; }
.student-search-label { display: block; margin-bottom: 7px; font-weight: 700; }
#buscarAlumno { display: block; width: 100%; max-width: 620px; margin-bottom: 10px; }
.student-count { color: var(--text-light); font-size: .9rem; margin: 8px 0 12px; }
.student-table-wrap { width: 100%; overflow-x: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; }
.student-management-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.student-management-table th,
.student-management-table td { padding: 12px 13px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.09); vertical-align: middle; }
.student-management-table th { background: rgba(0,0,0,.28); color: #fff; white-space: nowrap; }
.student-management-table tbody tr:hover { background: rgba(255,255,255,.035); }
.student-management-table tbody tr:last-child td { border-bottom: 0; }
.student-edit-button { padding: 7px 12px; border: 0; border-radius: 7px; background: var(--brand); color: #fff; cursor: pointer; font-weight: 700; }
.student-edit-button:hover { background: var(--brand-dark); }
.secondary-btn { padding: 10px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; background: #292929; color: #fff; cursor: pointer; font-weight: 700; }
.secondary-btn:hover { background: #383838; }
.form-action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#editarAlumnoPanel[hidden] { display: none !important; }
@media (max-width: 640px) {
    .student-management-toolbar > button { width: 100%; }
    .form-action-row > button { flex: 1 1 100%; }
    .student-management-table th, .student-management-table td { padding: 10px; }
}


/* ============================================================
   52. V21 — AJUSTES FINALES PARA CELULARES Y TABLETAS
   ------------------------------------------------------------
   Capa de compatibilidad responsive para pantallas estrechas.
   No cambia consultas SQL, permisos ni reglas de negocio.
   ============================================================ */

/* Evita que contenido ancho fuerce el desplazamiento de toda la página. */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body,
main,
section,
article,
.project-info,
.teacher-panel,
.student-management-panel {
    min-width: 0;
}

img,
video,
iframe,
canvas,
svg {
    max-width: 100%;
}

input,
select,
textarea {
    max-width: 100%;
    min-width: 0;
}

/* Tablas grandes: el desplazamiento queda dentro de su contenedor. */
.table-wrap,
.table-scroll,
.student-table-wrap,
.report-payments-detail .table-scroll,
.teacher-calendar-wrap {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Botones y enlaces de acción con área táctil cómoda. */
button,
.btn,
.account-btn,
.teacher-btn,
.secondary-btn,
.student-edit-button {
    touch-action: manipulation;
}

@media (max-width: 900px) {
    .navbar,
    .public-page .navbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 48px;
        align-items: center;
        gap: 10px 12px;
        padding: 12px 16px;
    }

    .navbar .logo,
    .navbar .public-logo {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .navbar .mobile-menu-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        width: 46px;
        height: 46px;
        margin: 0;
    }

    .navbar nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        max-height: min(65vh, 460px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .navbar.nav-open nav {
        display: flex;
    }

    .about-container,
    .portal,
    .admin,
    .teacher-shell,
    .public-section,
    .public-cards {
        width: auto;
        max-width: 100%;
        margin-left: 16px;
        margin-right: 16px;
    }

    .about-container,
    .portal,
    .admin {
        padding-left: 0;
        padding-right: 0;
    }

    .project-info,
    .teacher-panel,
    .teacher-summary-card {
        padding: 18px;
    }

    .teacher-welcome {
        align-items: stretch;
        flex-direction: column;
        padding: 22px;
    }

    .teacher-actions {
        width: 100%;
    }

    .teacher-actions .teacher-btn {
        flex: 1 1 180px;
    }

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

    .teacher-layout,
    .teacher-summary-layout,
    .dashboard-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .teacher-group-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .teacher-panel-head {
        flex-wrap: wrap;
    }

    .teacher-panel-head > a,
    .teacher-panel-head > button {
        max-width: 100%;
    }

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

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

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: clamp(1.45rem, 6vw, 2rem);
        overflow-wrap: anywhere;
    }

    h2 {
        font-size: clamp(1.15rem, 4.8vw, 1.55rem);
        overflow-wrap: anywhere;
    }

    p,
    li,
    label,
    small {
        overflow-wrap: anywhere;
    }

    .about-container,
    .portal,
    .admin,
    .teacher-shell,
    .public-section,
    .public-cards {
        margin-left: 12px;
        margin-right: 12px;
    }

    .project-info,
    .teacher-panel,
    .teacher-summary-card,
    .dashboard-quick-actions {
        padding: 14px;
        border-radius: 13px;
    }

    .form-grid-two,
    .form-grid-spaced,
    .form-stack,
    .dashboard-alerts,
    .dashboard-columns,
    .teacher-layout,
    .teacher-stats,
    .public-feature-grid,
    .public-gallery,
    .public-page .gallery-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .form-grid-two > *,
    .form-grid-spaced > *,
    .form-stack > *,
    .wide-field,
    .profile-edit-wide {
        grid-column: 1 / -1;
        min-width: 0;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    select,
    textarea {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        min-width: 18px;
        min-height: 18px;
    }

    button,
    .btn,
    .teacher-btn,
    .secondary-btn,
    .account-btn {
        min-height: 44px;
        max-width: 100%;
        white-space: normal;
    }

    .actions,
    .form-action-row,
    .quick-action-buttons,
    .teacher-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .actions > *,
    .form-action-row > *,
    .quick-action-buttons > *,
    .teacher-actions > * {
        width: 100% !important;
        max-width: 100%;
    }

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

    .stat {
        padding: 12px;
        min-width: 0;
    }

    .stat b,
    .teacher-stat strong {
        font-size: 1.45rem;
        overflow-wrap: anywhere;
    }

    .student-management-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .student-management-toolbar > button,
    .student-management-toolbar .secondary-btn {
        width: 100%;
    }

    .student-table-wrap,
    .table-wrap,
    .table-scroll,
    .report-payments-detail .table-scroll,
    .teacher-calendar-wrap {
        overflow-x: auto;
        max-width: 100%;
    }

    .student-management-table {
        min-width: 700px;
    }

    .report-payments-detail table {
        min-width: 700px;
    }

    .teacher-calendar-wrap .calendar {
        min-width: 600px;
    }

    .teacher-link {
        white-space: normal;
    }

    .public-hero {
        min-height: 0;
        padding: 70px 18px 48px;
    }

    .public-hero h1 {
        font-size: clamp(2rem, 10vw, 3.2rem);
        line-height: 1.08;
    }

    .public-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .public-hero-actions > * {
        width: 100%;
        text-align: center;
    }

    .public-gallery-item img,
    .public-page .gallery-card img {
        height: auto;
        max-height: 260px;
        object-fit: cover;
    }

    footer {
        padding: 18px 12px;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 360px) {
    .navbar,
    .public-page .navbar {
        padding: 10px;
        gap: 8px;
    }

    .navbar .logo-img,
    .logo-img {
        width: 84px;
        max-width: 100%;
        height: auto;
    }

    .navbar .mobile-menu-toggle {
        width: 42px;
        height: 42px;
    }

    .stats {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ============================================================
   53. V21 — PULIDO RESPONSIVE Y ACCESIBILIDAD MÓVIL
   ============================================================ */

/* Evita que elementos flexibles o cadenas largas ensanchen las tarjetas. */
.navbar > *,
.card,
.panel,
.dashboard-card,
.form-group,
.form-field {
    min-width: 0;
}

/* El menú puede recorrerse con teclado y mantiene visible el foco. */
.navbar nav a:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 3px solid #ff4d4d;
    outline-offset: 3px;
}

/* Respeta la preferencia del sistema por menos animaciones. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 600px) {
    /* Los campos no superan el ancho de su tarjeta en navegadores móviles. */
    .form-group,
    .form-field,
    .form-row,
    .form-grid,
    .form-grid > *,
    .form-row > * {
        min-width: 0;
        max-width: 100%;
    }

    /* Los elementos largos no rompen los paneles de cuenta o profesor. */
    .account-shell,
    .account-card,
    .teacher-shell,
    .teacher-panel,
    .student-management-panel,
    .report-card {
        overflow-wrap: anywhere;
    }

    /* Mantiene controles de formularios cómodos para tocar. */
    input[type="submit"],
    input[type="button"],
    input[type="reset"] {
        min-height: 44px;
        max-width: 100%;
        white-space: normal;
    }
}

/* ============================================================
   54. REDISEÑO VISUAL DEL CALENDARIO VILAMIR
   ------------------------------------------------------------
   Mejora el contraste, la jerarquía visual y la lectura de las
   actividades sin cambiar las rutas ni la lógica del calendario.
   ============================================================ */

/* Navegación semanal: panel limpio con controles bien agrupados. */
.calendar-toolbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.5fr) minmax(150px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(208, 0, 0, .18);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #f7f7f7 100%);
    box-shadow: 0 8px 24px rgba(18, 18, 18, .07);
}

.calendar-toolbar h2 {
    min-width: 0;
    padding: 0 8px;
    color: #191919;
    font-size: clamp(18px, 2vw, 25px);
    font-weight: 850;
    letter-spacing: -.45px;
    text-align: center;
}

.calendar-toolbar button {
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid #b90000;
    border-radius: 11px;
    background: #c90000;
    color: #fff;
    font-weight: 750;
    box-shadow: 0 4px 10px rgba(201, 0, 0, .14);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.calendar-toolbar button:first-child { justify-self: start; }
.calendar-toolbar button:last-child { justify-self: end; }
.calendar-toolbar button.secondary {
    background: #fff;
    border-color: #d5d5d5;
    color: #252525;
    box-shadow: none;
}

.calendar-toolbar button:hover {
    background: #a90000;
    box-shadow: 0 6px 14px rgba(201, 0, 0, .2);
    transform: translateY(-1px);
}
.calendar-toolbar button.secondary:hover { background: #f1f1f1; color: #111; }

/* Filtros en una tarjeta diferenciada. */
.calendar-filters {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px;
    margin-bottom: 22px;
    border: 1px solid #e4e4e4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .045);
}
.calendar-filter { flex: 1 1 180px; min-width: 0; }
.calendar-filter label {
    display: block;
    margin-bottom: 7px;
    color: #454545;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .75px;
    text-transform: uppercase;
}
.calendar-filter select {
    width: 100%;
    min-height: 45px;
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafafa;
    color: #222;
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.calendar-filter select:focus {
    outline: none;
    border-color: #c90000;
    box-shadow: 0 0 0 3px rgba(201, 0, 0, .12);
}
.calendar-filters .secondary {
    min-height: 45px;
    padding: 10px 15px;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    background: #f4f4f4;
    color: #252525;
    font-weight: 750;
}
.calendar-filters .secondary:hover { background: #e9e9e9; }

/* Contenedor del calendario semanal. */
.calendar-full {
    width: 100%;
    margin: 0 0 30px;
    padding: 0 0 8px;
    overflow-x: auto;
    border-radius: 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #c6c6c6 #f0f0f0;
    scrollbar-width: thin;
}
.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(135px, 1fr));
    min-width: 1015px;
    gap: 0;
    overflow: hidden;
    border: 1px solid #dedede;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .075);
}
.week-day {
    min-width: 0;
    min-height: 330px;
    border-right: 1px solid #e9e9e9;
    background: #fff;
    transition: background .18s ease;
}
.week-day:last-child { border-right: 0; }
.week-day > header {
    height: auto;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: #202020;
    color: #fff;
    text-align: center;
}
.week-day > header span {
    color: #e6e6e6;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 1px;
}
.week-day > header b {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 50%;
    background: #383838;
    color: #fff;
    font-size: 15px;
}
.week-day.today { background: #fffafa; }
.week-day.today > header {
    background: linear-gradient(145deg, #d00000, #970000);
}
.week-day.today > header span { color: #fff; }
.week-day.today > header b {
    border-color: #fff;
    background: #fff;
    color: #b00000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.week-day-body {
    min-height: 255px;
    height: calc(100% - 74px);
    padding: 10px;
    background: #fff;
}
.week-day.today .week-day-body { background: #fffafa; }

/* Actividades: tipo, horario y detalles fáciles de distinguir. */
.week-event {
    min-width: 0;
    gap: 5px;
    margin: 0 0 9px;
    padding: 11px 10px;
    border: 1px solid #e8e8e8;
    border-left: 4px solid #c90000;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .045);
    overflow-wrap: anywhere;
    transition: transform .16s ease, box-shadow .16s ease;
}
.week-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .09);
}
.week-event strong {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #b40000;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .15px;
}
.week-event span {
    color: #202020;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
}
.week-event small {
    color: #666;
    font-size: 10px;
    line-height: 1.4;
}
.week-event.class-event {
    border-color: #f0d7d7;
    border-left: 4px solid #d00000;
    background: linear-gradient(135deg, #fff7f7 0%, #fff 100%);
}
.week-event.event-event {
    border-color: #dedede;
    border-left: 4px solid #4c4c4c;
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
}
.week-event.event-event strong { color: #333; }
.calendar-empty {
    display: grid;
    min-height: 115px;
    place-items: center;
    padding: 18px 8px;
    border: 1px dashed #dedede;
    border-radius: 10px;
    background: rgba(245, 245, 245, .7);
    color: #888;
    font-size: 11px;
    line-height: 1.5;
}

/* Próximas actividades: tarjetas con mayor jerarquía visual. */
#proximasActividades {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
    gap: 16px;
}
#proximasActividades .upcoming-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e5e5e5;
    border-top: 4px solid #c90000;
    border-radius: 14px;
    background: linear-gradient(160deg, #fff 0%, #fafafa 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .055);
    transition: transform .18s ease, box-shadow .18s ease;
}
#proximasActividades .upcoming-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .09);
}
#proximasActividades .upcoming-card h3 {
    margin: 0 0 10px;
    color: #222;
    font-size: 17px;
    line-height: 1.35;
}
#proximasActividades .upcoming-card p {
    color: #5d5d5d;
    font-size: 13px;
    line-height: 1.6;
}
#proximasActividades .badge {
    display: inline-flex;
    align-items: center;
    margin: 3px 4px 3px 0;
    padding: 6px 9px;
    border: 1px solid #f0d0d0;
    border-radius: 999px;
    background: #fff3f3;
    color: #a90000;
    font-size: 11px;
    font-weight: 800;
}

/* Encabezado de la página del calendario. */
body.about-page .hero:has(+ .calendar-toolbar) {
    margin-bottom: 22px;
}
body.about-page .hero:has(+ .calendar-toolbar) h1 {
    letter-spacing: -.6px;
}

@media (max-width: 760px) {
    .calendar-toolbar {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 14px;
    }
    .calendar-toolbar h2 {
        grid-column: 1 / -1;
        grid-row: 1;
        padding: 2px 0 6px;
        font-size: 20px;
    }
    .calendar-toolbar button:first-child { justify-self: stretch; }
    .calendar-toolbar button:last-child { justify-self: stretch; }
    .calendar-toolbar button { width: 100%; padding: 10px 8px; font-size: 13px; }
    .calendar-filters { gap: 12px; padding: 14px; }
    .calendar-filter { flex-basis: 100%; }
    .calendar-filters .secondary { width: 100%; }
    .calendar-week-grid { min-width: 980px; }
    #proximasActividades { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .calendar-toolbar { grid-template-columns: 1fr; }
    .calendar-toolbar h2 { grid-column: 1; }
    .calendar-toolbar button:first-child,
    .calendar-toolbar button:last-child { justify-self: stretch; }
    .calendar-week-grid { min-width: 950px; }
}

@media (prefers-reduced-motion: reduce) {
    .calendar-toolbar button,
    .week-event,
    #proximasActividades .upcoming-card { transition: none; }
}

/* ============================================================
   27. CALENDARIO VILAMIR — CENTRADO Y PALETA INSTITUCIONAL
   Ajustes visuales exclusivos del calendario; no alteran otros módulos.
   ============================================================ */
body.about-page:has(#calendarioGeneral) main.wrap {
    width: min(100% - 32px, 1360px);
    max-width: 1360px;
    margin-inline: auto;
    padding-inline: 0;
}
body.about-page:has(#calendarioGeneral) main.wrap > .hero,
body.about-page:has(#calendarioGeneral) .calendar-toolbar,
body.about-page:has(#calendarioGeneral) .calendar-filters,
body.about-page:has(#calendarioGeneral) #calendarioGeneral,
body.about-page:has(#calendarioGeneral) main.wrap > .card:last-child {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
}
body.about-page:has(#calendarioGeneral) .calendar-toolbar {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border: 1px solid rgba(208, 0, 0, .18);
    border-top: 4px solid var(--brand, #d00000);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    box-shadow: 0 12px 30px rgba(11, 11, 13, .09);
}
body.about-page:has(#calendarioGeneral) .calendar-toolbar h2 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    color: #171717;
    text-align: center;
    font-size: clamp(18px, 2vw, 25px);
    font-weight: 900;
    letter-spacing: -.45px;
}
body.about-page:has(#calendarioGeneral) .calendar-toolbar button {
    min-height: 44px;
    border: 1px solid #b80000;
    border-radius: 11px;
    background: linear-gradient(135deg, #d00000, #9d0000);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(157, 0, 0, .16);
}
body.about-page:has(#calendarioGeneral) .calendar-toolbar button:first-child {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}
body.about-page:has(#calendarioGeneral) .calendar-toolbar button:last-child {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}
body.about-page:has(#calendarioGeneral) .calendar-toolbar button.secondary {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    min-width: 110px;
    border-color: #d2d2d2;
    background: #242424;
    color: #fff;
}
body.about-page:has(#calendarioGeneral) .calendar-toolbar button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}
body.about-page:has(#calendarioGeneral) .calendar-filters {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(11, 11, 13, .055);
}
body.about-page:has(#calendarioGeneral) .calendar-filter label { color: #8f0000; }
body.about-page:has(#calendarioGeneral) .calendar-filter select {
    border-color: #d8d8d8;
    background: #f8f8f8;
    color: #222;
}
body.about-page:has(#calendarioGeneral) .calendar-filters .secondary {
    border-color: #242424;
    background: #242424;
    color: #fff;
}
body.about-page:has(#calendarioGeneral) .calendar-full {
    margin-top: 22px;
    padding: 0 0 12px;
    text-align: center;
}
body.about-page:has(#calendarioGeneral) .calendar-week-grid {
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    border: 1px solid #d5d5d5;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(11, 11, 13, .12);
}
body.about-page:has(#calendarioGeneral) .week-day > header {
    background: linear-gradient(160deg, #252525, #0b0b0d);
}
body.about-page:has(#calendarioGeneral) .week-day.today > header {
    background: linear-gradient(145deg, #e01818, #9d0000);
}
body.about-page:has(#calendarioGeneral) main.wrap > .card:last-child {
    margin-top: 20px;
    padding: clamp(18px, 3vw, 30px);
    border: 1px solid #e0e0e0;
    border-top: 4px solid #d00000;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff, #f5f5f5);
    box-shadow: 0 12px 28px rgba(11, 11, 13, .07);
}
body.about-page:has(#calendarioGeneral) main.wrap > .card:last-child > h2 {
    margin: 0 0 20px;
    color: #171717;
    text-align: center;
    font-size: clamp(20px, 2.4vw, 27px);
}
body.about-page:has(#calendarioGeneral) #proximasActividades .upcoming-card {
    border-top-color: #d00000;
    border-radius: 14px;
}
@media (max-width: 760px) {
    body.about-page:has(#calendarioGeneral) main.wrap { width: calc(100% - 20px); }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar {
        grid-template-columns: 1fr 1fr;
        padding: 16px;
    }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar h2 {
        grid-column: 1 / -1;
        grid-row: 1;
    }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button:first-child {
        grid-column: 1;
        grid-row: 2;
        justify-self: stretch;
    }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button:last-child {
        grid-column: 2;
        grid-row: 2;
        justify-self: stretch;
    }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button.secondary {
        grid-column: 1 / -1;
        grid-row: 3;
        justify-self: stretch;
    }
    body.about-page:has(#calendarioGeneral) .calendar-filters { align-items: stretch; }
    body.about-page:has(#calendarioGeneral) .calendar-week-grid { margin-inline: 0; }
}
@media (max-width: 420px) {
    body.about-page:has(#calendarioGeneral) .calendar-toolbar { grid-template-columns: 1fr; }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar h2,
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button:first-child,
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button:last-child,
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button.secondary {
        grid-column: 1;
        justify-self: stretch;
    }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button:first-child { grid-row: 2; }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button:last-child { grid-row: 3; }
    body.about-page:has(#calendarioGeneral) .calendar-toolbar button.secondary { grid-row: 4; }
}

/* ============================================================
   GALERÍA DE EVENTOS: ACCIONES DE ADMINISTRACIÓN
   ============================================================ */
.gallery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}
.gallery-actions button,
.gallery-edit-form button {
    border: 1px solid var(--brand, #d00000);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    background: var(--brand, #d00000);
    color: #fff;
}
.gallery-actions button:hover,
.gallery-edit-form button:hover { background: var(--brand-dark, #9d0000); }
.gallery-actions .btn-secondary,
.gallery-edit-form button[type="button"] {
    background: #303038;
    border-color: #555560;
}
.gallery-actions .btn-danger { background: #8f1010; border-color: #8f1010; }
.gallery-actions button:disabled,
.gallery-edit-form button:disabled { opacity: .6; cursor: wait; }
.gallery-edit-form {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(208, 0, 0, .35);
    border-radius: 12px;
    background: rgba(20, 20, 24, .04);
    display: grid;
    gap: .75rem;
}
.gallery-edit-form h3 { grid-column: 1 / -1; margin: 0; }
.gallery-edit-form input,
.gallery-edit-form select { min-width: 0; width: 100%; box-sizing: border-box; }
@media (max-width: 600px) {
    .gallery-edit-form { grid-template-columns: minmax(0, 1fr); }
    .gallery-actions button { flex: 1 1 auto; }
}


/* ============================================================
   53. V21 — ESTILO UNIFICADO DE ALUMNOS Y GRUPOS
   Usa el mismo patrón visual de Responsables: fondo institucional,
   cabecera hero y paneles oscuros con bordes suaves.
   ============================================================ */
.student-admin-page .module,
.groups-admin-page .module {
    background: #151515;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-md);
}

.student-admin-page .module h2,
.groups-admin-page .module h2 {
    color: #fff;
    text-align: left;
    margin-bottom: 14px;
}

.student-admin-page .module label,
.groups-admin-page .module label {
    color: #f1f1f1;
}

.student-admin-page .student-management-help,
.groups-admin-page .muted-center {
    color: #bdbdbd;
}

.student-admin-page .student-count {
    color: #d0d0d0;
}

@media (max-width: 600px) {
    .student-admin-page .module,
    .groups-admin-page .module {
        padding: 15px;
    }
    .student-admin-page .form-grid-two {
        grid-template-columns: minmax(0, 1fr);
    }
    .student-admin-page .wide-field {
        grid-column: 1;
    }
    .groups-admin-page .form-grid-two {
        grid-template-columns: minmax(0, 1fr);
    }
    .groups-admin-page .wide-field {
        grid-column: 1;
    }
}


/* ============================================================
   99. ESTILO UNIFICADO: HERRAMIENTAS, ALUMNOS Y SEMINARIOS V21
   Mantiene la identidad negra, roja y gris de los paneles.
   ============================================================ */
.tools-admin-page,
.seminars-admin-page,
.student-admin-page {
    width: min(100% - 32px, 1250px);
    margin: 28px auto 44px;
    padding: 0;
}

.tools-admin-page .hero,
.seminars-admin-page .hero,
.student-admin-page .hero {
    margin-bottom: 20px;
}

.tools-admin-page .module,
.seminars-admin-page .module,
.student-admin-page .module {
    background: #151515;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: clamp(16px, 2.5vw, 24px);
}

.tools-admin-page .module h2,
.seminars-admin-page .module h2,
.student-admin-page .module h2 {
    color: #fff;
    margin-top: 0;
}

.tools-admin-page .search-bar input,
.tools-admin-page .search-bar select,
.seminars-admin-page input,
.seminars-admin-page textarea,
.seminars-admin-page select,
.student-admin-page input,
.student-admin-page select {
    min-width: 0;
    background: #211818;
    color: #f5f5f5;
    border: 1px solid #484848;
    border-radius: 10px;
}

.tools-admin-page .export-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: #1c1c1c;
    border: 1px solid #383838;
    border-top: 3px solid var(--brand);
    border-radius: 12px;
}

.tools-admin-page .export-card h3 { margin: 0 0 4px; color: #fff; }
.tools-admin-page .export-card .btn { max-width: 100%; text-align: center; }
.tools-admin-page #resultadosBusqueda,
.tools-admin-page #actividadSistema { min-width: 0; overflow-wrap: anywhere; }

.seminars-admin-page .form-stack { gap: 14px; }
.seminars-admin-page .form-grid-inline-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.seminars-admin-page #mensajeSeminario { min-height: 1.4em; margin-bottom: 0; }
.seminars-admin-page .cards-grid { align-items: stretch; gap: 18px; }
.seminars-admin-page .cards-grid > * { min-width: 0; }

@media (max-width: 680px) {
    .tools-admin-page, .seminars-admin-page, .student-admin-page {
        width: min(100% - 20px, 1250px);
        margin-top: 16px;
    }
    .tools-admin-page .module, .seminars-admin-page .module, .student-admin-page .module {
        padding: 15px;
    }
    .seminars-admin-page .form-grid-inline-fields { grid-template-columns: 1fr; }
    .tools-admin-page .export-grid { grid-template-columns: 1fr; }
    .tools-admin-page .export-card .btn { width: 100%; }
}


/* ============================================================
   100. PULIDO VISUAL GENERAL V21 Y MÓDULO DE CLASES
   Refinamiento de jerarquía, legibilidad, formularios y tarjetas.
   ============================================================ */

:root {
    --ui-panel: #151515;
    --ui-panel-raised: #1c1c1c;
    --ui-border: rgba(255, 255, 255, .11);
    --ui-border-hover: rgba(255, 42, 42, .55);
    --ui-focus: 0 0 0 3px rgba(208, 0, 0, .2);
}

/* Espaciado consistente y contenedores más cómodos */
.tools-admin-page,
.seminars-admin-page,
.student-admin-page,
.groups-admin-page,
.classes-page-container {
    max-width: 1250px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(12px, 2.2vw, 24px);
    padding-right: clamp(12px, 2.2vw, 24px);
}

.tools-admin-page .hero,
.seminars-admin-page .hero,
.student-admin-page .hero,
.groups-admin-page .hero,
.classes-page-container .hero {
    padding: clamp(22px, 3.5vw, 36px);
    border: 1px solid rgba(255, 65, 65, .2);
    background: radial-gradient(ellipse at 95% 0%, rgba(208, 0, 0, .22), transparent 42%),
                linear-gradient(135deg, #080808 0%, #1b1111 58%, #310707 100%);
}

.tools-admin-page .module,
.seminars-admin-page .module,
.student-admin-page .module,
.groups-admin-page .module,
.classes-page-container .module {
    border-color: var(--ui-border);
    background: linear-gradient(145deg, #191919, #111111);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

.tools-admin-page .module h2,
.seminars-admin-page .module h2,
.student-admin-page .module h2,
.groups-admin-page .module h2,
.classes-page-container .module h2 {
    letter-spacing: -.015em;
}

.tools-admin-page input:focus-visible,
.tools-admin-page select:focus-visible,
.seminars-admin-page input:focus-visible,
.seminars-admin-page textarea:focus-visible,
.seminars-admin-page select:focus-visible,
.student-admin-page input:focus-visible,
.student-admin-page select:focus-visible,
.groups-admin-page input:focus-visible,
.groups-admin-page select:focus-visible,
.classes-page-container input:focus-visible,
.classes-page-container textarea:focus-visible,
.classes-page-container select:focus-visible,
.tools-admin-page button:focus-visible,
.seminars-admin-page button:focus-visible,
.student-admin-page button:focus-visible,
.groups-admin-page button:focus-visible,
.classes-page-container button:focus-visible {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: var(--ui-focus);
}

.tools-admin-page .export-card,
.seminars-admin-page .cards-grid > *,
.student-admin-page .student-table-wrap,
.groups-admin-page .group-card,
.classes-page-container .dynamic-card {
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tools-admin-page .export-card:hover,
.seminars-admin-page .cards-grid > *:hover,
.groups-admin-page .group-card:hover,
.classes-page-container .dynamic-card:hover {
    transform: translateY(-3px);
    border-color: var(--ui-border-hover);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

/* Cabecera de clases, alineada con el resto de los paneles */
.classes-page-container {
    width: 100%;
    padding-top: 28px;
    padding-bottom: 42px;
}

.classes-hero {
    margin-bottom: 22px;
}

.classes-page-container .classes-eyebrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #ff7777;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .15em;
}

.classes-eyebrow::before {
    content: "";
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-light);
}

.classes-page-container .hero h1,
.classes-page-container .hero p {
    position: relative;
    z-index: 1;
}

.classes-page-container .hero h1 {
    max-width: 850px;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.classes-page-container .hero p {
    max-width: 780px;
}

.classes-page-container .classes-form-panel,
.classes-page-container .classes-info-panel,
.classes-page-container .classes-list-panel {
    margin-bottom: 22px;
    padding: clamp(17px, 2.8vw, 28px);
}

.classes-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 20px;
}

.classes-heading-mark {
    display: block;
    flex: 0 0 4px;
    width: 4px;
    min-height: 44px;
    border-radius: 5px;
    background: linear-gradient(180deg, #ff4242, #9d0000);
    box-shadow: 0 0 18px rgba(208, 0, 0, .2);
}

.classes-page-container .classes-section-heading h2 {
    margin: 0 0 5px;
    color: #fff;
    text-align: left;
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.classes-section-heading p {
    margin: 0;
    color: #aaa;
    line-height: 1.55;
}

.classes-page-container .form-stack {
    gap: 13px;
}

.classes-page-container input,
.classes-page-container textarea,
.classes-page-container select {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    color: #f5f5f5;
    background: #211818;
    border: 1px solid #414141;
    border-radius: 10px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.classes-page-container input::placeholder,
.classes-page-container textarea::placeholder {
    color: #969696;
}

.classes-page-container textarea {
    min-height: 100px;
    resize: vertical;
}

.classes-page-container button,
.classes-page-container .btn {
    border-radius: 10px;
    font-weight: 750;
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.classes-page-container button:hover,
.classes-page-container .btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.classes-page-container #mensajeClase {
    margin-top: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.classes-page-container .muted-center {
    max-width: 800px;
    margin: 0 auto;
    padding: 8px 0;
    color: #c7c7c7;
    line-height: 1.75;
    text-align: center;
}

.classes-page-container .muted-center a {
    color: #ff7777;
    font-weight: 700;
    text-underline-offset: 3px;
}

.classes-page-container .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 18px;
    align-items: stretch;
}

.classes-page-container .dynamic-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: clamp(18px, 2.4vw, 24px);
    background: linear-gradient(150deg, #202020, #141414 75%);
    border: 1px solid #383838;
    border-top: 3px solid var(--brand);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .17);
}

.classes-page-container .dynamic-card h2 {
    margin: 0 0 12px;
    color: #fff;
    text-align: left;
    font-size: 1.2rem;
    line-height: 1.35;
}

.classes-page-container .dynamic-card p {
    color: #c5c5c5;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.classes-page-container .dynamic-card p strong {
    color: #fff;
}

.classes-page-container .dynamic-card button,
.classes-page-container .dynamic-card > div {
    margin-top: auto;
}

.classes-page-container .dynamic-card button {
    width: 100%;
    margin-top: 16px;
}

.classes-page-container .dynamic-card > div {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding-top: 16px;
}

.classes-page-container .dynamic-card > div button {
    flex: 1 1 110px;
    width: auto;
    margin-top: 0;
}

@media (max-width: 680px) {
    .classes-page-container {
        padding-top: 16px;
        padding-bottom: 28px;
    }
    .classes-page-container .hero {
        padding: 22px 18px;
    }
    .classes-page-container .classes-eyebrow {
        font-size: .68rem;
        letter-spacing: .1em;
    }
    .classes-page-container .classes-section-heading {
        gap: 10px;
        margin-bottom: 16px;
    }
    .classes-page-container .classes-form-panel,
    .classes-page-container .classes-info-panel,
    .classes-page-container .classes-list-panel {
        padding: 16px;
    }
    .classes-page-container .dynamic-card > div {
        flex-direction: column;
    }
    .classes-page-container .dynamic-card > div button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tools-admin-page *,
    .seminars-admin-page *,
    .student-admin-page *,
    .groups-admin-page *,
    .classes-page-container * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}


/* ============================================================
   25.2. PULIDO VISUAL DE MIS CLASES
   Mantiene la identidad negra, roja y gris de VILAMIR.
   ============================================================ */
.mis-clases-container { max-width: 1250px; padding: 0 18px 34px; margin: 28px auto 0; }
.mis-clases-page .navbar { margin-bottom: 0; }
.mis-clases-hero { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 38px); border-color: rgba(208, 0, 0, .35); background: radial-gradient(circle at 92% 15%, rgba(208, 0, 0, .22), transparent 32%), linear-gradient(135deg, #090909 0%, #1a1010 58%, #310707 100%); }
.mis-clases-hero::after { content: 'V'; position: absolute; right: 28px; bottom: -54px; color: rgba(255, 255, 255, .035); font-size: clamp(140px, 20vw, 220px); font-weight: 900; line-height: 1; pointer-events: none; }
.mis-clases-eyebrow { position: relative; z-index: 1; margin: 0 0 10px; color: #ff7777 !important; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.mis-clases-hero h1 { position: relative; z-index: 1; margin: 0 0 10px; text-align: left; }
.mis-clases-hero > p:not(.mis-clases-eyebrow) { position: relative; z-index: 1; max-width: 760px; margin: 0; color: #d5d5d5; }
.mis-clases-hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.mis-clases-hero-meta span { padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; background: rgba(0, 0, 0, .24); color: #ededed; font-size: 12px; font-weight: 650; }
.mis-clases-list-panel { padding: clamp(16px, 3vw, 26px); border-color: #303030; background: linear-gradient(145deg, #151515, #111111); }
.mis-clases-section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.mis-clases-heading-mark { flex: 0 0 4px; width: 4px; min-height: 44px; border-radius: 8px; background: linear-gradient(180deg, #ff3939, #a60000); box-shadow: 0 0 18px rgba(208, 0, 0, .25); }
.mis-clases-section-heading h2 { margin: 0 0 5px; color: #fff; text-align: left; font-size: clamp(19px, 2.3vw, 24px); }
.mis-clases-section-heading p { margin: 0; color: #a9a9a9; font-size: 13px; line-height: 1.6; }
.mis-clases-grid { align-items: stretch; gap: 18px; }
.mis-clases-card { position: relative; min-width: 0; padding: 20px; border: 1px solid #333; border-radius: 16px; background: linear-gradient(155deg, #202020, #141414 72%); box-shadow: 0 12px 28px rgba(0, 0, 0, .16); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.mis-clases-card:hover { transform: translateY(-3px); border-color: rgba(208, 0, 0, .48); box-shadow: 0 16px 34px rgba(0, 0, 0, .25); }
.mis-clases-title { align-items: flex-start; padding-bottom: 15px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.mis-clases-title > div:nth-child(2) { flex: 1; min-width: 0; }
.mis-clases-title h2 { color: #fff; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.mis-clases-icon { border: 1px solid rgba(255, 60, 60, .22); background: linear-gradient(145deg, rgba(208, 0, 0, .22), rgba(208, 0, 0, .06)); }
.mis-clases-title .badge { padding: 5px 9px; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.mis-clases-date { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .035); }
.mis-clases-date strong { color: #eee; }
.mis-clases-group { border-color: rgba(255, 255, 255, .09); background: rgba(0, 0, 0, .2); }
.mis-clases-group-head strong { color: #f5f5f5; }
.mis-clases-schedules span { border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .045); line-height: 1.5; }
.mis-clases-page .message-center:empty { display: none; }
@media (max-width: 640px) {
  .mis-clases-container { margin-top: 16px; padding: 0 12px 24px; }
  .mis-clases-hero { padding: 23px 19px; }
  .mis-clases-hero-meta { gap: 7px; margin-top: 17px; }
  .mis-clases-hero-meta span { font-size: 11px; padding: 7px 9px; }
  .mis-clases-list-panel { padding: 16px 13px; }
  .mis-clases-card { padding: 16px; }
  .mis-clases-title { flex-wrap: wrap; }
  .mis-clases-title .badge { margin-left: 0; }
}


/* ============================================================
   26. PULIDO GLOBAL DE IDENTIDAD VISUAL V21
   Ajustes transversales: web pública y paneles internos.
   No modifica consultas, permisos ni lógica de negocio.
   ============================================================ */
:root {
    --brand: #d20a12;
    --brand-dark: #a7070d;
    --brand-light: #ff4148;
    --bg: #101012;
    --bg-dark: #080809;
    --surface: #171719;
    --surface-2: #1e1e22;
    --surface-light: #28282d;
    --text: #f4f4f5;
    --text-light: #d1d1d5;
    --muted: #a5a5ad;
    --line: rgba(255,255,255,.10);
    --radius-sm: 9px;
    --radius-md: 13px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 6px 18px rgba(0,0,0,.20);
    --shadow-md: 0 14px 34px rgba(0,0,0,.28);
    --transition: .22s ease;
}

html { scroll-padding-top: 88px; }
body {
    background: radial-gradient(circle at top right, rgba(179, 0, 0, 0.35), transparent 35%),
     radial-gradient(circle at bottom left, rgba(120, 0, 0, 0.25), transparent 30%), #666666;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { height: auto; }
::selection { color: #fff; background: rgba(210,10,18,.72); }
:focus-visible {
    outline: 3px solid rgba(255,65,72,.85);
    outline-offset: 3px;
}

/* Navegación consistente, clara y menos recargada */
.navbar {
    padding: 13px clamp(16px, 4vw, 54px);
    background: rgba(9,9,11,.94);
    border-bottom: 1px solid rgba(255,65,72,.42);
    box-shadow: 0 8px 28px rgba(0,0,0,.24);
}
.logo { letter-spacing: .045em; }
.navbar nav { gap: 5px; }
.navbar nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #e7e7e9;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}
.navbar nav a:hover,
.navbar nav a:focus-visible {
    color: #fff;
    background: rgba(210,10,18,.14);
    border-color: rgba(255,65,72,.22);
}

/* Escala tipográfica y separación general */
h1, h2, h3, h4, h5, h6 { line-height: 1.22; letter-spacing: -.018em; }
h1 { font-size: clamp(1.9rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); }
p { line-height: 1.7; }
.about-container, .portal, .admin {
    width: min(1240px, calc(100% - 40px));
    margin: clamp(22px, 4vw, 42px) auto;
}

/* Superficies, paneles y tarjetas */
.card,
.dashboard-panel,
.panel,
.form-container,
.table-wrap,
.table-scroll,
.report-panel,
.admin-section,
[class*="-panel"] {
    border-radius: var(--radius-lg);
}
.card {
    border: 1px solid rgba(255,255,255,.085);
    background: linear-gradient(145deg, #1d1d20, #151517 78%);
    box-shadow: var(--shadow-sm);
}
.card:hover {
    border-color: rgba(255,65,72,.32);
    box-shadow: var(--shadow-md);
}
.card h2, .card h3 { line-height: 1.3; }

/* Controles de formularios: alto consistente y foco visible */
input, select, textarea, .input {
    max-width: 100%;
    min-height: 42px;
    color: #f4f4f5;
    background-color: #111113;
    border: 1px solid #3a3a40;
    border-radius: 10px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #85858e; opacity: 1; }
input:focus, select:focus, textarea:focus, .input:focus {
    border-color: #e52b32;
    box-shadow: 0 0 0 3px rgba(210,10,18,.16);
    outline: none;
}
select option { color: #f4f4f5; background: #171719; }
label { color: #e5e5e8; font-weight: 650; }

/* Botones con jerarquía y estados coherentes */
button, .btn, input[type="submit"], input[type="button"] {
    border-radius: 10px;
    font-weight: 750;
    letter-spacing: .005em;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition), color var(--transition);
}
button:hover:not(:disabled), .btn:hover, input[type="submit"]:hover, input[type="button"]:hover {
    transform: translateY(-1px);
}
button:active:not(:disabled), .btn:active { transform: translateY(0); }
button:disabled, input:disabled, select:disabled, textarea:disabled {
    opacity: .58;
    cursor: not-allowed;
}

/* Tablas más legibles y desplazables en móvil */
.table-wrap, .table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.09);
    background: #151517;
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}
.admin table, .report-table, .report-panel table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.admin table th, .report-table th, .report-panel table th {
    color: #fff;
    background: #252528;
    font-size: .78rem;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.admin table td, .admin table th,
.report-table td, .report-table th,
.report-panel table td, .report-panel table th {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.075);
    vertical-align: middle;
}
.admin table tbody tr:hover, .report-table tbody tr:hover, .report-panel table tbody tr:hover {
    background: rgba(255,255,255,.035);
}

/* Mensajes y estados */
.alert, .message, .message-center, .success-message, .error-message {
    border-radius: 12px;
    line-height: 1.55;
}
.badge, .status-badge, .status-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    border-radius: 999px;
    line-height: 1.3;
}

/* Web pública: hero y secciones con ritmo visual uniforme */
.public-page {
    background:
        radial-gradient(circle at top right, rgba(179, 0, 0, 0.35), transparent 35%),
        radial-gradient(circle at bottom left, rgba(120, 0, 0, 0.25), transparent 30%),
        #666666;
    background-attachment: fixed;
    color: #f2f2f4;
}
.public-page .navbar { border-bottom-width: 1px; }
.public-hero {
    min-height: min(690px, calc(100svh - 66px));
    padding: clamp(52px, 8vw, 104px) clamp(22px, 8vw, 120px);
    background:
        radial-gradient(ellipse at 85% 22%, rgba(210,10,18,.30), transparent 34%),
        radial-gradient(ellipse at 8% 95%, rgba(255,255,255,.045), transparent 38%),
        linear-gradient(125deg, #080809 0%, #151518 58%, #28090b 100%);
}
.public-hero h1 {
    max-width: 900px;
    font-size: clamp(2.6rem, 6.7vw, 5.4rem);
    line-height: .99;
    letter-spacing: -.045em;
}
.public-hero p { max-width: 720px; font-size: clamp(1rem, 1.4vw, 1.13rem); }
.public-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.public-hero .btn { border-radius: 11px; font-weight: 800; }
.public-page section:not(.public-hero) { scroll-margin-top: 88px; }
.public-page footer { border-top: 1px solid rgba(255,255,255,.09); }

/* Calendario: más aire sin interferir con su funcionamiento */
.calendar-toolbar { row-gap: 10px; }
.calendar-toolbar button { min-height: 40px; }

/* Accesibilidad: respetar la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Ajustes responsive finales */
@media (max-width: 760px) {
    .navbar { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
    .navbar nav { width: 100%; justify-content: flex-start; gap: 5px; }
    .navbar nav a { padding: 8px 10px; font-size: 13px; }
    .about-container, .portal, .admin { width: calc(100% - 24px); margin: 20px auto; }
    .public-hero { min-height: 560px; padding: 56px 22px; }
    .public-hero h1 { font-size: clamp(2.3rem, 11vw, 3.7rem); }
    .admin table th, .admin table td,
    .report-table th, .report-table td,
    .report-panel table th, .report-panel table td { padding: 10px 11px; }
}
@media (max-width: 420px) {
    .logo { font-size: 21px; }
    .navbar nav a { font-size: 12px; padding: 7px 8px; }
    .public-hero { min-height: 510px; }
}


/* ============================================================
   30. ESPACIO DOCENTE V21 — ORGANIZACIÓN DE GRUPOS CENTRADA
   ============================================================ */
.teacher-groups-layout {
    grid-template-columns: minmax(0, 1120px);
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.teacher-groups-panel {
    width: 100%;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

.teacher-groups-panel > #listaGruposProfesor {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 340px));
    justify-content: center;
    align-items: stretch;
    gap: 20px;
}

.teacher-groups-panel .teacher-assigned-group {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

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

    .teacher-groups-panel > #listaGruposProfesor {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ============================================================
   36. UNIFICACIÓN VISUAL ADMINISTRATIVA V21
   Reportes, calendario y estadísticas comparten jerarquía,
   superficies, bordes, botones y fondo del panel administrativo.
   Solo afecta presentación; no modifica lógica ni consultas.
   ============================================================ */

/* Mantener el fondo radial de identidad VILAMIR en todas estas páginas. */
body.reports-page,
body.about-page:has(#calendarioGeneral) {
    background:
        radial-gradient(circle at top right, rgba(179, 0, 0, 0.35), transparent 35%),
        radial-gradient(circle at bottom left, rgba(120, 0, 0, 0.25), transparent 30%),
        #666666;
    background-attachment: fixed;
    color: var(--white, #fff);
    min-height: 100vh;
}

/* Contenedores con el mismo ancho y ritmo que el panel administrativo. */
.reports-wrap,
.v21-statistics-wrap,
body.about-page:has(#calendarioGeneral) main.wrap {
    width: min(1250px, calc(100% - 36px));
    max-width: 1250px;
    margin: 30px auto 56px;
    box-sizing: border-box;
}

/* Encabezados con el degradado negro-rojo del hero administrativo. */
.reports-head,
body.about-page:has(#calendarioGeneral) main.wrap > .hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #000000, #390606);
    border: 1px solid #3b2527;
    border-radius: var(--radius-xl, 18px);
    padding: clamp(22px, 3vw, 32px);
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg, 0 12px 30px rgba(0,0,0,.24));
}

.reports-head h1,
body.about-page:has(#calendarioGeneral) main.wrap > .hero h1 {
    color: #fff;
    font-size: clamp(27px, 3.5vw, 40px);
    margin: 0 0 8px;
}

.reports-head p,
body.about-page:has(#calendarioGeneral) main.wrap > .hero p {
    color: #e0e0e0;
    line-height: 1.7;
}

/* Tarjetas, indicadores y paneles: negro carbón y borde gris discreto. */
.report-stat,
.report-finance article,
.report-panel,
.v21-kpi,
.v21-stat-panel,
body.about-page:has(#calendarioGeneral) .calendar-toolbar,
body.about-page:has(#calendarioGeneral) .calendar-filters,
body.about-page:has(#calendarioGeneral) main.wrap > .card:last-child {
    background: #151515;
    border: 1px solid #333;
    border-radius: var(--radius-md, 14px);
    box-shadow: var(--shadow-md, 0 8px 22px rgba(0,0,0,.18));
}

.report-stat,
.report-finance article,
.report-panel,
.v21-kpi,
.v21-stat-panel {
    transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.report-stat:hover,
.report-finance article:hover,
.report-panel:hover,
.v21-kpi:hover {
    border-color: rgba(208, 0, 0, .55);
}

.report-panel h2,
.v21-stat-panel h2,
body.about-page:has(#calendarioGeneral) main.wrap > .card:last-child > h2 {
    color: #fff;
    text-align: left;
    border-bottom: 1px solid #333;
    padding-bottom: 12px;
}

/* Los filtros y botones conservan el mismo acabado rojo del panel. */
.report-filters,
.v21-filter-grid,
body.about-page:has(#calendarioGeneral) .calendar-filters {
    background: #151515;
    border-color: #333;
    border-radius: 14px;
}

.report-filters label,
.v21-filter-grid label,
body.about-page:has(#calendarioGeneral) .calendar-filter label {
    color: #e5e5e5;
    font-weight: 700;
}

.report-filters select,
.v21-filter-grid input,
.v21-filter-grid select,
body.about-page:has(#calendarioGeneral) .calendar-filter select {
    background: #211818;
    color: #fff;
    border: 1px solid #484044;
    border-radius: 8px;
    min-height: 42px;
}

.report-print,
.report-export,
.v21-filter-actions button,
body.about-page:has(#calendarioGeneral) .calendar-toolbar button,
body.about-page:has(#calendarioGeneral) .calendar-filters button {
    border-radius: 9px;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.report-print:hover,
.report-export:hover,
.v21-filter-actions button:hover,
body.about-page:has(#calendarioGeneral) .calendar-toolbar button:hover,
body.about-page:has(#calendarioGeneral) .calendar-filters button:hover {
    transform: translateY(-1px);
}

/* Estadísticas: encabezado y KPI con jerarquía visual similar a Administración. */
.v21-statistics-wrap .reports-head {
    align-items: center;
}

.v21-kpi {
    border-left: 3px solid var(--brand, #d00000);
    min-width: 0;
}

.v21-kpi span {
    color: #c8c8c8;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.v21-kpi strong {
    color: #fff;
}

.v21-kpi small,
.v21-panel-heading p {
    color: #aaa;
}

/* Tablas coherentes y con desplazamiento seguro en pantallas pequeñas. */
.report-panel .table-scroll,
.v21-stat-panel .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border-radius: 9px;
}

.report-panel table,
.v21-stat-panel table {
    width: 100%;
    border-collapse: collapse;
}

.report-panel table th,
.v21-stat-panel table th {
    background: #080808;
    color: #fff;
    border-bottom: 2px solid var(--brand, #d00000);
    white-space: nowrap;
}

.report-panel table td,
.v21-stat-panel table td {
    border-bottom: 1px solid #303030;
    color: #e1e1e1;
}

.report-panel table tbody tr:hover,
.v21-stat-panel table tbody tr:hover {
    background: #242020;
}

/* Calendario: controles centrados, vista semanal integrada y legible. */
body.about-page:has(#calendarioGeneral) .calendar-toolbar {
    gap: 12px;
    align-items: center;
}

body.about-page:has(#calendarioGeneral) .calendar-toolbar h2 {
    color: #fff;
}

body.about-page:has(#calendarioGeneral) .calendar-full {
    background: #151515;
    border: 1px solid #333;
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--shadow-md, 0 8px 22px rgba(0,0,0,.18));
}

body.about-page:has(#calendarioGeneral) .week-day > header {
    background: #080808;
    color: #fff;
    border-bottom: 2px solid var(--brand, #d00000);
}

@media (max-width: 900px) {
    .report-stats,
    .report-finance,
    .v21-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .reports-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .reports-wrap,
    .v21-statistics-wrap,
    body.about-page:has(#calendarioGeneral) main.wrap {
        width: calc(100% - 20px);
        margin-top: 18px;
    }

    .report-stats,
    .report-finance,
    .report-grid,
    .v21-kpi-grid,
    .v21-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .reports-head,
    .report-panel,
    .v21-stat-panel {
        padding: 18px;
    }

    .v21-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .v21-filter-actions > * {
        width: 100%;
    }
}



/* ============================================================
   37. LOGIN, PORTAL DE ALUMNO Y ESPACIO DEL PROFESOR
   Unificación visual con el panel administrativo VILAMIR.
   Cambios exclusivamente visuales; conserva la lógica existente.
   ============================================================ */

/* Fondo radial de identidad y contenedores con ritmo administrativo. */
body.login-page,
body.portal-page,
body.teacher-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(179, 0, 0, 0.35), transparent 35%),
        radial-gradient(circle at bottom left, rgba(120, 0, 0, 0.25), transparent 30%),
        #666666;
    background-attachment: fixed;
    color: #f5f5f5;
}

/* Navegación con contraste uniforme sobre el fondo. */
body.login-page .navbar,
body.portal-page .navbar,
body.teacher-page .navbar {
    background: rgba(10, 10, 10, .96);
    border-bottom: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 8px 26px rgba(0,0,0,.2);
}

body.login-page .navbar nav a,
body.portal-page .navbar nav a,
body.teacher-page .navbar nav a {
    border-radius: 8px;
    transition: background .2s ease, color .2s ease;
}

body.login-page .navbar nav a:hover,
body.portal-page .navbar nav a:hover,
body.teacher-page .navbar nav a:hover,
body.portal-page .navbar nav a.active,
body.teacher-page .navbar nav a.active {
    background: rgba(208,0,0,.2);
    color: #fff;
}

/* Login: tarjeta oscura, borde fino y encabezado negro-rojo. */
body.login-page .container {
    width: min(100% - 32px, 520px);
    margin: clamp(28px, 6vh, 64px) auto;
    display: flex;
    justify-content: center;
}

body.login-page .login-card {
    width: 100%;
    box-sizing: border-box;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid #3b2527;
    border-radius: 20px;
    background: linear-gradient(145deg, #171717, #0b0b0d 72%, #26090b);
    box-shadow: 0 18px 46px rgba(0,0,0,.3);
    color: #f5f5f5;
}

body.login-page .login-card h1 {
    color: #ff2a2a;
    line-height: 1.2;
}

body.login-page .login-card p { color: #c9c9c9; }
body.login-page .login-card label { color: #f2f2f2; }

body.login-page .login-card input {
    box-sizing: border-box;
    min-height: 46px;
    border: 1px solid #494949;
    border-radius: 9px;
    background: #242424;
    color: #fff;
    outline: none;
}

body.login-page .login-card input:focus {
    border-color: #d00000;
    box-shadow: 0 0 0 3px rgba(208,0,0,.18);
}

body.login-page .login-card button,
body.login-page .login-card button[type="submit"] {
    width: 100%;
    min-height: 46px;
    margin-top: 20px;
    border: 1px solid #d00000;
    border-radius: 9px;
    background: linear-gradient(135deg, #d00000, #8f0000);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, filter .2s ease;
}

body.login-page .login-card button:hover { filter: brightness(1.12); transform: translateY(-1px); }
body.login-page .login-card .register-link a { color: #ff777f; font-weight: 700; }
body.login-page #mensaje { overflow-wrap: anywhere; }

/* Portal del alumno: bienvenida y bloques con el mismo acabado del panel. */
body.portal-page .account-shell,
body.teacher-page .teacher-shell {
    width: min(1250px, calc(100% - 36px));
    max-width: 1250px;
    margin: 30px auto 56px;
    padding: 0;
    box-sizing: border-box;
}

body.portal-page .account-welcome,
body.teacher-page .teacher-welcome {
    background:
        radial-gradient(circle at top right, rgba(179,0,0,.24), transparent 38%),
        linear-gradient(135deg, #000, #211010 78%, #390606);
    border: 1px solid #3b2527;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0,0,0,.24);
}

body.portal-page .account-welcome h1,
body.teacher-page .teacher-welcome h1 { color: #fff; }
body.portal-page .account-welcome p,
body.teacher-page .teacher-welcome p { color: #dedede; }

body.portal-page .account-card,
body.portal-page .account-section,
body.portal-page .profile-card,
body.portal-page .account-shell .card,
body.teacher-page .teacher-panel,
body.teacher-page .teacher-stat {
    background: #151515;
    border: 1px solid #333;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

body.teacher-page .teacher-panel { padding: clamp(18px, 2.2vw, 26px); }
body.teacher-page .teacher-stat { transition: transform .2s ease, border-color .2s ease; }
body.teacher-page .teacher-stat:hover { transform: translateY(-2px); border-color: #6b2529; }
body.teacher-page .teacher-panel-head h2 { color: #fff; }
body.teacher-page .teacher-empty { background: #202020; border-color: #454545; }

/* Formularios y controles internos consistentes en ambas áreas. */
body.portal-page input,
body.portal-page select,
body.portal-page textarea,
body.teacher-page input,
body.teacher-page select,
body.teacher-page textarea {
    background: #211818;
    color: #f4f4f5;
    max-width: 100%;
    box-sizing: border-box;
    border-color: #484848;
    border-radius: 9px;
}

body.portal-page input:focus-visible,
body.portal-page select:focus-visible,
body.portal-page textarea:focus-visible,
body.teacher-page input:focus-visible,
body.teacher-page select:focus-visible,
body.teacher-page textarea:focus-visible,
body.teacher-page button:focus-visible,
body.login-page button:focus-visible {
    outline: 2px solid #ff4b55;
    outline-offset: 2px;
}

@media (max-width: 760px) {
    body.login-page .container { width: calc(100% - 28px); margin: 28px auto; }
    body.login-page .login-card { padding: 24px 20px; }
    body.portal-page .account-shell,
    body.teacher-page .teacher-shell { width: calc(100% - 24px); margin: 20px auto 38px; }
    body.portal-page .account-welcome,
    body.teacher-page .teacher-welcome { padding: 22px; border-radius: 15px; }
    body.teacher-page .teacher-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.teacher-page .teacher-layout { grid-template-columns: minmax(0, 1fr); }
    body.teacher-page .teacher-panel-head { flex-wrap: wrap; }
}

@media (max-width: 420px) {
    body.teacher-page .teacher-stats { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   53. V21 — AJUSTE SUTIL DE ESCALA GENERAL
   ------------------------------------------------------------
   Reduce ligeramente el tamaño visual y el espacio ocupado,
   conservando la legibilidad, el fondo radial y el responsive.
   ============================================================ */

body {
    font-size: 15px;
}

h1 { font-size: clamp(1.65rem, 2.3vw, 2.05rem); }
h2 { font-size: clamp(1.25rem, 1.8vw, 1.55rem); }
h3 { font-size: 1.08rem; }

.navbar {
    padding: 11px 3.5%;
}

.logo {
    font-size: 22px;
}

.navbar nav {
    gap: 9px;
}

.navbar nav a {
    font-size: 13px;
    padding: 7px 9px;
}

.about-container,
.portal,
.admin {
    width: min(1140px, 92%);
    margin-top: 28px;
    margin-bottom: 30px;
}

.card,
.panel,
.dashboard-card,
.dashboard-panel,
.dashboard-quick-actions {
    padding: clamp(14px, 1.7vw, 21px);
}

.cards-grid,
.dashboard-grid,
.dashboard-columns {
    gap: 14px;
}

button,
input,
select,
textarea {
    font-size: 0.96rem;
}

body.portal-page .account-shell,
body.teacher-page .teacher-shell {
    width: min(1190px, calc(100% - 40px));
    max-width: 1190px;
    margin-top: 24px;
    margin-bottom: 44px;
}

body.teacher-page .teacher-panel {
    padding: clamp(16px, 1.9vw, 23px);
}

body.portal-page .account-welcome,
body.teacher-page .teacher-welcome {
    padding: clamp(20px, 2.2vw, 27px);
}

body.login-page .login-card {
    padding: 27px;
}

@media (max-width: 760px) {
    .navbar { padding: 10px 14px; }
    .about-container,
    .portal,
    .admin { width: calc(100% - 24px); margin: 18px auto; }
    body.portal-page .account-shell,
    body.teacher-page .teacher-shell {
        width: calc(100% - 24px);
        margin: 18px auto 34px;
    }
    body.login-page .login-card { padding: 22px 18px; }
}

/* ============================================================
   57. INICIO / DASHBOARD V21 — ESTILO ADMINISTRATIVO UNIFICADO
   ============================================================ */
.home-dashboard-page .home-navbar {
    padding: 10px clamp(18px, 3.5vw, 52px);
    background: rgba(12, 12, 14, .94);
    border-bottom: 1px solid rgba(208, 0, 0, .55);
}

.home-dashboard-page .home-main {
    display: block;
    min-height: calc(100vh - 150px);
    padding: 34px 18px 54px;
}

.home-dashboard-page .home-welcome {
    width: min(900px, 100%);
    margin: 0 auto 20px;
    padding: 17px 24px;
    text-align: left;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .10);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-xl);
    background: linear-gradient(125deg, rgba(20, 20, 22, .98), rgba(35, 19, 19, .96));
    box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

.home-dashboard-page .home-welcome::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    top: -95px;
    right: -45px;
    border-radius: 50%;
    background: rgba(208, 0, 0, .16);
    filter: blur(4px);
    pointer-events: none;
}

.home-dashboard-page .home-eyebrow {
    display: inline-block;
    margin-bottom: 5px;
    color: #ff6666;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.home-dashboard-page .home-welcome h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    line-height: 1.2;
    text-align: left;
}

.home-dashboard-page .home-welcome p {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 4px 0;
    color: #d0d0d0;
    line-height: 1.45;
}

.home-dashboard-page .home-welcome .text-center {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    text-align: left;
}

.home-dashboard-page .home-welcome .logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    background: rgba(255, 255, 255, .045);
    color: #fff;
    text-decoration: none;
    font-size: .88rem;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.home-dashboard-page .home-welcome .logout-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 70, 70, .6);
    background: rgba(208, 0, 0, .16);
}

.home-dashboard-page .home-shortcuts {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.home-dashboard-page .home-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
    gap: 16px;
    margin: 0;
    align-items: stretch;
}

.home-dashboard-page .home-shortcut {
    width: auto;
    min-width: 0;
    min-height: 205px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-top: 3px solid rgba(208, 0, 0, .78);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(25, 25, 27, .97), rgba(18, 18, 20, .97));
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
    text-align: left;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
    cursor: pointer;
}

.home-dashboard-page .home-shortcut:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 60, 60, .48);
    background: linear-gradient(145deg, rgba(38, 24, 24, .98), rgba(20, 20, 22, .98));
    box-shadow: 0 16px 30px rgba(0, 0, 0, .27);
}

.home-dashboard-page .home-shortcut:focus-visible {
    outline: 3px solid rgba(255, 75, 75, .85);
    outline-offset: 3px;
}

.home-dashboard-page .home-shortcut-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 52, 52, .28);
    border-radius: 12px;
    background: rgba(208, 0, 0, .13);
    color: #ff5b5b;
    font-size: 1.2rem;
}

.home-dashboard-page .home-shortcut h2 {
    margin: 0 0 9px;
    color: #fff;
    font-size: 1.05rem;
    line-height: 1.35;
    text-align: left;
}

.home-dashboard-page .home-shortcut p {
    margin: 0 0 18px;
    color: #bdbdc2;
    font-size: .9rem;
    line-height: 1.55;
}

.home-dashboard-page .home-shortcut-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: #ff6666;
    font-size: .82rem;
    font-weight: 700;
}

.home-dashboard-page footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(12, 12, 14, .72);
    color: #c1c1c1;
    text-align: center;
    font-size: .82rem;
}

@media (max-width: 600px) {
    .home-dashboard-page .home-main { padding: 22px 14px 36px; }
    .home-dashboard-page .home-welcome { margin-bottom: 16px; padding: 15px 16px; }
    .home-dashboard-page .home-shortcut-grid { grid-template-columns: 1fr; gap: 12px; }
    .home-dashboard-page .home-shortcut { min-height: 0; padding: 19px; }
    .home-dashboard-page .home-shortcut-icon { margin-bottom: 13px; }
}

/* ============================================================
   58. PORTAL DEL ALUMNO V21 — PULIDO VISUAL Y JERARQUÍA
   ------------------------------------------------------------
   Mejora la lectura, compacta espacios y unifica los módulos.
   No modifica consultas, permisos, formularios ni comportamiento.
   ============================================================ */
body.portal-page .account-shell {
    width: min(1160px, calc(100% - 36px));
    max-width: 1160px;
    margin: 22px auto 42px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.portal-page .account-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 19px 23px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-left: 4px solid #d00000;
    border-radius: 15px;
    background:
        radial-gradient(circle at 95% 0%, rgba(208, 0, 0, .19), transparent 34%),
        linear-gradient(120deg, #101010, #211414 78%, #260909);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}

body.portal-page .account-eyebrow,
body.portal-page .panel-kicker {
    display: inline-block;
    color: #ff7777;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

body.portal-page .account-welcome h1 {
    margin: 5px 0 4px;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.25;
}

body.portal-page .account-welcome p {
    margin: 0;
    color: #c8c8c8;
    font-size: .9rem;
    line-height: 1.5;
}

body.portal-page .account-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

body.portal-page .account-btn {
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid rgba(255, 55, 55, .55);
    border-radius: 9px;
    background: linear-gradient(135deg, #d00000, #970000);
    color: #fff;
    font-size: .84rem;
    font-weight: 750;
    text-decoration: none;
    transition: transform .18s ease, filter .18s ease, border-color .18s ease;
}

body.portal-page .account-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

body.portal-page .account-btn-dark {
    border-color: #444;
    background: #242424;
}

body.portal-page .account-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px;
    margin: 0;
}

body.portal-page .account-stats > *,
body.portal-page .account-stats .stat-card,
body.portal-page .account-stats .account-stat {
    min-width: 0;
    border: 1px solid #353535;
    border-radius: 12px;
    background: linear-gradient(145deg, #1b1b1b, #121212);
    box-shadow: 0 7px 18px rgba(0, 0, 0, .14);
}

body.portal-page .account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
    align-items: start;
    gap: 15px;
    margin: 0;
}

body.portal-page .account-layout-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.portal-page .account-panel {
    min-width: 0;
    padding: clamp(16px, 1.8vw, 22px);
    border: 1px solid #343434;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(23, 23, 23, .98), rgba(15, 15, 15, .98));
    box-shadow: 0 8px 22px rgba(0, 0, 0, .17);
}

body.portal-page .account-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

body.portal-page .account-panel-head h2 {
    margin: 4px 0 0;
    color: #fff;
    font-size: 1.12rem;
    line-height: 1.35;
}

body.portal-page .account-panel-head h3,
body.portal-page .account-history-grid h3,
body.portal-page .qr-box h3 {
    margin: 4px 0 0;
    color: #f4f4f4;
    font-size: 1rem;
}

body.portal-page .panel-subtitle {
    margin: 5px 0 0;
    color: #aaa;
    font-size: .84rem;
    line-height: 1.45;
}

body.portal-page .profile-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(208, 0, 0, .3);
    border-radius: 11px;
    background: rgba(208, 0, 0, .12);
}

body.portal-page .profile-details,
body.portal-page .activity-summary,
body.portal-page .account-list,
body.portal-page .account-cards,
body.portal-page .payment-account-summary {
    min-width: 0;
}

body.portal-page .account-list,
body.portal-page .account-cards {
    gap: 10px;
}

body.portal-page .account-list > *,
body.portal-page .account-cards > *,
body.portal-page .profile-details > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.portal-page .account-link {
    color: #ff7777;
    font-size: .82rem;
    font-weight: 750;
    text-decoration: none;
}

body.portal-page .account-link:hover { color: #fff; text-decoration: underline; }

body.portal-page .profile-edit-form,
body.portal-page .password-change-section {
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

body.portal-page .profile-edit-grid {
    gap: 12px;
}

body.portal-page .profile-edit-grid label {
    color: #d8d8d8;
    font-size: .84rem;
    font-weight: 650;
}

body.portal-page input,
body.portal-page select,
body.portal-page textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    background: #202020;
    color: #f7f7f7;
}

body.portal-page .profile-edit-note {
    color: #bcbcbc;
    font-size: .82rem;
    line-height: 1.55;
}

body.portal-page .qr-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid #353535;
    border-radius: 12px;
    background: #111;
}

body.portal-page .qr-box p { margin: 6px 0 0; color: #aaa; font-size: .82rem; line-height: 1.45; }
body.portal-page #qrAlumno { flex: 0 0 auto; padding: 7px; border-radius: 8px; background: #fff; }
body.portal-page #qrAlumno img,
body.portal-page #qrAlumno canvas { display: block; max-width: 100%; height: auto; }

body.portal-page .account-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}

body.portal-page .account-history-grid > div {
    min-width: 0;
    padding: 13px;
    border: 1px solid #333;
    border-radius: 11px;
    background: #121212;
}

body.portal-page .account-message {
    padding: 11px 14px;
    border: 1px solid #5a3434;
    border-radius: 10px;
    background: #241414;
    color: #fff;
}

body.portal-page footer {
    padding: 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(10,10,10,.7);
    color: #aaa;
    text-align: center;
    font-size: .82rem;
}

@media (max-width: 900px) {
    body.portal-page .account-layout,
    body.portal-page .account-layout-wide { grid-template-columns: minmax(0, 1fr); }
    body.portal-page .account-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
    body.portal-page .account-shell { width: calc(100% - 24px); margin: 14px auto 28px; gap: 12px; }
    body.portal-page .account-welcome { align-items: flex-start; flex-direction: column; gap: 13px; padding: 16px; }
    body.portal-page .account-actions { justify-content: flex-start; width: 100%; }
    body.portal-page .account-actions .account-btn { flex: 1 1 auto; text-align: center; }
    body.portal-page .account-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    body.portal-page .account-panel { padding: 14px; }
    body.portal-page .account-history-grid { grid-template-columns: minmax(0, 1fr); }
    body.portal-page .account-panel-head { align-items: flex-start; }
    body.portal-page .account-panel-head .account-link,
    body.portal-page .account-notif-all { max-width: 48%; text-align: right; }
    body.portal-page .qr-box { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    body.portal-page .account-btn { transition: none; }
}

/* ============================================================
   59. PORTAL DEL ALUMNO — CAMBIO DE CONTRASEÑA COMPACTO
   ============================================================ */
body.portal-page .password-change-section {
    width: 100%;
    max-width: 760px;
    justify-self: start;
    margin: 16px 0;
    padding: 18px 20px;
    border: 1px solid rgba(208, 0, 0, .32);
    border-left: 3px solid var(--brand, #d00000);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(30, 20, 20, .96), rgba(15, 15, 15, .96));
    box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}
body.portal-page .password-change-section .account-panel-head { margin-bottom: 8px; }
body.portal-page .password-change-section .account-panel-head h3 {
    margin: 3px 0 0;
    font-size: 1.12rem;
    line-height: 1.3;
}
body.portal-page .password-change-section .profile-edit-note {
    max-width: 600px;
    margin: 8px 0 14px;
    font-size: .78rem;
}
body.portal-page .password-change-section .profile-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 13px;
}
body.portal-page .password-change-section .profile-edit-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .8rem;
}
body.portal-page .password-change-section .profile-edit-grid label.profile-edit-wide {
    grid-column: 1 / -1;
}
body.portal-page .password-change-section input {
    min-height: 36px;
    padding: 8px 10px;
    font-size: .88rem;
}
body.portal-page .password-change-section .profile-edit-actions {
    margin-top: 13px;
}
body.portal-page .password-change-section .account-btn {
    min-height: 36px;
    padding: 8px 14px;
    font-size: .82rem;
}
@media (max-width: 650px) {
    body.portal-page .password-change-section { padding: 14px; }
    body.portal-page .password-change-section .profile-edit-grid { grid-template-columns: minmax(0, 1fr); }
    body.portal-page .password-change-section .profile-edit-grid label.profile-edit-wide { grid-column: auto; }
}

/* 60. PORTAL DEL ALUMNO — CAMBIO DE CONTRASEÑA BAJO DEMANDA */
body.portal-page .password-change-section {
    max-width: 520px;
    padding: 16px 18px;
}
body.portal-page .password-change-summary .account-panel-head { margin-bottom: 4px; }
body.portal-page .password-change-summary .profile-edit-note {
    margin: 7px 0 12px;
    font-size: .8rem;
}
body.portal-page #toggleCambiarContrasena {
    min-height: 36px;
    padding: 8px 13px;
    font-size: .82rem;
}
body.portal-page #formCambiarContrasena[hidden] { display: none !important; }
body.portal-page #formCambiarContrasena {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.1);
}
body.portal-page #formCambiarContrasena .profile-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
@media (max-width: 650px) {
    body.portal-page .password-change-section { padding: 13px; }
}


/* ============================================================
   60. RECUPERACIÓN DE CONTRASEÑA
   ============================================================ */
body.login-page .forgot-password-link {
    margin-top: 10px;
    margin-bottom: 4px;
}
body.login-page .forgot-password-link a {
    color: #ff777f;
    font-weight: 800;
    text-decoration: none;
}
body.login-page .forgot-password-link a:hover { text-decoration: underline; }
body.login-page .recovery-card form { display: flex; flex-direction: column; gap: 10px; }
body.login-page .recovery-card form label { margin-top: 5px; }
body.login-page .recovery-card .message-center { overflow-wrap: anywhere; line-height: 1.5; }
body.login-page .recovery-card .message-center.error { color: #ff9b9b; }
body.login-page .recovery-card .message-center.success { color: #a6efba; }
body.login-page .recovery-card .register-link { margin-top: 22px; }

/* ============================================================
   61. PULIDO VISUAL INTEGRAL V21 — CONSISTENCIA Y ACCESIBILIDAD
   Capa visual transversal; no modifica lógica PHP ni consultas SQL.
   ============================================================ */
:root {
    --ui-radius-sm: 9px;
    --ui-radius-md: 14px;
    --ui-radius-lg: 19px;
    --ui-border: rgba(255, 255, 255, .11);
    --ui-border-strong: rgba(208, 0, 0, .42);
    --ui-surface: rgba(22, 22, 24, .94);
    --ui-surface-raised: rgba(31, 27, 28, .97);
    --ui-shadow: 0 12px 30px rgba(0, 0, 0, .20);
    --ui-focus: 0 0 0 3px rgba(255, 42, 42, .25);
}

html { scroll-behavior: smooth; }
body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, video, canvas, svg { max-width: 100%; }
img { height: auto; }

/* Superficies y contenedores coherentes en las distintas secciones */
.card, .panel, .stat-card, .dashboard-card, .content-card,
.form-card, .table-card, .section-card, .account-panel,
.admin-card, .profesor-card, .alumno-card {
    border-radius: var(--ui-radius-md);
}
.card, .panel, .content-card, .form-card, .table-card,
.section-card, .account-panel, .admin-card, .profesor-card, .alumno-card {
    border-color: var(--ui-border);
}
main, .main-content, .page-content, .dashboard-content {
    min-width: 0;
}

/* Jerarquía de títulos más compacta y legible */
.page-title, .section-title, main > h1, .main-content > h1 {
    line-height: 1.2;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}
h1, h2, h3, h4 { text-wrap: balance; }
p, .description, .section-description { line-height: 1.6; }

/* Controles con tamaños y estados consistentes */
button, .btn, input[type="button"], input[type="submit"],
a.button, .button {
    transition: background-color .18s ease, border-color .18s ease,
        color .18s ease, box-shadow .18s ease, transform .18s ease;
}
button:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
select, textarea {
    background: #211818;
    max-width: 100%;
    border-radius: var(--ui-radius-sm);
}
input::placeholder, textarea::placeholder { color: #aaa; opacity: 1; }
button:disabled, .btn:disabled, input:disabled, select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: .62;
}

/* Tablas: legibles en escritorio y desplazables en pantallas pequeñas */
table { border-collapse: separate; border-spacing: 0; }
thead th { font-weight: 750; }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background-color: rgba(255, 255, 255, .035); }
th, td { overflow-wrap: anywhere; }
.table-responsive, .table-wrapper, .tabla-responsive, .overflow-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Estados de información, validación y avisos */
.alert, .mensaje, .message, .notice, .flash-message {
    border-radius: var(--ui-radius-sm);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.error, .mensaje-error, .alert-error { border-color: rgba(255, 90, 90, .48); }
.success, .mensaje-exito, .alert-success { border-color: rgba(90, 210, 130, .42); }

/* Enlaces y elementos interactivos */
a { text-underline-offset: 3px; }
.card a, .panel a, .content-card a { overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
    .btn:hover, button:hover, a.button:hover, .button:hover {
        transform: translateY(-1px);
    }
    .card:hover, .content-card:hover, .section-card:hover {
        border-color: rgba(208, 0, 0, .24);
    }
}

/* Diseño adaptable para portátiles, tabletas y móviles */
@media (max-width: 900px) {
    .container { width: min(100% - 28px, 100%); }
    .cards-grid, .cards, .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .container { width: min(100% - 22px, 100%); }
    .cards-grid, .cards, .dashboard-grid,
    .form-grid, .profile-edit-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .card, .panel, .content-card, .form-card, .section-card {
        padding: clamp(12px, 3.5vw, 18px);
    }
    .page-title, main > h1, .main-content > h1 { font-size: clamp(1.45rem, 6vw, 2rem); }
    .btn, button, input[type="submit"] { max-width: 100%; }
    .actions, .form-actions, .toolbar, .page-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    table { min-width: 560px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ============================================================
   V21 · WEB PÚBLICA ORIENTADA A NUEVOS ALUMNOS
   Ajustes progresivos: conversión, accesibilidad y responsive.
   ============================================================ */
.public-page { overflow-x: clip; }
.public-navbar { gap: 22px; }
.public-navbar .logo-img { max-height: 58px; width: auto; object-fit: contain; }
.public-navbar nav { row-gap: 8px; }
.public-hero-v16 { position: relative; isolation: isolate; }
.public-hero-v16::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 78% 35%, rgba(208,0,0,.23), transparent 42%), linear-gradient(115deg, rgba(8,8,9,.97), rgba(25,18,18,.88)); }
.public-hero-content { max-width: 1120px; }
.public-hero-content h1 { max-width: 820px; text-wrap: balance; line-height: 1.06; letter-spacing: -.035em; }
.public-hero-content > p { max-width: 680px; line-height: 1.75; }
.public-hero-actions { align-items: center; gap: 12px; }
.public-hero-actions .btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
.public-text-link { display: inline-flex; align-items: center; min-height: 44px; color: #fff; font-weight: 700; text-decoration-color: rgba(255,255,255,.5); text-underline-offset: 4px; }
.public-text-link:hover { color: #ff5555; }
.public-section-heading { max-width: 820px; margin-inline: auto; }
.public-section-heading p { line-height: 1.7; }
.public-feature, .public-card { transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.public-feature:hover, .public-card:hover { transform: translateY(-4px); border-color: rgba(255,42,42,.55); box-shadow: 0 16px 38px rgba(0,0,0,.22); }
.public-discipline-card h3, .public-prof-card h3, .public-event-card h3 { text-wrap: balance; }
.public-contact { gap: 28px; border: 1px solid rgba(255,255,255,.12); background: radial-gradient(circle at 90% 10%, rgba(208,0,0,.24), transparent 42%), #141414; }
.public-contact h2 { text-align: left; }
.public-contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.public-contact-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; }
.public-faq-section { padding-top: clamp(44px, 6vw, 82px); padding-bottom: clamp(44px, 6vw, 82px); }
.public-faq-grid { width: min(100%, 1000px); margin: 28px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.public-faq { padding: 18px 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(15,15,15,.76); }
.public-faq summary { cursor: pointer; font-weight: 700; line-height: 1.45; padding-right: 8px; }
.public-faq summary::marker { color: #ff2a2a; }
.public-faq p { color: #d3d3d3; line-height: 1.7; margin-top: 12px; }
.public-footer-v16 a { text-underline-offset: 4px; }
.public-page a:focus-visible, .public-page summary:focus-visible, .public-page button:focus-visible { outline: 3px solid #ff5b5b; outline-offset: 4px; }
@media (max-width: 760px) {
 .public-navbar { align-items: flex-start; flex-direction: column; padding: 12px 5%; gap: 10px; }
 .public-navbar nav { width: 100%; justify-content: flex-start; gap: 6px; }
 .public-navbar nav a { padding: 8px 9px; font-size: 13px; }
 .public-hero-content h1 { font-size: clamp(2.15rem, 9vw, 3.4rem); }
 .public-hero-actions { align-items: stretch; flex-direction: column; }
 .public-hero-actions .btn, .public-hero-actions .public-text-link { width: 100%; }
 .public-faq-grid { grid-template-columns: 1fr; }
 .public-contact { align-items: flex-start; flex-direction: column; }
 .public-contact-actions { width: 100%; }
 .public-contact-actions .btn { flex: 1 1 160px; }
}
@media (prefers-reduced-motion: reduce) {
 .public-page *, .public-page *::before, .public-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* ============================================================
   55. ETAPA 4 — REFUERZO RESPONSIVE FINAL
   ============================================================ */

/* Evita que grids y filas flexibles fuerzen un ancho mayor al viewport. */
@media (max-width: 900px) {
    main, main > *, .main-content, .content, .container,
    .dashboard-grid, .cards-grid, .form-grid, .form-row {
        min-width: 0;
        max-width: 100%;
    }

    .table-responsive, .table-wrapper, .tabla-responsive,
    .overflow-table, .table-wrap, .table-scroll,
    .student-table-wrap, .teacher-calendar-wrap {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 600px) {
    /* Los controles conservan un tamaño táctil cómodo sin ensanchar la página. */
    input:not([type="checkbox"]):not([type="radio"]),
    select, textarea {
        max-width: 100%;
        min-width: 0;
    }

    .actions, .form-actions, .toolbar, .page-actions,
    .calendar-toolbar, .calendar-actions {
        min-width: 0;
        flex-wrap: wrap;
    }

    img, video, canvas, iframe {
        max-width: 100%;
    }
}

/* Consulta de grupos, clases y disciplinas por profesor en el panel administrador. */
.professor-assignment-panel {
    margin: 1.25rem 0 1.5rem;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--border, #d7dce2);
    border-radius: 16px;
    background: var(--surface, #fff);
    box-shadow: 0 8px 24px rgba(20, 28, 38, .06);
}
.professor-assignment-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.professor-assignment-heading h3 { margin: .2rem 0 .4rem; }
.professor-assignment-heading label { flex: 1 1 250px; max-width: 420px; }
.professor-assignment-heading select { width: 100%; }
.professor-assignment-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}
.professor-assignment-summary > div,
.professor-assignment-columns > section {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border, #e0e4e8);
    border-radius: 12px;
    background: var(--card, #f8f9fb);
}
.professor-assignment-summary span { display: block; margin-bottom: .35rem; color: #666; font-size: .88rem; }
.professor-assignment-summary strong { color: #000; overflow-wrap: anywhere; }
.professor-assignment-columns { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 1.75fr); gap: 1rem; }
.professor-assignment-columns h4 { color:#666; margin: 0 0 .75rem; }
.professor-assignment-columns ul { margin: 0; padding-left: 1.25rem; }
.professor-assignment-columns li { color: #000; margin: .4rem 0; overflow-wrap: anywhere; }
.professor-assignment-columns .table-wrap { max-width: 100%; overflow-x: auto; }
.professor-assignment-columns table { width: 100%; }
@media (max-width: 700px) {
    .professor-assignment-summary { grid-template-columns: 1fr; }
    .professor-assignment-columns { grid-template-columns: 1fr; }
    .professor-assignment-heading label { max-width: none; }
}


/* Oculta de forma fiable los paneles administrativos fuera de su módulo. */
.professor-assignment-panel[hidden] { display: none !important; }


/* ============================================================
   56. REDISEÑO GENERAL V21 — CONSISTENCIA VISUAL
   Identidad: rojo, carbón y gris; sin alterar la estructura funcional.
   ============================================================ */

:root {
    --brand: #d71920;
    --brand-dark: #a90f16;
    --brand-light: #ff4a50;
    --bg: #171719;
    --bg-dark: #0b0b0d;
    --surface: #202024;
    --surface-2: #29292f;
    --surface-light: #323239;
    --text: #f4f4f5;
    --text-light: #d4d4d8;
    --muted: #a1a1aa;
    --line: rgba(255, 255, 255, .11);
    --radius-sm: 9px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 5px 16px rgba(0, 0, 0, .22);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, .28);
    --shadow-lg: 0 20px 46px rgba(0, 0, 0, .34);
}

html { scroll-padding-top: 90px; }

body {
    background:
       radial-gradient(circle at top right, rgba(179, 0, 0, 0.35), transparent 35%), 
       radial-gradient(circle at bottom left, rgba(120, 0, 0, 0.25), transparent 30%),
        #666666;
    color: var(--text);
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 { line-height: 1.25; letter-spacing: -.015em; }
p { line-height: 1.65; }

.navbar {
    background: rgba(12, 12, 14, .94);
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    backdrop-filter: blur(14px);
}
.navbar nav a { border-radius: 10px; transition: color .2s ease, background .2s ease; }
.navbar nav a:hover,
.navbar nav a:focus-visible { background: rgba(215, 25, 32, .16); color: #fff; }

.hero,
.module,
.panel,
.dashboard-panel,
.dashboard-quick-actions,
.dashboard-card,
.dash-stat,
.stat,
.stats .stat,
.project-info,
.card,
.group-card,
.opcion,
.dynamic-card,
.form-section,
.content-panel {
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
}

.module,
.dashboard-panel,
.dashboard-quick-actions,
.dashboard-card,
.dash-stat,
.stat,
.stats .stat,
.panel,
.form-section,
.content-panel {
    background: linear-gradient(145deg, rgba(39, 39, 44, .98), rgba(27, 27, 31, .98));
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.hero {
    background: linear-gradient(125deg, #101012 0%, #321316 58%, #65151a 100%);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.card,
.project-info {
    background: linear-gradient(145deg, #29292e, #1b1b1f);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.card:hover,
.group-card:hover,
.opcion:hover,
.dashboard-card:hover {
    border-color: rgba(255, 74, 80, .42);
    box-shadow: var(--shadow-md);
}

button,
.btn,
.logout-button {
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: .005em;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
button:hover,
.btn:hover { box-shadow: 0 5px 14px rgba(215, 25, 32, .2); }
button:focus-visible,
.btn:focus-visible,
.logout-button:focus-visible,
.navbar a:focus-visible {
    outline: 3px solid rgba(255, 74, 80, .7);
    outline-offset: 3px;
}

/* Formularios del sistema: controles claros y etiquetas legibles en fondos oscuros. */
body label { color: #ededf0; }
.login-card label,
.register-card label,
.public-form label { color: #202024; }
input,
select,
textarea,
.input,
.select,
.textarea {
    border-radius: 10px;
    border-color: #666666;
    min-height: 42px;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(215, 25, 32, .17);
}
input[type="checkbox"],
input[type="radio"] { min-height: auto; }
::placeholder { color: #777781; opacity: 1; }

/* Tablas más fáciles de leer y desplazables en pantallas estrechas. */
table { border-collapse: separate; border-spacing: 0; }
th { font-weight: 750; }
.admin table,
.table-responsive table,
.table-wrap table,
.table-wrapper table { border-radius: 10px; overflow: hidden; }
.admin th { background: #29292f; color: #fff; }
.admin td { color: #e8e8eb; }
.admin tbody tr { transition: background .15s ease; }
.admin tbody tr:hover { background: rgba(255, 255, 255, .035); }

/* Mensajes y estados con contraste consistente. */
.alert, .notice, .message, .admin-loading, .admin-error { border-radius: 12px; }
.status-pill, .badge, .status-badge { font-weight: 700; }
hr, .divider { border-color: var(--line); }

/* Evita anchos fijos que desbordan en móviles sin cambiar la estructura de los módulos. */
@media (max-width: 800px) {
    .about-container, .portal, .admin { width: min(100% - 24px, 1180px); margin: 18px auto; padding-left: 0; padding-right: 0; }
    .hero { padding: clamp(18px, 4vw, 28px); }
    .module { padding: clamp(14px, 3vw, 20px); }
    .dashboard-card, .dashboard-wide { width: 100%; max-width: 100%; }
    .grid, .cards-grid, .dashboard-grid, .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
}
@media (max-width: 560px) {
    .quick-actions { align-items: stretch; }
    .quick-actions a, .quick-actions button { flex: 1 1 100%; text-align: center; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stats .stat { min-width: 0; padding: 14px; }
    .admin table { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   57. SEMINARIOS Y EVENTOS: CORRECCIÓN DE SOLAPAMIENTO EN MÓVILES
   La fecha deja de flotar encima del título en pantallas estrechas.
   ============================================================ */
@media (max-width: 600px) {
    #eventos .public-event-card,
    .public-event-card {
        box-sizing: border-box;
        min-width: 0;
        padding: 22px 18px 24px;
        overflow-wrap: anywhere;
    }

    #eventos .public-event-date,
    .public-event-card .public-event-date {
        position: static;
        inset: auto;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 64px;
        min-height: 58px;
        box-sizing: border-box;
        margin: 0 0 16px;
        padding: 8px 7px;
    }

    .public-event-card h3 {
        margin: 0 0 12px;
        padding: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
        line-height: 1.3;
    }

    .public-event-card p,
    .public-event-card .public-event-meta,
    .public-event-card > strong {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .public-event-card .public-event-meta {
        gap: 8px;
        line-height: 1.5;
    }
}


/* ============================================================
   57. GALERÍA PÚBLICA — FOTOGRAFÍAS COMPLETAS SIN RECORTE
   ============================================================ */
.public-gallery-v16 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    align-items: start;
    gap: 22px;
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
}

.public-gallery-v16 .public-gallery-item {
    min-width: 0;
    overflow: hidden;
    background: #111115;
    border: 1px solid #303038;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.public-gallery-v16 .public-gallery-item img {
    display: block;
    width: 100%;
    height: auto !important;
    max-height: 560px;
    object-fit: contain !important;
    object-position: center;
    background: #09090c;
}

.public-gallery-v16 .public-gallery-item > div {
    padding: 15px 17px;
}

.public-gallery-v16 .public-gallery-item h3 {
    margin: 0 0 6px;
    color: #fff;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.public-gallery-v16 .public-gallery-item small {
    display: block;
    color: #aaa;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .public-gallery-v16 {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .public-gallery-v16 .public-gallery-item img {
        width: 100%;
        height: auto !important;
        max-height: 70vh;
        object-fit: contain !important;
    }
}


/* ============================================================
   58. CAPA DE UNIFICACIÓN VISUAL V21
   Cambios seguros por cascada: no elimina reglas históricas ni
   cambia clases/IDs usados por PHP o JavaScript.
   ============================================================ */
:root {
    --vilamir-brand: #d00000;
    --vilamir-brand-dark: #9d0000;
    --vilamir-bg: #111114;
    --vilamir-surface: #1b1b20;
    --vilamir-surface-raised: #24242b;
    --vilamir-border: #393941;
    --vilamir-text: #f2f2f4;
    --vilamir-muted: #b9b9c2;
    --vilamir-radius-sm: 8px;
    --vilamir-radius-md: 12px;
    --vilamir-radius-lg: 16px;
    --vilamir-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

html { scroll-behavior: smooth; }
body { min-width: 320px; }
img, video, iframe { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }

/* Navegación: permite envolver elementos en tabletas sin desbordar. */
.navbar { gap: 14px; min-width: 0; }
.navbar .logo, .navbar .logo img, .navbar .logo-img { max-width: 100%; }
.navbar nav { min-width: 0; }
.navbar nav a { overflow-wrap: anywhere; }

/* Superficies consistentes, sin alterar la estructura de cada módulo. */
.dashboard-card,
.project-info,
.gallery-card,
.public-gallery-v16 .public-gallery-item,
.module,
.stat,
.card {
    border-radius: var(--vilamir-radius-md);
}
.dashboard-card,
.project-info,
.module {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Galería pública: fotografías completas y aproximadamente 50% más bajas. */
.public-gallery-v16 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 18px;
}
.public-gallery-v16 .public-gallery-item img {
    width: 100%;
    height: 180px !important;
    max-height: 180px;
    object-fit: contain !important;
    object-position: center;
}

/* Galería del módulo administrativo: miniaturas uniformes, sin cortar fotos. */
.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    align-items: start;
    gap: 16px;
}
.gallery-card { min-width: 0; overflow: hidden; }
.gallery-card img {
    display: block;
    width: 100%;
    height: 160px !important;
    max-height: 160px !important;
    object-fit: contain !important;
    object-position: center;
    background: #09090c;
}
.gallery-card h3,
.gallery-card p,
.gallery-card small { overflow-wrap: anywhere; }
.gallery-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-actions button { min-width: 0; }

/* Etiquetas: el texto oscuro solo se aplica dentro de superficies claras. */
.login-card,
.register-card,
.public-form { color: #202024; }
.login-card label,
.register-card label,
.public-form label { color: #ffffff; }
.login-card input,
.login-card select,
.login-card textarea,
.register-card input,
.register-card select,
.register-card textarea,
.public-form input,
.public-form select,
.public-form textarea {
    color: #ffffff;
    background-color: #fff;
}

/* Tablas y formularios: evitar desbordamientos en pantallas pequeñas. */
.admin,
.portal,
.about-container,
.form-grid-two,
.form-grid-spaced,
.table-responsive,
.table-wrap,
.table-wrapper { min-width: 0; }
.table-responsive,
.table-wrap,
.table-wrapper { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.form-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
input, select, textarea { box-sizing: border-box; }

@media (max-width: 800px) {
    .navbar { align-items: flex-start; flex-wrap: wrap; }
    .navbar nav { justify-content: flex-start; width: 100%; gap: 6px; }
    .navbar nav a { padding: 8px; }
    .form-grid-two { grid-template-columns: minmax(0, 1fr); }
    .public-gallery-v16 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
}
@media (max-width: 560px) {
    .public-gallery-v16 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .public-gallery-v16 .public-gallery-item img { height: 150px !important; max-height: 150px; }
    .gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .gallery-card img { height: 150px !important; max-height: 150px !important; }
    .navbar { padding: 12px 16px; }
    .navbar nav a { font-size: 13px; }
    .login-card, .register-card { width: min(100%, 420px); box-sizing: border-box; padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}


/* ============================================================
   59. ACCESIBILIDAD Y PULIDO RESPONSIVE V21
   Refuerzo progresivo: conserva estructura, clases e identificadores.
   ============================================================ */

/* Foco visible al navegar con teclado, sin alterar el clic normal. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #ff5757;
    outline-offset: 3px;
}

/* Evita que contenidos largos rompan tarjetas o el ancho de la página. */
:where(.admin, .portal, .teacher-page, .public-page, main, section, article,
       .dashboard-card, .module, .card, .stat, .project-info) {
    min-width: 0;
}
:where(p, li, td, th, label, .form-help, .error-message, .success-message) {
    overflow-wrap: anywhere;
}
pre, code {
    max-width: 100%;
    overflow-wrap: anywhere;
}
pre { overflow-x: auto; }

/* Tablas: permiten desplazamiento en pantallas angostas sin deformar columnas. */
:where(.table-responsive, .table-wrap, .table-wrapper, .table-container) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
:where(.table-responsive, .table-wrap, .table-wrapper, .table-container) table {
    max-width: 100%;
}

/* Controles de formulario: lectura y uso táctil más cómodos. */
:where(input, select, textarea) {
    min-width: 0;
    font: inherit;
}
:where(input, select, textarea):disabled,
:where(button, .btn, input[type="submit"]):disabled {
    cursor: not-allowed;
    opacity: .72;
}
:where(button, .btn, input[type="submit"], input[type="button"]) {
    touch-action: manipulation;
}

/* No fuerza animaciones a personas que prefieren movimiento reducido. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Ajustes de comodidad en teléfonos pequeños. */
@media (max-width: 560px) {
    :where(.admin, .portal, .teacher-page, .public-page) {
        overflow-wrap: anywhere;
    }
    :where(.form-group, .form-row, .form-grid, .form-grid-two) {
        min-width: 0;
    }
    :where(input, select, textarea) {
        max-width: 100%;
    }
    :where(.table-responsive, .table-wrap, .table-wrapper, .table-container) {
        margin-inline: 0;
    }
}

/* Alto contraste del sistema operativo: mantiene visibles bordes y foco. */
@media (forced-colors: active) {
    :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline: 2px solid Highlight;
    }
    :where(input, select, textarea, button, .btn) {
        border: 1px solid ButtonText;
    }
}


/* ============================================================
   ETAPA 2 V21 — SEMINARIOS Y GALERÍA RESPONSIVE
   Ajustes aditivos: se conservan las reglas anteriores y la lógica PHP/JS.
   ============================================================ */

/* Tarjetas de seminarios: fecha, título, costo y acciones con jerarquía clara. */
.seminars-admin-page #listaSeminarios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
    align-items: stretch;
    gap: clamp(12px, 2vw, 22px);
    width: 100%;
    min-width: 0;
}

.seminars-admin-page #listaSeminarios > .dynamic-card,
.seminars-admin-page #listaSeminarios > .member {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: clamp(16px, 2vw, 22px);
    border-radius: 15px;
    overflow-wrap: anywhere;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
}

.seminars-admin-page #listaSeminarios > .dynamic-card h2,
.seminars-admin-page #listaSeminarios > .member h2 {
    margin: 0 0 4px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.seminars-admin-page #listaSeminarios > .dynamic-card p,
.seminars-admin-page #listaSeminarios > .member p {
    margin: 0 0 5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.seminars-admin-page #listaSeminarios > .dynamic-card button,
.seminars-admin-page #listaSeminarios > .member button {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.seminars-admin-page #listaSeminarios > .dynamic-card button + button,
.seminars-admin-page #listaSeminarios > .member button + button {
    margin-top: 5px;
}

/* Formulario administrativo de seminarios: evita campos desbordados. */
.seminars-admin-page .form-stack,
.seminars-admin-page .form-grid-inline-fields {
    min-width: 0;
}

.seminars-admin-page .form-stack > input,
.seminars-admin-page .form-stack > textarea,
.seminars-admin-page .form-grid-inline-fields > input {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

/* Galería pública: imágenes completas y de tamaño moderado. */
.public-gallery-v16 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
    gap: clamp(12px, 2vw, 20px);
}

.public-gallery-v16 .public-gallery-item img {
    width: 100%;
    height: 160px !important;
    max-height: 160px;
    object-fit: contain !important;
    object-position: center;
    padding: 5px;
    box-sizing: border-box;
    background: #09090c;
}

.public-gallery-v16 .public-gallery-item > div {
    padding: 12px 14px;
}

.public-gallery-v16 .public-gallery-item h3 {
    font-size: clamp(15px, 1.5vw, 18px);
}

/* Galería de administración: miniaturas completas, alineadas y más pequeñas. */
.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    align-items: stretch;
    gap: 16px;
    min-width: 0;
}

.gallery-grid .gallery-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-grid .gallery-card > img {
    display: block;
    width: 100%;
    height: 160px !important;
    max-height: 160px;
    object-fit: contain !important;
    object-position: center;
    padding: 5px;
    box-sizing: border-box;
    background: #111115;
}

.gallery-grid .gallery-card > div {
    min-width: 0;
    padding: 13px;
    overflow-wrap: anywhere;
}

.gallery-grid .gallery-card h3,
.gallery-grid .gallery-card p,
.gallery-grid .gallery-card small {
    color: #000000;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.gallery-grid .gallery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.gallery-grid .gallery-actions button {
    flex: 1 1 90px;
    min-width: 0;
}

.gallery-grid .gallery-edit-form {
    box-sizing: border-box;
    width: 100%;
    padding: 13px;
    gap: 10px;
}

.gallery-grid .gallery-edit-form > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .seminars-admin-page #listaSeminarios {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
    }

    .seminars-admin-page #listaSeminarios > .dynamic-card,
    .seminars-admin-page #listaSeminarios > .member {
        padding: 15px;
    }

    .seminars-admin-page .form-grid-inline-fields {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .public-gallery-v16 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .public-gallery-v16 .public-gallery-item img {
        height: 125px !important;
        max-height: 125px;
    }

    .public-gallery-v16 .public-gallery-item > div {
        padding: 10px;
    }

    .public-gallery-v16 .public-gallery-item h3 {
        font-size: 14px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .gallery-grid .gallery-card > img {
        height: 125px !important;
        max-height: 125px;
    }

    .gallery-grid .gallery-card > div {
        padding: 10px;
    }

    .gallery-grid .gallery-actions {
        flex-direction: column;
    }

    .gallery-grid .gallery-actions button {
        width: 100%;
        flex-basis: auto;
    }
}

@media (max-width: 360px) {
    .public-gallery-v16,
    .gallery-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-gallery-v16 .public-gallery-item img,
    .gallery-grid .gallery-card > img {
        height: 150px !important;
        max-height: 150px;
    }
}

/* ============================================================
   ETAPA 3 — PANEL ADMINISTRATIVO: USABILIDAD Y RESPONSIVE
   Reglas acotadas a admin.php; no modifican la lógica CRUD.
   ============================================================ */
.admin-panel-page {
    min-width: 320px;
}

.admin-panel-page .navbar {
    align-items: center;
    gap: 14px;
}

.admin-panel-page .navbar nav {
    min-width: 0;
    row-gap: 6px;
}

.admin-panel-page .navbar nav a {
    white-space: nowrap;
}

.admin-panel-page main.admin {
    width: min(1250px, calc(100% - 32px));
    padding: 0;
    margin: 28px auto 40px;
    min-width: 0;
}

.admin-panel-page .admin .hero {
    padding: clamp(20px, 4vw, 34px);
}

.admin-panel-page .admin .hero h1,
.admin-panel-page .admin .hero p {
    position: relative;
    z-index: 1;
}

.admin-panel-page #stats {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
    align-items: stretch;
}

.admin-panel-page #stats > *,
.admin-panel-page #dashboard-extra > *,
.admin-panel-page #module > * {
    min-width: 0;
    max-width: 100%;
}

.admin-panel-page .tabs {
    max-width: 100%;
    max-height: 35vh;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.admin-panel-page .tabs button {
    flex: 0 0 auto;
    min-height: 40px;
    overflow-wrap: anywhere;
}

.admin-panel-page .module {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-panel-page .module table {
    width: 100%;
    max-width: 100%;
}

.admin-panel-page .module input,
.admin-panel-page .module select,
.admin-panel-page .module textarea {
    max-width: 100%;
    min-width: 0;
}

.admin-panel-page .module img {
    max-width: 100%;
    height: auto;
}

.admin-panel-page .admin-loading,
.admin-panel-page .admin-error {
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .admin-panel-page .navbar {
        align-items: flex-start;
    }

    .admin-panel-page .navbar nav {
        justify-content: flex-start;
    }

    .admin-panel-page main.admin {
        width: calc(100% - 24px);
        margin-top: 18px;
    }

    .admin-panel-page .admin .hero {
        padding: 22px 18px;
    }

    .admin-panel-page .admin .hero::after {
        right: 8px;
        font-size: 120px;
    }

    .admin-panel-page .tabs {
        position: static;
        max-height: none;
        padding: 8px;
    }

    .admin-panel-page .tabs button {
        flex: 1 1 auto;
    }

    .admin-panel-page .module {
        padding: 15px;
        min-width: 0;
        overflow-x: visible;
    }

    /* El desplazamiento horizontal pertenece al contenedor de cada tabla,
       no al módulo completo ni a la propia tabla (evita scroll anidado). */
    .admin-panel-page .module table {
        display: table;
        overflow: visible;
        white-space: normal;
    }
}

@media (max-width: 420px) {
    .admin-panel-page main.admin {
        width: calc(100% - 18px);
    }

    .admin-panel-page .admin .hero {
        padding: 18px 14px;
    }

    .admin-panel-page .admin .hero h1 {
        font-size: 26px;
    }

    .admin-panel-page .module {
        padding: 12px;
    }

    .admin-panel-page .tabs button {
        width: 100%;
    }
}



/* ============================================================
   ETAPA 4 — PORTAL DEL ALUMNO Y ESPACIO DOCENTE
   Ajustes responsive y de usabilidad, sin modificar la lógica.
   ============================================================ */

body.portal-page .account-shell,
body.teacher-page .teacher-shell {
    width: min(1240px, calc(100% - 36px));
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
}

body.portal-page .account-shell *,
body.teacher-page .teacher-shell * {
    min-width: 0;
    box-sizing: border-box;
}

body.portal-page .account-layout,
body.portal-page .account-layout-wide,
body.portal-page .account-stats,
body.portal-page .account-history-grid,
body.teacher-page .teacher-layout,
body.teacher-page .teacher-stats,
body.teacher-page .teacher-group-summary {
    min-width: 0;
}

body.portal-page .account-panel,
body.portal-page .account-welcome,
body.teacher-page .teacher-panel,
body.teacher-page .teacher-welcome {
    overflow-wrap: anywhere;
}

body.portal-page .account-panel-head,
body.teacher-page .teacher-panel-head {
    flex-wrap: wrap;
    gap: 10px 14px;
}

body.portal-page .account-actions,
body.portal-page .profile-edit-actions,
body.teacher-page .teacher-actions,
body.teacher-page .teacher-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

body.portal-page button,
body.portal-page .account-btn,
body.teacher-page button,
body.teacher-page .teacher-btn {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.portal-page input,
body.portal-page select,
body.portal-page textarea,
body.teacher-page input,
body.teacher-page select,
body.teacher-page textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body.teacher-page .teacher-calendar-wrap,
body.teacher-page .attendance-table-wrap,
body.portal-page .table-responsive,
body.portal-page .account-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.teacher-page table,
body.portal-page .account-panel table {
    max-width: 100%;
}

body.portal-page img,
body.teacher-page img,
body.portal-page canvas,
body.teacher-page canvas {
    max-width: 100%;
}

@media (max-width: 900px) {
    body.portal-page .account-shell,
    body.teacher-page .teacher-shell {
        width: calc(100% - 28px);
    }

    body.portal-page .account-layout,
    body.portal-page .account-layout-wide,
    body.teacher-page .teacher-layout,
    body.teacher-page .teacher-summary-layout,
    body.teacher-page .teacher-groups-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.portal-page .account-welcome,
    body.teacher-page .teacher-welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    body.portal-page .account-actions,
    body.teacher-page .teacher-actions {
        width: 100%;
    }

    body.portal-page .account-stats,
    body.teacher-page .teacher-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    body.portal-page .account-shell,
    body.teacher-page .teacher-shell {
        width: calc(100% - 20px);
        margin-top: 12px;
    }

    body.portal-page .account-panel,
    body.teacher-page .teacher-panel {
        padding: 14px;
    }

    body.portal-page .account-welcome,
    body.teacher-page .teacher-welcome {
        padding: 16px;
    }

    body.portal-page .account-welcome h1,
    body.teacher-page .teacher-welcome h1 {
        font-size: clamp(1.35rem, 6vw, 1.9rem);
        line-height: 1.2;
    }

    body.portal-page .account-stats,
    body.teacher-page .teacher-stats,
    body.portal-page .account-history-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.portal-page .account-actions .account-btn,
    body.teacher-page .teacher-actions .teacher-btn,
    body.teacher-page .teacher-toolbar .teacher-btn {
        flex: 1 1 100%;
        width: 100%;
        text-align: center;
    }

    body.portal-page .account-panel-head,
    body.teacher-page .teacher-panel-head {
        align-items: flex-start;
    }

    body.teacher-page .teacher-calendar-wrap table,
    body.teacher-page .attendance-table-wrap table,
    body.portal-page .account-panel table {
        min-width: 560px;
    }
}

@media (max-width: 360px) {
    body.portal-page .account-shell,
    body.teacher-page .teacher-shell {
        width: calc(100% - 14px);
    }

    body.portal-page .account-panel,
    body.teacher-page .teacher-panel {
        padding: 11px;
    }
}


/* ============================================================
   58. WEB PÚBLICA — IMPACTO VISUAL Y CONVERSIÓN
   Estilos limitados a publica.php; no altera los paneles internos.
   ============================================================ */
.public-page {
    --public-red: #e11d2e;
    --public-red-bright: #ff3545;
    --public-surface: #151519;
    --public-line: rgba(255,255,255,.11);
    background: #0b0b0d;
}

.public-page .public-navbar {
    padding: 10px clamp(18px, 4vw, 64px);
    gap: clamp(12px, 2vw, 28px);
    border-bottom: 1px solid rgba(255, 53, 69, .38);
    box-shadow: 0 10px 35px rgba(0,0,0,.28);
}
.public-page .public-navbar nav { gap: clamp(5px, 1vw, 15px); }
.public-page .public-navbar nav a {
    border-radius: 999px;
    padding: 10px 12px;
    color: #e7e7eb;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}
.public-page .public-navbar nav a:hover {
    color: #fff;
    background: rgba(225,29,46,.14);
}
.public-page .public-navbar nav .public-nav-cta {
    padding: 10px 18px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #f02b3b, #a90b1b) !important;
    border: 1px solid rgba(255,100,110,.6);
    border-radius: 999px;
    box-shadow: 0 7px 22px rgba(225,29,46,.24);
}
.public-page .public-navbar nav .public-nav-cta:hover {
    background: linear-gradient(135deg, #ff4654, #c40d20) !important;
    transform: translateY(-1px);
}

.public-page .public-hero-v16 {
    min-height: min(780px, calc(100svh - 76px));
    padding: clamp(64px, 8vw, 118px) clamp(22px, 8vw, 120px);
    background:
        radial-gradient(ellipse at 82% 32%, rgba(225,29,46,.28), transparent 28%),
        radial-gradient(ellipse at 72% 80%, rgba(135,10,25,.18), transparent 36%),
        linear-gradient(115deg, #08080a 0%, #151216 56%, #26090e 100%);
    border-bottom: 1px solid rgba(255,53,69,.32);
}
.public-page .public-hero-v16::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: clamp(220px, 35vw, 520px);
    aspect-ratio: 1;
    right: clamp(-100px, 3vw, 50px);
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 0 0 28px rgba(255,255,255,.018), 0 0 0 58px rgba(225,29,46,.025), inset 0 0 70px rgba(225,29,46,.08);
    pointer-events: none;
}
.public-page .public-hero-content { max-width: 1120px; }
.public-page .public-hero .eyebrow,
.public-page .public-section-heading .eyebrow,
.public-page .public-contact .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #ff6671;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
}
.public-page .public-hero .eyebrow::before {
    content: "";
    width: 24px;
    height: 2px;
    background: var(--public-red-bright);
    box-shadow: 0 0 12px rgba(255,53,69,.65);
}
.public-page .public-hero h1 {
    max-width: 850px;
    margin: 22px 0 24px;
    font-size: clamp(3rem, 7.3vw, 6.6rem);
    line-height: .98;
    letter-spacing: -.055em;
    text-wrap: balance;
}
.public-page .public-hero p {
    max-width: 650px;
    color: #c8c5cb;
    font-size: clamp(1rem, 1.35vw, 1.16rem);
    line-height: 1.8;
}
.public-page .public-hero-actions { gap: 13px; }
.public-page .public-hero-actions .btn,
.public-page .public-contact-actions .btn {
    min-height: 50px;
    padding: 13px 23px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
}
.public-page .public-hero-actions .btn:not(.public-btn-secondary),
.public-page .public-contact-actions .btn:not(.public-btn-secondary) {
    background: linear-gradient(135deg, #f12c3d, #b20d1e);
    border: 1px solid rgba(255,112,120,.65);
    box-shadow: 0 10px 28px rgba(200,12,32,.25);
}
.public-page .public-hero-actions .btn:not(.public-btn-secondary):hover,
.public-page .public-contact-actions .btn:not(.public-btn-secondary):hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(225,29,46,.34);
}
.public-page .public-btn-secondary {
    border: 1px solid rgba(255,255,255,.22) !important;
    background: rgba(255,255,255,.045) !important;
    color: #f6f6f7 !important;
}
.public-page .public-btn-secondary:hover { background: rgba(255,255,255,.10) !important; border-color: rgba(255,255,255,.4) !important; }
.public-page .public-hero-stats { gap: 12px; margin-top: 44px; }
.public-page .public-hero-stats > div {
    min-width: 142px;
    padding: 15px 19px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(35,35,40,.8), rgba(15,15,18,.75));
    box-shadow: 0 10px 28px rgba(0,0,0,.16);
    backdrop-filter: blur(8px);
}
.public-page .public-hero-stats strong { color: #fff; font-size: 1.55rem; }
.public-page .public-hero-stats span { color: #b7b4bc; font-size: .78rem; }

.public-page .public-section {
    padding: clamp(58px, 7vw, 96px) clamp(20px, 7vw, 100px);
}
.public-page .public-section.alt {
    background: linear-gradient(180deg, #141418, #101013);
    border-top: 1px solid rgba(255,255,255,.055);
    border-bottom: 1px solid rgba(255,255,255,.055);
}
.public-page .public-section-heading { margin-bottom: clamp(28px, 4vw, 46px); }
.public-page .public-section-heading h2 {
    margin: 12px 0 14px;
    font-size: clamp(1.9rem, 3.7vw, 3rem);
    letter-spacing: -.035em;
    text-wrap: balance;
}
.public-page .public-section-heading h2::after {
    width: 62px;
    height: 3px;
    margin-top: 17px;
    background: linear-gradient(90deg, #ff5964, #b70d20);
}
.public-page .public-section-heading p { max-width: 680px; color: #aaa7b0; }
.public-page .public-feature-grid { gap: 16px; }
.public-page .public-feature {
    position: relative;
    overflow: hidden;
    padding: clamp(21px, 2.4vw, 30px);
    border-color: rgba(255,255,255,.10);
    border-radius: 18px;
    background: linear-gradient(145deg, #1b1b21, #111114 75%);
}
.public-page .public-feature::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,53,69,.85), transparent 75%);
    opacity: .75;
}
.public-page .public-feature > span {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255,65,78,.25);
    border-radius: 15px;
    background: rgba(225,29,46,.10);
    font-size: 1.65rem;
}
.public-page .public-feature h3 { margin-top: 19px; font-size: 1.12rem; }
.public-page .public-feature p { color: #b6b4bd; font-size: .94rem; }
.public-page .public-card {
    border: 1px solid rgba(255,255,255,.10);
    border-top: 2px solid rgba(225,29,46,.8);
    border-radius: 18px;
    background: linear-gradient(145deg, #1c1c22, #121215 80%);
    box-shadow: 0 14px 32px rgba(0,0,0,.17);
}
.public-page .public-card:hover { border-color: rgba(255,72,84,.48); }
.public-page .public-card p { color: #bdbbc4; }
.public-page .public-card strong { color: #ff5964; }
.public-page .public-prof-avatar { background: linear-gradient(135deg, #3a1017, #1b0b0e); border-color: rgba(255,75,88,.3); }
.public-page .public-event-date { background: linear-gradient(145deg, #d51a2c, #720916); border-color: rgba(255,111,122,.55); box-shadow: 0 6px 18px rgba(170,10,28,.18); }
.public-page .public-promo-tag { color: #ffb0b6; background: rgba(225,29,46,.13); border-color: rgba(255,72,84,.3); }

/* El HTML usa public-gallery-v16 y public-footer-v16; se estilizan sus clases reales. */
.public-page .public-gallery-v16 { gap: clamp(14px, 2vw, 22px); }
.public-page .public-gallery-v16 .public-gallery-item {
    border-color: rgba(255,255,255,.11);
    border-radius: 17px;
    background: #151519;
    box-shadow: 0 14px 32px rgba(0,0,0,.20);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.public-page .public-gallery-v16 .public-gallery-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255,72,84,.42);
    box-shadow: 0 18px 38px rgba(0,0,0,.28);
}
.public-page .public-gallery-v16 .public-gallery-item img { background: #0a0a0d; }
.public-page .public-gallery-v16 .public-gallery-item > div { padding: 15px 17px 17px; }
.public-page .public-gallery-v16 .public-gallery-item small { color: #ff7780; }
.public-page .public-faq { border-color: rgba(255,255,255,.11); background: linear-gradient(145deg, #19191e, #111114); transition: border-color .2s ease, background .2s ease; }
.public-page .public-faq[open] { border-color: rgba(255,72,84,.38); background: #191519; }
.public-page .public-faq summary { color: #f4f2f5; }
.public-page .public-faq p { color: #bdbbc4; }
.public-page .public-contact {
    margin: 0;
    padding: clamp(42px, 6vw, 78px) clamp(20px, 7vw, 100px);
    border: 0;
    border-top: 1px solid rgba(255,53,69,.30);
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: radial-gradient(ellipse at 92% 25%, rgba(225,29,46,.20), transparent 38%), linear-gradient(115deg, #1a0b0e, #111114 65%);
}
.public-page .public-contact h2 { font-size: clamp(2.2rem, 4.6vw, 3.7rem); letter-spacing: -.04em; }
.public-page .public-contact p { color: #c0bdc5; }
.public-page .public-footer-v16 {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px 32px;
    align-items: center;
    padding: 32px clamp(20px, 7vw, 100px) 24px;
    background: #08080a;
    border-top: 1px solid rgba(255,255,255,.08);
}
.public-page .public-footer-v16 > div:first-child strong,
.public-page .public-footer-v16 > div:first-child span { display: block; }
.public-page .public-footer-v16 > div:first-child strong { color: #fff; font-size: 1.02rem; }
.public-page .public-footer-v16 > div:first-child span { margin-top: 6px; color: #88858e; }
.public-page .public-footer-v16 > div:nth-child(2) { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.public-page .public-footer-v16 a { color: #bdbac3; text-decoration: none; }
.public-page .public-footer-v16 a:hover { color: #ff5964; }
.public-page .public-footer-v16 small { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.07); color: #77747c; }

@media (max-width: 900px) {
    .public-page .public-navbar { align-items: center; }
    .public-page .public-hero-v16 { min-height: auto; }
    .public-page .public-hero-v16::after { right: -130px; opacity: .65; }
    .public-page .public-footer-v16 { grid-template-columns: 1fr; }
    .public-page .public-footer-v16 small { grid-column: 1; }
}
@media (max-width: 760px) {
    .public-page .public-navbar { align-items: flex-start; }
    .public-page .public-navbar nav { gap: 5px; }
    .public-page .public-navbar nav a { padding: 8px 10px; }
    .public-page .public-hero-v16 { padding-top: 58px; padding-bottom: 54px; }
    .public-page .public-hero-v16::after { width: 240px; right: -145px; top: 26%; opacity: .4; }
    .public-page .public-hero h1 { font-size: clamp(2.7rem, 11vw, 4.4rem); }
    .public-page .public-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .public-page .public-hero-stats > div { min-width: 0; padding: 12px 8px; }
    .public-page .public-hero-stats span { font-size: .68rem; }
}
@media (max-width: 480px) {
    .public-page .public-hero-stats { gap: 7px; }
    .public-page .public-hero-stats strong { font-size: 1.2rem; }
    .public-page .public-hero-actions .btn, .public-page .public-contact-actions .btn { width: 100%; }
    .public-page .public-footer-v16 > div:nth-child(2) { gap: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .public-page .public-gallery-v16 .public-gallery-item:hover,
    .public-page .public-card:hover,
    .public-page .public-feature:hover { transform: none; }
}
/* ============================================================
   PANEL ADMINISTRATIVO — NOTIFICACIONES COMPACTAS Y PLEGABLES
   ============================================================ */
#notificaciones-admin {
    background: #141416;
    border: 1px solid #29292d;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm, 0 4px 14px rgba(0, 0, 0, 0.2));
    margin: 14px 0 18px;
}

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

.notif-admin-top h2 {
    text-align: left;
    margin: 0 0 2px;
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-count-badge {
    background: #d71920;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.2;
}

.btn-notif-action {
    width: auto !important;
    margin: 0 !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: #cfcfd8 !important;
    border: 1px solid #3c3c44 !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
}

.btn-notif-action:hover {
    background: rgba(208, 0, 0, 0.18) !important;
    border-color: #d71920 !important;
    color: #fff !important;
}

#notificaciones-admin .small {
    margin: 0;
    color: #8f8f99;
    font-size: 12px;
}

/* Lista con scroll vertical limpio */
#notificaciones-admin #listaNotificacionesAdmin,
.notifications-admin-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    grid-template-columns: none !important;
    margin: 8px 0 !important;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(208, 0, 0, 0.45) rgba(255, 255, 255, 0.04);
}

#notificaciones-admin #listaNotificacionesAdmin::-webkit-scrollbar {
    width: 5px;
}
#notificaciones-admin #listaNotificacionesAdmin::-webkit-scrollbar-thumb {
    background: rgba(208, 0, 0, 0.45);
    border-radius: 4px;
}

/* Tarjeta individual de notificación (colapsada) */
#notificaciones-admin #listaNotificacionesAdmin > *,
.notifications-admin-list > * {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    width: 100% !important;
    min-height: auto !important;
    padding: 8px 14px !important;
    background: #18181c !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-left: 3px solid #3e3e46 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s ease, border-color 0.18s ease !important;
    text-align: left !important;
}

/* Diferenciación visual no leída / leída */
#notificaciones-admin #listaNotificacionesAdmin > *.no-leida {
    border-left-color: #ff2a2a !important;
    background: #1d1b22 !important;
}
#notificaciones-admin #listaNotificacionesAdmin > *.no-leida .notif-status-dot {
    background: #ff2a2a;
    box-shadow: 0 0 6px #ff2a2a;
}

#notificaciones-admin #listaNotificacionesAdmin > *.leida {
    border-left-color: #3e3e46 !important;
    opacity: 0.82;
}
#notificaciones-admin #listaNotificacionesAdmin > *.leida .notif-status-dot {
    background: #555;
}

#notificaciones-admin #listaNotificacionesAdmin > *:hover {
    background: #212128 !important;
    border-color: rgba(255, 65, 72, 0.35) !important;
    opacity: 1 !important;
}

/* Fila 1: Cabecera con Título a la izquierda y Fecha a la derecha */
.notif-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.notif-title-group {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.notif-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.notif-title-text {
    font-size: 13px !important;
    font-weight: 750 !important;
    color: #ff4a50 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-meta-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.notif-date-text {
    font-size: 11px !important;
    color: #888894 !important;
    white-space: nowrap;
}

.notif-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Fila 2: Mensaje en 1 sola línea (resumido por defecto) */
.notif-row-content {
    width: 100%;
}

.notif-message-text {
    margin: 0 !important;
    font-size: 12px !important;
    color: #adadb6 !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.notif-actions-bar {
    display: none;
    margin-top: 8px;
}

/* ============================================================
   ESTADO EXPANDIDO (AL HACER CLIC O PASAR EL MOUSE)
   ============================================================ */
#notificaciones-admin #listaNotificacionesAdmin > *.is-open,
#notificaciones-admin #listaNotificacionesAdmin > *:hover {
    padding: 11px 15px !important;
    border-left-color: #ff2a2a !important;
    background: #22222a !important;
}

#notificaciones-admin #listaNotificacionesAdmin > *.is-open .notif-arrow,
#notificaciones-admin #listaNotificacionesAdmin > *:hover .notif-arrow {
    transform: rotate(180deg);
    color: #ff4a50;
}

/* Al expandir, el mensaje se muestra entero */
#notificaciones-admin #listaNotificacionesAdmin > *.is-open .notif-message-text,
#notificaciones-admin #listaNotificacionesAdmin > *:hover .notif-message-text {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    color: #e4e4ea !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    margin-top: 3px !important;
}

/* Al expandir, se muestra el botón de comprobante */
#notificaciones-admin #listaNotificacionesAdmin > *.is-open .notif-actions-bar,
#notificaciones-admin #listaNotificacionesAdmin > *:hover .notif-actions-bar {
    display: flex !important;
}

.notif-comprobante-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #2b1417;
    color: #ff6b70 !important;
    border: 1px solid #6b1f24;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
}

.notif-comprobante-btn:hover {
    background: #d71920;
    color: #fff !important;
    border-color: #ff3b3b;
    transform: translateY(-1px);
}
/* ============================================================
   PANEL ADMINISTRATIVO — GENERADOR DE CUOTAS
   ============================================================ */
.cuotas-generator-card {
    background: linear-gradient(145deg, #18181c, #131316);
    border: 1px solid #303038;
    border-top: 3px solid var(--brand, #d71920);
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: var(--shadow-sm, 0 6px 18px rgba(0, 0, 0, 0.2));
}

.cuotas-generator-head h2 {
    text-align: left;
    margin: 2px 0 4px;
    color: #fff;
    font-size: 1.25rem;
}

.cuotas-generator-head .small {
    margin: 0 0 14px;
    color: #a0a0a8;
    font-size: 12.5px;
}

.cuotas-generator-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.cuotas-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 140px;
}

.cuotas-field label {
    font-size: 11.5px;
    font-weight: 700;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin: 0;
}

.cuotas-field select,
.cuotas-field input {
    min-height: 40px;
    padding: 8px 11px;
    background: #202026;
    color: #fff;
    border: 1px solid #404048;
    border-radius: 8px;
    font-size: 13.5px;
}

.cuotas-field select:focus,
.cuotas-field input:focus {
    border-color: #d71920;
    outline: none;
}

.cuotas-field-action {
    flex: 1 1 200px;
}

.btn-cuotas-submit {
    width: 100% !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 9px 16px !important;
    background: linear-gradient(135deg, #d71920, #9a0d13) !important;
    border: 1px solid #ff4a50 !important;
    color: #fff !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(215, 25, 32, 0.25);
    transition: all 0.2s ease !important;
}

.btn-cuotas-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff2a32, #b81017) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(215, 25, 32, 0.35);
}

.btn-cuotas-submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* Caja de respuesta / feedback */
.cuotas-feedback {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.cuotas-feedback.success {
    background: rgba(30, 140, 60, 0.15);
    border: 1px solid rgba(45, 180, 80, 0.4);
    color: #98f0af;
}

.cuotas-feedback.error {
    background: rgba(200, 30, 30, 0.15);
    border: 1px solid rgba(220, 50, 50, 0.4);
    color: #ff9b9b;
}

@media (max-width: 768px) {
    .cuotas-generator-form {
        flex-direction: column;
        align-items: stretch;
    }
    .cuotas-field, .cuotas-field-action {
        width: 100%;
        flex: none;
    }
}
/* ============================================================
   1. UNIFICACIÓN GLOBAL DE INPUTS Y FORMULARIOS (DARK VILAMIR)
   ============================================================ */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
select,
textarea,
.input,
.select,
.textarea {
    background-color: #18181b !important;
    border: 1px solid #333339 !important;
    color: #f4f4f5 !important;
    border-radius: 9px !important;
    padding: 10px 13px !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus,
select:focus,
textarea:focus,
.input:focus {
    outline: none !important;
    border-color: #d71920 !important;
    box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.22) !important;
    background-color: #1f1f24 !important;
}

select option {
    background-color: #18181b !important;
    color: #f4f4f5 !important;
}

input::placeholder,
textarea::placeholder {
    color: #7e7e88 !important;
}

label {
    color: #dedee4 !important;
    font-weight: 650;
}

/* Filas de asistencia en modo oscuro coherente */
.attendance-row {
    background: #19191d !important;
    color: #f4f4f5 !important;
    border: 1px solid #2d2d33 !important;
    border-radius: 10px !important;
}
.attendance-row strong {
    color: #fff !important;
}

/* ============================================================
   2. SISTEMA DE TOASTS FLOTANTES
   ============================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(22, 22, 26, 0.96);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color: #f5f5f5;
    font-size: 13px;
    line-height: 1.45;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-item.toast-success {
    border-left: 4px solid #39d98a;
}
.toast-item.toast-error {
    border-left: 4px solid #d71920;
}
.toast-item.toast-info {
    border-left: 4px solid #ffc857;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}
.toast-success .toast-icon { color: #39d98a; }
.toast-error .toast-icon { color: #ff4a50; }
.toast-info .toast-icon { color: #ffc857; }

.toast-close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    margin: 0;
    width: auto;
    line-height: 1;
}
.toast-close:hover {
    color: #fff;
}

.toast-item.toast-fadeout {
    opacity: 0;
    transform: translateX(30px);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   3. BOTONES DE ASISTENCIA RÁPIDA (DOCENTE)
   ============================================================ */
.attendance-quick-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 14px;
    padding: 10px 14px;
    background: #17171b;
    border: 1px solid #2e2e34;
    border-radius: 10px;
}

.attendance-quick-actions span {
    font-size: 12px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.btn-quick-attendance {
    width: auto !important;
    margin: 0 !important;
    padding: 6px 13px !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    background: rgba(208, 0, 0, 0.15) !important;
    border: 1px solid #d71920 !important;
    color: #ff6b70 !important;
    border-radius: 7px !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
}

.btn-quick-attendance:hover {
    background: #d71920 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-quick-attendance.secondary {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #444 !important;
    color: #ccc !important;
}

.btn-quick-attendance.secondary:hover {
    background: #333 !important;
    color: #fff !important;
}
/* ============================================================
   BOTÓN CONFIRMAR PAGO Y MODAL FLOTANTE
   ============================================================ */
.btn-confirmar-pago {
    background: linear-gradient(135deg, #177332, #0f4f21) !important;
    border: 1px solid #28a745 !important;
    color: #fff !important;
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    margin-right: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.2s ease !important;
}

.btn-confirmar-pago:hover {
    background: linear-gradient(135deg, #218838, #156529) !important;
    border-color: #34ce57 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35) !important;
}

/* Modal Emergente */
.modal-vilamir-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-vilamir-card {
    background: #18181c;
    border: 1px solid #383842;
    border-top: 3px solid #28a745;
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    padding: 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    color: #fff;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-vilamir-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.modal-vilamir-head h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #39d98a;
}

.modal-vilamir-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    margin: 0;
    width: auto;
    padding: 0 4px;
}

.modal-vilamir-close:hover { color: #fff; }

.modal-info-pago {
    background: #121215;
    border: 1px solid #2a2a30;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 14px;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.modal-field label {
    font-size: 12px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
}

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

.modal-actions button {
    width: auto !important;
    margin: 0 !important;
}

.btn-confirmar-submit {
    background: linear-gradient(135deg, #177332, #0f4f21) !important;
    border: 1px solid #28a745 !important;
    color: #fff !important;
}

.btn-confirmar-submit:hover {
    background: linear-gradient(135deg, #218838, #156529) !important;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
/* ============================================================
   PORTAL DEL TUTOR / PADRES
   ============================================================ */
.tutor-search-panel {
    background: #141416;
    border: 1px solid #2d2d33;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
}

.tutor-search-form {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tutor-search-form input {
    flex: 1 1 250px;
    min-height: 44px;
    font-size: 15px;
}

.tutor-search-form button {
    flex: 0 0 auto;
    width: auto !important;
    margin: 0 !important;
    min-height: 44px;
    padding: 10px 20px;
}

.tutor-student-card {
    background: linear-gradient(145deg, #18181c, #121215);
    border: 1px solid #303038;
    border-top: 3px solid var(--brand, #d71920);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25);
}

.tutor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tutor-kpis {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tutor-kpi {
    background: #121215;
    border: 1px solid #28282e;
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 140px;
}

.tutor-kpi span {
    display: block;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

.tutor-kpi strong {
    display: block;
    font-size: 18px;
    color: #fff;
    margin: 2px 0;
}

.tutor-kpi.warning strong { color: #ffd166; }
.tutor-kpi.success strong { color: #39d98a; }
.tutor-kpi small { font-size: 11px; color: #aaa; }

.tutor-groups-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tutor-group-pill {
    background: #202026;
    border: 1px solid #383842;
    border-radius: 8px;
    padding: 8px 12px;
}

.tutor-group-pill strong { display: block; font-size: 13px; color: #ff5258; }
.tutor-group-pill small { display: block; font-size: 11.5px; color: #bbb; }

.tutor-payments-wrap, .tutor-attendance-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.tutor-payment-row, .tutor-attendance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #121215;
    border: 1px solid #28282e;
    border-radius: 8px;
}

.tutor-payment-row strong, .tutor-attendance-row strong {
    display: block;
    font-size: 13px;
    color: #f0f0f5;
}

.tutor-payment-row small, .tutor-attendance-row small {
    display: block;
    font-size: 11px;
    color: #888;
}

.tutor-payment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tutor-btn-comprobante {
    font-size: 11.5px;
    color: #39d98a;
    text-decoration: underline;
    font-weight: 700;
}

.tutor-btn-whatsapp-pago {
    font-size: 11.5px;
    color: #25d366;
    text-decoration: none;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 6px;
}

.tutor-btn-whatsapp-pago:hover {
    background: #25d366;
    color: #fff;
}
/* ============================================================
   TARJETAS DE PRECIOS Y PROMOCIONES VILAMIR (RN-06 / TC-05)
   ============================================================ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    max-width: 1240px;
    margin: 30px auto 0;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    background: linear-gradient(155deg, #1b1b20, #111114 80%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: rgba(208, 0, 0, 0.45);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

/* Tarjeta destacada (2 Disciplinas) */
.pricing-card.featured {
    border: 2px solid #d71920;
    background: linear-gradient(155deg, #241416, #140d0e 85%);
    box-shadow: 0 14px 35px rgba(215, 25, 32, 0.2);
    transform: scale(1.02);
}

.pricing-card.featured:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 20px 42px rgba(215, 25, 32, 0.32);
}

.pricing-badge-popular {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #d71920, #900000);
    color: #fff;
    font-size: 11px;
    font-weight: 850;
    padding: 4px 14px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    border: 1px solid #ff4a50;
    white-space: nowrap;
}

/* Tarjeta Pase Libre */
.pricing-card.vip {
    border-top: 3px solid #ffc857;
}

.pricing-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #aaa;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
}

.vip-tag {
    color: #ffc857;
    background: rgba(255, 200, 87, 0.12);
    border: 1px solid rgba(255, 200, 87, 0.3);
}

.pricing-card h3 {
    font-size: 1.4rem;
    color: #fff;
    margin: 0 0 6px;
}

.pricing-desc {
    color: #a0a0a8;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
    min-height: 40px;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.pricing-price strong {
    font-size: 2.3rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.pricing-price span {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.pricing-savings {
    display: inline-block;
    color: #39d98a;
    background: rgba(57, 217, 138, 0.1);
    border: 1px solid rgba(57, 217, 138, 0.25);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 750;
    margin-bottom: 16px;
    align-self: flex-start;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 18px;
    flex-grow: 1;
}

.pricing-features li {
    font-size: 13px;
    color: #d1d1d8;
    line-height: 1.45;
}

.pricing-features li strong {
    color: #fff;
}

.btn-pricing {
    width: 100% !important;
    text-align: center;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 12px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    text-decoration: none;
    margin-top: auto;
}

.btn-pricing:hover {
    background: #d71920 !important;
    border-color: #ff3b3b !important;
}

.btn-featured {
    background: linear-gradient(135deg, #d71920, #900000) !important;
    border-color: #ff4a50 !important;
}

.btn-featured:hover {
    background: linear-gradient(135deg, #ff2a32, #b81017) !important;
}

.btn-vip {
    background: linear-gradient(135deg, #b8860b, #7a5800) !important;
    border-color: #ffd700 !important;
    color: #fff !important;
}

.btn-vip:hover {
    background: linear-gradient(135deg, #daa520, #996515) !important;
}

@media (max-width: 900px) {
    .pricing-card.featured {
        transform: none;
    }
    .pricing-card.featured:hover {
        transform: translateY(-5px);
    }
}

/* VILAMIR unificado: tablas desplazables sin desbordar la pantalla. */
.vilamir-table-scroll,
.table-wrap,
.table-responsive,
.table-wrapper,
.table-container {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.vilamir-table-scroll table,
.table-wrap table,
.table-responsive table,
.table-wrapper table,
.table-container table {
    width: max-content;
    min-width: 100%;
    max-width: none;
}
@media (max-width: 768px) {
    .vilamir-table-scroll,
    .table-wrap,
    .table-responsive,
    .table-wrapper,
    .table-container {
        scrollbar-width: thin;
        touch-action: pan-x pan-y;
    }
    body, main, .admin, .module { min-width: 0; }
}


/* Precio mensual visible en las tarjetas de promociones */
.promo-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 8px 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    background: rgba(0,0,0,.18);
}
.promo-price span { color: #d0d0d0; font-size: 13px; }
.promo-price strong { color: #fff; font-size: 24px; font-weight: 900; }

/* Presentación renovada del QR del alumno en su portal */
body.portal-page .account-qr {
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 22px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(35,20,22,.78), rgba(18,18,22,.96));
    text-align: center;
}
body.portal-page .account-qr > div:first-child { flex: 1 1 220px; }
body.portal-page .account-qr h3 { color: #fff; font-size: 1.2rem; }
body.portal-page .account-qr p { max-width: 340px; margin-left: auto; margin-right: auto; line-height: 1.55; }
body.portal-page .account-qr #qrAlumno {
    flex: 0 0 auto;
    width: 178px;
    min-width: 178px;
    min-height: 178px;
    padding: 12px;
    border-radius: 15px;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
body.portal-page .account-qr #qrAlumno img,
body.portal-page .account-qr #qrAlumno canvas { width: 154px!important; height: 154px!important; display:block; }
body.portal-page .account-qr > a { margin: 5px; }
@media(max-width:600px){body.portal-page .account-qr{flex-direction:column;gap:13px}body.portal-page .account-qr #qrAlumno{margin:0 auto}}
