/*
 * Constellation: el aire del portal legacy (tarjetas con banda azul, fondo gris azulado,
 * login sobre el cielo estrellado) con la interfaz de Filament.
 * Los colores salen de la marca (Configuración → Marca): --primary-500 es el color primario.
 */

:root {
    --cst-fondo: #eef1f7;
    --cst-banda: var(--primary-500);
    --cst-radio: 0.875rem;
    --cst-sombra: 0 1px 2px rgb(15 23 42 / 0.06), 0 4px 16px rgb(15 23 42 / 0.05);
}

.fi-body {
    background: var(--cst-fondo);
}

/* ---------- Barra superior ---------- */

.fi-topbar > nav,
.fi-topbar {
    background: #fff;
}

.fi-topbar {
    box-shadow: 0 1px 0 rgb(15 23 42 / 0.06);
}

/* ---------- Tarjetas con banda (como el legacy): secciones con título y tablas ---------- */

.cst-card,
.fi-ta-ctn,
:where(.fi-main) .fi-section.fi-section-has-header:not(.fi-section-not-contained):not(.fi-aside) {
    background: #fff;
    border-radius: var(--cst-radio);
    box-shadow: var(--cst-sombra);
    overflow: hidden;
    border: 0;
    --tw-ring-shadow: 0 0 #0000;
}

