/* Estilos generales */
body {
    font-family: 'Arial', sans-serif;
    background-color: #F5F5F5;
    margin: 0;
    padding: 0;
}

/* HEADER */
header .navbar {
    background-color: #b51313;
    font-family: 'Arial', sans-serif;
}

header .navbar-brand {
    font-size: 1.5rem;
    color: #FFF;
}

header .navbar-brand img {
    width: 50px;
    margin-right: 10px;
}

/* CARRUSEL */
.carousel-section {
    margin-top: 20px;
}

.carousel-inner img {
    object-fit: cover;
    height: 500px;
}

/* ICONOS CREATIVOS */
.icon-box {
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.icon-box i {
    margin-bottom: 15px;
}

/* Video interactivo */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* FOOTER */
footer {
    background-color: #EAE3D8;
    color: #777;
    padding: 20px;
}

.site-footer .text-muted-custom {
    margin: 0;
    font-size: .78rem;
}

/* Sección Principal */
h1 {
    color: #9A3434;
}

/* Responsividad */
@media (max-width: 767px) {
    .carousel-inner img {
        height: 300px;
    }

    header .navbar-brand {
        font-size: 1.2rem;
    }

    .icon-box {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .carousel-inner img {
        height: 250px;
    }

    .icon-box {
        margin-bottom: 20px;
    }
}

/* HEADER */
header .navbar {
    background-color: #800101;
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.98%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

header .navbar-brand {
    font-size: 1.5rem;
    color: #FFF;
    display: flex;
    align-items: center;
}

header .navbar-brand img {
    width: 50px;
    margin-left: 10px;
    /* Ajusta el logo a la esquina izquierda */
}

header .navbar-brand span {
    margin-left: 10px;
    /* Separación entre logo y texto */
}

header .navbar .d-flex {
    margin-left: auto;
    /* Alinea los botones a la derecha */
}

header .btn-light {
    color: #800101;
    border: 2px solid #800101;
    transition: all 0.3s ease;
}

header .btn-light:hover {
    background-color: #800101;
    color: #FFF;
}

/* HEADER */
header .navbar {
    background-color: #800101;
}

header .navbar-brand {
    font-size: 1.5rem;
    color: #FFF;
    display: flex;
    align-items: center;
}

header .navbar-brand img {
    width: 50px;
    margin-left: 10px;
    /* Ajusta el logo a la esquina izquierda */
}

header .navbar-brand span {
    margin-left: 10px;
    /* Separación entre logo y texto */
}

/* Para pantallas pequeñas, el texto del título no se muestra */
header .navbar .navbar-brand span.d-none.d-lg-inline {
    display: inline-block;
    /* Muestra el título en pantallas grandes */
}

header .navbar .d-flex {
    margin-left: auto;
    /* Alinea los botones a la derecha */
}

header .btn-light {
    color: #800101;
    border: 2px solid #800101;
    transition: all 0.3s ease;
}

header .btn-light:hover {
    background-color: #800101;
    color: #FFF;
}

/* Estilos para la navegación en dispositivos móviles */
@media (max-width: 991px) {
    header .navbar-brand {
        font-size: 1.2rem;
        /* Ajusta el tamaño del logo y texto en móviles */
    }

    header .navbar-nav {
        text-align: center;
        /* Centra los botones en dispositivos móviles */
    }

    header .navbar-toggler {
        border-color: #FFF;
    }

    header .navbar-toggler-icon {
        background-image: var(--bs-navbar-toggler-icon-bg) !important;
        background-color: transparent !important;
        background-size: 100% 100%;
        width: 1.35em;
        height: 1.35em;
    }
}

.btn-rojo {
    background-color: #b51313 !important;
    /* Rojo elegante */
    border-color: #b71c1c !important;
    /* Rojo oscuro */
    color: rgb(252, 250, 250) !important;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    /* Bordes redondeados */
    transition: all 0.3s ease-in-out;
}

.btn-rojo:hover {
    background-color: #b71c1c !important;
    /* Rojo más oscuro al pasar el mouse */
    border-color: #9a0007 !important;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    padding: 10px;
    text-align: center;
}

th {
    background-color: #8B0000;
    /* Rojo vino */
    color: white;
    font-weight: bold;
}

td {
    background-color: #f9f9f9;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
    /* Color gris claro para filas alternas */
}

tr:hover {
    background-color: #ffcccc;
    /* Resaltar cuando se pasa el mouse sobre una fila */
}

/* index.html: estilos movidos desde atributos inline */
.hero-title,
.section-title,
.feature-title {
    color: #9A3434;
}

.feature-icon {
    font-size: 50px;
    color: #800101;
}

.text-muted-custom {
    color: #777;
}

header .navbar-brand img {
    margin-right: 0;
}

/* Header template */
.header-brand-title {
    font-family: Helvetica, sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
}

/* Landing carousel effects (index.php) */
.landing-carousel {
    position: relative;
    overflow: hidden;
    height: 600px;
}

.landing-carousel .carousel-inner img {
    transition: transform 1s ease;
}

.landing-carousel .carousel-inner img:hover {
    transform: scale(1.05);
    opacity: 0.85;
}

.landing-carousel .carousel-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    transition: opacity 0.5s ease;
}

.landing-carousel .carousel-title {
    font-size: 2.5rem;
    font-weight: bold;
    animation: slideInLeft 1s ease;
}

.landing-carousel .carousel-description {
    font-size: 1.25rem;
    animation: slideInRight 1s ease;
}

.landing-carousel .carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
    z-index: 2;
    pointer-events: none;
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.landing-carousel .carousel-control-prev-icon,
.landing-carousel .carousel-control-next-icon {
    background-color: #9A3434;
    border-radius: 50%;
    padding: 15px;
}

.landing-carousel .carousel-control-prev-icon:hover,
.landing-carousel .carousel-control-next-icon:hover {
    background-color: #800101;
    transform: scale(1.1);
}

/* Incidentes pages */
.incidentes-page .accordion-button {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.incidentes-page .accordion-button:hover {
    transform: scale(1.05);
    background-color: #F39200 !important;
}

.incidentes-page .accordion-item {
    border-left: 5px solid #F39200;
    transition: box-shadow 0.3s ease;
}

.incidentes-page .accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.incidentes-page .accordion-header {
    padding: 1rem;
}

.incidentes-page .accordion-body {
    background-color: #F8B688;
    color: #511013;
    font-weight: bold;
}

.incidentes-page .badge {
    font-size: 0.9rem;
    font-weight: bold;
}

.incidentes-page .accordion-button.collapsed {
    background-color: #F8B688 !important;
}

/* Admin dashboard page */
.admin-title {
    color: #B91116;
}

.admin-dashboard .list-group-item {
    font-size: 18px;
    padding: 15px;
    border: none;
    background: #f8f9fa;
    transition: background 0.3s ease;
}

.admin-dashboard .list-group-item:hover {
    background: #E24622;
    color: white;
}

.admin-dashboard .list-group-item i {
    color: #B91116;
}

.admin-dashboard canvas {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Mapa del aula */
.mapa-aula-page svg {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border: 2px solid #333;
    background: #f5f5f5;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.mapa-aula-page .banca {
    fill: #c49b63;
    stroke: #6b4f2b;
    stroke-width: 2;
    cursor: pointer;
    transition: transform 0.2s;
}

.mapa-aula-page .banca:hover {
    transform: scale(1.05);
}

.mapa-aula-page .mesa {
    fill: #34495e;
    stroke: #222;
    stroke-width: 2;
    cursor: pointer;
}

.mapa-aula-page .pizarron {
    fill: #2c3e50;
    stroke: #000;
    stroke-width: 2;
    cursor: pointer;
}

.mapa-aula-page svg text {
    pointer-events: none;
    font-weight: bold;
    fill: #fff;
    font-size: 14px;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Modificar información */
.modify-profile-page {
    padding: 20px;
    overflow-x: auto;
}

.modify-profile-title {
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: bold;
}

.modify-profile-page .form-control {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.btnos {
    background-color: rgb(243, 180, 113);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
}

.btnos:hover {
    background-color: rgb(218, 203, 130);
}

.modify-profile-page .alert {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.modify-profile-page .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.modify-profile-page .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Product cards */
.vista-previa-card {
    max-width: 1540px;
}

.producto-card {
    width: 15rem;
}

/* Shared nav templates */
.portal-nav {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.portal-nav .portal-nav-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    color: #fff !important;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 25px;
    padding: 12px 28px;
    font-size: 16px;
}

.portal-nav .portal-nav-btn:hover {
    background: #c0392b !important;
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portal-nav .hover-transform:hover {
    transform: scale(1.05) rotate(2deg);
    transition: all 0.4s ease-in-out;
}

.portal-nav .transition-transform {
    transition: all 0.3s ease;
}

.portal-nav .nav-link i {
    font-size: 20px;
}

.portal-nav .navbar-nav .nav-item:hover {
    transform: translateY(-5px);
    transition: transform 0.2s ease-out;
}

/* Modern nav for admin/docente panels */
.portal-nav-modern {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 8px 14px;
}

.portal-nav-title {
    color: #800101;
    font-weight: 700;
    font-size: 1rem;
}

.portal-nav-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
}

.portal-nav-user-badge {
    max-width: 100%;
    white-space: normal;
    text-align: left;
}

.portal-nav-links {
    gap: 4px;
}

.portal-nav-links .nav-link {
    color: #4b4b4b;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    transition: background-color .2s ease, color .2s ease;
}

.portal-nav-links .nav-link:hover {
    background: rgba(128, 1, 1, 0.08);
    color: #800101;
}

.portal-nav-links .nav-link.nav-link-exit {
    color: #800101;
}

.portal-nav-toggler {
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    padding: 4px 8px;
}

.portal-notif-badge {
    position: absolute;
    top: 2px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #b51313;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    font-weight: 700;
}

@media (max-width: 991px) {
    .portal-nav-links {
        margin-top: 10px;
    }

    .portal-nav-modern .container-fluid {
        row-gap: 0.65rem;
    }

    .portal-nav-head {
        flex: 1 1 auto;
        align-items: flex-start;
        padding-right: 0.4rem;
    }

    .portal-nav-user-badge {
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .portal-nav-links .nav-link {
        padding: 10px 12px;
    }
}

/* Global responsive hardening */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video {
    max-width: 100%;
    height: auto;
}

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

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991px) {
    .portal-nav-title {
        font-size: 0.92rem;
    }

    .portal-nav-modern {
        padding: 6px 10px;
    }

    .portal-nav-links .nav-link {
        font-size: 0.92rem;
    }
}

@media (max-width: 768px) {
    .container,
    .container-md,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .table-responsive > table,
    .table-responsive > .table {
        width: max-content;
        min-width: 100%;
    }

    .table-responsive th,
    .table-responsive td {
        font-size: 0.86rem;
        padding: 0.45rem 0.5rem;
        white-space: nowrap;
        vertical-align: middle;
    }

    .btn {
        white-space: normal;
    }

    .mapa-equipos,
    .mapa-grid-denso {
        max-width: 100%;
        overflow: auto;
    }
}

@media (max-width: 576px) {
    header .navbar-brand img {
        width: 42px;
    }

    .portal-nav-title {
        font-size: 0.92rem;
    }

    .portal-nav-head {
        gap: 0.35rem;
    }

    .portal-nav-user-badge {
        font-size: 0.72rem;
    }

    .portal-nav-modern {
        border-radius: 10px;
    }

    .portal-notif-badge {
        right: -2px;
    }
}

/* Admin panel polish */
.admin-panel {
    background: linear-gradient(180deg, #fff 0%, #f6f7fb 100%);
    border-radius: 16px;
    padding: 24px;
}

.admin-kpi-card {
    border-left: 6px solid #8b0000 !important;
    transition: transform .2s ease, box-shadow .2s ease;
}

.admin-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12) !important;
}

.admin-kpi-card.urgent {
    border-left-color: #dc3545 !important;
}

.admin-chart-card {
    border-radius: 12px;
    transition: box-shadow .2s ease;
}

.admin-chart-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, .10) !important;
}

.historial-tiempo-titulo {
    color: #212529;
}

.tabla-tiempo-respuesta {
    --bs-table-bg: #ffffff;
    --bs-table-color: #1f2937;
    --bs-table-hover-bg: #f3f6fa;
    --bs-table-hover-color: #111827;
}

.tabla-tiempo-respuesta > :not(caption) > * > th {
    background-color: #8b0000 !important;
    color: #ffffff !important;
    border-color: #730000 !important;
    --bs-table-bg-type: #8b0000;
    --bs-table-accent-bg: #8b0000;
    --bs-table-color-state: #ffffff;
}

.tabla-tiempo-respuesta thead tr:hover th {
    background-color: #8b0000 !important;
    color: #ffffff !important;
}

/* Mapa visual docente: nodos SVG */
.mapa-equipos {
    background:
        linear-gradient(180deg, #f9fafc 0%, #f2f5fa 100%);
    overflow: auto;
}

.mapa-equipos.mapa-denso {
    max-height: none;
}

.equipo-node {
    width: 82px;
    min-height: 62px;
    position: relative;
    border: 2px solid #198754;
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px;
    color: #2d3436;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
    overflow: hidden;
}

.equipo-node,
.equipo-node:visited {
    color: #2d3436;
    text-decoration: none;
}

.equipo-node:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 14px rgba(0, 0, 0, .16);
}

.equipo-node svg {
    width: 34px;
    height: 30px;
    position: relative;
    z-index: 1;
}

.equipo-node span {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.equipo-node .equipo-count {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #111827;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-style: normal;
    font-weight: 700;
    padding: 0 4px;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.equipo-node .svg-fill {
    fill: #394b59;
}

.equipo-node .svg-screen {
    fill: #8fc7ff;
}

.equipo-node.tipo-tv .svg-fill {
    fill: #4d5c67;
}

.equipo-node.tipo-docente .svg-fill {
    fill: #37474f;
}

.equipo-node.tipo-encargado .svg-fill {
    fill: #5f4b8b;
}

.equipo-node.tipo-aula .svg-fill {
    fill: #8a5a24;
}

.equipo-node.tipo-aula .svg-screen {
    fill: #f6d365;
}

.equipo-node.estado-ok {
    border-color: #198754;
    background: #f2fff7;
}

.equipo-node.estado-atencion {
    border-color: #fd7e14;
    background: #fff8ef;
    box-shadow: 0 0 0 1px rgba(253, 126, 20, .25), 0 4px 10px rgba(253, 126, 20, .16);
}

.equipo-node.estado-leve {
    border-color: #0d6efd;
    background: #eef5ff;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, .25), 0 4px 10px rgba(13, 110, 253, .16);
}

.equipo-node.estado-urgente {
    border-color: #dc3545;
    background: #fff1f2;
    animation: pulseUrgente 1.6s infinite;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, .28), 0 6px 14px rgba(220, 53, 69, .24);
}

.equipo-node.is-selected {
    outline: 3px solid #1f2937;
    box-shadow: 0 0 0 4px rgba(31, 41, 55, .18);
}

.mapa-equipos.mapa-denso .equipo-node {
    width: 64px;
    min-height: 48px;
    border-radius: 8px;
    padding: 2px;
}

.mapa-equipos.mapa-denso .equipo-node svg {
    width: 24px;
    height: 22px;
}

.mapa-equipos.mapa-denso .equipo-node span {
    font-size: 8px;
}

.mapa-seccion {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    padding: 8px;
}

.mapa-seccion-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: #334e68;
    margin-bottom: 8px;
}

.mapa-seccion-badge {
    background: #334e68;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.2;
}

.mapa-grid-denso {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    align-items: start;
    align-content: start;
    padding: 6px;
}

.mapa-grid-denso .equipo-node {
    position: static !important;
    width: 100% !important;
    min-height: 58px;
}

.mapa-grid-control {
    grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
}

.mapa-grid-control .equipo-node {
    min-height: 64px;
}

.mapa-grid-trabajo {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

@media (max-width: 768px) {
    .mapa-grid-denso {
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
        gap: 8px;
    }
}

.mapa-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #4a5568;
}

.mapa-leyenda .punto {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

.mapa-leyenda .punto.ok {
    background: #198754;
}

.mapa-leyenda .punto.atencion {
    background: #fd7e14;
}

.mapa-leyenda .punto.leve {
    background: #0d6efd;
}

.mapa-leyenda .punto.urgente {
    background: #dc3545;
}

.reportes-recientes-card .card-body {
    padding: 1.35rem 1.45rem;
}

.reportes-recientes-table {
    min-width: 780px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #e5e9ef;
    border-radius: 10px;
    --bs-table-bg: #ffffff;
    --bs-table-striped-bg: #f7f9fc;
    --bs-table-hover-bg: #fff4f4;
}

.reportes-recientes-table thead th {
    background: #8b0000 !important;
    color: #ffffff !important;
    border: 0;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .8rem .9rem;
    white-space: nowrap;
}

.reportes-recientes-table tbody td {
    border-color: #e8edf3;
    padding: .78rem .9rem;
    vertical-align: middle;
}

.reportes-recientes-table tbody tr:hover > * {
    background: #fff4f4;
}

.reportes-recientes-equipo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: .25rem .5rem;
    border-radius: 999px;
    background: #f2f4f7;
    color: #253241;
    font-weight: 700;
}

.reportes-recientes-titulo {
    max-width: 380px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes pulseUrgente {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.35); }
    70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Theme toggle (global) */
.theme-toggle-btn {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 1400;
    width: 42px;
    height: 42px;
    border: 1px solid #c9c9c9;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #4a4a4a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.theme-toggle-btn i {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .theme-toggle-btn {
        width: 38px;
        height: 38px;
        right: 10px;
        bottom: 10px;
    }
}

/* Dark mode */
html[data-theme="dark"] body {
    background-color: #121821;
    color: #eaf1f8;
}

html[data-theme="dark"] .theme-toggle-btn {
    background: rgba(22, 30, 40, 0.95);
    color: #f8d24b;
    border-color: #415a73;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-muted-custom {
    color: #9fb0c2 !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .homev2-card,
html[data-theme="dark"] .homev2-panel,
html[data-theme="dark"] .homev2-chip,
html[data-theme="dark"] .homev2-role-list li,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .portal-nav-modern,
html[data-theme="dark"] .mapa-seccion {
    background: #1a2330 !important;
    color: #eaf1f8 !important;
    border-color: #314456 !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-light-subtle,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .offcanvas {
    background-color: #172230 !important;
    color: #eaf1f8 !important;
    border-color: #314456 !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end {
    border-color: #334a61 !important;
}

html[data-theme="dark"] .mapa-equipos {
    background: linear-gradient(180deg, #131e2a 0%, #0f1823 100%) !important;
    border: 1px solid #314659;
}

html[data-theme="dark"] .mapa-seccion-titulo,
html[data-theme="dark"] .mapa-leyenda {
    color: #c8d8e9;
}

html[data-theme="dark"] .mapa-seccion-badge {
    background: #2b3f54;
    color: #eaf1f8;
}

html[data-theme="dark"] .reportes-recientes-table {
    border-color: #36506a;
    --bs-table-bg: #172230;
    --bs-table-striped-bg: #1e2b3b;
    --bs-table-hover-bg: #26374a;
    --bs-table-color: #eaf1f8;
}

html[data-theme="dark"] .reportes-recientes-table thead th {
    background: #0f1722 !important;
    color: #f6f9ff !important;
}

html[data-theme="dark"] .reportes-recientes-table tbody td {
    border-color: #36506a;
}

html[data-theme="dark"] .reportes-recientes-table tbody tr:hover > * {
    background: #26374a;
}

html[data-theme="dark"] .reportes-recientes-equipo {
    background: #24364a;
    color: #eaf1f8;
}

html[data-theme="dark"] .equipo-node {
    background: #1a2a38;
    color: #eaf1f8;
    border-color: #3b556e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .26);
}

html[data-theme="dark"] .equipo-node,
html[data-theme="dark"] .equipo-node:visited {
    color: #eaf1f8;
}

html[data-theme="dark"] .equipo-node .svg-fill {
    fill: #9bb2c7;
}

html[data-theme="dark"] .equipo-node .svg-screen {
    fill: #6eaee7;
}

html[data-theme="dark"] .equipo-node.estado-ok {
    border-color: #198754;
    background: #153327;
}

html[data-theme="dark"] .equipo-node.estado-atencion {
    border-color: #fd7e14;
    background: #3b2a18;
    box-shadow: 0 0 0 1px rgba(253, 126, 20, .35), 0 4px 12px rgba(253, 126, 20, .20);
}

html[data-theme="dark"] .equipo-node.estado-leve {
    border-color: #0d6efd;
    background: #182b46;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, .34), 0 4px 12px rgba(13, 110, 253, .20);
}

html[data-theme="dark"] .equipo-node.estado-urgente {
    border-color: #dc3545;
    background: #431c25;
}

html[data-theme="dark"] .table {
    color: #eaf1f8;
    --bs-table-bg: #172230;
    --bs-table-color: #eaf1f8;
    --bs-table-striped-bg: #1e2b3b;
    --bs-table-striped-color: #eaf1f8;
    --bs-table-hover-bg: #29384c;
    --bs-table-hover-color: #ffffff;
    --bs-table-border-color: #36506a;
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table-bordered > :not(caption) > * > * {
    border-color: #36506a;
}

html[data-theme="dark"] .tabla-tiempo-respuesta thead th {
    background-color: #27415b !important;
    color: #f5f9ff !important;
    border-color: #3b5c7d !important;
    --bs-table-bg-type: #27415b;
    --bs-table-accent-bg: #27415b;
    --bs-table-color-state: #f5f9ff;
}

html[data-theme="dark"] .historial-tiempo-titulo {
    color: #f3f7fc;
}

html[data-theme="dark"] .table-dark {
    --bs-table-bg: #0f1722;
    --bs-table-color: #f6f9ff;
    --bs-table-border-color: #36506a;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-check-input,
html[data-theme="dark"] .input-group-text {
    background-color: #121c28;
    color: #eaf1f8;
    border-color: #3b536d;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #8ea2b8;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: #121c28;
    color: #eaf1f8;
    border-color: #84a9cc;
    box-shadow: 0 0 0 .2rem rgba(132, 169, 204, .24);
}

html[data-theme="dark"] .btn-outline-secondary {
    color: #d6dde6;
    border-color: #607488;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background: #607488;
    color: #0f141a;
}

html[data-theme="dark"] .btn-outline-dark {
    color: #e1eaf4;
    border-color: #71879e;
}

html[data-theme="dark"] .btn-outline-dark:hover,
html[data-theme="dark"] .btn-outline-dark:focus {
    background: #e1eaf4;
    border-color: #e1eaf4;
    color: #111821;
}

html[data-theme="dark"] .badge.text-bg-light {
    background-color: #27384b !important;
    color: #ecf3fa !important;
    border-color: #43607c !important;
}

html[data-theme="dark"] .badge.text-bg-dark,
html[data-theme="dark"] .badge.bg-dark {
    background-color: #0b121c !important;
    color: #f3f7fc !important;
    border: 1px solid #314456;
}

html[data-theme="dark"] .page-link {
    background-color: #172230;
    border-color: #314456;
    color: #dce8f5;
}

html[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #111a25;
    border-color: #2b4058;
    color: #74879b;
}

html[data-theme="dark"] .alert-info {
    background-color: #1d3142;
    border-color: #2e4a61;
    color: #d2e5f6;
}

html[data-theme="dark"] .alert-warning {
    background-color: #463a18;
    border-color: #6b5723;
    color: #f9ebbd;
}

html[data-theme="dark"] .alert-success {
    background-color: #1a3a2e;
    border-color: #2d5d49;
    color: #d6f6e7;
}

html[data-theme="dark"] .alert-danger {
    background-color: #442229;
    border-color: #6f3641;
    color: #ffd9df;
}

html[data-theme="dark"] .carousel-overlay {
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.58));
}

html[data-theme="dark"] .portal-nav-modern {
    background: #1a2431 !important;
    border-color: #334a61 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .portal-nav-title {
    color: #ff6b6b;
}

html[data-theme="dark"] .portal-nav-links .nav-link {
    color: #e0e9f3;
}

html[data-theme="dark"] .portal-nav-links .nav-link:hover {
    background: rgba(181, 19, 19, 0.26);
    color: #ffffff;
}

html[data-theme="dark"] .portal-nav-links .nav-link.nav-link-exit {
    color: #ff8787;
}

html[data-theme="dark"] .header-brand-title {
    color: #f3f7fb;
}

html[data-theme="dark"] .navbar .btn-light {
    background: #e9eef4;
    border-color: #d5dee8;
    color: #1d2a38;
}

html[data-theme="dark"] footer {
    background-color: #0f1722;
    color: #c5d2e1;
    border-top: 1px solid #2f4258;
}

html[data-theme="dark"] footer .text-muted-custom {
    color: #c5d2e1 !important;
}

/* Header centering fix (all themes) */
header .header-main-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
}

header .navbar-brand {
    grid-column: 2;
    justify-self: center;
    margin: 0 auto !important;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
    padding: 0.35rem 0.95rem 0.35rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

header .header-brand-mark {
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 224, 102, 0.2), rgba(255, 196, 0, 0.08));
}

header .navbar-brand .header-brand-logo {
    margin: 0 !important;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: translateY(1px);
    filter: saturate(1.02) contrast(1.01) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.16));
}

header .header-brand-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    text-align: left;
}

