.barcode-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.95fr);
    gap: 20px;
    align-items: start;
}

.barcode-scanner-panel,
.barcode-result-panel {
    align-self: start;
}
.records-panel {
    overflow: hidden;
}

.scan-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 20px;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow: hidden;
}

.scan-tab {
    min-height: 44px;
    border: 0;
    border-right: 1px solid var(--border);
    background: rgba(6, 11, 23, 0.82);
    color: var(--text-soft);
    cursor: pointer;
    transition: 0.2s ease;
}

.scan-tab:last-child {
    border-right: 0;
}

.scan-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.scan-tab.active {
    background: linear-gradient(
        100deg,
        rgba(192, 38, 211, 0.32),
        rgba(22, 71, 245, 0.52)
    );
    color: #fff;
}

.scanner-preview {
    position: relative;
    min-height: 320px;
    margin: 14px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background:
        radial-gradient(circle at center, rgba(37, 99, 235, 0.08), transparent 48%),
        #080d18;
}

.scanner-placeholder {
    color: var(--text-muted);
    font-size: 15px;
}

.scan-line {
    position: absolute;
    left: 4%;
    right: 4%;
    top: 10%;
    height: 2px;

    background: #00e89d;

    box-shadow:
        0 0 8px rgba(0, 232, 157, 0.8),
        0 0 18px rgba(0, 232, 157, 0.35);

    z-index: 10;

    pointer-events: none;

    animation: barcodeScanLine 2.2s ease-in-out infinite;
}

@keyframes barcodeScanLine {

    0% {
        top: 10%;
        opacity: 0.35;
    }

    10% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 88%;
        opacity: 0.35;
    }
}

.scan-button {
    width: calc(100% - 40px);
    margin: 0 20px 18px;
}

.result-success {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 232, 157, 0.20);
    background: rgba(0, 232, 157, 0.06);
    color: var(--green);
    font-size: 18px;
}

.result-body {
    padding: 22px;
}

.result-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

.barcode-result-number {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 1px;
}

.barcode-result-type {
    display: inline-flex;
    margin: 8px 0 18px;
    padding: 5px 9px;
    border: 1px solid rgba(22, 71, 245, 0.35);
    border-radius: 7px;
    color: #79a0ff;
    background: rgba(22, 71, 245, 0.08);
    font-size: 12px;
}

.record-fields {
    display: grid;
    grid-template-columns: 0.65fr 1.35fr;
    gap: 12px;
}

.workspace-select {
    margin-top: 12px;
}

.add-record-button {
    width: 100%;
    margin-top: 12px;
}

.records-panel {
    margin-top: 20px;
}

.records-toolbar {
    min-height: 70px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.records-toolbar h2 {
    margin: 0;
    font-size: 18px;
}

.records-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-search {
    width: 300px;
    min-height: 42px;
}

.records-action-button {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(8, 14, 27, 0.95);
    color: var(--text);
    cursor: pointer;
}

.records-action-button:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.table-wrapper {
    overflow-x: auto;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th,
.records-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}

.records-table th {
    color: #d8dde7;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.01);
}

.records-table td {
    color: var(--text-soft);
}

.empty-records {
    padding: 30px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
}

.records-footer {
    min-height: 62px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination button,
.current-page {
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #080d18;
    color: var(--text);
}

.pagination button {
    cursor: pointer;
}

.current-page {
    border-color: rgba(124, 58, 237, 0.55);
    background: linear-gradient(135deg, #7c3aed, #1647f5);
}

@media (max-width: 1100px) {
    .barcode-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .scan-tabs {
        grid-template-columns: 1fr;
    }

    .scan-tab {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .scan-tab:last-child {
        border-bottom: 0;
    }

    .record-fields {
        grid-template-columns: 1fr;
    }

    .records-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .records-actions {
        flex-wrap: wrap;
    }

    .record-search {
        width: 100%;
    }
}
.workspace-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px 46px 46px;
    gap: 8px;
    margin-top: 12px;
}

.workspace-row .workspace-select {
    margin-top: 0;
}

.workspace-action {
    min-width: 46px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border-strong);
    border-radius: 8px;

    background: rgba(6, 11, 23, 0.85);
    color: var(--text);

    font-size: 20px;
    cursor: pointer;
}

.workspace-action:hover {
    border-color: #6948ff;
    background: rgba(105, 72, 255, 0.10);
}

.workspace-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.workspace-action:disabled:hover {
    border-color: var(--border-strong);
    background: rgba(6, 11, 23, 0.85);
}

.workspace-delete {
    color: #ff5468;
}

@media (max-width: 600px) {
    .workspace-row {
        grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
    }
}
/* =========================================================
   BARKOD RESİM DÜZENLEYİCİ
   ========================================================= */

.scanner-editor {
    position: relative;
    overflow: hidden;
    min-height: 390px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barcode-image-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 390px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#barcodeImage {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
}

#barcodeVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.barcode-upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px;
    text-align: center;
}

.barcode-upload-placeholder strong {
    font-size: 24px;
    line-height: 1.2;
    color: var(--text);
}

.barcode-upload-placeholder span {
    color: var(--text-soft);
    font-size: 15px;
}

.upload-placeholder-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(124, 58, 237, 0.75);
    border-radius: 24px;
    color: #9b6cff;
    font-size: 30px;
    background: rgba(124, 58, 237, 0.08);
}

