/*
| Ortak kamera ile barkod okutma bileseni (public/assets/js/barkod-kamera.js).
| Ikon input icinde mutlak konumludur; metin ikonun altina girmesin diye
| input'a sag bosluk verilir.
*/

.bk-alan {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

/* erp-compact.css input dolgusunu !important ile verdiği için seçici önceliği ondan yüksek tutulur. */
/* Ekran alanı yanındaki düğmeye göre uzatıyorsa (flex/grid stretch) sarmalayıcı uzar;
   input da sarmalayıcıyı doldurarak eski yüksekliğini korur. */
span.bk-alan > input.bk-input[data-barkod-kamera] {
    align-self: stretch;
    padding-right: 34px !important;
}

/* Esnek genişleyen alanlarda (JS flex değerini sarmalayıcıya taşır) input sarmalayıcıyı doldurur. */
.bk-alan--esnek {
    min-width: 0;
}

span.bk-alan--esnek > input.bk-input[data-barkod-kamera] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.bk-buton {
    position: absolute;
    top: 50%;
    right: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 24px;
    padding: 0;
    color: #0f766e;
    background: transparent;
    border: 0;
    border-radius: 5px;
    transform: translateY(-50%);
    cursor: pointer;
}

/* Pasif veya salt okunur alanlarda kamera ile değer yazılamaz. */
.bk-input:disabled ~ .bk-buton,
.bk-input[readonly] ~ .bk-buton {
    display: none;
}

.bk-buton:hover,
.bk-buton:focus-visible {
    background: #e6f4f1;
    outline: none;
}

.bk-buton svg,
.bk-buton i {
    width: 14px;
    height: 14px;
    font-size: 14px;
    pointer-events: none;
}

/* Ekranların kendi pencerelerinin (en yüksek 999999) üstünde açılır; ekran kilidi ve sistem
   diyaloğu (layout.css, ekran-kilidi.css) yine de bunun üstünde kalır. */
.bk-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
}

.bk-modal[hidden] {
    display: none;
}

.bk-modal__arka {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
}

.bk-modal__pencere {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    width: min(440px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #d9e2ef;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
    transform: translate(-50%, -50%);
}

.bk-modal__pencere.is-dragging {
    user-select: none;
}

.bk-modal__baslik {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5edf6;
    cursor: move;
    touch-action: none;
}

.bk-modal__baslik h2 {
    margin: 0;
    color: #172033;
    font-size: 15px;
    font-weight: 900;
}

.bk-modal__baslik p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 12px;
}

.bk-modal__kapat {
    width: 28px;
    height: 28px;
    color: #64748b;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.bk-modal__kapat:hover {
    color: #172033;
    background: #f1f5f9;
}

.bk-modal__govde {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    overflow: auto;
}

.bk-goruntu {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0f172a;
    border-radius: 8px;
}

.bk-modal.is-kamerasiz .bk-goruntu {
    display: none;
}

.bk-goruntu video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bk-cerceve {
    position: absolute;
    inset: 28% 12%;
    border: 2px solid rgba(45, 212, 191, .9);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(15, 23, 42, .35);
}

.bk-durum {
    margin: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.bk-durum.is-error {
    color: #b45309;
}

.bk-elle {
    display: flex;
    gap: 8px;
}

.bk-elle input {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    padding: 0 9px;
    border: 1px solid #c8d5e4;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
}

.bk-elle input:focus {
    border-color: #0d9488;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .13);
}

.bk-modal__alt {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #e5edf6;
}

.bk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #d9e2ef;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.bk-btn:hover {
    background: #e2e8f0;
}

.bk-btn--primary {
    color: #ffffff;
    background: #0f766e;
    border-color: #0f766e;
}

.bk-btn--primary:hover {
    background: #115e59;
}