.cst-card-header,
.fi-ta-header:has(.fi-ta-header-heading),
:where(.fi-main) .fi-section.fi-section-has-header:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header {
    background: var(--cst-banda);
    color: #fff;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.fi-ta-header .fi-ta-header-heading,
:where(.fi-main) .fi-section.fi-section-has-header:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header .fi-section-header-heading {
    color: #fff;
}

:where(.fi-main) .fi-section.fi-section-has-header:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header .fi-section-header-description {
    color: rgb(255 255 255 / 0.75);
}

.fi-ta-header-toolbar {
    background: #fff;
}

/* ---------- Pantalla del cliente ---------- */

.cst-layout {
    display: grid;
    /* minmax(0, 1fr): la columna nunca es más ancha que la pantalla (si no, la tabla la estira y se corta). */
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* En celular primero lo que más se usa: subir y las listas; el perfil y el contacto, después. */
@media (max-width: 1023px) {
    .cst-main {
        order: -1;
    }
}

@media (min-width: 1024px) {
    .cst-layout {
        grid-template-columns: 20rem minmax(0, 1fr);
    }

    .cst-aside {
        position: sticky;
        top: 6rem;
    }
}

.cst-aside,
.cst-main {
    display: grid;
    gap: 1.5rem;
    min-width: 0;
}

.cst-perfil {
    padding: 1.75rem 1.5rem 1.25rem;
    text-align: center;
    border-top: 4px solid var(--cst-banda);
}

.cst-avatar {
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 0.85rem;
    border-radius: 9999px;
    display: grid;
    place-items: center;
    background: var(--primary-50);
    color: var(--cst-banda);
    font-size: 1.75rem;
    font-weight: 700;
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--primary-100);
}

.cst-perfil-nombre {
    font-size: 1.15rem;
    font-weight: 600;
    color: #111827;
}

.cst-perfil-rol {
    color: #6b7280;
    font-size: 0.875rem;
}

.cst-datos {
    margin-top: 1.25rem;
    text-align: left;
    font-size: 0.875rem;
}

.cst-datos > div {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-top: 1px solid #eef0f4;
}

.cst-datos dt {
    font-weight: 600;
    color: #374151;
}

.cst-datos dd {
    color: #4b5563;
    overflow-wrap: anywhere;
    text-align: right;
}

.cst-contacto {
    list-style: none;
    padding: 0.5rem 1.25rem;
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.cst-contacto li {
    display: flex;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #eef0f4;
}

.cst-contacto li:last-child {
    border-bottom: 0;
}

.cst-contacto a {
    color: inherit;
}

.cst-contacto a:hover {
    color: var(--cst-banda);
}

.cst-contacto-icono {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
    margin-top: 0.1rem;
    color: var(--cst-banda);
}

.cst-contacto-consulta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 1.25rem 1.25rem;
    padding: 0.6rem;
    border-radius: 0.6rem;
    background: var(--primary-50);
    color: var(--cst-banda);
    font-weight: 600;
    font-size: 0.875rem;
    transition: background-color 150ms ease;
}

.cst-contacto-consulta:hover {
    background: var(--primary-100);
}

.cst-subida {
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
}

.cst-subida-acciones {
    display: flex;
    justify-content: flex-end;
}

/* ---------- Login: cielo estrellado como el legacy ---------- */

.fi-simple-layout {
    background: #0b1230 url('/images/login-fondo.jpg') center / cover no-repeat fixed;
}

.fi-simple-main {
    border-radius: 1.25rem;
    box-shadow: 0 30px 80px rgb(0 0 0 / 0.45), 0 0 0 1px rgb(255 255 255 / 0.08);
    backdrop-filter: blur(2px);
}

.fi-simple-header .fi-logo {
    height: 6rem !important;
}

@media (prefers-reduced-motion: no-preference) {
    .fi-simple-main {
        animation: cst-entrar 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }
}

@keyframes cst-entrar {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
}

/* ---------- Asegure su cuenta y passkeys ---------- */

.cst-pasos {
    display: grid;
    gap: 1.5rem;
}

.cst-opciones {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cst-opcion {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 1rem;
    border: 1px solid #e1e6f0;
    border-radius: 0.85rem;
    background: #fff;
    text-align: start;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.cst-opcion:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
}

.cst-opcion:disabled {
    opacity: 0.6;
}

.cst-opcion-icono {
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
    color: var(--cst-banda);
}

.cst-opcion-texto {
    display: grid;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.cst-opcion-titulo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #111827;
}

.cst-opcion-detalle,
.cst-nota-chica {
    font-size: 0.8rem;
    color: #6b7280;
}

.cst-opcion-flecha {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
    color: #9ca3af;
}

.cst-centro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

.cst-fila {
    flex-direction: row;
    justify-content: center;
    gap: 1.25rem;
}

.cst-qr {
    width: 12rem;
    height: 12rem;
    padding: 0.5rem;
    border: 1px solid #e1e6f0;
    border-radius: 0.6rem;
    background: #fff;
}

.cst-clave {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e1e6f0;
    border-radius: 0.45rem;
    background: #f6f7fb;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #111827;
}

.cst-campo {
    display: grid;
    gap: 0.5rem;
}

.cst-campo label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.cst-codigo {
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.25rem;
    letter-spacing: 0.3em;
}

.cst-error,
.cst-aviso {
    font-size: 0.85rem;
    color: #b42318;
}

.cst-codigos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0;
    padding: 0.85rem;
    list-style: none;
    border: 1px solid #e1e6f0;
    border-radius: 0.6rem;
    background: #f6f7fb;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
}

.cst-passkeys {
    display: grid;
    gap: 1rem;
}

.cst-passkeys-cabecera {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.cst-passkeys-lista {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #e1e6f0;
    border-radius: 0.6rem;
}

.cst-passkeys-lista li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #eef0f4;
}

.cst-passkeys-lista li:first-child {
    border-top: 0;
}

.cst-passkey-nombre {
    display: block;
    font-weight: 600;
    color: #111827;
}

.cst-passkey-detalle {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
}

.cst-pasos .w-full,
.cst-centro .w-full {
    width: 100%;
}

/* ---------- Celular ---------- */

/* Filament oculta el logo de la barra en pantallas chicas (queda solo en el menú lateral): se muestra igual. */
@media (max-width: 1023px) {
    .fi-topbar-start {
        display: flex;
        align-items: center;
        margin-inline-end: auto;
    }

    .fi-topbar .fi-logo {
        height: 2.25rem !important;
    }
}

/* En celular el buscador global pisa al logo: cada lista tiene su propia búsqueda. */
@media (max-width: 639px) {
    .fi-topbar .fi-global-search-ctn,
    .fi-topbar .fi-global-search {
        display: none;
    }
}

/* Datos que en pantallas chicas van debajo del nombre (en las grandes tienen su columna). */
.cst-solo-movil {
    display: block;
    color: #6b7280;
    font-size: 0.8rem;
}

@media (min-width: 640px) {
    .cst-solo-movil {
        display: none;
    }
}

/* Nombres de archivo sin espacios (guiones bajos): se cortan donde haga falta en vez de estirar la tabla. */
.fi-ta-text.fi-wrapped,
.fi-ta-text.fi-wrapped .fi-ta-text-item {
    overflow-wrap: anywhere;
}