.upload-placeholder-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.upload-placeholder-button {
    min-width: 180px;
    height: 52px;
    padding: 0 22px;
    border-radius: 12px;
}


/* =========================================================
   DÖNDÜRME / AÇI / KIRPMA / ZOOM
   ========================================================= */

.image-control-grid {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.image-control-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-control-button {
    min-height: 58px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--panel-soft);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.image-control-button:hover {
    border-color: rgba(124, 58, 237, 0.8);
    background: rgba(124, 58, 237, 0.08);
}

.image-control-button:active {
    transform: translateY(1px);
}

.crop-control-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-color: rgba(124, 58, 237, 0.9);
    background: rgba(124, 58, 237, 0.08);
}

.crop-control-button strong {
    font-size: 17px;
}

.crop-control-button span {
    font-size: 12px;
    color: var(--text-soft);
}


/* =========================================================
   ZOOM
   ========================================================= */

.zoom-control {
    min-height: 58px;
    display: grid;
    grid-template-columns: 58px 1fr 58px;
    align-items: stretch;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel-soft);
}

.zoom-control button {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.zoom-control button:hover {
    background: rgba(124, 58, 237, 0.08);
}

.zoom-control button:first-child {
    border-right: 1px solid var(--border-strong);
}

.zoom-control button:last-child {
    border-left: 1px solid var(--border-strong);
}

.zoom-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.zoom-value strong {
    font-size: 18px;
}

.zoom-value span {
    font-size: 12px;
    color: var(--text-soft);
}


/* =========================================================
   GÖRÜNTÜ İYİLEŞTİRME
   ========================================================= */

.image-enhancement-panel {
    margin-top: 16px;
    padding: 18px 20px 20px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--panel-soft);
}

.image-enhancement-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 18px;
}

.image-enhancement-heading strong {
    font-size: 20px;
    color: var(--text);
}

.image-enhancement-heading span {
    font-size: 13px;
    color: var(--text-soft);
}

.enhancement-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.enhancement-control {
    min-width: 0;
}

.enhancement-control-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.enhancement-control-head span {
    color: var(--text-soft);
    font-size: 14px;
}

.enhancement-control-head strong {
    color: var(--text);
    font-size: 14px;
}

.enhancement-control input[type="range"] {
    width: 100%;
    accent-color: #7c3aed;
    cursor: pointer;
}


/* =========================================================
   KIRPMA SEÇİM ALANI
   ========================================================= */

.crop-selection {
    position: absolute;
    border: 2px solid #7c3aed;
    background: rgba(124, 58, 237, 0.12);
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.42),
        0 0 16px rgba(124, 58, 237, 0.55);
    pointer-events: none;
    z-index: 20;
}


/* =========================================================
   TARAMA ÇİZGİSİ
   ========================================================= */

.scanner-editor .scan-line {
    position: absolute;
    left: 4%;
    right: 4%;
    top: 10%;
    height: 2px;
    background: #00e89d;
    box-shadow:
        0 0 8px rgba(0, 232, 157, 0.85),
        0 0 18px rgba(0, 232, 157, 0.35);
    z-index: 30;
    pointer-events: none;
    animation: barcodeScanLine 2.2s ease-in-out infinite;
}

@keyframes barcodeScanLine {
    0% {
        top: 10%;
        opacity: 0.35;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 88%;
        opacity: 0.35;
    }
}