header .header-brand-title-full,
header .header-brand-title-mobile {
    margin: 0;
    white-space: nowrap;
}

header .header-brand-title-full,
header .header-brand-copy .header-brand-title {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1.05;
    text-transform: uppercase;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.12);
}

header .header-action-slot {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
}

@media (max-width: 991px) {
    header .header-main-bar {
        grid-template-columns: 1fr auto 1fr;
    }

    header .navbar-brand {
        gap: 0.5rem;
        padding: 0.25rem 0.65rem 0.25rem 0.3rem;
    }

    header .header-brand-mark {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
    }

    header .header-brand-title-mobile {
        font-family: "Trebuchet MS", "Segoe UI", sans-serif;
        font-size: 0.98rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        max-width: 62vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Login page */
.login-page {
    min-height: calc(100vh - 86px);
}

.login-shell {
    min-height: calc(100vh - 86px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.login-card {
    background: #ffffff;
    border: 1px solid #e4e8ee;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.15);
    padding: 1.5rem 1.25rem;
}

html[data-theme="dark"] .login-page {
    background:
        radial-gradient(circle at 20% 0%, rgba(181, 19, 19, 0.12), transparent 38%),
        radial-gradient(circle at 85% 15%, rgba(255, 196, 0, 0.08), transparent 35%),
        linear-gradient(180deg, #101822 0%, #0e151f 100%);
}

html[data-theme="dark"] .login-card {
    background: #172333;
    border-color: #35506b;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .login-card h2,
html[data-theme="dark"] .login-card label {
    color: #eef5fc;
}

.login-error-page {
    min-height: calc(100vh - 86px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    background:
        radial-gradient(circle at 18% 14%, rgba(181, 19, 19, 0.12), transparent 34%),
        radial-gradient(circle at 82% 86%, rgba(181, 19, 19, 0.08), transparent 36%);
}

.login-error-shell {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #edd9d9;
    border-radius: 18px;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.14);
    max-width: 500px;
    width: 100%;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 3vw, 1.8rem);
}

.login-error-shell::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, #8f0e0e, #b51313 40%, #d53131);
}

.login-error-image {
    width: clamp(130px, 38vw, 220px);
    height: auto;
    margin: 0 auto 0.7rem;
    display: block;
}

.login-error-title {
    margin: 0;
    color: #b51313;
    font-size: clamp(1.3rem, 3.8vw, 1.95rem);
    font-weight: 700;
    line-height: 1.2;
}

.login-error-subtitle {
    margin: 0.5rem auto 1.05rem;
    color: #5f6977;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    max-width: 30ch;
}

.login-error-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 0.25rem;
    padding-top: 0.9rem;
    border-top: 1px dashed #edd9d9;
}

.login-error-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #8f0e0e, #b51313);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.7rem 1.2rem;
    border: 1px solid #8f0e0e;
    box-shadow: 0 8px 18px rgba(181, 19, 19, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.login-error-btn-icon {
    font-size: 1rem;
}

.login-error-btn:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 11px 22px rgba(181, 19, 19, 0.36);
    filter: brightness(1.03);
}

.login-error-btn:focus-visible {
    outline: 3px solid rgba(181, 19, 19, 0.28);
    outline-offset: 2px;
}

.login-error-help {
    margin: 0;
    font-size: 0.86rem;
    color: #7a8593;
}

html[data-theme="dark"] .login-error-shell {
    background: #172333;
    border-color: #653637;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .login-error-title {
    color: #ff6f7d;
}

html[data-theme="dark"] .login-error-subtitle {
    color: #cfd8e3;
}

html[data-theme="dark"] .login-error-actions {
    border-top-color: #5c3a3d;
}

html[data-theme="dark"] .login-error-help {
    color: #9eafc1;
}

@media (max-width: 576px) {
    .login-error-shell {
        border-radius: 16px;
    }

    .login-error-actions {
        width: 100%;
    }

    .login-error-btn {
        width: 100%;
    }
}

/* Keep semantic colors stable in dark mode */
html[data-theme="dark"] .text-danger {
    color: #ff6f7d !important;
}

html[data-theme="dark"] .text-warning {
    color: #ffd166 !important;
}

html[data-theme="dark"] .text-success {
    color: #4fd18f !important;
}

html[data-theme="dark"] .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

html[data-theme="dark"] .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #1f1f1f;
}

html[data-theme="dark"] .btn-success {
    background-color: #198754;
    border-color: #198754;
    color: #fff;
}

html[data-theme="dark"] .btn-outline-danger {
    color: #ff7f8a;
    border-color: #ff7f8a;
}

html[data-theme="dark"] .btn-outline-danger:hover {
    background-color: #ff7f8a;
    border-color: #ff7f8a;
    color: #1d1113;
}

html[data-theme="dark"] .btn-outline-warning {
    color: #ffd166;
    border-color: #ffd166;
}

html[data-theme="dark"] .btn-outline-warning:hover {
    background-color: #ffd166;
    border-color: #ffd166;
    color: #1f1f1f;
}

html[data-theme="dark"] .btn-outline-success {
    color: #4fd18f;
    border-color: #4fd18f;
}

html[data-theme="dark"] .btn-outline-success:hover {
    background-color: #4fd18f;
    border-color: #4fd18f;
    color: #11231a;
}

html[data-theme="dark"] .badge.bg-danger,
html[data-theme="dark"] .badge.text-bg-danger {
    background-color: #dc3545 !important;
    color: #fff !important;
}

html[data-theme="dark"] .badge.bg-warning,
html[data-theme="dark"] .badge.text-bg-warning {
    background-color: #ffc107 !important;
    color: #232323 !important;
}

html[data-theme="dark"] .badge.bg-success,
html[data-theme="dark"] .badge.text-bg-success {
    background-color: #198754 !important;
    color: #fff !important;
}

/* Final mobile-first polish */
main.container,
main.container-fluid {
    max-width: 100%;
}

.card,
.alert,
.modal-content,
.accordion-item {
    max-width: 100%;
}

.table-responsive {
    border-radius: 14px;
}

.table-responsive > .table {
    margin-bottom: 0;
}

.admin-mobile-list {
    display: grid;
    gap: 0.9rem;
}

.admin-mobile-card {
    background: var(--bs-body-bg);
    border: 1px solid rgba(33, 37, 41, 0.12);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(33, 37, 41, 0.08);
    padding: 0.9rem;
}

.admin-mobile-card-head {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.admin-mobile-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.admin-mobile-card-meta {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.admin-mobile-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
}

.admin-mobile-grid .form-label {
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.admin-mobile-actions {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 1fr;
    margin-top: 0.9rem;
}

html[data-theme="dark"] .admin-mobile-card {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.admin-schedule-offcanvas {
    --bs-offcanvas-width: min(520px, 100vw);
    border-left: 1px solid rgba(33, 37, 41, 0.12);
}

.admin-schedule-offcanvas .offcanvas-header {
    align-items: flex-start;
    gap: 1rem;
}

.admin-schedule-offcanvas .offcanvas-title {
    font-weight: 700;
}

.admin-schedule-offcanvas .offcanvas-body {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.admin-schedule-form {
    background: rgba(248, 249, 250, 0.86);
    border: 1px solid rgba(33, 37, 41, 0.08);
    border-radius: 8px;
    margin-left: 0;
    margin-right: 0;
    padding: 0.15rem 0.15rem 1rem;
}

.admin-schedule-card {
    background: var(--bs-body-bg);
    box-shadow: 0 8px 22px rgba(33, 37, 41, 0.08);
}

.admin-schedule-table-wrap {
    border-radius: 8px;
}

.admin-schedule-table-wrap .table {
    font-size: 0.9rem;
}

.admin-schedule-table-wrap .btn {
    white-space: nowrap;
}

html[data-theme="dark"] .admin-schedule-offcanvas {
    --bs-body-bg: #14181f;
    --bs-body-color: #e9eef7;
    --bs-border-color: rgba(255, 255, 255, 0.14);
    --bs-offcanvas-bg: #14181f;
    --bs-offcanvas-color: #e9eef7;
    --bs-secondary-color: #aeb8c8;
    background: #14181f !important;
    border-left-color: rgba(255, 255, 255, 0.14);
    color: #e9eef7;
}

html[data-theme="dark"] .admin-schedule-offcanvas .offcanvas-header {
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] .admin-schedule-offcanvas .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: 0.82;
}

html[data-theme="dark"] .admin-schedule-form {
    background: #191f28;
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .admin-schedule-card {
    background: #1b2029 !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .admin-schedule-table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .admin-schedule-offcanvas .table {
    --bs-table-bg: #1b2029;
    --bs-table-color: #e9eef7;
    --bs-table-border-color: rgba(255, 255, 255, 0.12);
    --bs-table-striped-bg: #202733;
    --bs-table-striped-color: #e9eef7;
    --bs-table-hover-bg: #252d3a;
    --bs-table-hover-color: #ffffff;
    color: #e9eef7;
}

html[data-theme="dark"] .admin-schedule-offcanvas .table th,
html[data-theme="dark"] .admin-schedule-offcanvas .table td {
    border-color: rgba(255, 255, 255, 0.12);
    color: #e9eef7;
}

html[data-theme="dark"] .admin-schedule-offcanvas .table thead th {
    background-color: #151b24 !important;
    box-shadow: none !important;
    color: #f4f7fb;
}

html[data-theme="dark"] .admin-schedule-offcanvas .table tbody tr > * {
    background-color: #1b2029 !important;
    box-shadow: none !important;
    color: #e9eef7 !important;
}

html[data-theme="dark"] .admin-schedule-offcanvas .table tbody tr:nth-of-type(even) > * {
    background-color: #202733 !important;
}

html[data-theme="dark"] .admin-schedule-offcanvas .table tbody tr:hover > * {
    background-color: #263141 !important;
}

html[data-theme="dark"] .admin-schedule-offcanvas .form-control,
html[data-theme="dark"] .admin-schedule-offcanvas .form-select {
    background-color: #111720;
    border-color: rgba(255, 255, 255, 0.16);
    color: #f2f5fa;
}

html[data-theme="dark"] .admin-schedule-offcanvas .form-control:focus,
html[data-theme="dark"] .admin-schedule-offcanvas .form-select:focus {
    background-color: #111720;
    border-color: #8ea8ff;
    box-shadow: 0 0 0 0.2rem rgba(142, 168, 255, 0.18);
    color: #ffffff;
}

html[data-theme="dark"] .admin-schedule-offcanvas .form-select option {
    background-color: #111720;
    color: #f2f5fa;
}

html[data-theme="dark"] .admin-schedule-offcanvas .text-muted {
    color: #aeb8c8 !important;
}

@media (min-width: 480px) and (max-width: 767px) {
    .admin-mobile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-mobile-grid-wide {
        grid-column: 1 / -1;
    }

    .admin-mobile-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .admin-schedule-offcanvas {
        --bs-offcanvas-width: 100vw;
    }

    .admin-schedule-offcanvas .offcanvas-header,
    .admin-schedule-offcanvas .offcanvas-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .admin-schedule-table-wrap .table {
        min-width: 390px;
    }
}

@media (max-width: 991px) {
    .landing-carousel {
        height: 460px;
    }

    .landing-carousel .carousel-title {
        font-size: 2rem;
    }

    .landing-carousel .carousel-description {
        font-size: 1.05rem;
    }

    header .header-main-bar {
        gap: 0.75rem;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }

    header .navbar-brand {
        max-width: min(100%, 86vw);
    }

    .row.g-4,
    .row.g-3 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .portal-nav-modern {
        padding: 10px 12px;
    }
}

@media (max-width: 767px) {
    body {
        font-size: 0.96rem;
    }

    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl,
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    header .header-main-bar {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    header .navbar-brand {
        grid-column: 1;
        justify-self: start;
        max-width: calc(100vw - 86px);
        gap: 0.55rem;
        padding: 0.25rem 0.55rem 0.25rem 0.2rem;
        background: transparent;
        box-shadow: none;
    }

    header .header-action-slot {
        grid-column: 2;
    }

    header .header-brand-mark {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }

    header .header-brand-title-mobile {
        max-width: calc(100vw - 150px);
        font-size: 0.88rem;
        line-height: 1.15;
    }

    .landing-carousel {
        height: 320px;
        border-radius: 16px;
    }

    .landing-carousel .carousel-caption {
        width: min(92%, 540px);
    }

    .landing-carousel .carousel-title {
        font-size: 1.45rem;
    }

    .landing-carousel .carousel-description {
        font-size: 0.95rem;
    }

    .card-body,
    .accordion-body,
    .modal-body {
        padding: 1rem;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    .btn-group {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .btn-group > .btn {
        flex: 1 1 auto;
        border-radius: 10px !important;
    }

    .table-responsive > table,
    .table-responsive > .table {
        min-width: 720px;
    }

    .table-responsive th,
    .table-responsive td {
        font-size: 0.84rem;
        padding: 0.5rem 0.55rem;
    }

    .mapa-leyenda {
        gap: 10px;
        font-size: 12px;
    }

    .theme-toggle-btn {
        bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.94rem;
    }

    h1,
    .landing-carousel .carousel-title {
        line-height: 1.1;
    }

    header .navbar {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    header .navbar-brand {
        max-width: calc(100vw - 74px);
        gap: 0.45rem;
    }

    header .header-brand-mark {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    header .header-brand-title-mobile {
        max-width: calc(100vw - 132px);
        font-size: 0.8rem;
        letter-spacing: 0.015em;
    }

    .landing-carousel {
        height: 260px;
    }

    .landing-carousel .carousel-caption {
        width: 92%;
    }

    .landing-carousel .carousel-title {
        font-size: 1.2rem;
    }

    .landing-carousel .carousel-description {
        font-size: 0.86rem;
    }

    .card,
    .alert,
    .modal-content {
        border-radius: 14px;
    }

    .card-body,
    .accordion-body,
    .modal-body {
        padding: 0.9rem;
    }

    .row > [class*='col-'] {
        min-width: 0;
    }

    .table-responsive > table,
    .table-responsive > .table {
        min-width: 640px;
    }

    .portal-nav-links {
        width: 100%;
    }

    .portal-nav-links .nav-link,
    .portal-nav-links .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode polish: notifications visibility */
html[data-theme="dark"] .list-group-item-warning {
    background-color: #3a3217 !important;
    border-color: #7a6623 !important;
    color: #fff3c8 !important;
}

html[data-theme="dark"] .list-group-item-warning .text-muted,
html[data-theme="dark"] .list-group-item-warning small {
    color: #f7e6af !important;
}

html[data-theme="dark"] .portal-notif-badge,
html[data-theme="dark"] #badge_notificaciones_docente,
html[data-theme="dark"] #badge_notificaciones_ss,
html[data-theme="dark"] #adminNotifBadge {
    background: #ff3b4d !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Dark mode polish: hamburger button visibility on mobile */
html[data-theme="dark"] header .navbar-toggler,
html[data-theme="dark"] .portal-nav-modern .navbar-toggler,
html[data-theme="dark"] .portal-nav-modern .portal-nav-toggler {
    border-color: #88a6c4 !important;
    background-color: #1f3143;
}

html[data-theme="dark"] header .navbar-toggler-icon,
html[data-theme="dark"] .portal-nav-modern .navbar-toggler-icon {
    filter: invert(1) brightness(1.9);
}

html[data-theme="dark"] header .navbar,
html[data-theme="dark"] .portal-nav-modern {
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.98%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

html[data-theme="dark"] .portal-nav-modern .navbar-toggler:focus,
html[data-theme="dark"] .portal-nav-modern .portal-nav-toggler:focus,
html[data-theme="dark"] header .navbar-toggler:focus {
    box-shadow: 0 0 0 .18rem rgba(136, 166, 196, .35);
}

/* Reportes recientes: contraste final sobre estilos globales de tabla */
.reportes-recientes-card .reportes-recientes-table {
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(128, 1, 1, .08);
}

.reportes-recientes-card .reportes-recientes-table thead th,
.reportes-recientes-card .reportes-recientes-table.table > :not(caption) > * > th {
    background: #8b0000 !important;
    background-color: #8b0000 !important;
    color: #ffffff !important;
    border-color: #8b0000 !important;
    text-shadow: none;
}

.reportes-recientes-card .reportes-recientes-table tbody tr:nth-child(odd) > * {
    background-color: #ffffff !important;
}

.reportes-recientes-card .reportes-recientes-table tbody tr:nth-child(even) > * {
    background-color: #f4f6f9 !important;
}

.reportes-recientes-card .reportes-recientes-table tbody tr:hover > * {
    background-color: #fff1f1 !important;
}

html[data-theme="dark"] .reportes-recientes-card .reportes-recientes-table thead th,
html[data-theme="dark"] .reportes-recientes-card .reportes-recientes-table.table > :not(caption) > * > th {
    background: #0f1722 !important;
    background-color: #0f1722 !important;
    color: #f8fbff !important;
    border-color: #36506a !important;
}

html[data-theme="dark"] .reportes-recientes-card .reportes-recientes-table tbody tr:nth-child(odd) > * {
    background-color: #172230 !important;
}

html[data-theme="dark"] .reportes-recientes-card .reportes-recientes-table tbody tr:nth-child(even) > * {
    background-color: #1e2b3b !important;
}

html[data-theme="dark"] .reportes-recientes-card .reportes-recientes-table tbody tr:hover > * {
    background-color: #26374a !important;
}

/* Account access in role navigation */
.portal-account-chip {
    display: inline-grid;
    grid-template-columns: 28px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 230px;
    padding: 5px 8px;
    color: #343a40;
    background: #f5f6f8;
    border: 1px solid #dde1e6;
    border-radius: 8px;
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.portal-account-chip:hover,
.portal-account-chip:focus-visible {
    color: #800101;
    background: #fff7f7;
    border-color: #d5a2a2;
    outline: none;
}

.portal-account-chip:focus-visible {
    box-shadow: 0 0 0 3px rgba(128, 1, 1, .14);
}

.portal-account-chip-icon {
    color: #980909;
    font-size: 1.45rem;
    line-height: 1;
}

.portal-account-chip-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    overflow: hidden;
    place-items: center;
    background: #ffffff;
    border: 1px solid #d9dde2;
    border-radius: 50%;
}

.portal-account-chip-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-account-chip-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.12;
}

.portal-account-chip-copy small {
    color: #6f7780;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.portal-account-chip-copy strong {
    overflow: hidden;
    color: inherit;
    font-size: .78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-account-chip-arrow {
    color: #8b949e;
    font-size: .72rem;
}

html[data-theme="dark"] .portal-account-chip {
    color: #edf3f9;
    background: #111b27;
    border-color: #3a526a;
}

html[data-theme="dark"] .portal-account-chip:hover,
html[data-theme="dark"] .portal-account-chip:focus-visible {
    color: #ffffff;
    background: #273548;
    border-color: #d56161;
}

html[data-theme="dark"] .portal-account-chip-icon {
    color: #ff7777;
}

html[data-theme="dark"] .portal-account-chip-avatar {
    background: #0c151f;
    border-color: #56708a;
}

html[data-theme="dark"] .portal-account-chip-copy small,
html[data-theme="dark"] .portal-account-chip-arrow {
    color: #aebdcb;
}

/* Mi cuenta */
.account-page {
    min-height: 65vh;
    padding: 22px 0 54px;
    background: #f5f6f8;
}

.account-shell {
    max-width: 1180px;
}

.account-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    color: #5b626b;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.account-back-link:hover,
.account-back-link:focus-visible {
    color: #800101;
}

.account-back-link:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(128, 1, 1, .16);
    outline-offset: 3px;
}

.account-hero {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 134px;
    margin-bottom: 18px;
    padding: 24px 28px;
    color: #ffffff;
    background: #790707;
    border: 1px solid #620303;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(76, 1, 1, .16);
}

.account-avatar {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    color: #790707;
    background: #ffffff;
    border: 3px solid rgba(255, 255, 255, .38);
    border-radius: 50%;
    font-size: 1.42rem;
    font-weight: 800;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.account-hero-copy {
    min-width: 0;
}

.account-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #f5c4c4;
    font-size: .73rem;
    font-weight: 800;
    text-transform: uppercase;
}

.account-hero h1 {
    margin: 0;
    color: #ffffff !important;
    font-size: 1.8rem;
    font-weight: 780;
}

.account-hero p {
    overflow-wrap: anywhere;
    margin: 3px 0 0;
    color: #ffe9e9;
    font-size: .98rem;
}

.account-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    color: #ffffff;
    background: rgba(30, 70, 45, .48);
    border: 1px solid rgba(205, 247, 220, .35);
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 750;
    white-space: nowrap;
}

.account-status > span {
    width: 8px;
    height: 8px;
    background: #69e39b;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(105, 227, 155, .18);
}

.account-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    border-radius: 8px;
}

.account-alert > i {
    flex: 0 0 auto;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.account-summary,
.account-panel {
    background: #ffffff;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(29, 36, 44, .06);
}

.account-summary {
    position: sticky;
    top: 16px;
    overflow: hidden;
}

.account-summary-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: #fbf3f3;
    border-bottom: 1px solid #eadcdc;
}

.account-summary-head > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.account-summary-icon,
.account-panel-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: #8a0505;
    background: #f6dddd;
    border-radius: 8px;
}

.account-summary-icon {
    width: 38px;
    height: 38px;
    font-size: 1.08rem;
}

.account-photo-preview {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    place-items: center;
    color: #ffffff;
    background: #860707;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #dfcaca;
    font-size: 1rem;
    font-weight: 800;
}

.account-photo-preview > img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.account-photo-camera {
    position: absolute;
    right: -3px;
    bottom: -2px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    color: #ffffff;
    background: #353b43;
    border: 2px solid #ffffff;
    border-radius: 50%;
    font-size: .64rem;
}

.account-photo-section {
    padding: 15px 18px 6px;
    border-bottom: 1px solid #eceef0;
}

.account-photo-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.account-photo-select,
.account-photo-save,
.account-photo-remove {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 750;
}

.account-photo-select {
    color: #3c4249;
    background: #ffffff;
    border: 1px solid #cfd4da;
}

.account-photo-select:hover,
.account-photo-select:focus-visible {
    color: #800101;
    background: #fff5f5;
    border-color: #b56b6b;
}

.account-photo-save {
    color: #ffffff;
    background: #850707;
    border: 1px solid #850707;
}

.account-photo-save:hover,
.account-photo-save:focus-visible {
    color: #ffffff;
    background: #680303;
    border-color: #680303;
}

.account-photo-save:disabled {
    color: #707780;
    background: #e5e7ea;
    border-color: #d9dde1;
    opacity: 1;
}

.account-photo-help {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
    color: #747c85;
    font-size: .7rem;
    line-height: 1.4;
}

.account-photo-help[data-state="error"] {
    color: #a10b0b;
    font-weight: 700;
}

.account-photo-help[data-state="ready"] {
    color: #266f45;
    font-weight: 700;
}

.account-photo-remove-form {
    margin-top: 5px;
}

.account-photo-remove {
    min-height: 32px;
    padding: 4px 0;
    color: #8b1717;
    background: transparent;
    border: 0;
}

.account-photo-remove:hover,
.account-photo-remove:focus-visible {
    color: #620303;
    text-decoration: underline;
}

.account-summary-label {
    color: #727a84;
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.account-summary-head strong {
    overflow: hidden;
    color: #282d33;
    font-size: .98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-meta-list {
    margin: 0;
    padding: 8px 18px;
}

.account-meta-list > div {
    padding: 13px 0;
    border-bottom: 1px solid #eceef0;
}

.account-meta-list > div:last-child {
    border-bottom: 0;
}

.account-meta-list dt {
    margin-bottom: 2px;
    color: #777f89;
    font-size: .7rem;
    font-weight: 750;
    text-transform: uppercase;
}

.account-meta-list dd {
    overflow-wrap: anywhere;
    margin: 0;
    color: #30363d;
    font-size: .9rem;
    font-weight: 650;
}

.account-content {
    display: grid;
    gap: 18px;
}

.account-panel {
    overflow: hidden;
}

.account-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #e8eaed;
}

.account-panel-icon {
    width: 40px;
    height: 40px;
    font-size: 1.08rem;
}

.account-panel-header h2 {
    margin: 0;
    color: #282d33;
    font-size: 1.05rem;
    font-weight: 780;
}

.account-panel-header p {
    margin: 2px 0 0;
    color: #747c86;
    font-size: .82rem;
}

.account-form {
    padding: 20px;
}

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

.account-field {
    min-width: 0;
}

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

.account-field label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: #3c4249;
    font-size: .82rem;
    font-weight: 750;
}

.account-field label span {
    color: #838b94;
    font-size: .7rem;
    font-weight: 600;
}

.account-field .form-control,
.account-field .input-group-text,
.account-password-toggle {
    min-height: 44px;
    border-color: #d8dde3;
}

.account-field .form-control {
    color: #282e34;
    background: #ffffff;
}

.account-field .form-control[readonly] {
    color: #626a73;
    background: #f4f5f7;
}

.account-field .form-control:focus {
    border-color: #9c3131;
    box-shadow: 0 0 0 3px rgba(128, 1, 1, .11);
}

.account-field .input-group-text {
    color: #747c84;
    background: #f7f8f9;
}

.account-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eceef0;
}

.account-primary-btn,
.account-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: .87rem;
    font-weight: 750;
}

.account-primary-btn {
    color: #ffffff;
    background: #850707;
    border: 1px solid #850707;
}

.account-primary-btn:hover,
.account-primary-btn:focus-visible {
    color: #ffffff;
    background: #680303;
    border-color: #680303;
}

.account-secondary-btn {
    color: #243229;
    background: #e4f3e8;
    border: 1px solid #a7ceb1;
}

.account-secondary-btn:hover,
.account-secondary-btn:focus-visible {
    color: #15241a;
    background: #cce8d3;
    border-color: #7eb18b;
}

.account-password-toggle {
    display: grid;
    width: 46px;
    place-items: center;
    color: #505862;
    background: #f7f8f9;
    border: 1px solid #d8dde3;
}

.account-password-toggle:hover,
.account-password-toggle:focus-visible {
    color: #800101;
    background: #fceeee;
    border-color: #c48b8b;
}

.account-password-health {
    display: grid;
    gap: 7px;
    margin-top: 13px;
    color: #69717a;
    font-size: .76rem;
}

.account-password-meter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    max-width: 320px;
}

.account-password-meter span {
    height: 4px;
    background: #e1e4e8;
    border-radius: 2px;
    transition: background-color .2s ease;
}

.account-password-meter[data-score="1"] span:nth-child(-n+1),
.account-password-meter[data-score="2"] span:nth-child(-n+2) {
    background: #d44b4b;
}

.account-password-meter[data-score="3"] span:nth-child(-n+3) {
    background: #d39b28;
}

.account-password-meter[data-score="4"] span:nth-child(-n+4) {
    background: #2f9b5f;
}

html[data-theme="dark"] .account-page {
    background: #0e1620;
}

html[data-theme="dark"] .account-back-link {
    color: #b9c7d5;
}

html[data-theme="dark"] .account-back-link:hover,
html[data-theme="dark"] .account-back-link:focus-visible {
    color: #ff8b8b;
}

html[data-theme="dark"] .account-hero {
    background: #5f090c;
    border-color: #a24045;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .account-summary,
html[data-theme="dark"] .account-panel {
    background: #172230;
    border-color: #34495f;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .account-summary-head {
    background: #221d28;
    border-color: #513d4a;
}

html[data-theme="dark"] .account-photo-preview {
    color: #ffffff;
    background: #7e1519;
    border-color: #26384b;
    box-shadow: 0 0 0 1px #536a81;
}

html[data-theme="dark"] .account-photo-camera {
    background: #0d151e;
    border-color: #26384b;
}

html[data-theme="dark"] .account-photo-section {
    border-color: #304357;
}

html[data-theme="dark"] .account-photo-select {
    color: #edf3f9;
    background: #101923;
    border-color: #3a5066;
}

html[data-theme="dark"] .account-photo-select:hover,
html[data-theme="dark"] .account-photo-select:focus-visible {
    color: #ffffff;
    background: #35242b;
    border-color: #bd6666;
}

html[data-theme="dark"] .account-photo-save:disabled {
    color: #8898a8;
    background: #253445;
    border-color: #34495e;
}

html[data-theme="dark"] .account-photo-help {
    color: #aebdcc;
}

html[data-theme="dark"] .account-photo-help[data-state="error"],
html[data-theme="dark"] .account-photo-remove {
    color: #ff8b8b;
}

html[data-theme="dark"] .account-photo-help[data-state="ready"] {
    color: #7dd5a1;
}

/* Inicio operativo del docente */
.docente-report-page {
    max-width: 1140px;
}

.docente-welcome {
    margin-bottom: 24px;
    padding: 6px 0 4px;
}

.docente-welcome-copy {
    min-width: 0;
}

.docente-section-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #8b1515;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.docente-welcome-copy h1 {
    overflow-wrap: anywhere;
    margin: 0;
    color: #262b31;
    font-size: 1.5rem;
    font-weight: 800;
}

.docente-welcome-copy p {
    margin: 3px 0 0;
    color: #626a73;
    font-size: 1rem;
}

.docente-location-section {
    scroll-margin-top: 16px;
}

.docente-location-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.docente-location-heading h2 {
    margin: 0;
    color: #2e343a;
    font-size: 1.25rem;
    font-weight: 780;
}

.docente-location-heading .btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    border-radius: 8px;
}

.docente-location-form {
    padding-bottom: 22px;
    border-bottom: 1px solid #e2e5e8;
}

html[data-theme="dark"] .docente-location-form {
    border-color: #32475c;
}

html[data-theme="dark"] .docente-section-eyebrow {
    color: #ff8989;
}

html[data-theme="dark"] .docente-welcome-copy h1,
html[data-theme="dark"] .docente-location-heading h2 {
    color: #f1f5f9;
}

html[data-theme="dark"] .docente-welcome-copy p {
    color: #b8c5d2;
}

html[data-theme="dark"] .account-summary-icon,
html[data-theme="dark"] .account-panel-icon {
    color: #ff8b8b;
    background: #3c2830;
}

html[data-theme="dark"] .account-summary-label,
html[data-theme="dark"] .account-meta-list dt,
html[data-theme="dark"] .account-panel-header p,
html[data-theme="dark"] .account-field label span,
html[data-theme="dark"] .account-password-health {
    color: #aebdcc;
}

html[data-theme="dark"] .account-summary-head strong,
html[data-theme="dark"] .account-meta-list dd,
html[data-theme="dark"] .account-panel-header h2,
html[data-theme="dark"] .account-field label {
    color: #f0f5fa;
}

html[data-theme="dark"] .account-meta-list > div,
html[data-theme="dark"] .account-panel-header,
html[data-theme="dark"] .account-form-actions {
    border-color: #304357;
}

html[data-theme="dark"] .account-field .form-control,
html[data-theme="dark"] .account-field .input-group-text,
html[data-theme="dark"] .account-password-toggle {
    color: #edf3f9;
    background: #101923;
    border-color: #3a5066;
}

html[data-theme="dark"] .account-field .form-control[readonly] {
    color: #afbdca;
    background: #121c28;
}

html[data-theme="dark"] .account-field .form-control:focus {
    border-color: #d66a6a;
    box-shadow: 0 0 0 3px rgba(214, 106, 106, .16);
}

html[data-theme="dark"] .account-password-toggle:hover,
html[data-theme="dark"] .account-password-toggle:focus-visible {
    color: #ffffff;
    background: #3a252d;
    border-color: #bd6666;
}

html[data-theme="dark"] .account-password-meter span {
    background: #34475b;
}

html[data-theme="dark"] .account-secondary-btn {
    color: #dff7e6;
    background: #1c4932;
    border-color: #3a7654;
}

html[data-theme="dark"] .account-secondary-btn:hover,
html[data-theme="dark"] .account-secondary-btn:focus-visible {
    color: #ffffff;
    background: #286242;
    border-color: #64a87c;
}

@media (max-width: 991px) {
    .portal-account-chip {
        max-width: min(230px, 60vw);
    }

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

    .account-summary {
        position: static;
    }

    .account-meta-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .account-meta-list > div {
        border-right: 1px solid #eceef0;
        border-bottom: 0;
    }

    .account-meta-list > div:last-child {
        border-right: 0;
    }

    html[data-theme="dark"] .account-meta-list > div {
        border-color: #304357;
    }

}

@media (max-width: 767px) {
    .account-page {
        padding: 16px 0 72px;
    }

    .account-hero {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 13px;
        min-height: 0;
        padding: 18px;
    }

    .account-avatar {
        width: 54px;
        height: 54px;
        font-size: 1.14rem;
    }

    .account-hero h1 {
        font-size: 1.42rem;
    }

    .account-status {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .account-form-grid,
    .account-security-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .account-field-wide {
        grid-column: auto;
    }

    .account-meta-list {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .account-meta-list > div {
        border-right: 0;
        border-bottom: 1px solid #eceef0;
    }

    .account-meta-list > div:last-child {
        border-bottom: 0;
    }

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

    .docente-welcome {
        padding: 4px 0;
    }

    .docente-welcome-copy h1 {
        font-size: 1.34rem;
    }

    .docente-location-heading {
        align-items: flex-end;
    }
}

@media (max-width: 575px) {
    .portal-nav-head {
        width: calc(100% - 48px);
    }

    .portal-account-chip {
        width: 100%;
        max-width: 100%;
    }

    .account-panel-header,
    .account-form,
    .account-summary-head,
    .account-meta-list {
        padding-left: 14px;
        padding-right: 14px;
    }

    .account-panel-header {
        align-items: flex-start;
    }

    .account-photo-form {
        grid-template-columns: minmax(0, 1fr) minmax(82px, auto);
    }

}

@media (prefers-reduced-motion: reduce) {
    .portal-account-chip,
    .account-password-meter span {
        transition: none;
    }
}

/* Navegacion institucional: compacta, legible y estable */
.portal-nav-modern {
    overflow: hidden;
    padding: 0;
    background: #ffffff;
    border: 1px solid #d9dde2;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(27, 31, 36, .07);
}

.portal-nav-modern > .container-fluid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 !important;
}

.portal-nav-modern .portal-nav-head {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 9px 12px;
}

.portal-nav-modern .portal-nav-title {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    color: #3d4248;
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-nav-modern .portal-nav-title i {
    color: #8d0b0b;
    font-size: .92rem;
}

.portal-nav-modern .portal-account-chip {
    justify-self: end;
}

.portal-nav-modern .portal-account-chip.is-active {
    color: #800101;
    background: #fff7f7;
    border-color: #c88f8f;
}

.portal-nav-modern .navbar-collapse {
    grid-column: 1 / -1;
    border-top: 1px solid #e3e6e9;
}

.portal-nav-modern .portal-nav-links {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: 0;
    margin: 0 !important;
    padding: 0 5px;
}

.portal-nav-modern .portal-nav-links .nav-item {
    flex: 1 1 auto;
    min-width: 0;
}

.portal-nav-modern .portal-nav-links .nav-link {
    position: relative;
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 7px;
    color: #444a50;
    background: transparent;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: .79rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

.portal-nav-modern .portal-nav-links .nav-link i {
    flex: 0 0 auto;
    margin-right: 0 !important;
    color: #687078;
    font-size: .94rem;
}

.portal-nav-modern .portal-nav-links .nav-link:hover,
.portal-nav-modern .portal-nav-links .nav-link:focus-visible {
    color: #790707;
    background: #faf5f5;
    border-bottom-color: #d7a4a4;
    outline: none;
}

.portal-nav-modern .portal-nav-links .nav-link:hover i,
.portal-nav-modern .portal-nav-links .nav-link:focus-visible i,
.portal-nav-modern .portal-nav-links .nav-link.active i {
    color: #8c0808;
}

.portal-nav-modern .portal-nav-links .nav-link.active {
    color: #790707;
    background: #fbf7f7;
    border-bottom-color: #8c0808;
}

.portal-nav-modern .portal-nav-links .nav-link.nav-link-exit {
    margin-left: 5px;
    color: #9a430d;
    background: #fff3e8;
    border-left: 1px solid #edc3a4;
    border-bottom-color: #dc8b50;
}

.portal-nav-modern .portal-nav-links .nav-link.nav-link-exit i {
    color: #b35316;
}

.portal-nav-modern .portal-nav-links .nav-link.nav-link-exit:hover,
.portal-nav-modern .portal-nav-links .nav-link.nav-link-exit:focus-visible {
    color: #713006;
    background: #fbe3cf;
    border-bottom-color: #bd5512;
}

.portal-nav-modern .portal-nav-links .nav-link.nav-link-exit:hover i,
.portal-nav-modern .portal-nav-links .nav-link.nav-link-exit:focus-visible i {
    color: #8c3908;
}

.portal-nav-modern .portal-nav-toggler {
    margin: 9px 10px 9px 0;
    border-radius: 6px;
}

html[data-theme="dark"] .portal-nav-modern {
    background: #172230 !important;
    border-color: #3a4e62 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-title {
    color: #dce5ee;
}

html[data-theme="dark"] .portal-nav-modern .navbar-collapse {
    border-color: #34495d;
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link {
    color: #cbd6e1;
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link i {
    color: #93a4b5;
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link:hover,
html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link:focus-visible,
html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link.active {
    color: #ffffff;
    background: #202f3e;
    border-bottom-color: #ef7777;
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link:hover i,
html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link:focus-visible i,
html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link.active i {
    color: #ff8b8b;
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link.nav-link-exit {
    color: #ffb17b;
    background: #30251e;
    border-left-color: #6b4b36;
    border-bottom-color: #d27a3d;
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link.nav-link-exit i {
    color: #f19a60;
}

html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link.nav-link-exit:hover,
html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link.nav-link-exit:focus-visible {
    color: #ffe8d8;
    background: #483125;
    border-bottom-color: #f09a5e;
}

html[data-theme="dark"] .portal-nav-modern .portal-account-chip.is-active {
    color: #ffffff;
    background: #30242b;
    border-color: #bd6666;
}

@media (max-width: 991px) {
    .portal-nav-modern > .container-fluid {
        grid-template-columns: minmax(0, 1fr) 46px;
        align-items: start;
        padding: 9px 10px !important;
    }

    .portal-nav-modern .portal-nav-head {
        grid-column: 1;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        width: 100%;
        padding: 0;
    }

    .portal-nav-modern .portal-account-chip {
        width: min(100%, 280px);
        max-width: 100%;
        justify-self: start;
    }

    .portal-nav-modern .portal-nav-toggler {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        margin: 0 0 0 auto;
    }

    .portal-nav-modern .navbar-collapse {
        grid-column: 1 / -1;
        margin-top: 10px;
        border-top: 1px solid #e3e6e9;
    }

    .portal-nav-modern .portal-nav-links {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        padding: 7px 0 0;
    }

    .portal-nav-modern .portal-nav-links .nav-link {
        min-height: 42px;
        justify-content: flex-start;
        padding: 9px 10px;
        border-bottom: 0;
        border-left: 2px solid transparent;
        border-radius: 4px;
        font-size: .88rem;
        text-align: left;
    }

    .portal-nav-modern .portal-nav-links .nav-link:hover,
    .portal-nav-modern .portal-nav-links .nav-link:focus-visible,
    .portal-nav-modern .portal-nav-links .nav-link.active {
        border-bottom-color: transparent;
        border-left-color: #8c0808;
    }

    .portal-nav-modern .portal-nav-links .nav-link.nav-link-exit {
        margin: 5px 0 0;
        padding-top: 10px;
        border-top: 1px solid #edc3a4;
        border-left: 2px solid #bd5512;
    }

    html[data-theme="dark"] .portal-nav-modern .navbar-collapse {
        border-top-color: #34495d;
    }

    html[data-theme="dark"] .portal-nav-modern .portal-nav-links .nav-link.nav-link-exit {
        border-top-color: #6b4b36;
        border-left-color: #d27a3d;
    }
}

/* Acceso principal */
body.access-body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    background: #f7f8fa;
    color: #252a31;
}

.access-page {
    display: grid;
    grid-template-columns: minmax(360px, 44%) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100svh;
}

.access-brand {
    position: relative;
    display: grid;
    overflow: hidden;
    padding: 34px 48px 38px;
    background: #7d0808;
    color: #ffffff;
}

.access-brand-inner {
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr) auto;
    width: 100%;
    max-width: 620px;
    min-height: 0;
    margin: 0 auto;
}

.access-institution {
    position: relative;
    z-index: 5;
    margin: 0;
    color: #f4dada;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: uppercase;
}

.access-visual {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 0;
    isolation: isolate;
}

.access-mascot {
    position: relative;
    z-index: 3;
    display: block;
    width: min(88%, 470px);
    height: auto;
    max-height: 52vh;
    object-fit: contain;
}

.access-tech-node {
    position: absolute;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 8px;
    background: #650606;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(39, 0, 0, .22);
    font-size: 1.08rem;
}

.access-tech-router {
    top: 19%;
    right: 4%;
}

.access-tech-computer {
    right: 0;
    bottom: 17%;
}

.access-tech-tools {
    left: 3%;
    bottom: 22%;
}

.access-tech-line {
    position: absolute;
    z-index: 1;
    display: block;
    border-color: rgba(255, 255, 255, .24);
    border-style: solid;
}

.access-tech-line-a {
    top: 29%;
    right: 7%;
    width: 34%;
    height: 31%;
    border-width: 1px 1px 0 0;
}

.access-tech-line-b {
    bottom: 29%;
    left: 7%;
    width: 38%;
    height: 1px;
    border-width: 1px 0 0;
}

.access-brand-copy {
    position: relative;
    z-index: 5;
    padding-top: 10px;
}

.access-product-mark {
    display: block;
    margin-bottom: 7px;
    color: #ffd348;
    font-size: .85rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.access-brand-copy h1 {
    max-width: 520px;
    margin: 0;
    color: #ffffff;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: 0;
}

.access-brand-copy p {
    margin: 10px 0 0;
    color: #f1d4d4;
    font-size: .96rem;
    font-weight: 500;
    line-height: 1.4;
}

.access-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    padding: 24px 38px 18px;
    background: #f7f8fa;
}

.access-theme-toggle {
    display: grid;
    place-items: center;
    justify-self: end;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #d9dde2;
    border-radius: 50%;
    background: #ffffff;
    color: #424a54;
    box-shadow: 0 2px 8px rgba(30, 37, 44, .06);
    font-size: 1rem;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.access-theme-toggle:hover {
    border-color: #aeb5bd;
    background: #f1f3f5;
    color: #7d0808;
}

.access-theme-toggle:focus-visible,
.access-password-toggle:focus-visible,
.access-submit:focus-visible {
    outline: 3px solid rgba(178, 25, 25, .25);
    outline-offset: 2px;
}

.access-form-wrap {
    align-self: center;
    width: min(100%, 420px);
    margin: 34px auto;
}

.access-form-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.access-form-mark {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #f4e9e9;
    color: #8b0c0c;
    font-size: 1.1rem;
}

.access-form-heading h2 {
    margin: 0;
    color: #252a31;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
}

.access-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 46px;
    margin: -14px 0 22px;
    padding: 12px 13px;
    border: 1px solid #e2a7a7;
    border-radius: 6px;
    background: #fff4f4;
    color: #7d0808;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.4;
}

.access-alert i {
    margin-top: 1px;
}

.access-form {
    display: grid;
    gap: 20px;
}

.access-field {
    display: grid;
    gap: 8px;
}

.access-field label {
    color: #343a42;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.3;
}

.access-input-wrap {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 52px;
    overflow: hidden;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    background: #ffffff;
    color: #6a737d;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.access-input-wrap:focus-within {
    border-color: #9b1515;
    box-shadow: 0 0 0 3px rgba(155, 21, 21, .12);
}

.access-input-wrap > i {
    justify-self: center;
    font-size: 1rem;
}

.access-input-wrap input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0 12px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #22272e;
    font: inherit;
    font-size: .96rem;
}

.access-password-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-right: 4px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #59626d;
    font-size: 1rem;
}

.access-password-toggle:hover {
    background: #f0f2f4;
    color: #7d0808;
}

.access-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    padding: 12px 18px;
    border: 1px solid #7d0808;
    border-radius: 6px;
    background: #8b0c0c;
    color: #ffffff;
    font-size: .96rem;
    font-weight: 700;
    line-height: 1.2;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.access-submit:hover {
    border-color: #620505;
    background: #6f0707;
}

.access-submit:active {
    transform: translateY(1px);
}

.access-footer {
    justify-self: center;
    margin: 0;
    color: #747d87;
    font-size: .76rem;
    line-height: 1.35;
}

html[data-theme="dark"] body.access-body,
html[data-theme="dark"] .access-panel {
    background: #111821;
    color: #e8edf2;
}

html[data-theme="dark"] .access-brand {
    background: #620707;
}

html[data-theme="dark"] .access-theme-toggle {
    border-color: #3d4b59;
    background: #19232e;
    color: #e5ebf0;
    box-shadow: none;
}

html[data-theme="dark"] .access-theme-toggle:hover {
    border-color: #617181;
    background: #202d39;
    color: #ffcbcb;
}

html[data-theme="dark"] .access-form-mark {
    background: #302027;
    color: #ff9999;
}

html[data-theme="dark"] .access-form-heading h2,
html[data-theme="dark"] .access-field label {
    color: #edf2f6;
}

html[data-theme="dark"] .access-input-wrap {
    border-color: #40505f;
    background: #18232e;
    color: #9bacbc;
}

html[data-theme="dark"] .access-input-wrap:focus-within {
    border-color: #e26e6e;
    box-shadow: 0 0 0 3px rgba(226, 110, 110, .14);
}

html[data-theme="dark"] .access-input-wrap input {
    color: #f4f7f9;
}

html[data-theme="dark"] .access-password-toggle {
    color: #aab8c5;
}

html[data-theme="dark"] .access-password-toggle:hover {
    background: #263541;
    color: #ffffff;
}

html[data-theme="dark"] .access-alert {
    border-color: #814b4b;
    background: #2d1c22;
    color: #ffb1b1;
}

html[data-theme="dark"] .access-footer {
    color: #94a2af;
}

@media (max-width: 767px) {
    .access-page {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(470px, 1fr);
    }

    .access-brand {
        min-height: 315px;
        padding: 20px 24px 24px;
    }

    .access-brand-inner {
        grid-template-rows: auto 178px auto;
        max-width: 460px;
    }

    .access-institution {
        font-size: .7rem;
    }

    .access-mascot {
        width: min(68%, 220px);
        max-height: 178px;
    }

    .access-tech-node {
        width: 36px;
        height: 36px;
        font-size: .92rem;
    }

    .access-tech-router {
        top: 16%;
        right: 10%;
    }

    .access-tech-computer {
        right: 5%;
        bottom: 11%;
    }

    .access-tech-tools {
        left: 7%;
        bottom: 15%;
    }

    .access-brand-copy {
        padding-top: 2px;
    }

    .access-product-mark {
        margin-bottom: 4px;
        font-size: .76rem;
    }

    .access-brand-copy h1 {
        font-size: 1.55rem;
        line-height: 1.12;
    }

    .access-brand-copy p {
        margin-top: 5px;
        font-size: .82rem;
    }

    .access-panel {
        padding: 18px 22px 16px;
    }

    .access-theme-toggle {
        width: 40px;
        height: 40px;
    }

    .access-form-wrap {
        width: min(100%, 440px);
        margin: 28px auto 38px;
    }

    .access-form-heading {
        margin-bottom: 28px;
    }

    .access-form-heading h2 {
        font-size: 1.7rem;
    }
}

@media (min-width: 768px) and (max-height: 700px) {
    .access-brand {
        padding-top: 24px;
        padding-bottom: 26px;
    }

    .access-brand-inner {
        grid-template-rows: auto minmax(220px, 1fr) auto;
    }

    .access-mascot {
        max-height: 45vh;
    }

    .access-brand-copy h1 {
        font-size: 1.85rem;
    }

    .access-form-wrap {
        margin-top: 22px;
        margin-bottom: 22px;
    }
}

/* Ajustes de calidad responsive y controles táctiles */
html {
    max-width: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

body.access-body {
    min-width: 0;
}

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

main,
.row,
.row > *,
.card,
.card-body,
.modal-content,
.offcanvas,
.portal-nav-modern {
    min-width: 0;
}

button,
.btn,
.nav-link,
input,
select,
textarea {
    touch-action: manipulation;
}

header .header-action-slot {
    gap: 8px;
}

header .header-theme-toggle {
    position: static;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: #ffffff;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .34);
    box-shadow: none;
}

header .header-theme-toggle:hover,
header .header-theme-toggle:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .62);
    box-shadow: none;
    transform: none;
}

html[data-theme="dark"] header .header-theme-toggle {
    color: #f8d24b;
    background: rgba(8, 12, 18, .2);
    border-color: rgba(255, 255, 255, .32);
    box-shadow: none;
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-responsive > .table,
.table-responsive > table {
    margin-bottom: .25rem;
}

@media (max-width: 767px) {
    header .navbar {
        padding-right: max(.5rem, env(safe-area-inset-right));
        padding-left: max(.5rem, env(safe-area-inset-left));
    }

    header .header-main-bar {
        width: 100%;
        gap: 6px;
        padding-right: 0;
        padding-left: 0;
    }

    header .navbar-brand {
        max-width: calc(100vw - 76px - env(safe-area-inset-left) - env(safe-area-inset-right));
        min-width: 0;
    }

    header .header-brand-title-mobile {
        display: -webkit-box !important;
        overflow: hidden;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    header .header-theme-toggle {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl,
    .container-fluid {
        padding-right: max(10px, env(safe-area-inset-right));
        padding-left: max(10px, env(safe-area-inset-left));
    }

    .portal-nav-modern > .container-fluid {
        padding-right: max(10px, env(safe-area-inset-right)) !important;
        padding-left: max(10px, env(safe-area-inset-left)) !important;
    }

    .portal-account-chip,
    .portal-account-chip span,
    .portal-nav-title,
    th,
    td,
    dd,
    .alert,
    .card-title,
    .card-text {
        overflow-wrap: anywhere;
    }

    .form-control,
    .form-select,
    textarea.form-control,
    .access-input-wrap input {
        font-size: 16px;
    }

    .form-label,
    label {
        line-height: 1.3;
    }

    .modal-dialog {
        width: auto;
        max-width: calc(100vw - 16px);
        margin: 8px auto;
    }

    .modal-content {
        max-height: calc(100dvh - 16px);
    }

    .modal-body {
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .offcanvas {
        max-width: 100vw;
    }

    .btn:not(.btn-close),
    button:not(.btn-close) {
        min-height: 44px;
    }

    .input-group > .btn,
    .input-group > button {
        min-width: 44px;
    }

    footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

@media (max-width: 350px) {
    header .header-brand-mark {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    header .header-brand-title-mobile {
        max-width: calc(100vw - 116px);
        font-size: .72rem;
    }

    .portal-nav-modern > .container-fluid {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .portal-nav-modern .portal-account-chip {
        max-width: calc(100vw - 76px);
    }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
    .access-page {
        grid-template-columns: minmax(270px, 40%) minmax(0, 1fr);
        grid-template-rows: minmax(100dvh, auto);
    }

    .access-brand {
        min-height: 100dvh;
        padding: 18px 24px 0;
    }

    .access-brand-inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .access-visual {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        height: auto;
    }

    .access-mascot {
        width: min(58%, 220px);
        max-height: 70dvh;
    }

    .access-panel {
        min-height: 100dvh;
        padding-top: 28px;
        padding-bottom: 28px;
    }
}

/* Flujo visual del reporte docente */
.docente-report-page {
    width: min(100%, 1580px);
    max-width: 1580px;
    padding-right: 24px;
    padding-left: 24px;
}

.docente-report-page .docente-welcome {
    margin-bottom: 20px;
}

.docente-report-page .docente-welcome-copy h1 {
    font-size: 2rem;
}

.docente-report-page .docente-welcome-copy p {
    font-size: 1.05rem;
}

.docente-location-section {
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #dfe3e8;
}

.docente-location-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 0;
    border: 0;
}

.docente-location-field {
    min-width: 0;
}

.docente-location-field .form-label,
.docente-report-field .form-label {
    margin-bottom: 7px;
    color: #343a40;
    font-size: .86rem;
    font-weight: 700;
}

.docente-location-field .form-select {
    min-height: 50px;
    border-color: #cfd6dd;
    border-radius: 6px;
    background-color: #fff;
    font-weight: 650;
}

.docente-report-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 28px;
}

.docente-report-workspace.has-selection {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
}

.docente-map-stage,
.docente-report-panel {
    min-width: 0;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    background: #fff;
}

.docente-map-stage {
    padding: 20px;
}

.docente-map-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.docente-map-heading h2 {
    margin: 0;
    color: #252b31;
    font-size: 1.25rem;
    font-weight: 800;
}

.docente-map-count {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 1px solid #d8dde3;
    border-radius: 999px;
    color: #5f6872;
    background: #f7f8fa;
    font-size: .76rem;
    font-weight: 700;
}

.docente-aula-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid #cfd5dc;
    border-radius: 6px;
    background: #e9ecef;
}

.docente-aula-front {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(120px, 38%) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 54px;
    padding: 9px 16px;
    border-bottom: 1px solid #cfd5dc;
    background: #f5f6f7;
}

.docente-aula-front strong {
    overflow: hidden;
    color: #3f474f;
    font-size: .78rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docente-aula-board {
    display: flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border: 2px solid #59636c;
    border-radius: 3px;
    color: #fff;
    background: #38434c;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.docente-aula-floor {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0;
    border: 0;
    border-radius: 0;
    background-color: #f4f1eb;
    background-image:
        linear-gradient(rgba(74, 82, 89, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 82, 89, .07) 1px, transparent 1px);
    background-size: 32px 32px;
}

.docente-aula-floor::before {
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 50%;
    width: min(18%, 130px);
    border-right: 1px dashed rgba(92, 99, 106, .15);
    border-left: 1px dashed rgba(92, 99, 106, .15);
    background: rgba(255, 255, 255, .22);
    content: "";
    pointer-events: none;
    transform: translateX(-50%);
}

.docente-aula-shell.is-compact .docente-aula-floor {
    height: 330px;
}

.docente-aula-shell.is-medium .docente-aula-floor {
    height: 480px;
}

.docente-aula-shell.is-dense .docente-aula-floor {
    min-height: 480px;
    padding: 18px;
}

.docente-aula-access {
    position: absolute;
    z-index: 5;
    right: 14px;
    bottom: 0;
    display: inline-flex;
    min-width: 72px;
    min-height: 35px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #6d747b;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    color: #4c545c;
    background: #fff;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.docente-aula-floor .equipo-node {
    position: relative;
    z-index: 1;
    width: 86px;
    min-height: 72px;
    gap: 5px;
    padding: 7px 5px;
    border-width: 2px;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(31, 41, 55, .12);
    cursor: pointer;
    overflow: visible;
}

.docente-aula-floor .equipo-node:hover,
.docente-aula-floor .equipo-node:focus-visible {
    z-index: 8;
    border-color: #8b1515;
    box-shadow: 0 7px 16px rgba(31, 41, 55, .2);
}

.docente-aula-floor .equipo-node.estado-urgente {
    animation: none;
}

.docente-aula-floor .equipo-node.is-selected {
    z-index: 9;
    outline: 3px solid #8b1515;
    outline-offset: 3px;
    box-shadow: 0 10px 20px rgba(139, 21, 21, .23);
}

.docente-aula-floor .equipo-node span.equipo-node-device {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #34495e;
    font-size: 1.45rem;
    line-height: 1;
}

.docente-aula-floor .equipo-node span.equipo-node-label {
    display: block;
    max-width: 100%;
    color: #303840;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
}

.docente-equipo-positioned {
    position: absolute;
    top: var(--map-y);
    left: var(--map-x);
    transform: translate(-50%, -50%);
}

.docente-equipo-positioned:hover,
.docente-equipo-positioned:focus-visible {
    transform: translate(-50%, calc(-50% - 3px));
}

.docente-aula-floor .equipo-count {
    top: -8px;
    right: -8px;
    min-width: 23px;
    height: 23px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #9b1c1c;
    font-size: .7rem;
    line-height: 19px;
}

.docente-aula-floor .mapa-seccion {
    position: relative;
    z-index: 1;
    padding: 0;
    border: 0;
    background: transparent;
}

.docente-aula-floor .mapa-seccion + .mapa-seccion {
    margin-top: 24px !important;
    padding-top: 18px;
    border-top: 1px solid rgba(73, 80, 87, .18);
}

.docente-aula-floor .mapa-seccion-titulo {
    margin: 0 0 10px;
    color: #5c646c;
    font-size: .72rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.docente-aula-floor .mapa-seccion-badge {
    min-width: 24px;
    border-radius: 999px;
    text-align: center;
}

.docente-aula-floor .mapa-grid-denso {
    grid-template-columns: repeat(8, minmax(76px, 1fr));
    gap: 12px;
    padding: 0;
    overflow: visible;
}

.docente-aula-floor .mapa-grid-control {
    grid-template-columns: repeat(3, minmax(76px, 96px));
}

.docente-aula-floor .mapa-grid-denso .equipo-node {
    width: 100% !important;
    min-height: 70px;
}

.docente-map-legend {
    gap: 10px 16px;
    margin-top: 13px;
    color: #5f6872;
    font-size: .74rem;
}

.docente-map-legend .punto {
    width: 8px;
    height: 8px;
    margin-right: 5px;
}

.docente-report-panel {
    display: none;
    position: sticky;
    top: 16px;
    overflow: hidden;
    scroll-margin-top: 16px;
}

.docente-report-workspace.has-selection .docente-report-panel {
    display: block;
}

.docente-report-panel-empty {
    display: grid;
    min-height: 230px;
    place-items: center;
    align-content: center;
    gap: 9px;
    color: #69737d;
}

.docente-report-panel-empty i {
    font-size: 1.7rem;
}

.docente-report-panel.is-active .docente-report-panel-empty {
    display: none;
}

.docente-report-panel-content {
    padding: 18px;
}

.docente-selected-equipment {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: -18px -18px 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #e1e5e9;
    background: #f7f8f9;
}

.docente-selected-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    background: #8b1515;
    font-size: 1.35rem;
}

.docente-selected-equipment > div > span {
    display: block;
    margin-bottom: 2px;
    color: #69727c;
    font-size: .7rem;
    font-weight: 750;
    text-transform: uppercase;
}

.docente-selected-equipment input {
    width: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    color: #252b31;
    background: transparent;
    font-size: 1.05rem;
    font-weight: 850;
}

.docente-report-form {
    display: grid;
    gap: 16px;
}

.docente-report-field {
    min-width: 0;
}

.docente-report-field .form-control,
.docente-report-field .form-select {
    border-color: #cfd6dd;
    border-radius: 6px;
}

.docente-report-field .form-select {
    min-height: 46px;
}

.docente-report-field textarea {
    min-height: 112px;
    resize: vertical;
}

.docente-report-field .form-text {
    margin-top: 5px;
    font-size: .72rem;
}

.docente-evidence-picker {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    min-height: 62px;
    padding: 10px 12px;
    border: 1px dashed #9ca6af;
    border-radius: 6px;
    color: #343b43;
    background: #fafbfc;
    cursor: pointer;
}

.docente-evidence-picker:hover,
.docente-evidence-picker:focus-within {
    border-color: #8b1515;
    background: #fff7f7;
}

.docente-evidence-picker > i {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    color: #8b1515;
    background: #f4e6e6;
    font-size: 1.15rem;
}

.docente-evidence-picker strong,
.docente-evidence-picker small {
    display: block;
}

.docente-evidence-picker small {
    margin-top: 2px;
    color: #69737d;
    font-size: .72rem;
}

.docente-evidence-preview {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: 9px;
}

.docente-evidence-preview img {
    width: 54px;
    height: 54px;
    border-radius: 5px;
    object-fit: cover;
}

.docente-evidence-preview strong {
    display: block;
    overflow: hidden;
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docente-evidence-preview .btn-link {
    min-height: 30px;
    padding: 0;
    color: #8b1515;
    font-size: .75rem;
    text-decoration: none;
}

.docente-hours-alert {
    margin-bottom: 16px;
    font-size: .78rem;
}

.docente-report-submit {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 750;
}

.docente-recent-section {
    padding-top: 22px;
    border-top: 1px solid #dfe3e8;
}

.docente-recent-section .card-body {
    padding: 0;
}

.docente-recent-section h2 {
    color: #2b3137;
    font-size: 1rem;
    font-weight: 800;
}

.docente-map-stage-empty {
    min-height: 420px;
}

.docente-map-stage-empty .docente-aula-shell {
    min-height: 320px;
}

.docente-aula-empty-state {
    display: grid;
    min-height: 265px;
    place-items: center;
    align-content: center;
    gap: 9px;
    color: #66717b;
}

.docente-aula-empty-state i {
    font-size: 1.55rem;
}

html[data-theme="dark"] .docente-location-section,
html[data-theme="dark"] .docente-recent-section {
    border-color: #304357;
}

html[data-theme="dark"] .docente-location-field .form-label,
html[data-theme="dark"] .docente-report-field .form-label,
html[data-theme="dark"] .docente-map-heading h2,
html[data-theme="dark"] .docente-recent-section h2 {
    color: #edf3f9;
}

html[data-theme="dark"] .docente-map-stage,
html[data-theme="dark"] .docente-report-panel {
    border-color: #304357;
    background: #172230;
}

html[data-theme="dark"] .docente-map-count {
    border-color: #3b4f63;
    color: #c5d0dc;
    background: #111b26;
}

html[data-theme="dark"] .docente-aula-shell,
html[data-theme="dark"] .docente-aula-front {
    border-color: #3a4c5e;
}

html[data-theme="dark"] .docente-aula-front,
html[data-theme="dark"] .docente-selected-equipment {
    border-color: #304357;
    background: #111b26;
}

html[data-theme="dark"] .docente-aula-front strong,
html[data-theme="dark"] .docente-selected-equipment input {
    color: #edf3f9;
}

html[data-theme="dark"] .docente-aula-floor {
    background-color: #101923 !important;
    background-image:
        linear-gradient(rgba(183, 199, 215, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(183, 199, 215, .07) 1px, transparent 1px) !important;
}

html[data-theme="dark"] .docente-aula-access {
    border-color: #5e6f80;
    color: #d1dae4;
    background: #1d2a37;
}

html[data-theme="dark"] .docente-aula-floor .equipo-node-label {
    color: #edf3f9;
}

html[data-theme="dark"] .docente-evidence-picker {
    border-color: #607184;
    color: #edf3f9;
    background: #101923;
}

html[data-theme="dark"] .docente-evidence-picker:hover {
    border-color: #d66a6a;
    background: #231b22;
}

html[data-theme="dark"] .docente-evidence-picker small,
html[data-theme="dark"] .docente-selected-equipment > div > span,
html[data-theme="dark"] .docente-report-panel-empty,
html[data-theme="dark"] .docente-aula-empty-state {
    color: #aebdcc;
}

@media (max-width: 1199px) {
    .docente-report-workspace.has-selection {
        grid-template-columns: minmax(0, 1fr);
    }

    .docente-report-panel {
        position: static;
    }

    .docente-aula-floor .equipo-node {
        width: 78px;
    }
}

@media (max-width: 991px) {
    .docente-aula-shell.is-medium {
        overflow-x: auto;
    }

    .docente-aula-shell.is-medium .docente-aula-front,
    .docente-aula-shell.is-medium .docente-aula-floor {
        min-width: 760px;
    }
}

@media (max-width: 767px) {
    .docente-report-page {
        padding: 16px 12px 64px;
    }

    .docente-report-page .docente-welcome {
        margin-bottom: 18px;
    }

    .docente-report-page .docente-welcome-copy h1 {
        font-size: 1.45rem;
    }

    .docente-location-heading {
        align-items: center;
    }

    .docente-location-heading .btn span {
        display: none;
    }

    .docente-location-heading .btn {
        width: 42px;
        min-width: 42px;
        padding: 0;
        justify-content: center;
    }

    .docente-location-form {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .docente-map-stage {
        padding: 14px;
    }

    .docente-map-heading {
        margin-bottom: 12px;
    }

    .docente-map-heading h2 {
        font-size: 1.08rem;
    }

    .docente-aula-front {
        grid-template-columns: minmax(100px, 46%) minmax(0, 1fr);
        min-height: 48px;
        padding: 8px 10px;
    }

    .docente-aula-shell.is-compact .docente-aula-floor {
        height: 290px;
    }

    .docente-aula-shell.is-medium .docente-aula-floor {
        height: 430px;
    }

    .docente-aula-shell.is-dense .docente-aula-floor {
        min-height: 400px;
        padding: 14px 10px 48px;
    }

    .docente-aula-floor .mapa-grid-denso {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .docente-aula-floor .equipo-node,
    .docente-aula-floor .mapa-grid-denso .equipo-node {
        width: 76px;
        min-height: 68px;
    }

    .docente-aula-floor .mapa-grid-denso .equipo-node {
        width: 100% !important;
    }

    .docente-map-legend {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px 12px;
    }

    .docente-report-panel-content {
        padding: 16px;
    }

    .docente-selected-equipment {
        margin: -16px -16px 16px;
        padding: 14px 16px;
    }

    .docente-report-submit {
        width: 100%;
    }

    .docente-map-stage-empty {
        min-height: 340px;
    }

    .docente-map-stage-empty .docente-aula-shell {
        min-height: 250px;
    }

    .docente-aula-empty-state {
        min-height: 200px;
    }
}

@media (max-width: 359px) {
    .docente-report-page {
        padding-right: 8px;
        padding-left: 8px;
    }

    .docente-map-stage {
        padding: 10px;
    }

    .docente-map-count {
        display: none;
    }

    .docente-aula-floor .mapa-grid-denso {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .access-theme-toggle,
    .access-input-wrap,
    .access-submit {
        transition: none;
    }
}

/* Acceso principal: identidad visual v2 */
body.access-body {
    font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
}

.access-brand {
    padding: 44px 48px 0;
    background: #790707;
}

.access-brand-inner {
    grid-template-rows: auto minmax(0, 1fr);
    max-width: 590px;
}

.access-brand-copy {
    grid-row: 1;
    padding: 0;
}

.access-product-mark {
    margin-bottom: 8px;
    color: #f4c742;
    font-size: .78rem;
    font-weight: 800;
}

.access-brand-copy h1 {
    max-width: 430px;
    font-size: 2.05rem;
    line-height: 1.08;
}

.access-brand-copy p {
    margin-top: 9px;
    color: #ebcece;
    font-size: .9rem;
}

.access-visual {
    grid-row: 2;
    align-items: end;
    justify-items: center;
    margin-top: 12px;
    overflow: hidden;
}

.access-mascot {
    width: min(76%, 430px);
    max-height: 70vh;
    object-position: center bottom;
    filter: drop-shadow(0 18px 20px rgba(40, 0, 0, .24));
}

.access-form-wrap {
    width: min(100%, 440px);
}

.access-form-heading {
    display: block;
    margin-bottom: 34px;
}

.access-form-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #8b0c0c;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
}

.access-form-heading h2 {
    font-size: 2.05rem;
}

.access-submit {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 52px;
    gap: 0;
    min-height: 56px;
    padding: 0;
    overflow: hidden;
    border-color: #760707;
    background: #8b0c0c;
    box-shadow: 0 8px 20px rgba(97, 8, 8, .16);
}

.access-submit-symbol,
.access-submit-arrow {
    display: grid;
    place-items: center;
    align-self: stretch;
}

.access-submit-symbol {
    border-right: 1px solid rgba(255, 255, 255, .18);
    background: #720707;
    font-size: 1.05rem;
}

.access-submit-label {
    align-self: center;
    padding: 0 10px;
}

.access-submit-arrow {
    color: #f6d267;
    font-size: 1rem;
    transition: transform .18s ease;
}

.access-submit:hover {
    border-color: #5f0505;
    background: #760707;
}

.access-submit:hover .access-submit-symbol {
    background: #620505;
}

.access-submit:hover .access-submit-arrow {
    transform: translateX(3px);
}

html[data-theme="dark"] .access-brand {
    background: #650606;
}

html[data-theme="dark"] .access-form-eyebrow {
    color: #f28d8d;
}

html[data-theme="dark"] .access-submit {
    border-color: #9e1414;
    background: #a30f0f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] .access-submit-symbol {
    background: #7d0808;
}

html[data-theme="dark"] .access-submit:hover {
    background: #8d0b0b;
}

@media (max-width: 767px) {
    .access-page {
        grid-template-rows: auto minmax(470px, 1fr);
    }

    .access-brand {
        min-height: 270px;
        padding: 22px 22px 0;
    }

    .access-brand-inner {
        grid-template-columns: minmax(0, 1fr) 142px;
        grid-template-rows: minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        max-width: 470px;
    }

    .access-brand-copy {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        padding-bottom: 18px;
    }

    .access-product-mark {
        margin-bottom: 7px;
        font-size: .72rem;
    }

    .access-brand-copy h1 {
        font-size: 1.45rem;
        line-height: 1.12;
    }

    .access-brand-copy p {
        margin-top: 8px;
        font-size: .78rem;
    }

    .access-visual {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        width: 142px;
        height: 248px;
        margin: 0;
        overflow: visible;
    }

    .access-mascot {
        width: 142px;
        max-height: 248px;
    }

    .access-form-wrap {
        margin-top: 24px;
    }

    .access-form-heading {
        margin-bottom: 28px;
    }

    .access-form-heading h2 {
        font-size: 1.72rem;
    }
}

@media (max-width: 350px) {
    .access-brand {
        min-height: 250px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .access-brand-inner {
        grid-template-columns: minmax(0, 1fr) 124px;
        gap: 4px;
    }

    .access-brand-copy h1 {
        font-size: 1.28rem;
    }

    .access-brand-copy p {
        font-size: .72rem;
    }

    .access-visual,
    .access-mascot {
        width: 124px;
        max-height: 225px;
    }

    .access-visual {
        height: 225px;
    }

    .access-submit {
        grid-template-columns: 48px minmax(0, 1fr) 44px;
    }

    .access-submit-label {
        font-size: .9rem;
    }
}

@media (min-width: 768px) and (max-height: 700px) {
    .access-brand {
        padding-top: 28px;
    }

    .access-brand-copy h1 {
        font-size: 1.7rem;
    }

    .access-mascot {
        width: min(68%, 350px);
        max-height: 60vh;
    }
}

/* Las reglas de acceso v2 aparecen al final del archivo; estos ajustes deben ganar la cascada. */
body.access-body {
    min-width: 0;
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
    .access-page {
        grid-template-columns: minmax(250px, 40%) minmax(0, 1fr);
        grid-template-rows: minmax(100dvh, auto);
    }

    .access-brand {
        grid-column: 1;
        grid-row: 1;
        min-height: 100dvh;
        padding: 18px 22px 0;
    }

    .access-panel {
        grid-column: 2;
        grid-row: 1;
        min-height: 100dvh;
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .access-brand-inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .access-brand-copy {
        grid-column: 1;
        grid-row: 1;
        padding-bottom: 0;
    }

    .access-visual {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        height: auto;
    }

    .access-mascot {
        width: min(58%, 220px);
        max-height: 70dvh;
    }
}
