/* SHAM · Estructura: encabezado, menú lateral y pie (MainLayout).
   Global y no aislado: RadzenLayout/RadzenSidebar son componentes y el CSS aislado no los alcanza.
   Solo variables del tema (sham-theme.css). */

.sham-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
    min-height: 3.5rem;
    padding: 0 1rem 0 0.25rem;
}

.sham-header-logo {
    display: flex;
    align-items: center;
    height: 2rem;
}

    .sham-header-logo img {
        height: 2rem;
        width: auto;
    }

.sham-header-espacio {
    flex: 1;
}

.sham-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--sham-linea);
    background: transparent;
    color: var(--rz-text-secondary-color);
    cursor: pointer;
}

    .sham-icon-btn:hover {
        background: var(--sham-suave);
        color: var(--sham-sobre-suave);
    }

.sham-usuario {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sham-avatar {
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--rz-primary);
    color: var(--rz-on-primary);
    font-family: var(--sham-fuente-titulos);
    font-weight: 700;
    font-size: 0.8125rem;
}

.sham-usuario-texto {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

    .sham-usuario-texto b {
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--rz-text-title-color);
    }

    .sham-usuario-texto small {
        font-size: 0.75rem;
        color: var(--rz-text-secondary-color);
    }

/* El menú de perfil de Radzen no debe pintar su propio fondo */
.sham-perfil,
.sham-perfil .rz-navigation-item-wrapper,
.sham-perfil .rz-navigation-item-link {
    background: transparent;
    color: var(--rz-text-color);
}

/* ---------- Menú lateral ---------- */
.sham-sidebar {
    width: 15rem;
    border-inline-end: 1px solid var(--sham-linea);
}

.sham-sidebar-compacto {
    width: 4rem;
}

.sham-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.75rem 0.625rem;
}

.sham-nav-grupo {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--rz-text-secondary-color);
    padding: 0.875rem 0.625rem 0.25rem;
}

    .sham-nav-grupo:first-child {
        padding-top: 0.25rem;
    }