/* =========================================================
   OTOMATİK TARAMA BUTONU
   ========================================================= */

#scanBarcodeButton {
    width: 100%;
    min-height: 62px;
    margin-top: 16px;
    font-size: 18px;
    font-weight: 700;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .enhancement-controls {
        grid-template-columns: 1fr;
        gap: 18px;
    }

}

@media (max-width: 760px) {

    .image-control-grid-three {
        grid-template-columns: 1fr;
    }

    .upload-placeholder-actions {
        width: 100%;
    }

    .upload-placeholder-button {
        width: 100%;
    }

    .scanner-editor,
    .barcode-image-stage {
        min-height: 320px;
    }

    .barcode-upload-placeholder {
        padding: 22px;
    }

    .barcode-upload-placeholder strong {
        font-size: 20px;
    }

}
.crop-info {
    cursor: default;
    user-select: none;
}

#barcodeImageStage {
    cursor: crosshair;
}

#barcodeImageStage.has-image {
    cursor: crosshair;
}

#barcodeImage {
    transition:
        filter 0.12s ease,
        transform 0.12s ease;
}

.crop-selection {
    z-index: 50;
}

/* TEMEL LAYOUT V1.1 */
.barcode-grid,
.barcode-grid > *,
.barcode-scanner-panel,
.barcode-result-panel {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    .barcode-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* =========================================================
   TEMEL LAYOUT V1.3 - KARE TARAYICI + KAYNAK SEKME DÜZENİ
   ========================================================= */

/*
 * Tarayıcı alanı masaüstü ve mobilde aynı mantık:
 * her zaman 1:1 kare. İçerik bu alanın boyutunu değiştiremez.
 */
.scanner-editor,
.barcode-image-stage,
#barcodeImageStage {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/*
 * Yüklenen fotoğraf ne kadar uzun/dikey/yatay olursa olsun
 * tamamı kare alanın içinde görünür.
 */
#barcodeImageStage #barcodeImage,
.barcode-image-stage #barcodeImage,
.scanner-editor #barcodeImage {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 !important;
}

/*
 * Kamera/video da kare alanı aşamaz.
 */
#barcodeImageStage #barcodeVideo,
.barcode-image-stage #barcodeVideo,
.scanner-editor #barcodeVideo {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/*
 * Kaynak sekmeleri her çözünürlükte 3 sütun.
 */
.barcode-source-tabs,
.scan-source-tabs,
.upload-tabs,
.source-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
}

/*
 * Mevcut üç butonun ortak parent'ı hangi sınıfa sahip olursa olsun
 * :has() destekleyen modern tarayıcılarda 3 sütuna zorla.
 */
*:has(> #liveCameraTab):has(> #takePhotoTab):has(> #galleryTab) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 0 !important;
}

#liveCameraTab,
#takePhotoTab,
#galleryTab {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

.source-tab-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    font-size: 18px;
    line-height: 1;
}

.source-tab-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Desktop'ta kare çok büyüyüp sayfayı ezmesin.
 * Panel genişliği kadar, doğal maksimum.
 */
@media (min-width: 901px) {
    .scanner-editor,
    .barcode-image-stage,
    #barcodeImageStage {
        max-height: 720px !important;
    }
}

/*
 * Mobilde kare tam ekran genişliğine sığar.
 * Uzun fotoğraf artık kutuyu büyütemez ve altı kesilemez.
 */
@media (max-width: 760px) {
    .scanner-editor,
    .barcode-image-stage,
    #barcodeImageStage {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        max-height: none !important;
    }

    #liveCameraTab,
    #takePhotoTab,
    #galleryTab {
        min-height: 48px !important;
        height: 48px !important;
        padding: 0 6px !important;
        gap: 5px !important;
        font-size: 12.5px !important;
        border-radius: 0 !important;
    }

    .source-tab-icon {
        width: 18px;
        font-size: 16px;
    }

    .source-tab-label {
        font-size: 12px;
    }
}

/* Dar telefonlarda yazıyı biraz daha kısaltmadan da üçü sığsın. */
@media (max-width: 390px) {
    #liveCameraTab,
    #takePhotoTab,
    #galleryTab {
        padding-left: 3px !important;
        padding-right: 3px !important;
        gap: 3px !important;
    }

    .source-tab-label {
        font-size: 11px;
    }

    .source-tab-icon {
        width: 16px;
        font-size: 15px;
    }
}


