/* ── Layout: sin scroll lateral, columnas 50/50 ─────────────────────────── */
html {
    scrollbar-gutter: stable;
}


.sph-col-half {
    max-width: calc(50% - 0.75rem); /* compensa la mitad del gap-4 (1.5rem) */
}

@media (max-width: 767px) {
    .sph-col-half {
        max-width: 100%;
    }
}

/* ── Inputs Figma (scoped al form) ───────────────────────────────────────── */
#create-network-user-form .form-control,
#create-network-user-form .form-select {
    height: 48px;
    background-color: #f6f7f9;
    border: none;
    border-bottom: 1.5px solid #e5e7ea;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #283370;
    padding: 0 12px;
    box-shadow: none;
}

#create-network-user-form .form-control::placeholder,
#create-network-user-form .form-select::placeholder {
    color: #9ea5ad;
    font-weight: 500;
}

#create-network-user-form .form-control:focus,
#create-network-user-form .form-select:focus {
    background-color: #f6f7f9;
    border-bottom-color: #0ea9d8;
    box-shadow: none;
    outline: none;
}

#create-network-user-form .form-control.is-invalid,
#create-network-user-form .form-select.is-invalid {
    background-image: none;
    border-bottom-color: #f34141;
    border-top: none;
    border-left: none;
    border-right: none;
}

#create-network-user-form .form-control.is-valid,
#create-network-user-form .form-select.is-valid {
    background-image: none;
    border-bottom-color: #e5e7ea;
}

#create-network-user-form .invalid-feedback {
    font-size: 14px;
    font-weight: 400;
    color: #f34141;
    margin-top: 4px;
}

/* ── Teléfono: intl-tel-input ────────────────────────────────────────────── */
#create-network-user-form .iti {
    width: 100%;
}

#create-network-user-form .iti input#phone {
    height: 48px;
    background-color: #f6f7f9;
    border: none;
    border-bottom: 1.5px solid #e5e7ea;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #283370;
    box-shadow: none;
    width: 100%;
}

#create-network-user-form .iti input#phone:focus {
    background-color: #f6f7f9;
    border-bottom-color: #0ea9d8;
    box-shadow: none;
    outline: none;
}

#create-network-user-form .iti input#phone.is-invalid {
    border-bottom-color: #f34141;
}

#create-network-user-form .iti__flag-container {
    background-color: #f6f7f9;
    border-radius: 8px 0 0 8px;
    border-bottom: 1.5px solid #e5e7ea;
}

#create-network-user-form .iti__selected-flag {
    background-color: #f6f7f9 !important;
    border-radius: 8px 0 0 8px;
    height: 48px;
    padding: 0 10px;
}

#create-network-user-form .iti__selected-dial-code {
    font-size: 14px;
    font-weight: 500;
    color: #283370;
    margin-left: 4px;
}

/* iti dropdown panel — mismo estilo que select2 */
.iti__dropdown-content {
    z-index: 9999 !important;
    border: 1px solid #e5e7ea !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
    overflow: hidden;
    background-color: #ffffff !important;
}

.iti__search-input {
    width: 100% !important;
    border: 1px solid #e5e7ea !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
    color: #283370 !important;
    background-color: #f6f7f9 !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
}

.iti__search-input:focus {
    border-color: #0ea9d8 !important;
}

.iti__country-list {
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    max-height: 240px !important;
}

.iti__country {
    font-size: 14px !important;
    color: #283370 !important;
    padding: 8px 12px !important;
    background-color: #ffffff !important;
}

.iti__country.iti__highlight {
    background-color: #91dff7 !important;
    color: #283370 !important;
}

.iti__divider {
    border-bottom-color: #e5e7ea !important;
}

.iti__dial-code {
    color: #9ea5ad !important;
    font-size: 14px !important;
}

/* ── AssignStock: modos de entrada de IMEIs (Lista de IMEIs / Escanear) — en
   PC "Escanear" es solo informativo (se asume pistola); en movil es clicable
   y abre la camara — ver isMobileDevice() en Functions.cshtml ── */
.sph-imei-mode-row {
    border-bottom: 1px solid #e5e7ea;
}

.sph-imei-mode {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 8px;
    border: none;
    background: transparent;
    color: #9ea5ad;
    font-size: 14px;
    font-weight: 600;
}

.sph-imei-mode:not(:disabled) {
    cursor: pointer;
}

.sph-imei-mode-active {
    color: #0ea9d8;
    border-bottom: 2px solid #0ea9d8;
    margin-bottom: -1px;
}

/* ── AssignStock: vista previa de camara al escanear (ZXing, solo movil) ── */
.sph-scanner-video {
    width: 100%;
    max-height: 480px;
    border-radius: 8px;
    background-color: #000000;
    object-fit: contain; /* "cover" recorta bordes, podria recortar el propio codigo */
}

/* ── AssignStock: input de IMEI unico y burbujas lado a lado ── */
.sph-imei-input {
    max-width: 220px;
}

.sph-imei-chips {
    align-content: flex-start;
    /* Fixed, not max-height — renderChips() empties and repopulates this on every commit/select,
       and a height that collapses to content would shift the hint text and "Limpiar" button
       below it up and down on every re-render (BlockElement's overlay included). */
    height: 96px;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .sph-imei-chips {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ── Hint blocks: icono ? + texto ────────────────────────────────────────── */
.sph-input-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    color: #283370;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

.sph-input-hint .mdi {
    font-size: 16px;
    color: #0ea9d8;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── AssignStock: cadena de custodia (chips/dot + tooltip) — scoped a esta pantalla.
   .sph-chain-tooltip: nunca override global de tooltip — .tooltip-inner de Bootstrap tiene
   max-width que parte emails largos en 2+ lineas, forzamos una sola linea.
   .sph-chain-chip/.sph-chain-dot: el chip gris "ChipAction" del design system (Figma node
   17540:41298) sin su "X" de cierre — los roles se distinguen solo por el icono mdi, sin
   color/patron/forma. Desktop (md+) muestra icono + nombre truncado; movil solo el icono
   (mismo badge gris, sin label) porque N chips con label no caben en la fila ── */
.sph-chain-tooltip .tooltip-inner {
    max-width: none;
    white-space: nowrap;
}

.sph-chain-chip, .sph-chain-dot {
    background-color: var(--bs-gray-100, #eaebf1);
    color: var(--bs-gray-700, #495057);
}

.sph-chain-dot {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sph-chain-chip .mdi, .sph-chain-dot .mdi {
    font-size: 14px;
}

