/* =========================================================
   Base
========================================================= */
html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

/* Header logo (si se usa en otras pantallas) */
.header-logo {
    flex-shrink: 0;
    height: 24px;
    width: 190px;
    background: url('../images/logonbicon.png') left center / contain no-repeat;
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

/* Splash */
.custom-splash-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.custom-splash-image {
    width: 500px !important;
    max-width: 500px !important;
    height: auto !important;
}

/* =========================================================
   Login (apunta a la card que TIENE el password)
========================================================= */

/* Card real del login (la que contiene el input password) */
.dx-card:has(input[type="password"]),
.card:has(input[type="password"]),
.xaf-login-form:has(input[type="password"]) {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: min(520px, calc(100vw - 48px)) !important;
    max-width: 520px !important;
    border-radius: 28px !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    background: linear-gradient(180deg, #171c2d 0%, #101525 100%) !important;
    box-shadow: 0 20px 55px rgba(0,0,0,0.34) !important;
    /* espacio arriba para el logo */
    padding: 70px 36px 34px 36px !important;
    margin: 0 !important;
}

    /* Logo dentro del panel, arriba a la izquierda */
    .dx-card:has(input[type="password"])::before,
    .card:has(input[type="password"])::before,
    .xaf-login-form:has(input[type="password"])::before {
        content: "";
        position: absolute;
        top: 18px;
        left: 36px;
        width: 150px;
        height: 24px;
        background: url('/images/logonbicon.png') left center / contain no-repeat;
    }

    /* Inputs del login */
    .dx-card:has(input[type="password"]) input,
    .dx-card:has(input[type="password"]) .dx-texteditor-input,
    .dx-card:has(input[type="password"]) .dxbl-text-editor input,
    .card:has(input[type="password"]) input,
    .card:has(input[type="password"]) .dx-texteditor-input,
    .card:has(input[type="password"]) .dxbl-text-editor input,
    .xaf-login-form:has(input[type="password"]) input,
    .xaf-login-form:has(input[type="password"]) .dx-texteditor-input,
    .xaf-login-form:has(input[type="password"]) .dxbl-text-editor input {
        height: 48px !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255,255,255,0.18) !important;
        background: rgba(255,255,255,0.03) !important;
        color: #fff !important;
        padding: 0 16px !important;
        font-size: 15px !important;
    }

    /* Botón login */
    .dx-card:has(input[type="password"]) .dx-button.dx-button-mode-contained,
    .dx-card:has(input[type="password"]) .btn-primary,
    .card:has(input[type="password"]) .dx-button.dx-button-mode-contained,
    .card:has(input[type="password"]) .btn-primary,
    .xaf-login-form:has(input[type="password"]) .dx-button.dx-button-mode-contained,
    .xaf-login-form:has(input[type="password"]) .btn-primary {
        background: linear-gradient(90deg, #5e66f7, #6d5eff) !important;
        border: none !important;
        color: #fff !important;
        height: 46px !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        font-size: 15px !important;
    }

/* =========================================================
   Dashboard KPI spacing (Fluent)
========================================================= */
.dx-flex-card-layout-row-center-only + .dx-flex-card-layout-row-center-only {
    margin-top: 12px !important;
}

.dx-flex-card-layout-content > .dx-flex-card-layout-row-center-only:first-of-type {
    padding-bottom: 8px !important;
}

.dx-flex-card-layout-row-element {
    line-height: 1.15 !important;
}

//grid personalizado.cell-normal {
    padding: 4px 6px;
}

.cell-comercial {
    background-color: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
}

.cell-direccion {
    background-color: #dcfce7;
    color: #15803d;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
}


/* =========================================================
   Matriz de Abastecimiento — expandir PropertyEditor al tab
========================================================= */

/* Hacer que el tab content ocupe toda la altura disponible */
.dxbl-tab-panel .dxbl-tab-content,
.dxbl-tab-panel .dxbl-tabs-content-container {
    height: 100% !important;
    overflow: hidden !important;
}

/* El form layout item que contiene la matriz debe expandirse */
.dxbl-fl-ctrl:has(.matrix-wrapper),
.dxbl-fl-ctrl-cont:has(.matrix-wrapper) {
    flex: 1 1 auto !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* El wrapper de la matriz ocupa todo */
.matrix-wrapper {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
}

    /* El scroll de la tabla toma el espacio restante */
    .matrix-wrapper .matrix-scroll-wrap {
        flex: 1 1 auto !important;
        overflow: auto !important;
        height: auto !important;
        min-height: 200px !important;
    }

    /* El header y toolbar no se encogen */
    .matrix-wrapper .matrix-header,
    .matrix-wrapper .matrix-toolbar {
        flex-shrink: 0 !important;
    }