/* =========================================================
   TEMEL LAYOUT V1.4 - KESİN KARE / MOBİL 3 SÜTUN
   Bu blok dosyanın EN SONUNDA olduğu için eski responsive
   kurallarını bilinçli olarak geçersiz kılar.
   ========================================================= */

/* Dış scanner ve iç image stage birlikte kare kalır. */
.scanner-preview.scanner-editor {
    position: relative !important;
    width: auto !important;
    max-width: none !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 14px 20px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#barcodeImageStage.barcode-image-stage {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
}

/* Resmin TAMAMI kare içinde görünür. */
#barcodeImageStage #barcodeImage {
    position: absolute !important;
    inset: 0 !important;
    display: none;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 !important;
}

#barcodeImageStage.has-image #barcodeImage {
    display: block !important;
}

/* Kamera da aynı kareyi kullanır. */
#barcodeVideo {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Kamera / Galeri / Yükle: her zaman aynı satırdaki üç sütun. */
.scan-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: auto !important;
    max-width: none !important;
    gap: 0 !important;
}

.scan-tab {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-right: 1px solid var(--border) !important;
    border-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-sizing: border-box !important;
}

.scan-tab:last-child {
    border-right: 0 !important;
}

/* 90 / -1 / +1: mobil dahil DAİMA aynı satır. */
.image-control-grid.image-control-grid-three {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
}

.image-control-grid.image-control-grid-three > * {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* İlk açı satırındaki butonları telefonda daha kompakt tut. */
@media (max-width: 760px) {
    .scanner-preview.scanner-editor {
        width: auto !important;
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 12px 8px !important;
    }

    .scan-tabs {
        margin-left: 8px !important;
        margin-right: 8px !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .scan-tab {
        min-height: 46px !important;
        height: 46px !important;
        padding: 0 4px !important;
        gap: 4px !important;
        font-size: 12px !important;
    }

    .source-tab-icon {
        width: 16px !important;
        font-size: 15px !important;
        flex: 0 0 16px !important;
    }

    .source-tab-label {
        font-size: 12px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .image-control-grid.image-control-grid-three {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    #rotate90Button,
    #rotateMinusButton,
    #rotatePlusButton {
        min-height: 48px !important;
        height: 48px !important;
        padding: 0 4px !important;
        font-size: 15px !important;
    }
}


/* =========================================================
   TEMEL LAYOUT V1.5 - KONTROLLER + YEŞİL TARAMA ÇİZGİSİ
   ========================================================= */

/* Üst kaynak seçimi */
.scan-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#liveCameraTab,
#takePhotoTab,
#galleryTab {
    min-width: 0 !important;
    overflow: hidden !important;
}

.source-tab-icon {
    flex: 0 0 auto !important;
}

.source-tab-label {
    min-width: 0 !important;
    white-space: nowrap !important;
}

/* Kırp: yalnız sade metin */
#cropImageButton {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 58px !important;
    padding: 0 12px !important;
}

#cropImageButton .crop-simple-label {
    display: inline-block !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}

#cropImageButton strong,
#cropImageButton > span:not(.crop-simple-label) {
    display: none !important;
}

/* Zoom: - | büyüteç + yüzde | + */
.zoom-control {
    min-height: 58px !important;
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) 52px !important;
    align-items: stretch !important;
}

.zoom-control > button {
    min-width: 0 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    line-height: 1 !important;
}

.zoom-value-simple {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 0 7px !important;
    overflow: hidden !important;
}

.zoom-value-simple .zoom-magnifier {
    flex: 0 0 auto !important;
    font-size: 19px !important;
    line-height: 1 !important;
    color: var(--text-soft) !important;
}

.zoom-value-simple #zoomValue {
    min-width: 0 !important;
    font-size: 15px !important;
    white-space: nowrap !important;
}

/* ---------------------------------------------------------
   Yeşil tarama çizgisi
   Resim varken görünür; üstten alta ve alttan üste akar.
   --------------------------------------------------------- */
@keyframes barcodeScanSweepV15 {
    0% {
        top: 1%;
        opacity: .35;
    }
    7% {
        opacity: 1;
    }
    93% {
        opacity: 1;
    }
    100% {
        top: calc(99% - 3px);
        opacity: .45;
    }
}

