/* =========================================================
   KOVRA PASO 43 — EDGE TO EDGE REAL
   Fondo desde el píxel 0. Solo el contenido respeta safe-area.
========================================================= */

:root {
    --kovra-edge-base: #050807;
    --kovra-edge-top: #091c10;
    --kovra-edge-background:
        radial-gradient(
            circle at 50% -8%,
            rgba(54,230,107,.09) 0%,
            rgba(54,230,107,.045) 16%,
            rgba(54,230,107,0) 34%
        ),
        #050807;
}

/*
 * El lienzo REAL de la aplicación empieza en el borde físico.
 * Esta es la superficie que también queda detrás de la cámara/notch.
 */
html {
    width: 100%;
    min-width: 100%;
    min-height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: var(--kovra-edge-background) !important;
    background-color: var(--kovra-edge-base) !important;
    background-repeat: no-repeat !important;
    background-size: 100% max(100svh, 100dvh) !important;
    color-scheme: dark;
}

/*
 * MUY IMPORTANTE:
 * el BODY ya NO reserva safe-area arriba.
 * Así no existe una banda vacía independiente.
 */
body {
    width: 100%;
    min-width: 100%;
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0 !important;
    padding-top: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: var(--kovra-edge-background) !important;
    background-color: var(--kovra-edge-base) !important;
    background-repeat: no-repeat !important;
    background-size: 100% max(100svh, 100dvh) !important;
    background-attachment: fixed !important;
}

/*
 * No existe pseudo-elemento, overlay, barra o separador en la zona superior.
 */
html::before,
html::after,
body::before {
    content: none !important;
    display: none !important;
}

/*
 * SOLO EL CONTENIDO baja debajo de cámara / Dynamic Island.
 * El fondo continúa por detrás sin interrupciones.
 */
.app,
.page,
.access-shell,
.register-shell {
    box-sizing: border-box;
    border-top: 0 !important;
    outline: 0 !important;
}

.app,
.page {
    padding-top: max(8px, calc(env(safe-area-inset-top) + 6px)) !important;
}

.access-shell,
.register-shell {
    padding-top: max(8px, calc(env(safe-area-inset-top) + 6px)) !important;
}

/*
 * Evita que reglas históricas de Inicio vuelvan a sumar safe-area al body.
 */
body:has(.app),
body:has(.page),
body:has(.access-shell),
body:has(.register-shell) {
    padding-top: 0 !important;
}

/*
 * El primer bloque no dibuja línea, sombra o borde horizontal.
 */
body > main:first-child,
body > .app:first-child,
body > .page:first-child,
body > .access-shell:first-child,
body > .register-shell:first-child,
.app > :first-child,
.page > :first-child,
.access-shell > :first-child,
.register-shell > :first-child {
    border-top-color: transparent !important;
    outline: 0 !important;
}

/* Registro: compacto después del safe-area. */
.register-shell .register-header {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

/* Nuevo cliente: identidad primero; score solo en Buró. */
.id-preview-card {
    grid-template-columns: minmax(0,1fr) !important;
}

/* Perfil del cliente: foto + nombre + KOVRA ID. */
.client-identity-card {
    grid-template-columns: 72px minmax(0,1fr) !important;
    min-height: 96px;
}

.client-profile-photo-shell {
    width: 66px;
    height: 66px;
}

.client-profile-photo-shell .avatar {
    width: 66px !important;
    height: 66px !important;
}

.client-photo-edit {
    right: -2px !important;
    bottom: -2px !important;
}

.client-identity-card .name-row h1 {
    font-size: clamp(19px,5.2vw,24px) !important;
}

.client-identity-card .id-row {
    flex-wrap: wrap;
    margin-top: 8px;
}

.client-identity-card .id-row strong {
    font-size: 12.5px !important;
}

.client-identity-card .copy-button {
    min-height: 32px !important;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(54,230,107,.07);
    color: var(--green);
}

.photo-helper {
    display: block;
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 10.5px !important;
}

.profile-balance-only {
    grid-template-columns: minmax(0,1fr) !important;
}

.profile-balance-only .balance-card {
    min-height: 96px !important;
}

@media (min-width:700px) {
    .client-identity-card {
        grid-template-columns: 78px minmax(0,1fr) !important;
    }

    .client-profile-photo-shell,
    .client-profile-photo-shell .avatar {
        width: 72px !important;
        height: 72px !important;
    }
}


/* Refuerzo visual: el fondo sube hasta el borde físico superior en TODAS las vistas. */
html,
body {
    background-origin: border-box !important;
    background-clip: border-box !important;
}

body > .app:first-child,
body > .page:first-child,
body > .access-shell:first-child,
body > .register-shell:first-child {
    margin-top: 0 !important;
}
