/* ==========================================================================
   DERVİŞOĞLU OTOMOTİV — STOK PANELİ
   Tasarım sistemi: lastik/kauçuk temalı, aydınlık zemin, koyu antrasit +
   turuncu vurgu. Tüm class/id adları orijinal app.py ve şablonlarla aynı
   tutuldu; burada sadece görünüm yeniden tasarlandı.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ==========================================================================
   0. RENK PALETİ VE DEĞİŞKENLER
   ========================================================================== */
:root {
    /* Nötrler — kağıt/kauçuk */
    --paper: #F6F4F1;          /* sayfa zemini */
    --surface: #FFFFFF;        /* kart, panel, tablo zemini */
    --surface-soft: #FAF8F6;   /* hafif vurgulu yüzey */
    --line: #E4E0D9;           /* standart kenarlık */
    --line-strong: #D6D1C7;

    /* Mürekkep — metin tonları */
    --ink: #1C1B1A;            /* başlıklar, ana metin */
    --ink-soft: #55524C;       /* ikincil metin */
    --ink-faint: #8A867D;      /* placeholder, yardımcı metin */

    /* Marka — lastik kauçuğu siyahı */
    --rubber: #1F1E1D;
    --rubber-soft: #34322F;

    /* Vurgu — lastik performans turuncusu */
    --accent: #D85B2C;
    --accent-dark: #B3461F;
    --accent-soft: #FBE7DA;
    --accent-soft-line: #F0C9AE;

    /* Durum renkleri */
    --success: #2E7D4F;
    --success-dark: #225D3A;
    --success-soft: #E3F1E7;

    --danger: #B23A3A;
    --danger-dark: #8C2A2A;
    --danger-soft: #FAE6E3;

    --warn: #A6762B;
    --warn-dark: #87601F;
    --warn-soft: #F7ECD8;

    --info: #3B6FA0;
    --info-dark: #2C547C;
    --info-soft: #E3EDF6;

    /* Eski değişken adları (CSS içinde önceden var olan referanslar için) */
    --renk-ana: #3B6FA0;
    --renk-ana-koyu: #2C547C;
    --renk-ozel: #B23A3A;
    --renk-ozel-koyu: #8C2A2A;
    --renk-ikincil: #A6762B;
    --renk-ikincil-koyu: #87601F;
    --renk-basarili: #2E7D4F;
    --renk-basarili-koyu: #225D3A;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(28, 27, 26, 0.06);
    --shadow-md: 0 6px 20px rgba(28, 27, 26, 0.08);
    --shadow-lg: 0 16px 40px rgba(28, 27, 26, 0.14);
    --page-content-gap: 20px;
}

/* ==========================================================================
   1. GENEL AYARLAR
   ========================================================================== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--paper);
    color: var(--ink);
    overflow-x: auto;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

::selection {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

/* Ortak yükleme katmanı */
.app-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    gap: 14px;
    align-content: center;
    background: rgba(246, 244, 241, 0.78);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.app-loader-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.loader {
    width: 40px;
    height: 30px;
    --c: no-repeat linear-gradient(#854f1d 0 0);
    background:
        var(--c) 0 100% / 8px 30px,
        var(--c) 50% 100% / 8px 20px,
        var(--c) 100% 100% / 8px 10px;
    position: relative;
    clip-path: inset(-100% 0);
}

.loader::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #854f1d;
    left: -16px;
    top: 0;
    animation: l5-1 2s linear infinite, l5-2 0.5s cubic-bezier(0, 200, .8, 200) infinite;
}

.app-loader-text {
    margin: 0;
    color: var(--rubber);
    font-size: 14px;
    font-weight: 700;
}

@keyframes l5-1 {
    0% { left: -16px; transform: translateY(-8px); }
    100% { left: calc(100% + 8px); transform: translateY(22px); }
}

@keyframes l5-2 { 100% { top: -0.1px; } }

@media (prefers-reduced-motion: reduce) {
    .loader::before { animation-duration: 5s, 1.25s; }
}

/* İnce lastik-sırtı dokusu — header alt çizgisi için tekrarlanan desen */
.tread-rule {
    height: 4px;
    width: 100%;
    background-image: repeating-linear-gradient(
        100deg,
        var(--accent) 0px,
        var(--accent) 10px,
        transparent 10px,
        transparent 20px
    );
    opacity: 0.9;
}

/* ==========================================================================
   2. ANA SAYFA - NAVBAR VE KARŞILAMA
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 32px;
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--rubber);
}

.logo-area {
    display: flex;
    align-items: center;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.site-logo {
    height: 54px;
    width: auto;
    object-fit: contain;
    display: block;
}

.login-btn {
    background-color: var(--rubber);
    color: white;
    text-decoration: none;
    padding: 11px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.login-btn:hover {
    background-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Karşılama ekranı */
.landing-navbar {
    min-height: 84px;
    padding: 12px 32px;
    border-bottom: 0;
    box-shadow: none;
}

.landing-nav-spacer {
    width: 42px;
    height: 42px;
}

.landing-menu {
    position: relative;
}

.landing-menu-trigger {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.landing-menu-trigger span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .2s ease;
}

.landing-menu-trigger:hover,
.landing-menu.open .landing-menu-trigger {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.landing-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 185px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity .18s ease, transform .18s ease;
}

.landing-menu.open .landing-menu-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.landing-menu-dropdown a,
.landing-menu-dropdown button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.landing-menu-dropdown a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.landing-menu-dropdown button:disabled { color: var(--ink-faint); cursor: not-allowed; }
.landing-menu-dropdown button span { font-size: 10px; font-weight: 700; }

.landing-content {
    display: grid;
    min-height: calc(100vh - 84px);
    place-items: center;
    padding: 24px;
    background: var(--paper);
    text-align: center;
}

.landing-hero {
    display: flex;
    width: min(100%, 680px);
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.landing-logo {
    width: min(100%, 285px);
    height: auto;
    margin-bottom: clamp(18px, 3vw, 26px);
    object-fit: contain;
}

.landing-coming-soon {
    margin: 0;
    color: var(--ink-soft);
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: clamp(24px, 3.6vw, 40px);
    font-weight: 600;
    letter-spacing: -.03em;
}

.landing-hero h1 {
    margin: 10px 0 0;
    color: var(--accent-dark);
    font-size: clamp(14px, 1.7vw, 18px);
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

@media (max-width: 560px) {
    .landing-navbar { padding: 10px 16px; }
    .landing-hero { padding: 28px 20px; border-radius: 14px; }
    .landing-hero h1 { letter-spacing: .1em; }
}

.content {
    text-align: center;
    margin-top: 14vh;
    padding: 0 24px;
}

.content-eyebrow {
    display: inline-block;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-line);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.content h1 {
    font-size: 3rem;
    color: var(--ink);
    font-weight: 700;
    margin: 0 0 14px 0;
}

.content-sub {
    color: var(--ink-soft);
    font-size: 16px;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.55;
}

/* ==========================================================================
   3. YÖNETİCİ GİRİŞ SAYFASI (LOGIN KARTI)
   ========================================================================== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 20%, rgba(216, 91, 44, 0.07), transparent 45%),
        var(--rubber);
}

.login-container {
    background-color: var(--surface);
    width: 100%;
    max-width: 380px;
    padding: 38px 36px 34px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    height: 38px;
    width: auto;
    margin-bottom: 22px;
}

.login-container h2 {
    margin: 0 0 8px 0;
    color: var(--ink);
    font-size: 23px;
    font-weight: 700;
}

.login-subtitle {
    color: var(--ink-faint);
    font-size: 13.5px;
    margin-bottom: 26px;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: var(--surface-soft);
    font-family: inherit;
}

.input-group input:focus {
    border-color: var(--accent);
    background-color: var(--surface);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-container button {
    width: 100%;
    padding: 12px;
    background-color: var(--rubber);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s ease;
    margin-top: 6px;
    font-family: inherit;
}

.login-container button:hover {
    background-color: var(--accent);
}

.auth-message {
    min-height: 20px;
    margin: 15px 0 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.auth-message.success {
    color: var(--success);
}

.auth-message.session-ended {
    display: grid;
    gap: 9px;
    box-sizing: border-box;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(178, 58, 58, .22);
    border-radius: var(--radius-sm);
    background: rgba(178, 58, 58, .055);
}

.auth-message.session-ended strong {
    display: block;
    font-size: 13px;
    line-height: 1.45;
}

.auth-message.session-ended span {
    display: block;
    padding-top: 8px;
    border-top: 1px solid rgba(178, 58, 58, .14);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
}

.auth-switch {
    margin: 14px 0 0;
    color: var(--ink-faint);
    font-size: 13px;
}

.auth-switch a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.user-management-wrapper {
    width: 95%;
    max-width: 1500px;
    margin: var(--page-content-gap) auto 40px;
    text-align: left;
}

.user-table-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.user-refresh-btn, .user-save-btn, .user-edit-btn, .user-approve-btn, .user-remove-btn, .user-back-btn { border: 0; border-radius: var(--radius-sm); padding: 8px 12px; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.user-refresh-btn, .user-save-btn { background: var(--ink); }
.user-refresh-btn:hover, .user-save-btn:hover { background: var(--accent); }
.user-edit-btn { background: var(--info); }
.user-edit-btn:hover { background: var(--info-dark); }
.user-approve-btn { background: var(--success); }
.user-approve-btn:hover { background: var(--success-dark); }
.user-unlock-btn { align-self: center; border: 1px solid var(--accent-soft-line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--accent-soft); color: var(--accent-dark); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.user-unlock-btn:hover { background: var(--accent); color: #fff; }
.user-back-btn { background: var(--line-strong); color: var(--ink-soft); }
.user-back-btn:hover { background: var(--line); }
.user-remove-btn { background: var(--danger); }
.user-remove-btn:hover { background: var(--danger-dark); }
.user-save-btn:disabled { cursor: not-allowed; opacity: .45; }
.user-management-message { min-height: 19px; margin: 12px 0; color: var(--danger); font-size: 13px; font-weight: 700; }
.user-management-message.success { color: var(--success); }
.user-table-card { overflow: hidden; }
.user-table-scroll { overflow-x: auto; }
.user-table-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
.invite-code-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-top: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.invite-code-card h2 { margin: 0 0 5px; color: var(--ink); font-size: 17px; }
.invite-code-card p { margin: 0; max-width: 440px; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.invite-code-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto; gap: 8px; min-width: 480px; }
.invite-code-form input { min-width: 0; padding: 8px 9px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--ink); font: inherit; font-size: 13px; }
.invite-code-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.user-table { width: 100%; min-width: 950px; border-collapse: collapse; }
.user-table th { padding: 12px; background: var(--rubber); color: #fff; font-size: 11px; letter-spacing: .3px; text-align: left; text-transform: uppercase; }
.user-table td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; vertical-align: middle; }
.user-name-cell { color: var(--ink) !important; font-weight: 700; }
.self-badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.user-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 600; white-space: nowrap; }
.user-toggle input { accent-color: var(--accent); }
.permission-list { display: flex; gap: 8px; flex-wrap: wrap; min-width: 250px; }
.user-action-cell { display: flex; gap: 6px; white-space: nowrap; }
.user-edit-card { max-width: 650px; margin: 0 auto; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.user-edit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.user-edit-eyebrow { margin: 0 0 5px; color: var(--ink-faint); font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.user-edit-head h2 { margin: 0; color: var(--ink); font-size: 22px; }
.user-edit-form { display: grid; gap: 14px; margin-top: 20px; }
.user-edit-form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .25px; }
.user-edit-form input { width: 100%; padding: 10px 11px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--ink); font: inherit; font-size: 14px; text-transform: none; letter-spacing: normal; }
.user-edit-form input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.user-edit-help { margin: -3px 0 0; color: var(--ink-faint); font-size: 12px; }
.user-edit-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
@media (max-width: 1000px) { .invite-code-card { flex-direction: column; } .invite-code-form { width: 100%; min-width: 0; } }
@media (max-width: 620px) { .invite-code-form { grid-template-columns: 1fr; } }
.access-denied { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--paper); text-align: center; }
.access-denied > div { max-width: 520px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.access-denied h1 { margin-top: 0; font-size: 24px; }
.access-denied p { color: var(--ink-soft); }
.access-denied a { display: inline-block; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }


/* ==========================================================================
   4. STOK PANELİ ÜST BAŞLIK (LOGO + EYLEM BUTONLARI)
   ========================================================================== */
.stok-container-fluid {
    width: calc(100% - 232px);
    min-width: 0;
    max-width: calc(100% - 232px);
    margin-left: 232px;
    margin-top: 0;
    text-align: center;
    padding-bottom: 40px;
    box-sizing: border-box;
}

.stok-container-fluid h1 {
    margin: 30px 0;
    color: var(--ink);
    font-weight: 700;
    font-size: 26px;
}

.stok-header {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: 232px;
    min-height: 100vh;
    padding: 26px 16px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #222222;
    border-right: 0;
    box-shadow: none;
}

.stok-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    margin: -12px -16px 0;
    background-color: #222222;
    padding: 0 8px 10px;
    border-radius: 0;
    border-bottom: 0;
}

.stok-logo {
    width: 135px;
    max-width: calc(100% - 24px);
    height: auto;
    display: block;
    /* Beyaz PNG zemini koyu yan menüde görünmez olur. */
    filter: invert(1);
    mix-blend-mode: screen;
    transform: none;
}

.page-title-band {
    min-height: 68px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-sizing: border-box;
    text-align: left;
}

.page-title-band h1 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
}