.scanner-preview .scan-line,
#scannerPreview .scan-line {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 2px !important;
    z-index: 80 !important;
    pointer-events: none !important;

    background:
        linear-gradient(
            90deg,
            rgba(0,232,157,0),
            rgba(0,232,157,.92) 12%,
            #73ffbd 50%,
            rgba(0,232,157,.92) 88%,
            rgba(0,232,157,0)
        ) !important;

    box-shadow:
        0 0 7px rgba(0,232,157,.95),
        0 0 18px rgba(0,232,157,.55) !important;

    transform: translateZ(0);
    will-change: top;
}

/* Resim yokken görünmez */
#scannerPreview:not(.has-image) .scan-line,
#barcodeImageStage:not(.has-image) ~ .scan-line {
    opacity: 0 !important;
}

/* Resim varken akıcı şekilde çalışır */
#scannerPreview.has-image .scan-line {
    opacity: 1 !important;
    animation:
        barcodeScanSweepV15 1.8s ease-in-out infinite alternate !important;
}

@media (max-width: 760px) {
    #liveCameraTab,
    #takePhotoTab,
    #galleryTab {
        height: 46px !important;
        min-height: 46px !important;
        padding: 0 5px !important;
        gap: 4px !important;
    }

    .source-tab-label {
        font-size: 12px !important;
    }

    .source-tab-icon {
        width: 16px !important;
        flex-basis: 16px !important;
        font-size: 15px !important;
    }

    #cropImageButton,
    .zoom-control,
    #resetImageButton {
        min-height: 48px !important;
        height: 48px !important;
    }

    .zoom-control {
        grid-template-columns: 42px minmax(0, 1fr) 42px !important;
    }

    .zoom-control > button {
        font-size: 21px !important;
    }

    .zoom-value-simple .zoom-magnifier {
        font-size: 17px !important;
    }

    .zoom-value-simple #zoomValue {
        font-size: 13px !important;
    }
}


/* =========================================================
   TEMEL LAYOUT V1.6 - SONUÇ ODAKLI DÜZELTMELER
   ========================================================= */

/* Kırp butonu: kesin görünür, sadece metin */
#cropImageButton {
    color: var(--text) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#cropImageButton::before,
#cropImageButton::after {
    content: none !important;
}

/* Zoom merkez alanı: yalnız büyüteç + yüzde */
.zoom-value-simple {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 6px !important;
}

.zoom-value-simple::after,
.zoom-value-simple small,
.zoom-value-simple span:not(.zoom-magnifier):not(#zoomValue) {
    display: none !important;
}

.zoom-value-simple .zoom-magnifier {
    font-size: 16px !important;
    line-height: 1 !important;
}

.zoom-value-simple #zoomValue,
#zoomValue {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Barkod bulunduğunda tarama çizgisi tamamen kaybolur */
#scannerPreview.scan-complete .scan-line,
#barcodeImageStage.scan-complete .scan-line {
    animation: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Yeni tarama başladığında tekrar görünür */
#scannerPreview.has-image:not(.scan-complete) .scan-line {
    visibility: visible !important;
}

@media (max-width: 760px) {
    #cropImageButton {
        font-size: 15px !important;
    }

    .zoom-value-simple .zoom-magnifier {
        font-size: 15px !important;
    }

    .zoom-value-simple #zoomValue,
    #zoomValue {
        font-size: 12px !important;
    }
}


/* =========================================================
   TEMEL LAYOUT V1.7 - NET KAYDIRMA HEDEFLERİ
   ========================================================= */
#barcodeResultPanel,
#barcodeScannerPanel {
    scroll-margin-top: 72px;
}


/* =========================================================
   TEMEL LAYOUT V1.8 - SAFARI KAYDIRMA HEDEFLERİ
   ========================================================= */
#barcodeResultTitle {
    scroll-margin-top: 76px !important;
}


/* =========================================================
   TEMEL LAYOUT V1.12 - SERİ NO + KAYIT DÜZENLEME
   ========================================================= */

.barcode-result-correction {
    display: grid !important;
    gap: 7px !important;
    margin: 4px 0 16px !important;
}

.barcode-result-correction label {
    color: var(--text-soft) !important;
    font-size: 12px !important;
}

#barcodeCorrectionInput {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: .03em !important;
}

#barcodeCorrectionInput:focus {
    border-color: rgba(86, 82, 255, .92) !important;
    box-shadow: 0 0 0 3px rgba(80, 70, 229, .12) !important;
}

