.shell-body {
    --shell-blue: #2563eb;
    --dapp-icon-camera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4l1.5 2H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l1.5-2z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E");
    --dapp-icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
    min-height: 100vh;
    overflow: hidden;
    background: #f8fafc !important;
    background-image: none !important;
}

.shell-loading {
    position: fixed; inset: 0; z-index: 50000; display: flex; align-items: center; justify-content: center;
    padding: 1.25rem; color: #172b4d;
    background: radial-gradient(circle at 50% 15%, #e4efff 0%, transparent 48%), linear-gradient(145deg, #f8fbff, #edf3fa);
}
.shell-loading-card {
    width: min(100%, 440px); padding: clamp(2rem, 6vw, 3.25rem); text-align: center;
    background: rgba(255,255,255,.92); border: 1px solid white; border-radius: 28px;
    box-shadow: 0 24px 70px rgba(32,65,112,.12);
}
.shell-loading-card img { width: 82px; height: 82px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(37,99,235,.14)); }
.shell-loading-eyebrow { margin: 1.3rem 0 .65rem; color: #4d73a9; font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.shell-loading-card h1 { margin: 0; color: #14284a; font-size: clamp(1.7rem, 6vw, 2.15rem); line-height: 1.2; overflow-wrap: anywhere; }
.shell-loading-intro { margin: .6rem 0 0; color: #718098; font-size: .92rem; }
.shell-loading-progress { margin-top: 2.25rem; }
.shell-loading-progress-heading { display: flex; justify-content: space-between; gap: 1rem; color: #64748b; font-size: .8rem; font-weight: 700; text-align: left; }
.shell-loading-progress-heading span:last-child { color: #2563eb; white-space: nowrap; }
.shell-loading-track { height: 7px; margin-top: .7rem; overflow: hidden; border-radius: 999px; background: #e8eff9; }
.shell-loading-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #69a8ff); transition: width .3s ease; }
.shell-loading-delay { margin: 1rem 0 0; color: #a35b12; font-size: .78rem; }
.shell-loading-delay[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .shell-loading-track span { transition: none; } }

.shell-app {
    height: 100vh;
    display: grid;
    grid-template-rows: 72px 1fr;
    background: #f8fafc;
}

.shell-app[hidden],
.shell-route-error[hidden],
.shell-confirm[hidden] {
    display: none !important;
}

.shell-topbar {
    height: 72px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0 3rem;
    background: var(--shell-blue);
    border-bottom: 0;
    box-shadow: none;
    z-index: 30;
}

.shell-topbar::before {
    display: none;
}

.shell-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: min(560px, 48vw);
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
}

.shell-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex: 0 0 auto;
}

.shell-brand strong,
.shell-brand small {
    display: block;
    line-height: 1.05;
}

.shell-brand strong {
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: 0;
}

.shell-brand small {
    margin-top: 0.2rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.shell-search {
    flex: 1;
    max-width: 588px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 180px;
    height: 50px;
    padding: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.24);
    color: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px rgba(255,255,255,0.08), 0 8px 24px rgba(8, 44, 88, 0.2);
}

.shell-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 0.95rem;
}

.shell-search input::placeholder {
    color: rgba(255, 255, 255, 0.62);
}

.shell-preview-badge {
    display: none;
    align-items: center;
    min-height: 28px;
    padding: 0 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 900;
    white-space: nowrap;
}

.shell-preview-badge[hidden] {
    display: none !important;
}

.shell-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.78rem;
}

.shell-user #shellRefreshBtn {
    display: none;
}

.shell-profile {
    border: 0;
    background: transparent;
    text-align: right;
    cursor: pointer;
    color: #ffffff;
    padding: 0 0.1rem 0 0;
}

.shell-user-name,
.shell-user-role {
    display: block;
    line-height: 1.15;
}

.shell-user-name {
    font-weight: 900;
    font-size: 0.86rem;
    letter-spacing: 0;
}

.shell-user-role {
    margin-top: 0.22rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: none;
    letter-spacing: 0;
}

.shell-avatar {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    overflow: hidden;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.shell-avatar:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.shell-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shell-icon-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.shell-icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.shell-sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.shell-sidebar-toggle span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: #ffffff;
}

.shell-logout {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.72);
    color: #ffffff;
    font-weight: 900;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    overflow: hidden;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.shell-action-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.shell-action-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.16));
}