.sham-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: 8px;
    color: var(--rz-text-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

    .sham-nav-item .rzi {
        color: var(--rz-text-secondary-color);
        font-size: 1.25rem;
    }

    .sham-nav-item:hover {
        background: var(--sham-hover);
        color: var(--rz-text-title-color);
    }

    .sham-nav-item.active {
        background: var(--sham-suave);
        color: var(--sham-sobre-suave);
        font-weight: 600;
    }

        .sham-nav-item.active .rzi {
            color: var(--sham-sobre-suave);
            font-variation-settings: "FILL" 1;
        }

/* Menú compacto: solo iconos */
.sham-sidebar-compacto .sham-nav-item span,
.sham-sidebar-compacto .sham-nav-grupo {
    display: none;
}

.sham-sidebar-compacto .sham-nav-item {
    justify-content: center;
}

/* ---------- Pie ---------- */
.sham-footer {
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
    padding: 0.375rem 1rem;
    border-top: 1px solid var(--sham-linea);
}

@media (max-width: 640px) {
    .sham-usuario-texto {
        display: none;
    }
}

/* ---------- Pantallas sin estructura (login, error, no encontrado) ---------- */
.sham-blank {
    padding: 1rem;
    min-height: 100vh;
    background: var(--sham-fondo);
}

    .sham-blank:has(> .sham-acceso) {
        padding: 0;
    }

/* ---------- Acceso: login y recuperación (PanelAcceso) ---------- */
.sham-acceso {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

.sham-acceso-marca {
    position: relative;
    overflow: hidden;
    background: var(--sham-panel-marca);
    color: var(--sham-panel-texto);   /* el panel es siempre azul profundo, en ambos modos */
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
}

.sham-acceso-trazo {
    position: absolute;
    left: -10%;
    width: 120%;
    bottom: 20%;
    height: 7.5rem;
    opacity: 0.14;
    pointer-events: none;
}

    .sham-acceso-trazo path {
        fill: none;
        stroke: var(--sham-panel-texto);
        stroke-width: 3;
        stroke-linejoin: round;
    }

.sham-acceso-logo {
    position: relative;
    width: 13rem;
    max-width: 100%;
    height: auto;
    align-self: flex-start;
}

.sham-acceso-propuesta {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

    .sham-acceso-propuesta h2 {
        color: var(--sham-panel-texto);
        font-size: 1.875rem;
        line-height: 1.2;
        font-weight: 700;
        max-width: 17ch;
        margin: 0;
        text-wrap: balance;
    }

    .sham-acceso-propuesta ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        font-size: 0.9375rem;
        color: var(--sham-panel-texto-2);
    }

    .sham-acceso-propuesta li {
        display: flex;
        align-items: center;
        gap: 0.625rem;
    }

        .sham-acceso-propuesta li .rzi {
            color: var(--sham-panel-acento);
            font-size: 1.25rem;
        }

.sham-acceso-institucion {
    position: relative;
    font-size: 0.8125rem;
    color: var(--sham-panel-texto-3);
}

.sham-acceso-formulario {
    background: var(--sham-superficie);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}

.sham-acceso-tarjeta {
    width: 100%;
    max-width: 22rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sham-acceso-titulo {
    font-size: 1.625rem;
    font-weight: 700;
    margin: 0;
}

.sham-acceso-sub {
    margin: -0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--rz-text-secondary-color);
}

.sham-acceso-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

    .sham-acceso-form .rz-form-field {
        width: 100%;
    }

.sham-acceso-fila {
    display: flex;
    justify-content: flex-end;
    font-size: 0.875rem;
}

.sham-link {
    color: var(--rz-link-color);
    font-weight: 600;
    text-decoration: none;
}

    .sham-link:hover {
        text-decoration: underline;
        color: var(--rz-link-hover-color);
    }

.sham-acceso-boton {
    width: 100%;
    font-weight: 600;
}

.sham-acceso-pie {
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
    text-align: center;
}

@media (max-width: 860px) {
    /* Móvil y tableta: cabecera de marca arriba y el formulario como una hoja que sube sobre ella */
    .sham-acceso {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .sham-acceso-marca {
        padding: calc(2.25rem + env(safe-area-inset-top, 0px)) 1.25rem 3.75rem;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 1rem;
    }

    .sham-acceso-logo {
        width: 10.5rem;
        align-self: center;
    }

    /* Solo el lema; la lista de ventajas queda para escritorio */
    .sham-acceso-propuesta {
        gap: 0;
        align-items: center;
    }

        .sham-acceso-propuesta h2 {
            font-size: 1.125rem;
            font-weight: 600;
            max-width: 24ch;
            color: var(--sham-panel-texto-2);
        }

        .sham-acceso-propuesta ul {
            display: none;
        }

    .sham-acceso-trazo {
        left: -20%;
        width: 140%;
        bottom: 1.75rem;
        height: 4.5rem;
        opacity: 0.12;
    }

    .sham-acceso-institucion {
        padding: 0.375rem 0.875rem;
        border-radius: 999px;
        border: 1px solid color-mix(in srgb, var(--sham-panel-texto) 28%, transparent);
        font-size: 0.8125rem;
        color: var(--sham-panel-texto-2);
    }

    .sham-acceso-formulario {
        position: relative;
        z-index: 1;
        margin-top: -1.75rem;
        border-radius: 1.5rem 1.5rem 0 0;
        align-items: flex-start;
        padding: 2rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
        box-shadow: var(--sham-sombra-hoja);
    }

    .sham-acceso-tarjeta {
        max-width: 26rem;
        margin: 0 auto;
    }

    .sham-acceso-titulo {
        font-size: 1.5rem;
    }
}

/* ---------- Buscador de pacientes (encabezado) ---------- */
.sham-buscador {
    position: relative;
    flex: 0 1 26rem;
    min-width: 0;
    margin-left: 1rem;
}

.sham-buscador-movil {
    display: none;
}

.sham-buscador-campo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid var(--rz-base-500);
    border-radius: 8px;
    background: var(--sham-fondo);
    color: var(--rz-text-secondary-color);
}

    .sham-buscador-campo:focus-within {
        border-color: var(--rz-primary);
        background: var(--sham-superficie);
        box-shadow: 0 0 0 3px var(--rz-primary-lighter);
    }

    .sham-buscador-campo input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: none;
        background: transparent;
        color: var(--rz-text-title-color);
        font: inherit;
        font-size: 0.875rem;
    }

        .sham-buscador-campo input::placeholder {
            color: var(--rz-text-secondary-color);
            opacity: 1;
        }

.sham-buscador-lista {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    right: 0;
    z-index: 10;
    list-style: none;
    margin: 0;
    padding: 0.375rem;
    background: var(--sham-superficie);
    border: 1px solid var(--sham-linea);
    border-radius: 10px;
    box-shadow: var(--sham-sombra);
    max-height: 22rem;
    overflow-y: auto;
}

.sham-buscador-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: 8px;
    cursor: pointer;
}

    .sham-buscador-item div {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .sham-buscador-item b {
        font-weight: 600;
        font-size: 0.875rem;
        color: var(--rz-text-title-color);
    }

    .sham-buscador-item small {
        font-size: 0.75rem;
        color: var(--rz-text-secondary-color);
    }

    .sham-buscador-item:hover,
    .sham-buscador-item.activo {
        background: var(--sham-suave);
    }

        .sham-buscador-item:hover b,
        .sham-buscador-item.activo b,
        .sham-buscador-item:hover small,
        .sham-buscador-item.activo small {
            color: var(--sham-sobre-suave);
        }

.sham-buscador-info {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    color: var(--rz-text-secondary-color);
}

@media (max-width: 760px) {
    .sham-buscador {
        flex: 0 0 auto;
        margin-left: 0;
        position: static;
    }

    .sham-buscador-movil {
        display: grid;
    }

    .sham-buscador-campo {
        display: none;
    }

    .sham-buscador-abierto .sham-buscador-campo {
        display: flex;
        position: absolute;
        left: 0.75rem;
        right: 0.75rem;
        top: 3.5rem;
        z-index: 11;
        background: var(--sham-superficie);
    }

    .sham-buscador-abierto .sham-buscador-lista {
        top: 6.25rem;
        left: 0.75rem;
        right: 0.75rem;
    }
}

/* Símbolo corto del logo: solo en el móvil (sham-responsive.css lo muestra) */
:root .sham-header-logo img.sham-logo-corto {
    display: none !important;
}