.stock-live-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    padding: 5px 9px;
    border: 1px solid #d7ded9;
    border-radius: 999px;
    background: #f6f8f6;
    color: #647068;
    font-size: 11px;
    font-weight: 800;
}

.stock-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a8aeaa;
}

.stock-live-status.is-online {
    border-color: #b8d5c3;
    background: #e8f4ec;
    color: #24643f;
}

.stock-live-status.is-online .stock-live-dot {
    background: #2e7d4f;
    box-shadow: 0 0 0 3px rgba(46, 125, 79, .13);
}

.stock-live-status.is-reconnecting,
.stock-live-status.is-fallback {
    border-color: #e7c987;
    background: #fff6df;
    color: #785515;
}

.stock-live-status.is-reconnecting .stock-live-dot,
.stock-live-status.is-fallback .stock-live-dot { background: #a6762b; }

.stock-live-toast[hidden] { display: none; }
.stock-live-toast {
    position: fixed;
    z-index: 9000;
    right: 18px;
    bottom: 18px;
    max-width: min(390px, calc(100vw - 36px));
    padding: 11px 14px;
    border: 1px solid #b8d5c3;
    border-radius: 9px;
    background: #e8f4ec;
    color: #24643f;
    box-shadow: 0 10px 28px rgba(31, 55, 40, .18);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    text-align: left;
}

.header-actions {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding-top: 8px;
}

.header-slip-btn {
    display: flex;
    align-items: center;
    gap: 13px;
    background: transparent;
    color: #c4c7d8;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    border: 0;
    width: 100%;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-slip-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.header-slip-btn.active {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.header-slip-btn.active .side-nav-icon {
    color: var(--accent);
}

.menu-expand-icon {
    margin-left: auto;
    color: #c4c7d8;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    stroke-width: 2;
    transition: transform 0.28s ease;
}

.side-menu-group.is-open .menu-expand-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

.menu-toggle:hover .menu-expand-icon {
    color: var(--accent);
}

.side-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    margin: 0 0 0 12px;
    padding: 0 0 0 12px;
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.13);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 0.32s ease, margin 0.32s ease, padding 0.32s ease, opacity 0.2s ease, transform 0.28s ease;
}

.side-menu-group.is-open .side-submenu {
    max-height: 100px;
    margin: 4px 0 8px 12px;
    padding: 2px 0 2px 12px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.side-submenu a {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 4px;
    color: #969bad;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.submenu-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: #6f7488;
    stroke-width: 1.8;
}

.side-submenu a:hover,
.side-submenu a.active {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.side-submenu a.active .submenu-icon {
    color: var(--accent);
}

.side-nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #777b9f;
    stroke-width: 1.8;
}

/* Stok dışındaki ekranlarda kullanılan geri/çıkış bağlantıları. */
.header-back-btn,
.logout-btn {
    background: var(--surface-soft);
    color: var(--ink);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: all 0.2s ease;
}

.header-back-btn:hover {
    background: var(--accent);
}

.logout-btn.logout-confirm {
    background-color: var(--danger) !important;
    color: #ffffff;
}

.stok-topbar {
    min-height: 78px;
    padding: 0 3.5%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #c4c7d8;
    font-size: 14px;
    border-bottom: 0;
    background: #222222;
    box-sizing: border-box;
}

.stok-topbar.has-live-status {
    justify-content: space-between;
}

.stok-topbar .stock-live-status {
    margin-left: 0;
}

.stok-topbar strong {
    color: #ffffff;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 178px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: #c4c7d8;
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.user-menu-trigger:hover,
.user-menu.open .user-menu-trigger {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.user-menu-trigger:hover {
    transform: translateY(-1px);
}

.welcome-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 7px;
    background: rgba(216, 91, 44, 0.16);
    color: var(--accent);
}

.welcome-avatar svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.welcome-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    line-height: 1.15;
}

.welcome-label {
    color: #969bad;
    font-size: 10px;
    font-weight: 600;
}

.welcome-copy strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    color: #c4c7d8;
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.user-menu.open .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 120;
    display: none;
    min-width: 100%;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.user-menu.open .user-menu-dropdown {
    display: block;
}

.user-menu-dropdown button {
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--danger);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.user-menu-dropdown button:hover {
    background: #fff0ed;
}

/* ==========================================================================
   5. FİLTRELEME PANELİ
   ========================================================================== */
.filter-panel {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--surface);
    padding: 16px 22px;
    margin: var(--page-content-gap) auto 16px auto;
    width: 95%;
    max-width: 1500px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    gap: 16px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.panel-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.col-xs {
    min-width: 90px !important;
}

.panel-row-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-faint);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.filter-group input, .filter-group select {
    padding: 7px 9px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--ink);
    background-color: var(--surface-soft);
    width: 100%;
    outline: none;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-group input::placeholder {
    color: var(--ink-faint);
    opacity: 0.8;
}

.filter-group input:focus, .filter-group select:focus {
    border-color: var(--accent);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.no-spin {
    appearance: textfield;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    margin: 0;
}

.no-spin::-webkit-outer-spin-button,
.no-spin::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.search-btn {
    background-color: var(--ink);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-btn:hover {
    background-color: var(--accent);
}

.filter-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-group {
    gap: 7px;
}

.stock-type-switch {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    width: 100%;
    min-width: 180px;
    margin-top: 25px;
    padding: 3px;
    overflow: visible;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: transparent;
    box-shadow: inset 0 1px 2px rgba(34, 32, 29, 0.06);
}

.stock-type-switch::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: 999px;
    background: var(--surface-soft);
}

.stock-type-switch-slider {
    position: absolute;
    z-index: 2;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: var(--ink);
    box-shadow: 0 2px 6px rgba(34, 32, 29, 0.2);
    transition: transform 0.22s ease;
}

.stock-type-switch[data-type="Jant"] .stock-type-switch-slider {
    transform: translateX(100%);
}

.stock-type-switch button {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.18s ease;
}

.stock-type-switch button.active {
    color: #fff;
}

.stock-type-peek {
    position: absolute;
    z-index: 0;
    top: -27px;
    display: grid;
    place-items: center;
    width: 50%;
    height: 43px;
    color: #55524c;
    pointer-events: none;
}

.stock-type-peek-tire {
    left: 0;
}

.stock-type-peek-rim {
    right: 0;
}

.stock-type-peek svg {
    width: 38px;
    height: 38px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.clear-filter-btn {
    background-color: var(--surface-soft);
    color: var(--ink);
    border: 1.5px solid var(--line);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    white-space: nowrap;
}

.clear-filter-btn:hover {
    border-color: var(--accent);
    background-color: var(--accent-soft);
}

.jant-filter-mode .jant-hidden-filter,
.jant-mode .tire-only-column {
    display: none !important;
}

.brand-menu .brand-menu-empty {
    justify-content: center;
    padding: 16px 12px;
    color: var(--ink-faint);
    cursor: default;
}

/* ==========================================================================
   6. YÖNETİM BUTONLARI (EKLE / DÜZELT / SİL / YEDEK)
   ========================================================================== */
.action-buttons-group {
    margin-left: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
    min-width: 170px;
}

.action-btn {
    border: none;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    width: 100%;
}

.action-buttons-group a.action-btn {
    text-decoration: none;
    display: inline-block;
}

.add-btn {
    grid-column: 1;
    grid-row: 1;
    background-color: var(--success);
    color: white;
}

.add-btn:hover {
    background-color: var(--success-dark);
}

.edit-btn {
    grid-column: 2;
    grid-row: 1;
    background-color: var(--warn);
    color: white;
}

.edit-btn:hover {
    background-color: var(--warn-dark);
}

.delete-btn {
    grid-column: 2;
    grid-row: 2;
    background-color: var(--danger);
    color: white;
}

.delete-btn:hover {
    background-color: var(--danger-dark);
}

.backup-btn {
    grid-column: 1;
    grid-row: 2;
    background-color: var(--ink);
    color: white;
}

.backup-btn:hover {
    background-color: var(--rubber-soft);
}

/* ==========================================================================
   7. EXCEL TARZI TABLO
   ========================================================================== */
.excel-table {
    width: 95%;
    max-width: 1500px;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 13.5px;
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.responsive-table-scroll {
    width: 95%;
    max-width: 1500px;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: visible;
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.responsive-table-scroll > .excel-table {
    width: 100%;
    min-width: 900px;
    max-width: none;
    margin: 0;
}

.add-page-wrapper > .responsive-table-scroll,
.stock-movement-box > .responsive-table-scroll,
.slip-history-wrapper > .responsive-table-scroll {
    width: 100%;
    max-width: none;
}

/* Sol menü sonrası bilgi metnini içerik başlangıcına hizala. */
#info-msg {
    margin-left: 2.5% !important;
}

@media (max-width: 800px) {
    .stok-container-fluid {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }

    .stok-header {
        position: static;
        width: 100%;
        min-height: auto;
        padding: 16px;
        box-shadow: none;
    }

    .stok-logo-box {
        margin: -6px -16px 0;
        padding: 0 8px 16px;
    }

    .stok-logo {
        width: 155px;
        height: auto;
    }

    .header-actions {
        flex: 0;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding-top: 16px;
    }

    .header-slip-btn {
        text-align: center;
    }

    .stok-topbar {
        min-height: 48px;
        justify-content: center;
    }

    .stok-topbar.has-live-status {
        justify-content: space-between;
        gap: 8px;
        padding: 0 14px;
    }

    .stok-topbar.has-live-status .user-menu-trigger {
        min-width: 150px;
    }

    .stok-topbar.has-live-status .stock-live-status {
        flex: 0 1 auto;
        white-space: nowrap;
    }

    .responsive-table-scroll {
        width: calc(100% - 20px);
        max-width: none;
    }

    .add-page-wrapper > .responsive-table-scroll,
    .stock-movement-box > .responsive-table-scroll,
    .slip-history-wrapper > .responsive-table-scroll {
        width: 100%;
    }
}

/* Etiket kataloğu */
.label-catalog-page {
    width: min(1500px, calc(100% - 40px));
    margin: var(--page-content-gap) auto 40px;
}

.label-upload-card,
.label-list-card {
    padding: 20px;
    border: 1px solid #dce2e4;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 31, 35, .06);
}

.label-list-card { margin-top: 18px; }
.label-upload-head,
.label-list-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.label-upload-head h2,
.label-list-head h2 { margin: 0 0 4px; color: #252423; }
.label-upload-head p,
.label-list-head p { margin: 0; color: #68747a; font-size: 13px; }
.label-list-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.label-list-tools .count-primary-button { min-height: 40px; }
.label-list-tools .count-primary-button:disabled {
    cursor: not-allowed;
    opacity: .48;
}
.label-upload-badge {
    padding: 6px 9px;
    border-radius: 999px;
    background: #edf1f2;
    color: #536168;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.label-upload-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 18px;
}
.label-upload-form label { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.label-upload-form label > span { color: #4c585d; font-size: 12px; font-weight: 800; }
.label-upload-form select,
.label-upload-form input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid #cbd3d6;
    border-radius: 9px;
    background: #fff;
    color: #2e3335;
}
.label-upload-files input { padding: 7px; }
.label-brand-hint {
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid #d9e0e2;
    border-radius: 9px;
    background: #f4f7f8;
    color: #536067;
    font-size: 12px;
    line-height: 1.45;
}
.label-upload-status { min-height: 20px; margin: 10px 0 0; font-size: 13px; font-weight: 700; }
.label-upload-status.is-success { color: #286343; }
.label-upload-status.is-error { color: #9a302b; }
.label-upload-status.is-warning { color: #85631a; }
.label-upload-status.is-working { color: #4f6068; }

.label-catalog-filters {
    display: grid;
    grid-template-columns: minmax(190px, .45fr) minmax(280px, 1fr);
    gap: 9px;
    margin: 16px 0 11px;
}
.label-catalog-filters select,
.label-catalog-filters input {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #cbd3d6;
    border-radius: 8px;
    background: #fff;
}
.label-table-wrap { overflow: auto; border: 1px solid #dce2e4; border-radius: 9px; }
.label-catalog-table { width: 100%; min-width: 1540px; border-collapse: collapse; }
.label-catalog-table th,
.label-catalog-table td { padding: 9px; border-bottom: 1px solid #e3e8ea; text-align: left; vertical-align: middle; }
.label-catalog-table th { background: #f2f4f5; color: #435057; font-size: 11px; white-space: nowrap; }
.label-catalog-table input,
.label-catalog-table select {
    box-sizing: border-box;
    width: 100%;
    min-width: 115px;
    height: 38px;
    padding: 6px 8px;
    border: 1px solid #ccd4d7;
    border-radius: 7px;
    background: #fff;
}
.label-catalog-table input[readonly] {
    background: #f3f6f7;
    color: #3b4c54;
    font-weight: 800;
}
.label-catalog-table .label-select-cell {
    width: 38px;
    min-width: 38px;
    padding-right: 3px;
    padding-left: 10px;
    text-align: center;
}
.label-catalog-table .label-select-checkbox {
    display: inline-block;
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    accent-color: #252423;
}
.label-thumb {
    display: block;
    width: 54px;
    height: 76px;
    border: 1px solid #d9dfe1;
    border-radius: 5px;
    object-fit: contain;
    background: #fff;
}
.label-thumb-button {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: zoom-in;
}
.label-thumb-button:hover .label-thumb,
.label-thumb-button:focus-visible .label-thumb {
    border-color: #e45a27;
    box-shadow: 0 0 0 2px rgba(228, 90, 39, .18);
}
.label-thumb-button:focus-visible { outline: none; }
.label-status { display: inline-block; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.label-status.is-ready { background: #e8f4ec; color: #286343; }
.label-status.is-review { background: #fff3d6; color: #7a5914; }
.label-row-actions { display: flex; gap: 5px; }
.label-row-actions button {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #cbd3d6;
    border-radius: 7px;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
}
.label-row-actions button:first-child { border-color: #252423; background: #252423; color: #fff; }

body.label-image-open { overflow: hidden; }
.label-image-modal[hidden] { display: none; }
.label-image-modal {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(24, 27, 29, .58);
    backdrop-filter: blur(1px);
    cursor: zoom-out;
}
.label-image-dialog {
    display: flex;
    width: min(820px, calc(100vw - 56px));
    max-height: calc(100vh - 56px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
    cursor: default;
}
.label-image-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px 15px;
    border-bottom: 1px solid #e2e6e8;
}
.label-image-dialog-head h2 {
    margin: 0 0 5px;
    color: #202426;
    font-size: clamp(18px, 2.3vw, 26px);
}
.label-image-dialog-head p {
    margin: 0;
    color: #68747a;
    font-size: 12px;
}
.label-image-close {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0f2f3;
    color: #606b70;
    font-size: 29px;
    line-height: 1;
    cursor: pointer;
}
.label-image-close:hover,
.label-image-close:focus-visible {
    background: #252423;
    color: #fff;
    outline: none;
}
.label-image-stage {
    display: grid;
    min-height: 0;
    flex: 1;
    place-items: center;
    overflow: auto;
    padding: 22px;
    background: #f7f8f8;
}
.label-image-stage img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    object-fit: contain;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(19, 25, 28, .12);
}
.label-image-dialog.stock-label-image-only {
    display: block;
    width: auto;
    max-width: 86vw;
    max-height: 76vh;
    overflow: visible;
    border: 0;
    border-radius: 7px;
    background: transparent;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .38);
}
.stock-label-image-only > img {
    display: block;
    width: auto;
    max-width: 86vw;
    height: auto;
    max-height: 76vh;
    border-radius: 7px;
    object-fit: contain;
}

@media (max-width: 800px) {
    .label-catalog-page { width: calc(100% - 20px); margin-top: 12px; }
    .label-upload-card,
    .label-list-card { padding: 14px; }
    .label-upload-head,
    .label-list-head { align-items: stretch; flex-direction: column; }
    .label-list-tools { align-items: stretch; flex-direction: column; }
    .label-list-tools .count-primary-button { width: 100%; }
    .label-upload-form,
    .label-catalog-filters { grid-template-columns: 1fr; }
    .label-upload-form button { width: 100%; }
    .label-image-modal { padding: 10px; }
    .label-image-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    .label-image-dialog-head { padding: 14px; }
    .label-image-stage { padding: 12px; }
    .label-image-stage img { max-height: calc(100vh - 145px); }
    .label-image-dialog.stock-label-image-only,
    .stock-label-image-only > img {
        max-width: 88vw;
        max-height: 72vh;
    }
}

/* Sayımın tamamlanması ile stoğa uygulanması arasındaki güvenli kontrol alanı */
.count-apply-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px;
    padding: 18px 20px;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    background: #f5f8f9;
}

.count-apply-panel[hidden] { display: none; }
.count-apply-panel h3,
.count-snapshot-card h2,
.count-snapshot-view h3 { margin: 0 0 5px; }
.count-apply-panel p,
.count-snapshot-card p { margin: 0; color: #607078; }
.count-apply-actions,
.count-snapshot-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.count-snapshot-card {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #d8dfe2;
    border-radius: 10px;
    background: #fff;
}

.count-snapshot-head,
.count-snapshot-view-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.count-snapshot-controls select {
    min-width: 310px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #bcc8ce;
    border-radius: 7px;
    background: #fff;
}

.count-snapshot-view {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e0e5e7;
}

.count-snapshot-view[hidden] { display: none; }
.count-snapshot-view-title span { color: #66757c; font-size: 13px; }
.count-snapshot-table-wrap { margin-top: 12px; overflow: auto; }
.count-snapshot-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.count-snapshot-table th,
.count-snapshot-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e3e8ea;
    text-align: left;
    white-space: nowrap;
}
.count-snapshot-table th { background: #f3f5f6; color: #3e4b50; font-size: 12px; }

.count-archive-card {
    margin-top: 18px;
    padding: 18px 20px 20px;
    overflow: visible;
    border: 1px solid #d8dfe2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 31, 35, .05);
}

.count-archive-card > h2 {
    width: 100%;
    margin: 0 0 12px;
    color: #252423;
    font-size: 18px;
    text-align: left;
}

.count-archive-picker {
    position: relative;
    width: min(100%, 560px);
}

.count-archive-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #cfd5d8;
    border-radius: 9px;
    background: #fff;
    color: #686f72;
    font: 700 14px/1.2 'Segoe UI', sans-serif;
    text-align: left;
    cursor: pointer;
}

.count-archive-picker.is-open .count-archive-toggle {
    border-color: #697b84;
    box-shadow: 0 0 0 3px rgba(105, 123, 132, .12);
}

.count-archive-chevron {
    font-size: 25px;
    line-height: 1;
    transition: transform .18s ease;
}

.count-archive-picker.is-open .count-archive-chevron {
    transform: rotate(180deg);
}

.count-archive-content {
    position: absolute;
    z-index: 90;
    top: calc(100% + 7px);
    left: 0;
    width: 100%;
    max-height: 390px;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid #d6dcde;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(25, 31, 34, .18);
}

.count-archive-content[hidden],
.count-archive-view[hidden] {
    display: none;
}

.count-archive-legend {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 7px 8px 10px;
    color: #5d686d;
    font-size: 12px;
    font-weight: 700;
}

.count-archive-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border: 1px solid #c8cdd0;
    border-radius: 50%;
    background: #fff;
}

.count-archive-dot.is-before {
    border-color: #c7a33c;
    background: #e6c75f;
}

.count-archive-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.count-archive-option {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 56px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #fff;
    color: #2b2a28;
    text-align: left;
    cursor: pointer;
}

.count-archive-option.is-before {
    border-color: #eadc9c;
    background: #fff6c9;
}

.count-archive-option.active {
    border-color: #5c6b72;
    box-shadow: inset 0 0 0 1px #5c6b72;
}

.count-archive-option span {
    min-width: 0;
}

.count-archive-option strong,
.count-archive-option small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.count-archive-option strong { font-size: 13px; }
.count-archive-option small { margin-top: 3px; color: #697279; font-size: 11px; }
.count-archive-empty { margin: 12px 0 0; color: #697279; }

.count-archive-view {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e1e6e8;
}

.count-archive-view-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.count-archive-view-head h3 { margin: 0 0 4px; }
.count-archive-view-head p { margin: 0; color: #66747a; font-size: 12px; }
.count-archive-actions { display: flex; gap: 8px; }
.count-archive-help { margin: 12px 0 7px; color: #68757a; font-size: 12px; }
.count-archive-filters {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(130px, .65fr) minmax(140px, .7fr) minmax(230px, 1.4fr) auto;
    gap: 8px;
    margin-bottom: 10px;
}
.count-archive-filters input,
.count-archive-filters select {
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #cfd6d9;
    border-radius: 8px;
    background: #fff;
    color: #303638;
    font: 600 13px/1.2 'Segoe UI', sans-serif;
}
.count-archive-table-wrap { overflow: auto; border: 1px solid #dce2e4; border-radius: 9px; }
.count-archive-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.count-archive-table th,
.count-archive-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e4e8e9;
    text-align: left;
    white-space: nowrap;
}
.count-archive-table th { background: #f2f4f5; color: #435057; font-size: 12px; }
.count-archive-table tbody tr { cursor: pointer; }
.count-archive-table tbody tr:hover td { background: #f3f7f8; }
.count-archive-table tbody tr:last-child td { border-bottom: 0; }

.count-compare-modal {
    position: fixed;
    z-index: 2100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(20, 24, 26, .62);
}

.count-compare-modal[hidden] { display: none; }
.count-compare-card {
    width: min(620px, 100%);
    padding: 22px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.count-compare-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.count-compare-head span { color: #6a7478; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.count-compare-head h2 { margin: 3px 0 0; }
.count-compare-head button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #eef1f2;
    font-size: 24px;
    cursor: pointer;
}
.count-compare-product {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0;
}
.count-compare-product div { padding: 10px 12px; border-radius: 8px; background: #f4f6f7; }
.count-compare-product dt { color: #6c777c; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.count-compare-product dd { margin: 3px 0 0; font-weight: 700; }
.count-compare-quantities {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
}
.count-compare-quantities > div:not(.count-compare-arrow) {
    padding: 16px;
    border: 1px solid #dce2e4;
    border-radius: 10px;
    text-align: center;
}
.count-compare-quantities span { display: block; color: #69757a; font-size: 12px; font-weight: 700; }
.count-compare-quantities strong { display: block; margin-top: 5px; font-size: 30px; }
.count-compare-arrow { color: #6f797d; font-size: 24px; }
.count-compare-difference {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 800;
}
.count-compare-difference.is-positive { background: #e9f5ed; color: #286343; }
.count-compare-difference.is-negative { background: #f9e8e6; color: #8a302c; }
.count-compare-difference.is-same { background: #edf0f1; color: #4d585d; }

.stock-stale-warning {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 28px 0;
    padding: 14px 16px;
    border: 1px solid #d5aa35;
    border-radius: 9px;
    background: #fff8df;
    color: #403819;
    box-shadow: 0 4px 12px rgba(67, 54, 18, .08);
}

.weak-admin-password-warning {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 28px 0;
    padding: 13px 14px;
    border: 1px solid #d58b87;
    border-radius: 9px;
    background: #fff0ef;
    color: #6f211e;
    box-shadow: 0 4px 12px rgba(111, 33, 30, .08);
}

.weak-admin-password-warning[hidden] { display: none; }
.weak-admin-password-warning-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    background: #b23a3a;
    color: #fff;
    font-weight: 900;
}
.weak-admin-password-warning-content { min-width: 0; }
.weak-admin-password-warning strong { display: block; margin-bottom: 2px; }
.weak-admin-password-warning p { margin: 0; color: #7c403d; }
.weak-admin-password-warning a {
    margin-left: auto;
    color: #7d2926;
    font-weight: 800;
    white-space: nowrap;
}
.weak-admin-password-warning-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7d2926;
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}
.weak-admin-password-warning-close:hover,
.weak-admin-password-warning-close:focus-visible {
    background: #f4d8d6;
    outline: none;
}

.stock-stale-warning[hidden] { display: none; }
.stock-stale-warning-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    background: #9a7311;
    color: #fff;
    font-weight: 900;
}
.stock-stale-warning strong { display: block; margin-bottom: 2px; }
.stock-stale-warning p { margin: 0; color: #685c31; }
.stock-stale-warning a {
    margin-left: auto;
    color: #42350f;
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 850px) {
    .count-apply-panel,
    .count-snapshot-head,
    .count-snapshot-view-title,
    .weak-admin-password-warning,
    .stock-stale-warning {
        align-items: stretch;
        flex-direction: column;
    }
    .count-apply-actions,
    .count-snapshot-controls { width: 100%; flex-wrap: wrap; }
    .count-apply-actions button,
    .count-snapshot-controls button { flex: 1 1 150px; }
    .count-snapshot-controls select { width: 100%; min-width: 0; }
    .stock-stale-warning { margin: 12px 10px 0; }
    .weak-admin-password-warning { margin: 12px 10px 0; }
    .weak-admin-password-warning-icon { display: none; }
    .weak-admin-password-warning a { margin-left: 0; }
    .weak-admin-password-warning-close {
        align-self: flex-end;
    }
    .stock-stale-warning-icon { display: none; }
    .stock-stale-warning a { margin-left: 0; }
    .count-archive-options { grid-template-columns: 1fr; }
    .count-archive-view-head { align-items: stretch; flex-direction: column; }
    .count-archive-actions button { flex: 1 1 auto; }
    .count-archive-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .count-archive-filters #count-archive-search { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    .count-archive-card { padding: 14px; }
    .count-archive-toggle { padding: 14px; }
    .count-archive-content { padding: 8px; }
    .count-archive-legend { align-items: flex-start; flex-direction: column; gap: 7px; }
    .count-archive-actions { width: 100%; }
    .count-archive-filters { grid-template-columns: 1fr; }
    .count-archive-filters #count-archive-search { grid-column: auto; }
    .count-compare-card { padding: 16px; }
    .count-compare-product { grid-template-columns: 1fr; }
    .count-compare-quantities { gap: 7px; }
    .count-compare-quantities > div:not(.count-compare-arrow) { padding: 12px 8px; }
}


/* Stok sayımı */
.count-page {
    width: min(1500px, calc(100% - 40px));
    margin: var(--page-content-gap) auto 40px;
}

.count-start-card,
.count-workspace,
.count-history-card {
    border: 1px solid #dfe2e4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 31, 35, .06);
}

.count-start-card,
.count-history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
}

.count-start-card {
    display: block;
}

.count-start-card[hidden],
.count-history-card[hidden],
.count-snapshot-card[hidden] {
    display: none;
}

.count-start-card h2,
.count-history-card h2,
.count-session-head h2 {
    margin: 0;
    color: #252423;
}

.count-start-card p,
.count-history-card p,
.count-session-head p {
    margin: 5px 0 0;
    color: #6d6a65;
    font-size: 13px;
}

.count-start-controls,
.count-history-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(100%, 560px);
}

.count-start-controls {
    width: min(100%, 700px);
    margin-top: 12px;
}

.count-start-controls input {
    width: 60%;
    flex: 0 1 60%;
}

.count-start-controls input,
.count-history-controls select,
.count-list-tools input,
.count-field input {
    min-height: 44px;
    border: 1px solid #cfd4d7;
    border-radius: 9px;
    background: #fff;
    color: #252423;
    font: 600 14px/1.2 'Segoe UI', sans-serif;
}

.count-start-controls input,
.count-history-controls select,
.count-list-tools input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
}

.count-primary-button,
.count-secondary-button,
.count-finish-button {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 9px;
    font: 800 13px/1.15 'Segoe UI', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.count-primary-button {
    background: #1f1e1d;
    color: #fff;
}

.count-secondary-button {
    border: 1px solid #cfd4d7;
    background: #f3f4f5;
    color: #292827;
}

.count-finish-button {
    background: #8f2d2a;
    color: #fff;
}

.count-session-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-delete-button {
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid #bd6c68;
    border-radius: 9px;
    background: #fff;
    color: #842d29;
    font: 800 13px/1.15 'Segoe UI', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.count-primary-button:disabled,
.count-secondary-button:disabled,
.count-finish-button:disabled,
.count-delete-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.count-inline-note {
    flex-basis: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f2f3f4;
    color: #555 !important;
}

.count-workspace {
    margin-top: 18px;
    overflow: hidden;
}

.count-session-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #e1e4e6;
}

.count-status-badge {
    display: inline-flex;
    margin-bottom: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef0f1;
    color: #555;
    font-size: 11px;
    font-weight: 800;
}

.count-status-badge.is-active {
    background: #e8f3ec;
    color: #286343;
}

.count-status-badge.is-completed {
    background: #eceff1;
    color: #48545a;
}

.count-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 20px;
    background: #f7f7f6;
}

.count-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 68px;
    padding: 12px 14px;
    border: 1px solid #dde1e3;
    border-radius: 10px;
    background: #fff;
    color: #464440;
    text-align: left;
    cursor: pointer;
}

.count-summary-card span {
    font-size: 12px;
    font-weight: 700;
}

.count-summary-card strong {
    font-size: 24px;
}

.count-summary-card.is-danger {
    border-color: #e5b6b2;
    background: #fff6f5;
    color: #8a302c;
}

.count-summary-card.is-warning {
    border-color: #e7d6aa;
    background: #fffaf0;
    color: #785d19;
}

.count-summary-card.is-success {
    border-color: #b8d8c5;
    background: #f3faf6;
    color: #2b6947;
}

.count-summary-card.active {
    box-shadow: inset 0 0 0 2px currentColor;
}

.count-scan-panel {
    margin: 4px 20px 18px;
    padding: 16px;
    border: 1px solid #dfe2e4;
    border-radius: 12px;
    background: #fff;
}

.count-scan-fields {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 130px auto auto;
    align-items: end;
    gap: 10px;
}

.count-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.count-field label {
    color: #55524c;
    font-size: 12px;
    font-weight: 800;
}

.count-field input {
    width: 100%;
    padding: 9px 11px;
}

.count-selected-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #f4f5f5;
    color: #56534e;
    font-size: 13px;
}

.count-selected-product strong {
    color: #252423;
}

.count-message {
    min-height: 18px;
    margin: 8px 2px 0;
    color: #555;
    font-size: 12px;
    font-weight: 700;
}

.count-message.is-success { color: #286343; }
.count-message.is-error { color: #9a312c; }

.count-list-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 14px;
}

.count-list-tools input {
    max-width: 560px;
}

.count-filter-buttons {
    display: flex;
    gap: 6px;
}

.count-filter-buttons button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #d5d9db;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-weight: 700;
    cursor: pointer;
}

.count-filter-buttons button.active {
    border-color: #252423;
    background: #252423;
    color: #fff;
}

.count-table-wrap {
    width: 100%;
    max-height: 62vh;
    overflow: auto;
    border-top: 1px solid #e0e3e5;
}

.count-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
    color: #343230;
    font-size: 12px;
}

.count-table th {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: 11px 10px;
    border-bottom: 1px solid #ccd2d5;
    background: #eceeef;
    text-align: left;
    white-space: nowrap;
}

.count-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e5e7e8;
    background: #fff;
    vertical-align: middle;
}

.count-table tr[data-result="sayimda_yok"] td { background: #fff6f5; }
.count-table tr[data-result="stokta_yok"] td,
.count-table tr[data-result="farkli"] td { background: #fffaf0; }

.count-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.count-result-badge {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 999px;
    background: #edf0f1;
    color: #566168;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.count-result-badge.is-sayimda_yok { background: #f6deda; color: #8c302b; }
.count-result-badge.is-stokta_yok,
.count-result-badge.is-farkli { background: #f4e8c9; color: #775b15; }
.count-result-badge.is-dogru { background: #dff0e5; color: #296645; }

.count-row-entry {
    display: flex;
    gap: 5px;
}

.count-row-entry input {
    width: 65px;
    min-height: 34px;
    padding: 5px 7px;
    border: 1px solid #cfd4d7;
    border-radius: 7px;
}

.count-row-entry button {
    min-height: 34px;
    padding: 5px 9px;
    border: 0;
    border-radius: 7px;
    background: #252423;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.count-empty-cell {
    padding: 34px !important;
    color: #777;
    text-align: center;
}

.count-entry-history {
    margin: 18px 20px 20px;
    overflow: hidden;
    border: 1px solid #dfe2e4;
    border-radius: 12px;
    background: #fff;
}

.count-entry-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    border-bottom: 1px solid #dfe2e4;
    background: #f7f7f6;
}

.count-entry-history-head h3 {
    margin: 0;
    color: #292725;
    font-size: 16px;
}

.count-entry-history-head p {
    margin: 3px 0 0;
    color: #716d67;
    font-size: 11px;
}

.count-entry-history-head > span {
    color: #64615c;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.count-history-table-wrap {
    width: 100%;
    max-height: 300px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.count-history-table {
    width: 100%;
    min-width: 820px;
    border-collapse: separate;
    border-spacing: 0;
    color: #3d3a37;
    font-size: 12px;
}

.count-history-table th {
    position: sticky;
    z-index: 1;
    top: 0;
    padding: 9px 10px;
    border-bottom: 1px solid #d8dcde;
    background: #eceeef;
    text-align: left;
    white-space: nowrap;
}

.count-history-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e6e8e9;
    background: #fff;
    vertical-align: middle;
}

.count-history-table td small {
    display: block;
    margin-top: 2px;
    color: #77736d;
}

.count-history-card {
    margin-top: 18px;
}

#count-camera-reader {
    min-height: 250px;
    background: #111;
}

#count-camera-reader video {
    object-fit: cover;
}

@media (max-width: 1350px) {
    .count-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .count-scan-fields {
        grid-template-columns: minmax(220px, 1fr) 120px;
    }
    .count-scan-fields button {
        width: 100%;
    }
    .count-start-card,
    .count-history-card {
        align-items: stretch;
        flex-direction: column;
    }
    .count-start-controls,
    .count-history-controls {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 650px) {
    .count-page {
        width: calc(100% - 20px);
        margin-top: 12px;
    }
    .count-start-card,
    .count-history-card,
    .count-session-head {
        padding: 14px;
    }
    .count-start-controls,
    .count-history-controls,
    .count-list-tools {
        align-items: stretch;
        flex-direction: column;
    }
    .count-start-controls input,
    .count-start-controls button,
    .count-history-controls select,
    .count-history-controls button,
    .count-list-tools input {
        width: 100%;
        max-width: none;
    }
    .count-start-controls input {
        flex: 0 0 auto;
    }
    .count-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
    }
    .count-summary-card {
        min-height: 62px;
        padding: 10px;
    }
    .count-summary-card strong {
        font-size: 20px;
    }
    .count-session-head {
        align-items: stretch;
        flex-direction: column;
    }
    .count-session-actions {
        width: 100%;
    }
    .count-session-actions button {
        flex: 1 1 50%;
        min-width: 0;
    }
    .count-scan-panel {
        margin: 0 10px 14px;
        padding: 12px;
    }
    .count-scan-fields {
        grid-template-columns: 1fr 105px;
    }
    .count-scan-fields button {
        grid-column: span 1;
        padding-inline: 7px;
    }
    .count-selected-product {
        align-items: flex-start;
        flex-direction: column;
    }
    .count-list-tools {
        padding: 0 10px 10px;
    }
    .count-filter-buttons {
        width: 100%;
    }
    .count-filter-buttons button {
        flex: 1 1 0;
    }
    .count-table-wrap {
        max-height: 58vh;
        -webkit-overflow-scrolling: touch;
    }
    .count-entry-history {
        margin: 14px 10px;
    }
    .count-entry-history-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

.excel-table th {
    background-color: var(--rubber);
    color: white;
    text-align: left;
    padding: 12px 10px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    user-select: none;
}

.excel-table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.excel-table tbody tr:hover {
    background-color: var(--accent-soft);
}

.excel-table tbody tr.selected-row {
    background-color: var(--accent-soft) !important;
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.center-col { text-align: center !important; }
.right-col { text-align: right !important; }

.column-md { width: 120px; }
.column-sm { width: 100px; }
.column-xs { width: 75px; }

.insert-table select {
    min-width: 88px;
}

.stok-actions {
    margin: 40px 0;
}

.back-btn {
    display: inline-block;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    border: 1.5px solid var(--ink);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.back-btn:hover {
    background-color: var(--ink);
    color: white;
}

/* ==========================================================================
   8. MARKA SEÇİM MENÜSÜ (BRAND SELECT)
   ========================================================================== */
.brand-select {
    position: relative;
    width: 100%;
    min-width: 170px;
    z-index: 20;
}

.brand-select-btn {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface-soft);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}

.brand-select-btn:hover,
.brand-select.open .brand-select-btn {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface);
}

.brand-selected {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-soft);
    font-weight: 600;
}

.brand-arrow {
    color: var(--accent);
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.brand-select.open .brand-arrow {
    transform: rotate(180deg);
}

/* Menü ekranın üst katmanında, sabit konumda açılır. */
.brand-menu {
    display: none;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 225px;
    max-height: 360px !important;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 999999 !important;
}

.brand-select.open .brand-menu {
    display: block;
}

.brand-menu-search {
    width: 100%;
    height: 34px;
    margin: 0 0 6px;
    padding: 7px 9px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    outline: none;
    color: var(--ink);
    background: var(--surface-soft);
    font: inherit;
}

.brand-menu-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.brand-select-input {
    min-width: 0;
    flex: 1;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-weight: inherit;
}

.brand-select-input::placeholder { color: var(--ink-faint); }

/* Stok marka filtresi diger filtreler gibi tek kutu gorunur. */
.filter-panel .brand-select {
    min-width: 0;
}

.filter-panel .brand-select-btn {
    min-height: 0;
    padding: 7px 9px;
    background-color: var(--surface-soft);
}

.filter-panel .brand-select-input,
.filter-panel .brand-select-input:focus {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.excel-table .season-cell {
    white-space: nowrap;
}

.brand-menu button {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.brand-menu button[hidden] {
    display: none !important;
}

.brand-menu button:hover {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.brand-menu button[data-value=""] {
    font-weight: 800;
    color: var(--success-dark);
    border-bottom: 1px solid var(--line);
    margin-bottom: 3px;
    border-radius: 0;
}

.brand-logo-mini {
    width: 44px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    overflow: hidden;
}

.brand-logo-mini img {
    max-width: 38px;
    max-height: 18px;
    object-fit: contain;
    display: block;
}

.brand-logo-fallback,
.brand-badge {
    min-width: 26px;
    height: 16px;
    border-radius: 5px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-line);
}

/* Tablo ve kartlar menüyü kesmesin diye güvenlik */
.add-page-wrapper,
.filter-panel,
.insert-table,
.insert-table tbody,
.insert-table tr,
.insert-table td {
    overflow: visible !important;
}

.insert-table .brand-select {
    min-width: 225px;
}

/* ==========================================================================
   9. STOK EKLEME / DÜZENLEME SAYFASI
   ========================================================================== */
.add-page-wrapper {
    padding: 24px;
    background-color: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    margin: 20px auto;
    width: 95%;
    max-width: 1500px;
}

.record-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.record-type-label {
    white-space: nowrap;
}

.record-type-switch {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(75px, 1fr));
    min-width: 180px;
    padding: 3px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    overflow: hidden;
}

.record-type-slider {
    position: absolute;
    z-index: 0;
    inset: 3px auto 3px 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: var(--ink);
    transition: transform 0.22s ease;
}

.record-type-switch[data-type="Jant"] .record-type-slider {
    transform: translateX(100%);
}

.record-type-switch button {
    position: relative;
    z-index: 1;
    padding: 7px 14px;
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.record-type-switch button.active {
    color: #fff;
}

.rim-brand-select {
    display: none;
}

.jant-entry-mode .tire-entry-only,
.jant-entry-mode .tire-brand-select {
    display: none !important;
}

.jant-entry-mode .rim-brand-select {
    display: block;
}

.brand-logo-mini.alcar-brand-logo {
    background: #2b2b2b;
    border-color: #2b2b2b;
}

.insert-table tbody input, .insert-table tbody select {
    width: 100%;
    border: 1.5px solid var(--line);
    padding: 7px 9px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    outline: none;
    background-color: var(--surface-soft);
    transition: all 0.15s;
    font-family: inherit;
}

.insert-table tbody input:focus, .insert-table tbody select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background-color: var(--surface);
}

@media (max-width: 800px) {
    .add-page-wrapper {
        width: calc(100% - 20px);
        margin: 12px auto 24px;
        padding: 14px;
        overflow: visible;
    }

    .record-type-selector {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
        margin-bottom: 18px;
    }

    .record-type-switch {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .record-type-switch button {
        min-height: 44px;
        padding: 9px 12px;
        font-size: 14px;
    }

    .add-page-wrapper > .responsive-table-scroll {
        width: 100%;
        overflow: visible;
        border-radius: 0;
    }

    .insert-table,
    .responsive-table-scroll > .insert-table {
        display: block;
        width: 100%;
        min-width: 0;
        margin: 0;
        overflow: visible !important;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .insert-table thead {
        display: none;
    }

    .insert-table tbody,
    .insert-table tbody tr {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        padding: 0;
        background: transparent !important;
    }

    .insert-table tbody td {
        display: block;
        width: 100%;
        min-width: 0;
        padding: 0 !important;
        overflow: visible !important;
        border: 0;
        background: transparent !important;
        text-align: left !important;
    }

    .insert-table tbody td::before {
        content: attr(data-label);
        display: block;
        margin: 0 0 6px;
        color: var(--ink-faint);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: .2px;
        text-transform: uppercase;
    }

    .insert-table tbody input,
    .insert-table tbody select,
    .insert-table .brand-select-btn {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 11px 12px;
        font-size: 16px;
        text-align: left !important;
    }

    .insert-table .brand-select {
        width: 100%;
        min-width: 0;
        position: relative;
        z-index: 50;
    }

    .add-page-wrapper .brand-menu {
        max-width: calc(100vw - 16px);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .add-page-wrapper .brand-menu-search {
        min-height: 44px;
        font-size: 16px;
    }

    .add-page-wrapper .brand-menu button {
        min-height: 46px;
        font-size: 14px;
    }

    .add-page-wrapper .product-barcode-info {
        width: 100%;
        margin-top: 18px;
        padding: 12px;
    }

    .add-page-wrapper .product-barcode-field input {
        min-height: 48px;
        font-size: 16px;
    }

    .add-page-wrapper .add-page-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 20px;
        padding-top: 16px;
    }

    .add-page-wrapper .add-page-actions button {
        width: 100%;
        min-height: 48px;
        min-width: 0;
        font-size: 15px;
    }

    #validation-error-msg {
        margin: 14px 0 0 !important;
        text-align: left !important;
        line-height: 1.45;
    }
}

.add-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 26px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.add-page-actions button {
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-width: 150px;
    font-family: inherit;
}

.btn-cancel {
    background-color: var(--surface-soft);
    color: var(--ink);
    border: 1.5px solid var(--line) !important;
}

.btn-cancel:hover {
    background-color: var(--line);
}

.btn-submit {
    background-color: var(--success) !important;
    color: white !important;
}

.btn-submit:hover {
    background-color: var(--success-dark) !important;
}

/* "Çıkış fişi" sayfasında temizle/vazgeç butonu kırmızı tonda kalır */
.simple-slip-actions .btn-cancel {
    background-color: var(--danger) !important;
    color: #ffffff !important;
    border: none !important;
}

.simple-slip-actions .btn-cancel:hover {
    background-color: var(--danger-dark) !important;
}

/* ==========================================================================
   10. ÇIKIŞ FİŞİ SAYFASI
   ========================================================================== */
.slip-page {
    margin-top: 0;
}

.slip-wrapper,
.slip-history-wrapper {
    width: 95%;
    max-width: 1500px;
    margin: var(--page-content-gap) auto;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    padding: 24px;
    text-align: left;
}

.slip-view-section[hidden] {
    display: none;
}

.simple-slip-wrapper {
    max-width: 1500px;
}

.slip-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.slip-title-row h1 {
    margin: 0 0 6px 0;
    color: var(--ink);
    font-size: 26px;
}

.slip-title-row p {
    margin: 0;
    color: var(--ink-faint);
    font-size: 13px;
    font-weight: 500;
}

.slip-no-card {
    min-width: 120px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    text-align: center;
    background: var(--surface-soft);
}

.slip-no-card span {
    display: block;
    color: var(--ink-faint);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.slip-no-card strong {
    display: block;
    color: var(--accent-dark);
    font-size: 18px;
    margin-top: 4px;
}

.slip-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 5px;
}

.slip-field input,
.slip-field textarea,
.slip-table input,
.slip-table select {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 9px;
    font-size: 13px;
    outline: none;
    background: var(--surface-soft);
    font-family: inherit;
    transition: all 0.15s;
}

.slip-field input:focus,
.slip-field textarea:focus,
.slip-table input:focus,
.slip-table select:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.slip-table-wrap {
    overflow-x: auto;
}

.slip-table {
    min-width: 1180px;
}

.slip-table th,
.slip-table td {
    padding: 8px;
}

.slip-product-col {
    min-width: 330px;
}

.slip-stock-select {
    min-width: 320px;
}

.row-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--danger);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s;
}

.row-delete-btn:hover {
    background: var(--danger-dark);
}

.slip-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.slip-actions button {
    min-width: 140px;
}

.slip-msg {
    display: none;
    margin: 14px 0 0 0;
    font-size: 13.5px;
    font-weight: 700;
    text-align: right;
}

.slip-history-wrapper h2 {
    margin: 0 0 4px 0;
    font-size: 21px;
    color: var(--ink);
}

.slip-history-table td {
    font-size: 12.5px;
}

@media (max-width: 900px) {
    .slip-top-form {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* ---- Ürün arama kutusu ---- */
.slip-search-box {
    background: var(--surface-soft);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.slip-search-box label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 7px;
}

.slip-search-box input {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    font-size: 15px;
    outline: none;
    background: var(--surface);
    font-family: inherit;
}

.slip-search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.slip-search-box small {
    display: block;
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.result-wrap {
    max-height: 330px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}

.result-table {
    min-width: 1000px;
    box-shadow: none;
    border-radius: 0;
}

.result-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}

.result-row {
    cursor: pointer;
}

.result-row:hover {
    background: var(--accent-soft) !important;
}

/* ---- Seçilen ürün kartı ---- */
.selected-sale-card {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 16px;
}

.selected-sale-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.selected-sale-product {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    margin-bottom: 14px;
}

.selected-sale-meta-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.65fr) 220px;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.customer-row-only {
    grid-template-columns: minmax(280px, 0.55fr) !important;
    max-width: 520px;
}

.customer-field-wide input {
    min-height: 36px;
}

.date-time-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.compact-date-time {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.compact-date-time .slip-field input {
    height: 32px;
    padding: 6px 8px;
}

.selected-sale-form {
    display: grid;
    grid-template-columns: 105px 170px 180px minmax(300px, 0.75fr);
    gap: 12px;
    align-items: start;
}

.sale-form-with-date {
    display: grid !important;
    grid-template-columns: 100px 150px 165px 155px minmax(220px, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
}

.slip-field textarea {
    min-height: 72px;
    line-height: 1.4;
    resize: vertical;
    font-family: inherit;
}

.selected-note-field textarea {
    height: 78px;
    max-height: 105px;
    resize: vertical;
}

.note-field-right textarea {
    height: 100%;
    min-height: 92px;
}

.slip-general-note-field textarea {
    height: 74px;
    max-height: 105px;
    resize: vertical;
}

#fiyatInput::placeholder,
#toplamTutarInput::placeholder,
#kayitTarihInput::placeholder,
#kayitSaatInput::placeholder {
    color: var(--ink-faint);
    font-weight: 500;
    opacity: 1;
}

.simple-slip-actions {
    border-top: none;
    margin-top: 16px;
    padding-top: 0;
}

/* Stoğa yansıt — açıklamadan sonra, klavye ile en son ulaşılan onay kutusu */
.stock-reflect-under-qty {
    margin-top: 0;
    width: max-content;
    min-width: 170px;
    box-sizing: border-box;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.25;
    padding: 10px 12px;
    align-self: end;
}

.stock-not-reflected {
    color: var(--warn-dark);
    font-size: 15px;
    vertical-align: middle;
}

.slip-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 10px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.slip-check-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.slip-check-row span {
    user-select: none;
    -webkit-user-select: none;
}

@media (max-width: 1250px) {
    .sale-form-with-date {
        grid-template-columns: 100px 150px 165px 155px 1fr !important;
    }
}

@media (max-width: 900px) {
    .simple-slip-grid,
    .selected-sale-meta-grid,
    .selected-sale-form,
    .customer-row-only,
    .sale-form-with-date {
        grid-template-columns: 1fr !important;
        max-width: none;
    }
}

/* ---- Satış takibi geçmişi ---- */
.sales-history-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.sales-history-head h2 {
    margin-bottom: 4px;
}

.history-summary {
    margin: 0;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
}

.history-date-field {
    min-width: 170px;
    max-width: 190px;
}

.history-date-field input[type="date"] {
    height: 34px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.history-action-cell {
    white-space: nowrap;
    width: 165px;
    min-width: 165px;
}

.mini-edit-btn,
.mini-delete-btn {
    border: none;
    border-radius: 5px;
    padding: 5px 9px;
    margin: 0 2px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
}

.mini-edit-btn { width: 58px; }
.mini-delete-btn { width: 92px; }

.slip-inline-edit {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height .35s ease, opacity .25s ease, transform .35s ease;
}

.slip-inline-edit.is-open {
    max-height: 760px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 18px;
}

.slip-inline-edit-card {
    padding: 20px;
    border: 1px solid var(--accent-soft-line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.slip-inline-edit-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.slip-inline-edit-head h3,
.slip-inline-edit-head p { margin: 0; }
.slip-inline-edit-head p { color: var(--ink-soft); font-size: 13px; margin-top: 5px; }

.slip-inline-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 14px;
}

.inline-edit-note { grid-column: span 2; }

@media (max-width: 760px) {
    .slip-inline-edit-grid { grid-template-columns: 1fr; }
    .inline-edit-note { grid-column: auto; }
    .history-action-cell { width: 150px; min-width: 150px; }
}

.mini-edit-btn {
    background: var(--warn);
}

.mini-edit-btn:hover {
    background: var(--warn-dark);
}

.mini-delete-btn {
    background: var(--danger);
}

.mini-delete-btn:hover,
.mini-delete-btn.delete-confirming {
    background: var(--danger-dark);
}

@media (max-width: 760px) {
    .sales-history-head {
        flex-direction: column;
    }
    .history-date-field {
        width: 100%;
        max-width: none;
    }
}

/* ==========================================================================
   11. PDF FİYAT LİSTESİ AKTARMA SAYFASI
   ========================================================================== */
.price-import-page {
    margin-top: 0;
}

.price-import-wrapper {
    width: 95%;
    max-width: 1500px;
    margin: var(--page-content-gap) auto 40px auto;
    text-align: left;
}

.price-import-title {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    margin-bottom: 18px;
    border-left: 5px solid var(--accent);
}

.price-import-title h1 {
    margin: 0 0 6px 0;
    color: var(--ink);
    font-size: 25px;
}

.price-import-title p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
}

.price-import-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    margin-bottom: 18px;
}

.price-upload-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.price-file-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 320px;
    flex: 1;
}

.price-file-area label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ink-faint);
    letter-spacing: 0.3px;
}

.price-file-area input[type="file"] {
    padding: 9px 10px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    font-size: 13px;
    font-family: inherit;
}

.price-file-area small {
    color: var(--ink-faint);
    font-size: 12px;
}

.price-read-btn,
.price-apply-btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 20px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: .2s;
    min-width: 140px;
    font-family: inherit;
}

.price-read-btn {
    background: var(--ink);
}

.price-read-btn:hover {
    background: var(--accent);
}

.price-apply-btn {
    background: var(--success);
}

.price-apply-btn:hover {
    background: var(--success-dark);
}

.price-apply-btn:disabled {
    background: var(--line-strong);
    cursor: not-allowed;
}

.price-info-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.price-stat {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: var(--surface-soft);
}

.price-stat span {
    display: block;
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.price-stat strong {
    font-size: 22px;
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
}

.price-stat.update {
    border-left: 4px solid var(--warn);
}

.price-stat.new {
    border-left: 4px solid var(--accent);
}

.price-stat.same {
    border-left: 4px solid var(--success);
}

.price-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.price-check {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-check input {
    accent-color: var(--accent);
}

.price-status {
    margin: 14px 0 0 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-soft);
}

.price-preview-wrap {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: auto;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
    max-height: 65vh;
}

.price-preview-table {
    min-width: 1100px;
    border-radius: 0;
}

.price-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-update {
    background: var(--warn-soft);
    color: var(--warn-dark);
}

.badge-new {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.badge-same {
    background: var(--success-soft);
    color: var(--success-dark);
}

@media (max-width: 800px) {
    .price-info-row {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

/* Fiyat listesi ön izleme miktar kutusu */
.price-qty-input {
    width: 70px;
    height: 30px;
    padding: 5px 7px;
    border: 1px solid #c7d1d8;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
    background: #ffffff;
    color: #333;
}

.price-qty-input:focus {
    outline: none;
    border-color: #679C63;
    box-shadow: 0 0 0 2px rgba(103, 156, 99, 0.18);
}

.price-qty-input::placeholder {
    color: #9aa1a7;
    font-weight: 700;
}


/* ==========================================================================
   FİYAT LİSTESİ — İSKONTO ALANI
   ========================================================================== */
.price-stat.discount {
    min-width: 118px;
}

.discount-input {
    width: 86px;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    color: var(--ink);
    background: var(--surface);
    outline: none;
}

.discount-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(216, 91, 44, 0.14);
}

/* ========================================================================== 
   12. CONTINENTAL WEBDEN FİYAT OKUMA DENEMESİ
   ========================================================================== */
.web-import-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.web-import-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.web-import-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.web-import-row input {
    height: 38px;
    min-width: 190px;
    padding: 8px 10px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.web-import-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 132, 156, 0.16);
}

.web-read-btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 800;
    cursor: pointer;
    color: #fff;
    background: var(--accent-2);
    transition: .2s;
    font-family: inherit;
}

.web-read-btn:hover {
    background: var(--accent-2-dark, #7a4d7d);
}

.web-import-box small {
    display: block;
    margin-top: 8px;
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 600;
}

.price-stat.vat {
    border-left: 4px solid var(--accent-2);
}

/* ==========================================================================
   99. STOK HAREKETİ PANELİ
   ========================================================================== */
.stock-movement-box {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid #d9dee3;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    text-align: left;
}

.stock-movement-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.stock-movement-head h2 {
    margin: 0;
    font-size: 18px;
    color: #63849C;
}

.movement-date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.movement-date-filter input {
    width: 160px;
    padding: 8px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.movement-date-filter input:focus {
    border-color: #63849C;
    box-shadow: 0 0 0 2px rgba(99,132,156,0.16);
}

.movement-filter-btn,
.movement-clear-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}

.movement-filter-btn {
    background: #63849C;
    color: #fff;
}

.movement-clear-btn {
    background: #e9ecef;
    color: #333;
}

.movement-table th,
.movement-table td {
    font-size: 13px;
}

.movement-clickable {
    cursor: pointer;
}

.movement-clickable:hover {
    background: #eef5f8 !important;
}

.movement-in {
    color: #2E7D4F !important;
    font-weight: 800;
}

.movement-out {
    color: #B23A3A !important;
    font-weight: 800;
}

/* ==========================================================================
   10. YEDEK AYARLARI SAYFASI
   ========================================================================== */
.backup-settings-page {
    max-width: none;
    text-align: left;
}

.backup-card {
    background: #ffffff;
    border: 1px solid #e1e5e8;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.07);
    padding: 26px;
    max-width: 980px;
    margin: var(--page-content-gap) auto;
}

.backup-card h1 {
    margin: 0 0 10px 0;
    color: #63849C;
    font-size: 24px;
}

.backup-desc {
    color: #55524C;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 22px;
}

.backup-form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backup-form-row label {
    font-size: 12px;
    color: #55524C;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.backup-form-row textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 130px;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    padding: 12px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    outline: none;
    background: #fbfcfd;
}

.backup-form-row textarea:focus {
    border-color: #63849C;
    box-shadow: 0 0 0 3px rgba(99,132,156,.16);
    background: #ffffff;
}

.backup-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.backup-save-btn,
.backup-test-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
}

.backup-save-btn {
    background: #679C63;
    color: #fff;
}

.backup-test-btn {
    background: #63849C;
    color: #fff;
}

.backup-msg {
    display: none;
    margin-top: 16px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.45;
}

/* ========================================================================== 
   11. HIZLI BARKOD İŞLEMLERİ
   ========================================================================== */
.barcode-panel {
    width: 95%;
    max-width: 1500px;
    margin: var(--page-content-gap) auto 24px;
    padding: 18px;
    border: 1px solid var(--line, #d9dee3);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(36, 52, 64, 0.07);
}

.barcode-panel-head,
.barcode-controls,
.barcode-modal-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.barcode-panel-head {
    justify-content: space-between;
    margin-bottom: 15px;
}

.barcode-panel h2,
.barcode-modal h2 {
    margin: 0;
    color: var(--accent, #63849c);
    font-size: 18px;
}

.barcode-panel-head p,
.barcode-modal-head p {
    margin: 4px 0 0;
    color: #6b6b68;
    font-size: 13px;
}

.barcode-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-bottom: 15px;
}

.barcode-modes label {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #cfd8dc;
    border-radius: 9px;
    background: #f5f7f8;
    color: #454846;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.barcode-modes input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    margin: 0;
}

.barcode-modes label > span {
    display: flex;
    min-width: 0;
    width: 100%;
    align-items: center;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.barcode-modes label strong { font-size: 14px; line-height: 1.2; }
.barcode-modes label small {
    color: #727b7f;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.25;
}

.barcode-modes label:has(input:checked) {
    border-color: #7f9caf;
    background: #e6f0f5;
    color: #365b72;
    box-shadow: 0 0 0 2px rgba(99, 132, 156, .12);
}

.barcode-modes label:focus-within {
    outline: 2px solid rgba(59, 111, 160, .45);
    outline-offset: 2px;
}

.barcode-modes label.is-disabled {
    border-style: dashed;
    background: #f1f1ef;
    color: #8b8e8c;
    cursor: not-allowed;
    opacity: .72;
}

.barcode-controls { align-items: end; }
.barcode-input-wrap { flex: 1 1 340px; }
.barcode-quantity-wrap { flex: 0 0 92px; }

.barcode-input-wrap,
.barcode-quantity-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #55524c;
    font-size: 12px;
    font-weight: 800;
}

.barcode-controls input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 9px 12px;
    border: 1.5px solid #bcc8ce;
    border-radius: 8px;
    background: #fff;
    color: #242827;
    font: 700 16px/1.2 'Segoe UI', sans-serif;
}

.barcode-controls input:focus {
    outline: none;
    border-color: var(--accent, #63849c);
    box-shadow: 0 0 0 3px rgba(99, 132, 156, 0.18);
}

.barcode-controls input:disabled { background: #eef1f2; color: #7d8180; }
.barcode-quantity-wrap[hidden] { display: none; }

.barcode-submit-btn,
.barcode-camera-btn {
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.barcode-submit-btn { background: #2e7d4f; }
.barcode-camera-btn { background: var(--accent, #63849c); }
.barcode-submit-btn:hover { background: #24643f; }
.barcode-camera-btn:hover { background: #4e7089; }
.barcode-submit-btn:disabled { opacity: .6; cursor: wait; }

.barcode-panel > small {
    display: block;
    margin-top: 9px;
    color: #6b6b68;
    font-size: 12px;
}

.barcode-status {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 750;
}

.barcode-status:not(:empty) { display: block; }
.barcode-status.is-info,
.barcode-status.is-working { background: #eef5f8; color: #365b72; }
.barcode-status.is-success { background: #e8f4ec; color: #24643f; }
.barcode-status.is-warning { background: #fff4df; color: #875c13; }
.barcode-status.is-error { background: #faeaea; color: #9a3030; }

.unknown-barcode-recovery[hidden] { display: none; }
.unknown-barcode-recovery {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 10px;
    padding: 12px 13px;
    border: 1px solid #e7c987;
    border-radius: 8px;
    background: #fff8e8;
    text-align: left;
}

.unknown-barcode-recovery > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.unknown-barcode-recovery strong { color: #785515; font-size: 13px; }
.unknown-barcode-recovery span { color: #796b4f; font-size: 11px; line-height: 1.35; }
.unknown-barcode-recovery button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 13px;
    border: 0;
    border-radius: 7px;
    background: #a6762b;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.new-barcode-choice[hidden] { display: none; }
.new-barcode-choice {
    margin-top: 14px;
    padding: 15px;
    border: 1px solid #b9cfdc;
    border-radius: 10px;
    background: #f2f8fb;
    text-align: left;
}

.new-barcode-choice-head h3,
.new-barcode-choice-card h4 {
    margin: 0;
    color: #365b72;
}

.new-barcode-choice-head h3 { font-size: 16px; }
.new-barcode-choice-head p,
.new-barcode-choice-card p {
    margin: 5px 0 0;
    color: #59676e;
    font-size: 12px;
    line-height: 1.4;
}

.new-barcode-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 13px;
}

.new-barcode-choice-card {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 13px;
    border: 1px solid #d2e0e7;
    border-radius: 8px;
    background: #fff;
}

.new-barcode-choice-card h4 { font-size: 14px; }
.new-barcode-choice-card p { flex: 1; margin: 0; }
.new-barcode-choice-card select,
.existing-product-search {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 7px 9px;
    border: 1.5px solid #aebfc8;
    border-radius: 7px;
    background: #fff;
    color: #303638;
    font-family: inherit;
}

.existing-product-search:focus {
    outline: none;
    border-color: var(--accent, #63849c);
    box-shadow: 0 0 0 3px rgba(99, 132, 156, .15);
}

.existing-product-result-info {
    min-height: 17px;
    color: #66757c;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.existing-product-results {
    display: grid;
    gap: 6px;
    max-height: 310px;
    overflow-y: auto;
    padding-right: 3px;
    -webkit-overflow-scrolling: touch;
}

.new-barcode-choice-card .existing-product-result {
    display: flex;
    align-items: flex-start;
    min-height: 0;
    width: 100%;
    flex-direction: column;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid #d3dee4;
    border-radius: 7px;
    background: #fff;
    color: #303638;
    text-align: left;
}

.new-barcode-choice-card .existing-product-result:hover,
.new-barcode-choice-card .existing-product-result.is-selected {
    border-color: #5d8a70;
    background: #e8f4ec;
    color: #214e33;
}

.existing-product-result strong { font-size: 12px; line-height: 1.3; }
.existing-product-result span { color: #68757b; font-size: 10px; line-height: 1.3; }
.existing-product-selected[hidden] { display: none; }
.existing-product-selected {
    padding: 8px 9px;
    border: 1px solid #b8d5c3;
    border-radius: 7px;
    background: #e8f4ec;
    color: #24643f;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.new-barcode-choice-card button {
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: var(--accent, #63849c);
    color: #fff;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.new-barcode-choice-card.is-existing button { background: #2e7d4f; }
.new-barcode-choice-card button:disabled { opacity: .55; cursor: not-allowed; }

/* Barkod ekranı — panelin geri kalanıyla uyumlu temiz düğmeler */
.barcode-submit-btn,
.barcode-camera-btn {
    width: 205px;
    min-width: 205px;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--rubber, #1f1e1d);
    color: #fff;
    box-shadow: 0 3px 8px rgba(31, 30, 29, .18);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    transition: background .16s ease, transform .12s ease, box-shadow .16s ease;
}

.barcode-submit-btn:hover,
.barcode-camera-btn:hover {
    background: var(--accent, #d85b2c);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(216, 91, 44, .24);
}

.barcode-submit-btn:active,
.barcode-camera-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(31, 30, 29, .2);
}

.barcode-submit-btn:disabled,
.barcode-camera-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

.barcode-modes label:not(.is-disabled) {
    border-color: #d4d9dc;
    background: #fff;
    box-shadow: 0 2px 7px rgba(36, 52, 64, .08);
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .12s ease;
}

.barcode-modes label:not(.is-disabled):hover {
    border-color: #e3a07e;
    background: #fff9f5;
}

.barcode-modes label:has(input:checked):not(.is-disabled) {
    border-color: var(--accent, #d85b2c);
    background: var(--accent-soft, #fbe7da);
    color: var(--accent-dark, #b3461f);
    box-shadow: 0 0 0 2px rgba(216, 91, 44, .12);
}

body.barcode-modal-open { overflow: hidden; }

.camera-secure-warning[hidden] { display: none; }
.camera-secure-warning {
    margin: 0 20px 14px;
    padding: 10px 13px;
    border: 1px solid #e7c987;
    border-radius: 8px;
    background: #fff6df;
    color: #785515;
    font-size: 13px;
    line-height: 1.45;
}

.camera-secure-warning strong { margin-right: 4px; }
.camera-secure-warning code { font-size: 12px; }

.barcode-modal[hidden] { display: none; }
.barcode-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(14, 22, 28, .78);
}

.barcode-modal-card {
    overflow: hidden;
    width: min(680px, 100%);
    max-height: calc(100dvh - 36px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.barcode-modal-head {
    justify-content: space-between;
    padding: 16px 18px;
}

.barcode-modal-close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #edf0f2;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

#barcode-reader {
    min-height: 250px;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #111;
}

#barcode-reader > div,
#barcode-reader video {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
}

#barcode-reader video { object-fit: cover; }

.barcode-camera-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 18px 4px;
    background: #fff;
}

.barcode-camera-tools button,
.barcode-photo-button {
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #d5d9dc;
    border-radius: 9px;
    background: #f4f5f6;
    color: #292929;
    font: 700 13px/1.15 'Segoe UI', sans-serif;
    text-align: center;
    cursor: pointer;
}

.barcode-camera-tools button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.barcode-camera-tools button.is-active {
    border-color: #2f7653;
    background: #e4f2e9;
    color: #235d40;
}

.barcode-photo-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f1e1d;
    color: #fff;
}

.barcode-photo-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.barcode-camera-status {
    margin: 0;
    padding: 11px 18px 4px;
    color: #55524c;
    font-size: 13px;
    font-weight: 700;
}

.barcode-camera-tip {
    margin: 0;
    padding: 3px 18px 15px;
    color: #77736c;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}

.barcode-read-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    min-width: 20px;
    padding: 1px 4px;
    border: 1px solid #b8d5c3;
    border-radius: 999px;
    background: #e8f4ec;
    color: #2e7d4f;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
    justify-content: center;
}
.label-linked-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    margin-left: 4px;
    padding: 1px 4px;
    border: 1px solid #e2bd82;
    border-radius: 999px;
    background: #fff1db;
    color: #9a5b12;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

.stock-label-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid #d7e1e6;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    box-shadow: 0 5px 16px rgba(26, 34, 38, .05);
}
.stock-label-preview-button {
    display: block;
    width: 104px;
    margin: 0;
    padding: 4px;
    border: 1px solid #d9dfe1;
    border-radius: 8px;
    background: #f7f8f8;
    cursor: zoom-in;
}
.stock-label-preview-button img {
    display: block;
    width: 100%;
    height: 136px;
    object-fit: contain;
    background: #fff;
}
.stock-label-preview-button:hover,
.stock-label-preview-button:focus-visible {
    border-color: #e45a27;
    box-shadow: 0 0 0 3px rgba(228, 90, 39, .14);
    outline: none;
}
.stock-label-inline-barcode {
    align-self: center;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    background: transparent;
}

.product-barcode-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 11px 14px;
    border: 1px solid #d7e1e6;
    border-radius: 9px;
    background: #f7fafb;
    color: #35454e;
}

.product-barcode-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e4eef3;
    color: #4e7089;
    font-size: 18px;
}

.product-barcode-info small {
    display: block;
    margin-bottom: 2px;
    color: #78858b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .25px;
    text-transform: uppercase;
}

.product-barcode-info strong { font-size: 13px; }
.product-barcode-field {
    display: flex;
    min-width: 220px;
    flex: 1 1 360px;
    flex-direction: column;
}

.product-barcode-field input {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    padding: 7px 10px;
    border: 1.5px solid #bcc8ce;
    border-radius: 7px;
    background: #fff;
    color: #242827;
    font: 700 14px/1.2 'Segoe UI', sans-serif;
}

.product-barcode-field input:focus {
    outline: none;
    border-color: var(--accent, #63849c);
    box-shadow: 0 0 0 3px rgba(99, 132, 156, .15);
}
.product-barcode-help {
    margin-top: 5px;
    color: #66757c;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
}
.product-barcode-count { margin-left: auto; text-align: right; }

.pattern-barcode-box {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #d7e1e6;
    border-radius: 10px;
    background: #fff;
}

.pattern-barcode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.pattern-barcode-head h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 16px;
}

.pattern-barcode-head p {
    margin: 0;
    color: var(--ink-faint);
    font-size: 12px;
}

.pattern-barcode-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 560px;
    justify-content: flex-end;
}

.pattern-barcode-actions input {
    width: min(280px, 100%);
    height: 38px;
    padding: 7px 10px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    font: 700 13px/1.2 inherit;
}

.pattern-barcode-actions button {
    min-height: 38px;
    padding: 8px 13px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #fff;
    font: 800 12px/1.2 inherit;
    cursor: pointer;
    white-space: nowrap;
}

#patternBarcodeCamera {
    background: var(--accent);
}

.pattern-barcode-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.pattern-barcode-list span {
    padding: 5px 9px;
    border: 1px solid #bed6c6;
    border-radius: 999px;
    background: #eef8f1;
    color: var(--success-dark);
    font-size: 12px;
    font-weight: 800;
}

.pattern-barcode-list small {
    color: var(--ink-faint);
}

.pattern-barcode-status {
    min-height: 18px;
    margin: 8px 0 0;
    color: var(--ink-faint);
    font-size: 12px;
    font-weight: 700;
}

.pattern-barcode-status.success { color: var(--success-dark); }
.pattern-barcode-status.error { color: var(--danger); }

.pattern-barcode-camera-card {
    max-width: 720px;
}

#pattern-barcode-reader {
    width: 100%;
    min-height: 320px;
    overflow: hidden;
    background: #111;
}

#pattern-barcode-reader > div,
#pattern-barcode-reader video {
    width: 100% !important;
    max-height: 62vh;
}

#pattern-barcode-reader video {
    object-fit: cover;
}

@media (max-width: 600px) {
    .stock-label-card { grid-template-columns: 78px minmax(0, 1fr); gap: 9px; padding: 8px; }
    .stock-label-preview-button { width: 78px; }
    .stock-label-preview-button img { height: 104px; }
    .stock-label-inline-barcode { padding: 3px; }
    .stock-label-inline-barcode .product-barcode-icon { display: none; }
    .product-barcode-info { align-items: flex-start; flex-wrap: wrap; }
    .product-barcode-count { width: 100%; margin-left: 44px; text-align: left; }
    .pattern-barcode-head,
    .pattern-barcode-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .pattern-barcode-actions { margin-top: 12px; }
    .pattern-barcode-actions input,
    .pattern-barcode-actions button { width: 100%; }
    .pattern-barcode-camera-card {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    #pattern-barcode-reader { min-height: 52vh; }
}

@media (max-width: 800px) {
    .camera-secure-warning { margin: 0 10px 12px; }
    .barcode-panel {
        width: calc(100% - 20px);
        margin: 12px auto 18px;
        padding: 14px;
    }
    .barcode-panel-head { align-items: stretch; flex-direction: column; }
    .barcode-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .barcode-modes label { min-height: 64px; padding: 9px; }
    .new-barcode-choice-grid { grid-template-columns: 1fr; }
    .unknown-barcode-recovery { align-items: stretch; flex-direction: column; }
    .unknown-barcode-recovery button { width: 100%; }
    .barcode-controls { align-items: stretch; flex-wrap: wrap; }
    .barcode-input-wrap { flex-basis: 100%; }
    .barcode-quantity-wrap { flex: 1 1 88px; }
    .barcode-submit-btn,
    .barcode-camera-btn {
        width: auto;
        min-width: 0;
        flex: 1 1 145px;
    }
    .barcode-modal { padding: 0; }
    .barcode-modal-card { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .barcode-modal-head { padding: 10px 12px; }
    .barcode-modal-head h2 { font-size: 18px; }
    .barcode-modal-head p { margin-top: 2px; font-size: 12px; }
    #barcode-reader {
        min-height: 0;
        flex: 1 1 0;
    }
    .barcode-camera-tools {
        gap: 6px;
        padding: 10px 10px 3px;
    }
    .barcode-camera-tools button,
    .barcode-photo-button {
        min-height: 44px;
        padding: 8px 5px;
        font-size: 12px;
    }
    .barcode-camera-status { padding: 8px 12px 2px; font-size: 12px; }
    .barcode-camera-tip { padding: 2px 12px calc(9px + env(safe-area-inset-bottom)); }
}