.shell-logout:hover {
    background: rgba(239, 68, 68, 0.88);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.shell-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: 252px 1fr;
    width: 100%;
    background: linear-gradient(90deg, #f8fafc 0 252px, #f8fafc 252px);
}

.shell-sidebar {
    min-height: 0;
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding: 0.68rem 0.48rem 1rem !important;
    background: #edf3f9 !important;
    border-right: 0 !important;
    box-shadow: none !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255, 255, 255, 0.42) transparent !important;
}

.shell-sidebar::-webkit-scrollbar-track {
    background: #f8fafc !important;
}

.shell-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.42) !important;
}

/* La barra debe distinguirse del fondo y permanecer accesible en el menú. */
html body aside.shell-sidebar {
    scrollbar-width: thin !important;
    scrollbar-color: #9bafc9 #edf3f9 !important;
    -ms-overflow-style: auto !important;
}
html body aside.shell-sidebar::-webkit-scrollbar {
    display: block !important;
    width: 7px !important;
    height: 7px !important;
}
html body aside.shell-sidebar::-webkit-scrollbar-track {
    background: #edf3f9 !important;
    border-radius: 8px;
}
html body aside.shell-sidebar::-webkit-scrollbar-thumb {
    background: #9bafc9 !important;
    border-radius: 8px;
}
html body .shell-profile-view {
    scrollbar-width: thin;
    scrollbar-color: #9bafc9 #edf2f8;
}
html body .shell-profile-view::-webkit-scrollbar { width: 7px; height: 7px; }
html body .shell-profile-view::-webkit-scrollbar-track { background: #edf2f8; border-radius: 8px; }
html body .shell-profile-view::-webkit-scrollbar-thumb { background: #9bafc9; border-radius: 8px; }

.shell-nav {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
}

.shell-nav-loading,
.shell-empty {
    padding: 1rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
}

.shell-nav-section {
    --section-hover: #f1f5f9;
    --section-accent: #64748b;
    --section-strong: #334155;
    position: relative;
    padding: 0.36rem 0.38rem 0.42rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    border-left: 4px solid var(--section-accent);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
}

.shell-nav-section::before {
    display: none;
}

.shell-nav-section[data-group="principal"] {
    --section-accent: #2563eb;
}

.shell-nav-section[data-group="gestion_de_reservas"] {
    --section-accent: #059669;
}

.shell-nav-section[data-group="calendario"] {
    --section-accent: #d97706;
}

.shell-nav-section[data-group="documentos"] {
    --section-accent: #7c3aed;
}

.shell-nav-section[data-group="soporte_tecnico"] {
    --section-accent: #e11d48;
}

.shell-nav-section[data-group="administracion"] {
    --section-accent: #4f46e5;
}

.shell-nav-section[data-group="otros_modulos"] {
    --section-accent: #0891b2;
}

.shell-nav-title {
    padding: 0.34rem 0.5rem 0.24rem;
    color: var(--section-accent);
    font-size: 0.61rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.shell-nav-link {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.38rem 0.54rem;
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.86rem;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease;
}

.shell-nav-link:hover {
    background: var(--section-hover);
    color: #0b2c61;
}

.shell-nav-link:focus-visible { color: #0b2c61; outline: 2px solid #5478a3; outline-offset: 2px; }
.shell-nav-link:active { color: #071e44; }

.shell-nav-link.is-active {
    background: #ffffff;
    color: #0b2c61;
    box-shadow: none;
    font-weight: 800;
}

.shell-nav-link.is-hidden-by-search {
    display: none;
}

.shell-nav-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex: 0 0 22px;
    font-size: 0;
}

.shell-nav-icon::before {
    content: "";
    width: 17px;
    height: 17px;
    display: block;
    background: currentColor;
    -webkit-mask: var(--shell-menu-icon, var(--dapp-icon-generic)) center / contain no-repeat;
    mask: var(--shell-menu-icon, var(--dapp-icon-generic)) center / contain no-repeat;
}

.shell-nav-link[data-page="portal.html"] {
    --shell-menu-icon: var(--dapp-icon-home);
}

.shell-nav-link[data-page="reservas.html"],
.shell-nav-link[data-page="reservas-tablets-admin.html"],
.shell-nav-link[data-page="registro-tablets.html"] {
    --shell-menu-icon: var(--dapp-icon-tablet);
}

.shell-nav-link[data-page="bus-escolar.html"] {
    --shell-menu-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='16' rx='3'/%3E%3Cpath d='M4 11h16M7 19v2m10-2v2M8 15h.01M16 15h.01'/%3E%3C/svg%3E");
}

.shell-nav-link[data-page="autorizacion-salidas-bus.html"] {
    --shell-menu-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-3'/%3E%3Crect x='9' y='2' width='6' height='4' rx='1'/%3E%3Cpath d='m8 13 2.5 2.5L16 10'/%3E%3C/svg%3E");
}

.shell-nav-link[data-page="cra.html"],
.shell-nav-link[data-page="reservas-cra-admin.html"] {
    --shell-menu-icon: var(--dapp-icon-book);
}

.shell-nav-link[data-page="reservas-musica.html"] {
    --shell-menu-icon: var(--dapp-icon-music);
}

.shell-nav-link[data-page="calendario-evaluaciones.html"] {
    --shell-menu-icon: var(--dapp-icon-chart);
}

.shell-nav-link[data-page="entrevistas-apoderados.html"] {
    --shell-menu-icon: var(--dapp-icon-users);
}

.shell-nav-link[data-page="registro-entrevistas-apoderados.html"] {
    --shell-menu-icon: var(--dapp-icon-edit);
}

.shell-nav-link[data-page="calendario-escolar.html"] {
    --shell-menu-icon: var(--dapp-icon-calendar);
}

.shell-nav-link[data-page="agenda-reuniones.html"] {
    --shell-menu-icon: var(--dapp-icon-clock);
}

.shell-nav-link[data-page="soporte.html"] {
    --shell-menu-icon: var(--dapp-icon-support);
}

.shell-nav-link[data-page="inventario-ti.html"] {
    --shell-menu-icon: var(--dapp-icon-monitor);
}

.shell-nav-link[data-page="documentos-institucionales.html"] {
    --shell-menu-icon: var(--dapp-icon-file);
}

.shell-refresh-link {
    --shell-menu-icon: var(--dapp-icon-refresh);
    margin-top: auto;
}

.shell-nav-link[data-page="reservas-admin.html"],
.shell-nav-link[data-page="soporte-admin.html"],
.shell-nav-link[data-page="novedades-admin.html"],
.shell-nav-link[data-page="reservas-tablets-admin.html"],
.shell-nav-link[data-page="registro-tablets.html"],
.shell-nav-link[data-page="reservas-cra-admin.html"],
.shell-nav-link[data-page="reportes-admin.html"],
.shell-nav-link[data-page="usuarios-admin.html"],
.shell-nav-link[data-page="enlaces-admin.html"] {
    --shell-menu-icon: var(--dapp-icon-admin);
}

.shell-nav-link[data-page="permisos-admin.html"] {
    --shell-menu-icon: var(--dapp-icon-shield);
}

.shell-nav-link[data-page="mis-permisos.html"] {
    --shell-menu-icon: var(--dapp-icon-clipboard);
}

.shell-nav-link[data-page="mis-licencias.html"] {
    --shell-menu-icon: var(--dapp-icon-thermometer);
}

.shell-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    justify-content: center;
    background: #f8fafc;
    border-top-left-radius: 18px;
    overflow: hidden;
}

.shell-frame-wrap {
    min-height: 0;
    width: 100%;
    max-width: 1480px;
    flex: 1 1 auto;
    margin: 0;
    border: 0;
    border-radius: 18px 0 0 0;
    overflow: hidden;
    background: #ffffff;
    box-shadow: none;
}

.shell-frame {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: transparent;
}

@media (min-width: 2200px) {
    .shell-layout {
        width: min(100%, 1680px);
        margin: 0 auto;
    }

    .shell-main {
        border-top-right-radius: 18px;
    }

    .shell-frame-wrap {
        border-radius: 18px 18px 0 0;
    }
}

.shell-profile-view {
    min-height: 0;
    overflow: auto;
    margin: 1rem 2rem 2rem;
    padding: clamp(1.4rem, 3vw, 2.4rem);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.shell-profile-view[hidden] {
    display: none !important;
}

.shell-profile-page {
    width: min(1040px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shell-profile-heading {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #dbe3ef;
}

.shell-profile-kicker,
.shell-profile-panel-label {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.shell-profile-heading h1 {
    margin: 0.18rem 0 0;
    color: #0f3fb5;
    font-size: 1.6rem;
    line-height: 1.1;
    font-weight: 900;
}

.shell-profile-back {
    min-height: 40px;
    padding: 0 0.9rem;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: #ffffff;
    color: #1d4ed8;
    font-weight: 900;
    cursor: pointer;
}

.shell-profile-identity {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 1.2rem;
    align-items: center;
    padding: 1.2rem;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.shell-profile-photo {
    position: relative;
    width: 112px;
    height: 112px;
}

.shell-profile-photo img {
    width: 100%;
    height: 100%;
    display: block;
    border: 4px solid #ffffff;
    border-radius: 50%;
    object-fit: cover;
    background: #dbeafe;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.shell-profile-photo-btn {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 36px;
    height: 36px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32);
}

.shell-profile-photo-btn::before {
    content: "";
    width: 17px;
    height: 17px;
    display: block;
    margin: auto;
    background: currentColor;
    -webkit-mask: var(--dapp-icon-camera) center / contain no-repeat;
    mask: var(--dapp-icon-camera) center / contain no-repeat;
}

.shell-profile-copy h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.55rem;
    line-height: 1.15;
    font-weight: 900;
}

.shell-profile-copy p {
    margin: 0.35rem 0 0.75rem;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 700;
}

.shell-profile-role-pill {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 0.72rem;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 900;
}

.shell-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 1rem;
}

.shell-profile-panel {
    padding: 1.15rem;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.shell-profile-data {
    margin: 0.9rem 0 0;
    display: grid;
    gap: 0.72rem;
}

.shell-profile-data div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.72rem 0;
    border-top: 1px solid #edf2f7;
}

.shell-profile-data dt {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
}

.shell-profile-data dd {
    margin: 0;
    min-width: 0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.shell-profile-pref-row {
    min-height: 98px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.shell-profile-pref-row h3 {
    margin: 0.45rem 0 0.25rem;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
}

.shell-profile-pref-row p {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}

.shell-switch {
    width: 58px;
    height: 34px;
    position: relative;
    flex: 0 0 auto;
}

.shell-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.shell-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.18s ease;
}

.shell-switch span::before {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    top: 4px;
    left: 4px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease;
}

.shell-switch input:checked + span {
    background: #2563eb;
}

.shell-switch input:checked + span::before {
    transform: translateX(24px);
}

.shell-route-error {
    position: fixed;
    inset: 0;
    z-index: 60000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
}

.shell-route-error div {
    width: min(420px, 100%);
    padding: 1.5rem;
    border-radius: 8px;
    background: #ffffff;
    text-align: center;
}

.shell-route-error h2 {
    margin: 0 0 0.6rem;
    font-size: 1.2rem;
}

.shell-route-error p {
    margin: 0 0 1.25rem;
    color: #64748b;
}

.shell-confirm {
    position: fixed;
    inset: 0;
    z-index: 70000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.62);
}

.shell-confirm-card {
    width: min(420px, 100%);
    padding: 1.4rem;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28);
}

.shell-confirm-card h2 {
    margin: 0 0 0.55rem;
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 900;
}

.shell-confirm-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
}

.shell-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.shell-confirm-cancel,
.shell-confirm-accept {
    min-height: 42px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
}

.shell-confirm-cancel {
    border: 1px solid #dbe3ef;
    background: #ffffff;
    color: #475569;
}

.shell-confirm-accept {
    border: 1px solid #be123c;
    background: #be123c;
    color: #ffffff;
}

.shell-brand .shell-brand-short,
.shell-sidebar-mobile-head,
.shell-mobile-logout,
.shell-sidebar-backdrop {
    display: none;
}

@media (max-width: 980px) {
    .shell-app {
        height: 100dvh;
        grid-template-rows: 64px 1fr;
    }

    .shell-topbar {
        height: 64px;
        padding: 0 0.75rem;
        gap: 0.55rem;
    }

    .shell-sidebar-toggle {
        display: inline-flex;
        flex: 0 0 38px;
    }

    .shell-brand {
        min-width: 0;
        flex: 1 1 auto;
        gap: 0.65rem;
    }

    .shell-brand > span { min-width: 0; }

    .shell-brand img {
        width: 38px;
        height: 38px;
    }

    .shell-brand strong {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.94rem;
    }

    .shell-brand small,
    .shell-search,
    .shell-preview-badge {
        display: none;
    }

    .shell-user {
        flex: 0 0 auto;
        gap: 0.45rem;
    }

    .shell-avatar { flex-shrink: 0; }

    .shell-profile {
        max-width: 120px;
        display: none;
    }

    .shell-user-name,
    .shell-user-role {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .shell-user-name {
        font-size: 0.78rem;
    }

    .shell-user-role {
        font-size: 0.72rem;
    }

    .shell-avatar,
    .shell-icon-btn {
        width: 38px;
        height: 38px;
    }

    .shell-logout {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        padding: 0;
        border-radius: 50%;
        font-size: 1rem;
    }

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

    .shell-sidebar {
        position: fixed !important;
        top: 64px !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 25 !important;
        width: min(260px, 78vw) !important;
        height: auto !important;
        max-height: none !important;
        transform: translateX(-100%) !important;
        transition: transform 0.2s ease !important;
        box-shadow: 18px 0 35px rgba(15, 23, 42, 0.16) !important;
        visibility: hidden;
        pointer-events: none;
        overscroll-behavior: contain;
    }

    .shell-sidebar.is-open {
        transform: translateX(0) !important;
        visibility: visible;
        pointer-events: auto;
    }

    .shell-sidebar-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.35rem 0.3rem 0.75rem;
        color: #1e293b;
        font-size: 0.85rem;
        font-weight: 700;
    }

    .shell-sidebar-mobile-head button {
        min-height: 38px;
        padding: 0.4rem 0.65rem;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: transparent;
        color: #1e293b;
        font: inherit;
        cursor: pointer;
    }

    .shell-sidebar-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 64px 0 0;
        z-index: 24;
        background: rgba(15,23,42,0.25);
    }

    .shell-topbar :focus-visible {
        outline: 2px solid #ffffff;
        outline-offset: 2px;
    }

    .shell-sidebar :focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
    }

    .shell-frame-wrap {
        margin: 0;
    }

    .shell-profile-view {
        margin: 0.75rem;
        padding: 1rem;
    }

    .shell-profile-heading {
        min-height: 64px;
    }

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

    .shell-profile-identity {
        text-align: center;
    }

    .shell-profile-photo {
        margin: 0 auto;
    }

    .shell-profile-data div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

@media (max-width: 560px) {
    .shell-profile,
    .shell-logout {
        display: none !important;
    }

    .shell-topbar {
        gap: 0.4rem;
        padding-inline: 0.65rem;
    }

    .shell-brand { gap: 0.4rem; }
    .shell-brand .shell-brand-name { display: none; }
    .shell-brand .shell-brand-short { display: block; font-size: 0.85rem; }
    .shell-user { gap: 0.35rem; }

    /* La separación de la campana se inyecta después desde notifications.js. */
    .shell-topbar .shell-user #notifContainer {
        padding-left: 0 !important;
        border-left: 0 !important;
    }

    .shell-mobile-logout {
        display: block;
        width: 100%;
        min-height: 42px;
        margin-top: 0.75rem;
        border: 1px solid rgba(255,255,255,0.35);
        border-radius: 8px;
        padding: 0.6rem;
        background: rgba(185,28,28,0.75);
        color: #ffffff;
        font: inherit;
        cursor: pointer;
    }

    .shell-profile-heading {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 0.75rem 0;
    }

    .shell-profile-back {
        width: 100%;
    }
}

@media (max-width: 980px) and (prefers-reduced-motion: reduce) {
    .shell-sidebar { transition: none !important; }
}

/* Presencia en la barra institucional. */
.shell-presence { display: inline-flex; align-items: center; gap: 0.4rem; height: 42px; padding-right: 0.95rem; margin-right: 0.18rem; border-right: 1px solid rgba(255, 255, 255, 0.24); color: rgba(255,255,255,.9); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.shell-presence[hidden] { display: none; }
.shell-presence-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #4ade80; }
@media (max-width: 560px) { .shell-presence { gap: .25rem; height: 38px; padding-right: .35rem; margin-right: 0; font-size: .68rem; } }

/* Lucide Icons (bell, message-circle-more, headset), ISC License. Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2026 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2026. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
/* Barra institucional: decoración sin interacción y controles existentes. */
.shell-topbar { background: linear-gradient(105deg, #092b62 0%, #0b326c 52%, #071f4b 100%); }
.shell-topbar::before { content: ''; display: block; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%2072%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20fill%3D%22%23194c83%22%20opacity%3D%22.55%22%20d%3D%22M90%2072%20180%2043%20200%2049%20280%2014%20335%2043%20360%2034%20455%2072Z%22%2F%3E%3Cpath%20fill%3D%22%2325619a%22%20opacity%3D%22.38%22%20d%3D%22M140%2072%20212%2051%20230%2056%20289%2028%20328%2053%20357%2045%20435%2072Z%22%2F%3E%3Cpath%20d%3D%22M0%2071h308C408%2071%20415%2012%20555%203%22%20fill%3D%22none%22%20stroke%3D%22%23d4ad59%22%20stroke-width%3D%221.6%22%20opacity%3D%22.85%22%2F%3E%3C%2Fsvg%3E") center / min(800px, 66%) 100% no-repeat; pointer-events: none; }
.shell-topbar > * { position: relative; }
.shell-topbar .shell-brand small { color: rgba(236,244,255,.9); }
.shell-topbar .shell-user :is(.notif-bell-icon,.chat-nav-icon) { width: 22px !important; height: 22px !important; transform: none !important; }
.shell-topbar .shell-user :is(.notif-bell-icon,.chat-nav-icon) svg, .shell-topbar #shellSupportBtn svg { display: none !important; }
.shell-topbar .shell-user :is(.notif-bell-icon,.chat-nav-icon)::before, .shell-topbar #shellSupportBtn::before { content: ''; display: block; width: 22px; height: 22px; flex: none; background: currentColor; mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
.shell-topbar .notif-bell-icon::before { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10.268%2021a2%202%200%200%200%203.464%200%22%2F%3E%3Cpath%20d%3D%22M3.262%2015.326A1%201%200%200%200%204%2017h16a1%201%200%200%200%20.74-1.673C19.41%2013.956%2018%2012.499%2018%208A6%206%200%200%200%206%208c0%204.499-1.411%205.956-2.738%207.326%22%2F%3E%3C%2Fsvg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10.268%2021a2%202%200%200%200%203.464%200%22%2F%3E%3Cpath%20d%3D%22M3.262%2015.326A1%201%200%200%200%204%2017h16a1%201%200%200%200%20.74-1.673C19.41%2013.956%2018%2012.499%2018%208A6%206%200%200%200%206%208c0%204.499-1.411%205.956-2.738%207.326%22%2F%3E%3C%2Fsvg%3E"); }
.shell-topbar .chat-nav-icon::before { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2.992%2016.342a2%202%200%200%201%20.094%201.167l-1.065%203.29a1%201%200%200%200%201.236%201.168l3.413-.998a2%202%200%200%201%201.099.092%2010%2010%200%201%200-4.777-4.719%22%2F%3E%3Cpath%20d%3D%22M8%2012h.01M12%2012h.01M16%2012h.01%22%2F%3E%3C%2Fsvg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2.992%2016.342a2%202%200%200%201%20.094%201.167l-1.065%203.29a1%201%200%200%200%201.236%201.168l3.413-.998a2%202%200%200%201%201.099.092%2010%2010%200%201%200-4.777-4.719%22%2F%3E%3Cpath%20d%3D%22M8%2012h.01M12%2012h.01M16%2012h.01%22%2F%3E%3C%2Fsvg%3E"); }
.shell-topbar #shellSupportBtn::before { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2011h3a2%202%200%200%201%202%202v3a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-5Zm0%200a9%209%200%201%201%2018%200m0%200v5a2%202%200%200%201-2%202h-1a2%202%200%200%201-2-2v-3a2%202%200%200%201%202-2h3Z%22%2F%3E%3Cpath%20d%3D%22M21%2016v2a4%204%200%200%201-4%204h-5%22%2F%3E%3C%2Fsvg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2011h3a2%202%200%200%201%202%202v3a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-5Zm0%200a9%209%200%201%201%2018%200m0%200v5a2%202%200%200%201-2%202h-1a2%202%200%200%201-2-2v-3a2%202%200%200%201%202-2h3Z%22%2F%3E%3Cpath%20d%3D%22M21%2016v2a4%204%200%200%201-4%204h-5%22%2F%3E%3C%2Fsvg%3E"); }
.shell-topbar .shell-action-icon svg { stroke-width: 2; filter: none; }
@media (max-width: 980px) { .shell-topbar::before { background-size: min(560px, 75%) 100%; opacity: .7; } }
@media (max-width: 560px) { .shell-topbar::before { background-size: 85% 100%; opacity: .45; } }