.barcode-toast {
    position: fixed !important;
    left: 50% !important;
    top: 82px !important;
    z-index: 13000 !important;
    transform: translate(-50%, -12px) !important;
    min-width: 190px !important;
    max-width: calc(100vw - 28px) !important;
    min-height: 46px !important;
    padding: 10px 18px !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(0,224,160,.34) !important;
    border-radius: 13px !important;
    background: rgba(4,39,34,.97) !important;
    color: #45f2bd !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease !important;
}

.barcode-toast.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, 0) !important;
}

@media (max-width: 900px) {
    .barcode-toast {
        top: 74px !important;
        font-size: 13px !important;
    }

}


/* =========================================================
   V1.13 - KAYIT İŞLEM BUTONLARI
   Düzenle = mavi, Sil = kırmızı
   ========================================================= */

.record-action-button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    vertical-align: middle !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition:
        transform .15s ease,
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease !important;
}

.record-action-button + .record-action-button {
    margin-left: 7px !important;
}

.record-action-button svg {
    width: 19px !important;
    height: 19px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.9 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    pointer-events: none !important;
}

/* Düzenle: belirgin mavi */
.record-action-edit {
    color: #66a3ff !important;
    background: rgba(37, 99, 235, .18) !important;
    border: 1px solid rgba(59, 130, 246, .65) !important;
    box-shadow: inset 0 0 0 1px rgba(59,130,246,.05) !important;
}

.record-action-edit:hover {
    color: #dbeafe !important;
    background: rgba(37, 99, 235, .38) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 16px rgba(37,99,235,.22) !important;
    transform: translateY(-1px) !important;
}

/* Sil: belirgin kırmızı */
.record-action-delete {
    color: #ff6b79 !important;
    background: rgba(220, 38, 38, .18) !important;
    border: 1px solid rgba(239, 68, 68, .68) !important;
    box-shadow: inset 0 0 0 1px rgba(239,68,68,.04) !important;
}

.record-action-delete:hover {
    color: #fee2e2 !important;
    background: rgba(220, 38, 38, .38) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 16px rgba(239,68,68,.20) !important;
    transform: translateY(-1px) !important;
}

.record-action-button:active {
    transform: translateY(0) scale(.96) !important;
}

@media (max-width: 760px) {
    .record-action-button {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        border-radius: 9px !important;
    }

    .record-action-button svg {
        width: 18px !important;
        height: 18px !important;
    }

    .record-action-button + .record-action-button {
        margin-left: 5px !important;
    }
}


/* =========================================================
   V1.14 - İŞLEM RENKLERİ
   Düzenle = YEŞİL / Sil = KIRMIZI
   ========================================================= */

.record-action-edit {
    color: #34d399 !important;
    background: rgba(16, 185, 129, .22) !important;
    border-color: rgba(52, 211, 153, .72) !important;
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .06) !important;
}

.record-action-edit:hover {
    color: #ecfdf5 !important;
    background: rgba(16, 185, 129, .42) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, .24) !important;
}

.record-action-delete {
    color: #ff6b79 !important;
    background: rgba(220, 38, 38, .25) !important;
    border-color: rgba(239, 68, 68, .78) !important;
}

.record-action-delete:hover {
    color: #fff1f2 !important;
    background: rgba(220, 38, 38, .48) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, .24) !important;
}


/* =========================================================
   V1.15 - TEMA UYUMLU ONAY PENCERESİ
   Tarayıcının beyaz native confirm penceresi yerine.
   ========================================================= */
.theme-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 18, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .16s ease;
}
.theme-confirm-overlay.is-open { opacity: 1; }

.theme-confirm-dialog {
    width: min(460px, 100%);
    display: flex;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(100, 116, 139, .35);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(13,22,42,.98), rgba(6,12,27,.99));
    box-shadow: 0 24px 80px rgba(0,0,0,.48), 0 0 0 1px rgba(99,102,241,.06);
    color: #f8fafc;
    transform: translateY(8px) scale(.985);
    transition: transform .16s ease;
}
.theme-confirm-overlay.is-open .theme-confirm-dialog {
    transform: translateY(0) scale(1);
}
.theme-confirm-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 20px;
    color: #a78bfa;
    background: rgba(124,58,237,.14);
    border: 1px solid rgba(139,92,246,.35);
}
.theme-confirm-icon.is-danger {
    color: #fb7185;
    background: rgba(225,29,72,.13);
    border-color: rgba(244,63,94,.38);
}
.theme-confirm-content { flex: 1; min-width: 0; }
.theme-confirm-title {
    margin: 2px 0 7px;
    font-size: 19px;
    line-height: 1.25;
    font-weight: 750;
    color: #f8fafc;
}
.theme-confirm-text {
    color: #aebbd0;
    font-size: 15px;
    line-height: 1.55;
}
.theme-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}
.theme-confirm-btn {
    min-width: 108px;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid rgba(100,116,139,.35);
    font: inherit;
    font-weight: 700;
    color: #e5e7eb;
    background: #111a2d;
    cursor: pointer;
}
.theme-confirm-btn:hover { filter: brightness(1.1); }
.theme-confirm-cancel { background: rgba(15,23,42,.9); }
.theme-confirm-ok {
    border-color: rgba(99,102,241,.45);
    background: linear-gradient(135deg, #a21caf, #334cff);
    color: white;
}
.theme-confirm-danger {
    border-color: rgba(239,68,68,.6);
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: white;
}
@media (max-width: 560px) {
    .theme-confirm-overlay { padding: 14px; }
    .theme-confirm-dialog { padding: 18px; border-radius: 18px; gap: 12px; }
    .theme-confirm-icon { width: 42px; height: 42px; flex-basis: 42px; }
    .theme-confirm-actions { gap: 8px; }
    .theme-confirm-btn { min-width: 0; flex: 1; padding: 0 12px; }
}


#scannerPreview.is-empty #scannerPlaceholder {
    display: flex !important;
}

#scannerPreview.has-image #scannerPlaceholder,
#scannerPreview.has-video #scannerPlaceholder {
    display: none !important;
}

#scannerPreview.has-video > #barcodeImageStage {
    visibility: hidden !important;
    pointer-events: none !important;
}

.scanner-empty-state {
    position: absolute !important;
    inset: 0 !important;
    z-index: 20 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    color: var(--text) !important;
    pointer-events: auto !important;
}

.scanner-empty-icon {
    width: 64px !important;
    height: 64px !important;
    display: grid !important;
    place-items: center !important;
    border: 1px solid rgba(139,92,246,.62) !important;
    border-radius: 18px !important;
    background: rgba(91,33,182,.12) !important;
    color: #c026d3 !important;
    font-size: 28px !important;
}

.scanner-empty-state h3 {
    margin: 2px 0 0 !important;
    font-size: 23px !important;
    line-height: 1.2 !important;
    color: #f8fafc !important;
}

.scanner-empty-state p {
    max-width: 560px !important;
    margin: 0 !important;
    color: #aebbd0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.scanner-empty-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 10px !important;
    width: min(420px, 100%) !important;
    margin-top: 6px !important;
}

.scanner-empty-actions button {
    min-height: 46px !important;
    border-radius: 12px !important;
    font: inherit !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

.scanner-empty-upload {
    color: #fff !important;
    border: 1px solid rgba(99,102,241,.55) !important;
    background: linear-gradient(135deg,#c026d3,#3148ff) !important;
}

.scanner-empty-camera {
    color: #e5e7eb !important;
    border: 1px solid rgba(100,116,139,.45) !important;
    background: #111a2d !important;
}

@media (max-width: 760px) {
    .scanner-empty-state {
        padding: 18px !important;
        gap: 10px !important;
    }

    .scanner-empty-state h3 {
        font-size: 20px !important;
    }

    .scanner-empty-state p {
        font-size: 13px !important;
    }

    .scanner-empty-actions {
        grid-template-columns: 1fr 1fr !important;
        width: 100% !important;
        max-width: 360px !important;
    }

    .scanner-empty-actions button {
        min-height: 44px !important;
        font-size: 13px !important;
    }
}


/* =========================================================
   MEMBERSHIP V1.2.2 - BARKOD HATA / DUPLICATE UYARISI
   ========================================================= */

.barcode-toast.error {
    border-color: rgba(248, 113, 113, .58) !important;
    background: rgba(62, 12, 18, .97) !important;
    color: #fecaca !important;
    box-shadow:
        0 16px 44px rgba(127, 29, 29, .34)
        !important;
}

.barcode-toast.error.show {
    opacity: 1 !important;
    visibility: visible !important;
}
