/* Market POS - Modern Stylesheet */

/* ── Erişilebilirlik: klavye odağı görünür olsun (mouse'la net olmasın) ── */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible,
.btn-sm:focus-visible {
    outline-offset: 1px;
}
/* Skip-to-content linki için */
.skip-link {
    position: absolute; top: -40px; left: 0;
    background: #2563eb; color: #fff;
    padding: 8px 14px; z-index: 9999;
    text-decoration: none; font-weight: 600;
}
.skip-link:focus-visible { top: 0; }

:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-d: #1d4ed8;
    --primary-l: #dbeafe;
    --success: #16a34a;
    --success-l: #dcfce7;
    --danger: #dc2626;
    --danger-l: #fee2e2;
    --warn: #f59e0b;
    --warn-l: #fef3c7;
    --shadow: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Login */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    text-align: center;
}
.login-logo {
    width: 72px; height: 72px;
    background: var(--primary-l);
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.login-logo svg { width: 36px; height: 36px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-sub { color: var(--text-muted); margin: 0 0 24px; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.form-grp { text-align: left; margin-bottom: 14px; }
.form-grp label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-l);
}

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--border-strong);
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    transition: all .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-warn:hover { background: #d97706; border-color: #d97706; color: #fff; }
.btn-block { width: 100%; justify-content: center; padding: 11px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; }
.btn svg { width: 16px; height: 16px; }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
}
.alert-err { background: var(--danger-l); color: var(--danger); }
.alert-ok { background: var(--success-l); color: var(--success); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.brand {
    padding: 20px 18px;
    display: flex; align-items: center; gap: 10px;
    font-size: 17px; font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #1e293b;
}
.brand svg { width: 24px; height: 24px; color: var(--primary); }
.menu { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.m-grp { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #475569; padding: 12px 12px 4px; }
.menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: background .12s;
}
.menu a:hover { background: #1e293b; color: #fff; }
.menu a.active { background: var(--primary); color: #fff; }
.menu svg { width: 18px; height: 18px; }
.side-foot { padding: 14px; border-top: 1px solid #1e293b; }
.usr { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.usr svg { width: 32px; height: 32px; color: #64748b; }
.usr-ad { font-size: 13px; color: #fff; font-weight: 500; }
.usr-rol { font-size: 11px; color: #64748b; text-transform: uppercase; }
.logout { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px; border-radius: 6px; }
.logout:hover { background: #1e293b; color: #fff; }
.logout svg { width: 16px; height: 16px; }

.main { flex: 1; padding: 24px; overflow-x: auto; }

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.page-head h1 {
    font-size: 22px; margin: 0;
    display: flex; align-items: center; gap: 10px;
}
.page-head h1 svg { width: 24px; height: 24px; color: var(--primary); }
.page-actions { display: flex; gap: 8px; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-body { padding: 18px; }
.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
}
.tbl th {
    background: var(--surface-2);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .center { text-align: center; }

/* Stat */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.bl { background: var(--primary-l); color: var(--primary); }
.stat-icon.gr { background: var(--success-l); color: var(--success); }
.stat-icon.or { background: var(--warn-l); color: var(--warn); }
.stat-icon.rd { background: var(--danger-l); color: var(--danger); }
.stat-val { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-lbl { font-size: 12px; color: var(--text-muted); }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.badge-bl { background: var(--primary-l); color: var(--primary); }
.badge-gr { background: var(--success-l); color: var(--success); }
.badge-or { background: var(--warn-l); color: var(--warn); }
.badge-rd { background: var(--danger-l); color: var(--danger); }
.badge-gy { background: #e2e8f0; color: #475569; }

/* === HIZLI SATIŞ EKRANI (TAM EKRAN, TABLO STİLİ) === */
.pos-body { background: #e6e9f5; overflow: hidden; }
.pos-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.pos-shell-grid { display: flex; gap: 0; padding: 10px; flex: 1; min-height: 0; overflow: hidden; }
.pos-left2 { width: var(--pos-left, 56%); min-width: 360px; max-width: calc(100% - 360px); margin-right: 5px; }
.pos-splitter { width: 6px; flex-shrink: 0; cursor: col-resize; background: transparent; position: relative; }
.pos-splitter:hover, .pos-splitter.active { background: var(--primary); }
.pos-splitter::before {
    content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 4px; height: 40px; background: #cbd5e1; border-radius: 2px;
}
.pos-splitter:hover::before, .pos-splitter.active::before { background: #fff; }
.pos-right2 { flex: 1; min-width: 360px; margin-left: 5px; }

/* Kategori sekme barı (POS sağ üst) */
.pr-grup-tabs { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.pr-grup-tabs .pgt {
    padding: 6px 14px;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-bottom: 3px solid var(--c, #94a3b8);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: all .12s;
}
.pr-grup-tabs .pgt:hover { background: #f1f5f9; color: #0f172a; }
.pr-grup-tabs .pgt.active {
    background: var(--c, var(--primary));
    color: #fff;
    border-color: var(--c, var(--primary));
}

/* Sol panel - sepet tablosu */
.pos-left2 { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.pos-toolbar {
    display: flex; gap: 4px; flex-wrap: wrap;
    background: #fff; padding: 6px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tb-btn {
    background: #2563eb; color: #fff;
    border: 0; padding: 8px 14px;
    font-size: 13px; font-weight: 600;
    border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.tb-btn:hover { background: var(--primary-d); color: #fff; }
.tb-btn.tb-icon { padding: 8px; background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.tb-btn.tb-icon:hover { background: #f1f5f9; color: #0f172a; }
.tb-btn svg { width: 14px; height: 14px; }

.kasa-tabs { display: inline-flex; background: #f1f5f9; border-radius: 8px; padding: 3px; gap: 2px; }
.kasa-tab {
    background: transparent; color: #64748b;
    border: 0; padding: 6px 14px;
    font-size: 13px; font-weight: 600;
    border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .12s;
}
.kasa-tab svg { width: 14px; height: 14px; }
.kasa-tab:hover { background: #e2e8f0; color: #0f172a; }
.kasa-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.3); }
.kasa-cnt {
    background: rgba(255,255,255,.25); color: inherit;
    padding: 1px 7px; border-radius: 10px;
    font-size: 11px; font-weight: 700;
    min-width: 18px; text-align: center;
}
.kasa-tab:not(.active) .kasa-cnt { background: #e2e8f0; }
.kasa-tab.kasa-add {
    padding: 6px 8px;
    color: #16a34a;
    border: 1px dashed #86efac;
    background: #f0fdf4;
}
.kasa-tab.kasa-add:hover { background: #dcfce7; border-color: #16a34a; }
.kasa-tab.kasa-add svg { width: 14px; height: 14px; color: #16a34a; }

.kasa-tab.kasa-rem {
    padding: 6px 8px;
    color: #dc2626;
    border: 1px dashed #fca5a5;
    background: #fef2f2;
}
.kasa-tab.kasa-rem:hover { background: #fee2e2; border-color: #dc2626; }
.kasa-tab.kasa-rem svg { width: 14px; height: 14px; color: #dc2626; }
.kasa-cnt.empty { display: none; }

/* ── Sayfa sekmeleri (ayarlar, raporlar vb.) ── */
.ayar-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 18px;
    background: var(--surface-2, #f1f5f9);
    border-radius: 10px;
    padding: 4px;
    flex-wrap: wrap;
    border: 1px solid var(--border, #e2e8f0);
}
.ayar-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    font-size: 13.5px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .15s;
    white-space: nowrap;
}
.ayar-tab svg { width: 15px; height: 15px; }
.ayar-tab.active {
    background: #fff;
    color: var(--primary, #4f46e5);
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
}
.ayar-tab:hover:not(.active) {
    color: var(--text, #0f172a);
    background: rgba(255,255,255,.6);
}
/* ── Etiket şablon sekmeleri ── */
.et-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 18px;
    background: var(--surface-2, #f1f5f9);
    border-radius: 10px;
    padding: 4px;
    flex-wrap: wrap;
    border: 1px solid var(--border, #e2e8f0);
}
.et-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    font-size: 13.5px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .15s;
    white-space: nowrap;
}
.et-tab svg { width: 15px; height: 15px; }
.et-tab.active {
    background: #fff;
    color: var(--primary, #4f46e5);
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
}
.et-tab:hover:not(.active) {
    color: var(--text, #0f172a);
    background: rgba(255,255,255,.6);
}

.tb-row2 {
    display: flex; gap: 6px; align-items: center;
    background: #fff; padding: 6px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tb-row2 .tb-search {
    flex: 1;
    display: flex; align-items: center; gap: 4px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 6px; padding: 4px 10px;
}
.tb-row2 .tb-search input {
    flex: 1; border: 0; background: transparent;
    padding: 6px 0; font-size: 14px;
    outline: none;
    box-shadow: none !important;
}
.tb-row2 .tb-search svg { width: 16px; height: 16px; color: #94a3b8; }
.tb-row2 .tb-icon-mini {
    background: #fff; border: 1px solid #e2e8f0;
    color: #475569; padding: 6px;
    border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.tb-row2 .tb-icon-mini:hover { background: #f1f5f9; }
.tb-row2 .tb-icon-mini svg { width: 16px; height: 16px; }

/* Canlı arama paneli */
.tb-search { position: relative; }
.search-pop {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 90;
    max-height: 360px;
    overflow-y: auto;
}
.search-pop.show { display: block; }
.search-pop .sp-it {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font-size: 13px;
}
.search-pop .sp-it:last-child { border-bottom: none; }
.search-pop .sp-it:hover, .search-pop .sp-it.hi { background: var(--primary-l); color: var(--primary); }
.search-pop .sp-img {
    width: 36px; height: 36px;
    background: #f8fafc; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
}
.search-pop .sp-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.search-pop .sp-img svg { width: 18px; height: 18px; color: #cbd5e1; }
.search-pop .sp-info { flex: 1; min-width: 0; }
.search-pop .sp-ad { font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-pop .sp-bk { font-size: 11px; color: #94a3b8; font-family: monospace; }
.search-pop .sp-fyt { font-weight: 700; color: var(--primary); white-space: nowrap; }
.search-pop .sp-empty { padding: 16px; text-align: center; color: #94a3b8; font-size: 13px; }

/* Resim büyük önizleme (search-pop ve ks grid için) */
.img-preview {
    position: fixed;
    z-index: 999;
    width: 240px; height: 240px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,.25);
    padding: 8px;
    pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.img-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-preview .ipv-cap {
    position: absolute; bottom: 6px; left: 8px; right: 8px;
    background: rgba(15,23,42,.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Yeni Kısayol grid */
.ks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: 460px;
    overflow-y: auto;
    padding: 6px;
    background: #f8fafc;
    border-radius: 8px;
}
.ks-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all .12s;
    user-select: none;
}
.ks-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.ks-card.sel {
    border-color: var(--success);
    background: var(--success-l);
}
.ks-card.sel::after {
    content: '✓';
    position: absolute; top: 4px; right: 6px;
    background: var(--success); color: #fff;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.ks-card .ks-img {
    width: 100%; aspect-ratio: 1;
    background: var(--surface-2);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin-bottom: 6px;
}
.ks-card .ks-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ks-card .ks-img svg { width: 28px; height: 28px; color: #cbd5e1; }
.ks-card .ks-ad {
    font-size: 12px; font-weight: 500;
    color: #0f172a;
    line-height: 1.2;
    height: 2.4em; overflow: hidden;
}
.ks-card .ks-fyt { font-size: 13px; font-weight: 700; color: var(--primary); margin-top: 2px; }

/* Sepet tablosu */
.pos-cart-wrap {
    flex: 1; min-height: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.pos-cart-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.pos-cart-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pos-cart-tbl thead th {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px; font-weight: 600;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    position: sticky; top: 0; z-index: 1;
    text-transform: none;
    letter-spacing: 0;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-cart-tbl thead th.ct-center,
.pos-cart-tbl thead th.ct-num { text-align: center; }
.pos-cart-tbl thead th.ct-num.ct-fyt,
.pos-cart-tbl thead th.ct-num.ct-tut { text-align: right; padding-right: 14px; }
.pos-cart-tbl td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
.pos-cart-tbl tbody tr:hover { background: #f8fafc; }
.pos-cart-tbl .ct-num { text-align: right; font-variant-numeric: tabular-nums; }
.pos-cart-tbl .ct-center { text-align: center; }
.pos-cart-tbl .ct-sira { color: #64748b; width: var(--ctw-sira, 36px); text-align: center; }
.pos-cart-tbl .ct-bk { width: var(--ctw-bk, 110px); color: #64748b; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-cart-tbl .ct-bk svg { width: 14px; height: 14px; }
.pos-cart-tbl .ct-ad { font-weight: 500; color: #0f172a; width: var(--ctw-ad, auto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-cart-tbl .ct-mik { width: var(--ctw-mik, 130px); }
.pos-cart-tbl td.ct-mik { text-align: center; }
.pos-cart-tbl .ct-bir { width: var(--ctw-bir, 60px); }
.pos-cart-tbl .ct-fyt { width: var(--ctw-fyt, 110px); }
.pos-cart-tbl .ct-tut { width: var(--ctw-tut, 110px); font-weight: 700; color: var(--primary); }
.pos-cart-tbl .ct-act { width: var(--ctw-act, 36px); text-align: center; }

/* Resize handle: ortada görünür, geniş tıklama alanı */
.pos-cart-tbl thead th { position: sticky; top: 0; z-index: 1; }
.pos-cart-tbl thead th .ct-rsz {
    position: absolute; top: 0; right: -4px; width: 9px; height: 100%;
    cursor: col-resize; background: transparent;
    z-index: 3;
}
.pos-cart-tbl thead th .ct-rsz::after {
    content: ''; position: absolute;
    top: 25%; bottom: 25%; left: 50%;
    width: 2px; transform: translateX(-50%);
    background: #cbd5e1; border-radius: 2px;
    transition: background .15s, width .15s;
}
.pos-cart-tbl thead th .ct-rsz:hover::after,
.pos-cart-tbl thead th .ct-rsz.dragging::after { background: var(--primary); width: 3px; }
body.col-resizing { cursor: col-resize !important; user-select: none !important; }
body.col-resizing * { cursor: col-resize !important; }

/* Tüm number input'larda native spin button gizle (+/- butonlarımız var) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.ct-qty {
    display: inline-flex; align-items: center; gap: 0;
    border: 1px solid #cbd5e1; border-radius: 6px;
    overflow: hidden; height: 30px;
}
.ct-qty button {
    width: 28px; height: 28px; border: 0;
    background: #f8fafc; color: #0f172a;
    font-size: 16px; line-height: 1; cursor: pointer;
}
.ct-qty button:hover { background: #e2e8f0; }
.ct-qty input {
    width: 50px; height: 28px; border: 0;
    text-align: center; font-size: 13px;
    outline: none; padding: 0;
    box-shadow: none !important;
    background: #fff;
}
.ct-fyt-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-right: 6px; }
.ct-fyt-cell .ct-fyt-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Bilinmeyen barkod satiri - kirmizi vurgu (cift tikla fiyat gir) */
.ct-row.row-bilinmeyen { background: #fee2e2 !important; }
.ct-row.row-bilinmeyen td { color: #991b1b; font-weight: 500; }
.ct-row.row-bilinmeyen:hover { background: #fecaca !important; cursor: pointer; }
.ct-row.row-bilinmeyen .ct-fyt-val { color: #dc2626; font-weight: 700; }
@keyframes bilinmeyenPulse { 0%,100%{background:#fee2e2}50%{background:#fecaca} }
.ct-row.row-bilinmeyen { animation: bilinmeyenPulse 1.5s ease-in-out infinite; }

.ct-edit, .ct-cog {
    background: var(--primary); color: #fff; border: 0;
    padding: 6px; border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.ct-edit:hover, .ct-cog:hover { background: var(--primary-d); }
.ct-edit svg, .ct-cog svg { width: 13px; height: 13px; }

.pos-cart-empty { padding: 60px 20px; text-align: center; color: #94a3b8; }
.pos-cart-empty svg { width: 48px; height: 48px; opacity: .3; margin-bottom: 10px; }

/* Sticky alt ödeme barı */
.pos-paybar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #fff;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    flex-shrink: 0;
    align-items: stretch;
}
.pos-paybar > button {
    height: var(--btn-h, auto);
    min-width: 100px;
    font-size: var(--btn-fs, inherit);
}
.pos-paybar > button[style*="--btn-w"] {
    flex: 0 0 var(--btn-w);
    width: var(--btn-w);
}
.pos-paybar > button:not([style*="--btn-w"]) {
    flex: 1 1 0;
    width: 0;
}

/* Fiş Notu — toplam ile alt buton bari arasinda */
.pos-fis-not {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 6px 10px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.pos-fis-not > svg {
    width: 18px; height: 18px; color: #94a3b8;
    flex-shrink: 0;
}
.pos-fis-not > input {
    flex: 1;
    border: 1px solid #e2e8f0;
    background: #fafafa;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    color: #0f172a;
    outline: 0;
    transition: all .15s;
}
.pos-fis-not > input::placeholder { color: #94a3b8; font-style: italic; }
.pos-fis-not > input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(79,70,229,.12); }
.pos-fis-not > input:not(:placeholder-shown) { background: #fef3c7; border-color: #fbbf24; font-weight: 500; }
.pos-fis-not .pn-clr {
    background: transparent; border: 0; cursor: pointer; padding: 4px;
    color: #94a3b8; border-radius: 4px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.pos-fis-not .pn-clr:hover { background: #fee2e2; color: #dc2626; }
.pos-fis-not .pn-clr svg { width: 14px; height: 14px; }
@media (max-width: 700px) {
    /* Mobilde fis notu paybar-ust'in ustune sabitle (butonlarin arkasinda kalmasin) */
    .pos-fis-not {
        position: fixed !important;
        left: 0; right: 0;
        /* paybar (~66) + paybar-ust (~50) = ~116px */
        bottom: calc(116px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 489;
        padding: 5px 8px;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -1px 4px rgba(0,0,0,.05);
    }
    .pos-fis-not > input { font-size: 12px; padding: 6px 8px; }
}

/* Paybar üst yardımcı butonlar (Muhtelif/İskonto/Bekleyen) */
.pos-paybar-ust {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #fff;
    padding: 6px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -1px 3px rgba(0,0,0,.04);
    flex-shrink: 0;
    margin-bottom: 1px;
    align-items: stretch;
}
.pos-paybar-ust > button {
    height: var(--btn-h, auto);
    min-width: 100px;
    padding: 9px 10px;
    font-size: var(--btn-fs, 13px); font-weight: 600;
    border: 1px solid #e2e8f0;
    background: var(--btn-bg, #f8fafc);
    color: var(--btn-clr, #0f172a);
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    position: relative;
    line-height: 1.1;
}
.pos-paybar-ust > button[style*="--btn-w"] { flex: 0 0 var(--btn-w); width: var(--btn-w); }
.pos-paybar-ust > button:not([style*="--btn-w"]) { flex: 1 1 0; width: 0; }
/* Hover: ozellestirilmis --btn-bg varsa onun ustune brightness, yoksa default mavi vurgu */
.pos-paybar-ust > button:hover { filter: brightness(.94); }
.pos-paybar-ust > button:not([style*="--btn-bg"]):hover {
    filter: none;
    background: var(--primary-l);
    border-color: var(--primary);
    color: var(--primary);
}
.pos-paybar-ust > button svg { width: 15px; height: 15px; }

/* Buton düzenleme modu — sadece masaüstü */
@media (max-width: 700px) {
    body.pb-edit .pos-paybar.pb-custom,
    body.pb-edit .pos-paybar-ust.pb-custom {
        display: flex !important;  /* mobilde absolute layout'u iptal et */
        position: static !important;
        height: auto !important;
    }
    body.pb-edit .pos-paybar.pb-custom > button,
    body.pb-edit .pos-paybar-ust.pb-custom > button {
        position: static !important;
        width: auto !important;
        height: auto !important;
        flex: 1 1 0 !important;
    }
}
body.pb-edit .pos-paybar > button, body.pb-edit .pos-paybar-ust > button {
    pointer-events: none;
    outline: 2px dashed var(--primary);
    outline-offset: -3px;
    transition: none;
}
/* Free-form mode: container absolute layout'a geçer */
.pos-paybar.pb-custom, .pos-paybar-ust.pb-custom {
    display: block !important;
    position: relative;
    height: var(--bar-h, 60px);
    overflow: visible;
}
.pos-paybar.pb-custom > button, .pos-paybar-ust.pb-custom > button {
    position: absolute !important;
    top: var(--btn-y, 0);
    left: var(--btn-x, 0);
    width: var(--btn-w, auto) !important;
    height: var(--btn-h, auto) !important;
    flex: none !important;
    margin: 0 !important;
    min-width: 0 !important;
}
body.pb-edit .pos-paybar.pb-custom > button,
body.pb-edit .pos-paybar-ust.pb-custom > button {
    cursor: move;
    pointer-events: auto !important;
    z-index: 5;
}
body.pb-edit .pb-dragging { z-index: 100 !important; opacity: .8; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
/* Düzenleme pop-over */
.pb-edit-pop { position:fixed;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:14px;box-shadow:0 8px 28px rgba(0,0,0,.18);width:210px; }
.pb-edit-pop label { font-size:11px;color:#64748b;font-weight:600;display:block;margin-bottom:3px }
.pb-edit-pop input[type=text], .pb-edit-pop input[type=number] { width:100%;box-sizing:border-box;padding:5px 8px;border:1px solid #e2e8f0;border-radius:6px;font-size:13px;margin-bottom:10px }
.pb-edit-pop .pbfs-btns { display:flex;gap:4px;margin-bottom:10px }
.pb-edit-pop .pbfs-btn { flex:1;padding:4px 0;font-size:12px;font-weight:700;border:1px solid #e2e8f0;border-radius:5px;background:#f8fafc;cursor:pointer;transition:all .1s }
.pb-edit-pop .pbfs-btn:hover,.pb-edit-pop .pbfs-btn.active { background:var(--primary);color:#fff;border-color:var(--primary) }

/* Sağ-alt köşede resize handle */
.bh-rsz {
    position: absolute; right: -5px; bottom: -5px;
    width: 16px; height: 16px;
    background: var(--success);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: nwse-resize;
    pointer-events: auto !important;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.bh-rsz:hover { background: #15803d; transform: scale(1.15); }

/* Kart (container) yüksekliği handle — alt kenarda yatay çubuk */
.bar-rsz {
    position: absolute; left: 50%; bottom: -5px;
    transform: translateX(-50%);
    width: 60px; height: 9px;
    background: var(--warn);
    border: 2px solid #fff;
    border-radius: 5px;
    cursor: ns-resize;
    z-index: 11;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.bar-rsz:hover { background: #d97706; height: 11px; }
.pos-paybar button {
    padding: 14px 8px;
    font-size: var(--btn-fs, 13px); font-weight: 700;
    border: 0; border-radius: 6px;
    background: var(--btn-bg, var(--primary)); color: var(--btn-clr, #fff);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    text-align: center;
    line-height: 1.2;
}
/* Hover: kullanicinin sectigi rengi koy (filter ile %12 koyulastir).
   Eski sabit --primary-d kullanildigi icin ozelleştirilmis renkler kayboluyordu. */
.pos-paybar button:hover { filter: brightness(.88); }
.pos-paybar button.pb-cancel { background: var(--btn-bg, #ef4444); }
.pos-paybar button.pb-cancel:hover { filter: brightness(.88); }
.pos-paybar button.pb-warn { background: var(--btn-bg, var(--warn)); }
.pos-paybar button.pb-warn:hover { filter: brightness(.88); }
.pos-paybar button svg { width: 16px; height: 16px; }

/* Sepet özet (paybar üstü) */
.pos-summary {
    display: flex; gap: 14px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    align-items: center;
}
.pos-summary .s-it { display: flex; flex-direction: column; }
.pos-summary .s-it small { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.pos-summary .s-it b { font-size: 15px; color: #0f172a; }
/* TOPLAM — kullanicinin gormesi gereken en kritik bilgi → badge benzeri vurgu */
.pos-summary .s-tot {
    background: var(--tot-bg, linear-gradient(135deg, #4f46e5 0%, #6366f1 100%));
    color: var(--tot-clr, #ffffff);
    border-radius: 10px;
    padding: 8px 16px;
    box-shadow: 0 4px 10px rgba(79,70,229,.25);
    border: 2px solid transparent;
    transition: filter .15s, transform .12s;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
}
.pos-summary .s-tot small {
    color: var(--tot-clr, #ffffff) !important;
    opacity: .9;
    font-size: 12px !important;
    font-weight: 700;
    letter-spacing: .06em;
}
.pos-summary .s-tot b {
    font-size: var(--tot-fs, 26px) !important;
    color: var(--tot-clr, #ffffff) !important;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .01em;
}
body.pb-edit .pos-summary .s-tot {
    cursor: pointer;
    outline: 2px dashed #f59e0b;
    outline-offset: 3px;
}
body.pb-edit .pos-summary .s-tot:hover { filter: brightness(.96); transform: scale(1.02); }
.pos-summary .s-spacer { flex: 1; }
.pos-summary input { width: 90px; padding: 4px 8px; font-size: 13px; }

/* Sağ panel - ürün grid */
.pos-right2 { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.pos-right-head {
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pos-right-head .pr-acts {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}
.pos-right-head .pr-grup { flex: 1; }
.pos-right-head .pr-grup .srcsel-btn {
    background-color: #4f46e5;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    color: #fff;
    border-color: #4f46e5;
    font-weight: 600;
}
.pos-right-head .pr-act {
    background: #fff; color: #475569;
    border: 1px solid #e2e8f0;
    padding: 8px 14px; font-size: 13px; font-weight: 600;
    border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.pos-right-head .pr-act:hover { background: #f1f5f9; color: #0f172a; }
.pos-right-head .pr-act svg { width: 14px; height: 14px; }

/* Icon-only butonlar (sadece simge, hover'da title goster) */
.pos-right-head .pr-act-icon {
    padding: 8px;
    width: 36px; height: 36px;
    justify-content: center;
}
.pos-right-head .pr-act-icon svg { width: 16px; height: 16px; }

/* En saga it (siralama butonu) */
.pos-right-head .pr-act-end { margin-left: auto; }

.pos-grid-wrap {
    flex: 1; min-height: 0;
    background: #f3f4ff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.pos-grid-scroll {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    gap: 8px;
    align-content: start;
    /* Satir yuksekligi varsayilani — variantlar override eder */
    grid-auto-rows: minmax(110px, auto);
}
.pos-grid-scroll[data-boyut="kucuk"] { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));  grid-auto-rows: minmax(90px, auto); }
.pos-grid-scroll[data-boyut="orta"]  { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); grid-auto-rows: minmax(130px, auto); }
.pos-grid-scroll[data-boyut="buyuk"] { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: minmax(170px, auto); }
.pos-grid-scroll[data-boyut="dev"]   { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-rows: minmax(220px, auto); }

.pos-prod {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    /* aspect-ratio fallback; gercek satir yuksekligi JS (grid-auto-rows) ile ayarlaniyor */
    aspect-ratio: 1;
    padding: 6px;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: all .12s;
    overflow: hidden;
    position: relative;           /* X butonu (pp-rm) icin + kendi stacking context */
}
.pos-prod:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,.15);
    z-index: 50;                                  /* Komşu kartları bas — ad/fiyat tooltip arkada kalmasın */
    overflow: visible;                            /* Tooltip ::after kart sınırı dışında görünür olsun */
}
.pos-prod .pp-img {
    flex: 1; width: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.pos-prod .pp-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pos-prod .pp-img svg { width: 32px; height: 32px; color: #cbd5e1; }
.pos-prod .pp-ad { font-size: 11px; font-weight: 500; color: #0f172a; line-height: 1.2; max-height: 2.4em; overflow: hidden; text-align: center; }
.pos-prod .pp-fyt { font-size: 12px; font-weight: 700; color: var(--primary); }
.pos-prod.tukenmis { opacity: .4; pointer-events: none; }
.pos-prod.drag-on { cursor: grab; }
.pos-prod.drag-on:active { cursor: grabbing; }
.pos-prod.dragging { opacity: .4; transform: scale(.95); }
body.sira-mod .pos-prod { outline: 2px dashed var(--primary); outline-offset: -3px; position: relative; }

/* ── Urun karti gorunum tercihi (Resim/Ad/Fiyat goster/gizle) ── */
body.pp-no-img .pos-prod .pp-img { display: none !important; }
body.pp-no-ad  .pos-prod .pp-ad  { display: none !important; }
body.pp-no-fyt .pos-prod .pp-fyt { display: none !important; }
/* Ad ve/veya fiyat gizliyse resim buyusun (hem masaustu hem mobil) */
body.pp-no-ad .pos-prod .pp-img,
body.pp-no-fyt .pos-prod .pp-img {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
}
body.pp-no-ad .pos-prod .pp-img img,
body.pp-no-fyt .pos-prod .pp-img img {
    max-width: 100% !important;
    max-height: 100% !important;
}
body.pp-no-ad .pos-prod .pp-img svg,
body.pp-no-fyt .pos-prod .pp-img svg {
    width: 48px !important; height: 48px !important;
}

/* Hover tooltip — JS ile body'ye eklenen floating element (clipping olmayan) */
.pp-float-tip {
    position: fixed;
    background: #0f172a;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10000;             /* gruplar/headerlar dahil her şeyin önünde */
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(0,0,0,.28);
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pp-float-tip::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 100%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #0f172a;
}

/* Sira modunda urun kartinin sag ustunde "x" — kisayoldan kaldirir */
.pos-prod .pp-rm {
    position: absolute;
    top: -8px; right: -8px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition: transform .15s, background .15s;
}
.pos-prod .pp-rm:hover {
    background: #b91c1c;
    transform: scale(1.15);
}
.pos-prod .pp-rm:active { transform: scale(.92); }
body.sira-mod .pgt { outline: 2px dashed #7c3aed; outline-offset: 2px; cursor: grab; }
body.sira-mod .pgt:active { cursor: grabbing; }
body.sira-mod .pgt.dragging { opacity: .4; transform: scale(.92); }
.pos-top {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    background: #0f172a;
    color: #fff;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
}
.pos-top-mini { padding: 6px 10px; gap: 8px; }
.pos-top-mini .pt-brand { font-size: 13px; }
.pos-top-mini .pt-brand svg { width: 18px; height: 18px; }
.pos-top-mini .pt-search-wrap {
    flex: 1; max-width: 520px;
    display: flex; align-items: center; gap: 6px;
    background: #1e293b; border: 1px solid #334155;
    border-radius: 6px; padding: 2px 6px 2px 10px;
}
.pos-top-mini .pt-search-wrap svg { width: 16px; height: 16px; color: #64748b; }
.pos-top-mini .pt-search-wrap input {
    flex: 1; border: 0; background: transparent;
    color: #fff; font-size: 13px; padding: 6px 0; outline: none;
}
.pos-top-mini .pt-search-wrap input::placeholder { color: #64748b; }
.pos-top-mini .btn-mini {
    background: transparent; border: 0;
    color: #94a3b8; padding: 5px;
    cursor: pointer; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
}
.pos-top-mini .btn-mini:hover { background: #334155; color: #fff; }
.pos-top-mini .btn-mini svg { width: 16px; height: 16px; }
.pos-top-mini .pt-btn-mini {
    background: #1e293b; border: 1px solid #334155;
    color: #cbd5e1; padding: 7px 9px;
    border-radius: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.pos-top-mini .pt-btn-mini:hover { background: #334155; color: #fff; }
.pos-top-mini .pt-btn-mini svg { width: 18px; height: 18px; }

.menu-pop { display: flex; flex-direction: column; gap: 8px; }
.menu-pop .mp-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; }
.menu-pop .mp-lbl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.menu-pop .mp-lbl svg { width: 16px; height: 16px; }
.menu-pop .seg { display: inline-flex; background: var(--surface-2); border-radius: 6px; padding: 2px; }
.menu-pop .seg button { background: transparent; border: 0; color: var(--text); padding: 5px 10px; font-size: 12px; font-weight: 700; border-radius: 4px; cursor: pointer; min-width: 28px; }
.menu-pop .seg button.active { background: var(--primary); color: #fff; }
.menu-pop .mp-btn {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    text-align: left;
    font-size: 14px; color: var(--text);
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; text-decoration: none;
}
.menu-pop .mp-btn:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.menu-pop .mp-btn svg { width: 18px; height: 18px; }
.menu-pop .mp-out { color: var(--danger); border-color: var(--danger-l); }
.menu-pop .mp-out:hover { background: var(--danger-l); color: var(--danger); border-color: var(--danger); }
.menu-pop .mp-user {
    margin-top: 4px; padding: 8px 4px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
}
.menu-pop .mp-user svg { width: 18px; height: 18px; }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1; border-radius: 24px;
    transition: .2s;
}
.switch .slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* Negatif stok modu — tükenmiş ürünler tıklanabilir */
body.neg-stok .pos-prod.tukenmis {
    opacity: .55;
    pointer-events: auto;
    border-style: dashed;
    border-color: var(--warn);
}
.pos-top .pt-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.pos-top .pt-brand svg { width: 20px; height: 20px; color: var(--primary); }
.pos-top .pt-spacer { flex: 1; }
.pos-top .pt-tools { display: flex; align-items: center; gap: 10px; }
.pos-top .pt-tool { display: flex; align-items: center; gap: 8px; }
.pos-top .pt-lbl { font-size: 11px; text-transform: uppercase; color: #94a3b8; letter-spacing: .04em; display: flex; align-items: center; gap: 4px; }
.pos-top .pt-lbl svg { width: 14px; height: 14px; }
.pos-top .seg { display: inline-flex; background: #1e293b; border-radius: 6px; padding: 2px; }
.pos-top .seg button { background: transparent; border: 0; color: #cbd5e1; padding: 5px 10px; font-size: 12px; font-weight: 700; border-radius: 4px; cursor: pointer; min-width: 28px; }
.pos-top .seg button.active { background: var(--primary); color: #fff; }
.pos-top .pt-btn {
    background: #1e293b; border: 1px solid #334155; color: #cbd5e1;
    padding: 7px 12px; border-radius: 6px; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; text-decoration: none;
}
.pos-top .pt-btn:hover { background: #334155; color: #fff; }
.pos-top .pt-btn svg { width: 16px; height: 16px; }
.pos-top .pt-user { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #cbd5e1; padding-left: 8px; border-left: 1px solid #334155; }
.pos-top .pt-user svg { width: 18px; height: 18px; color: #64748b; }

.pos-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 12px;
    padding: 12px;
    flex: 1;
    min-height: 0;
}
.pos-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.pos-right {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.scan-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex; gap: 10px; align-items: center;
    box-shadow: var(--shadow);
}
.scan-bar input {
    font-size: 18px;
    padding: 14px 16px;
    border: 2px solid var(--primary);
    background: var(--primary-l);
    font-weight: 500;
}
.scan-bar input:focus { background: #fff; }
.scan-bar .lbl {
    display: flex; align-items: center; gap: 6px;
    font-weight: 600; color: var(--primary);
    white-space: nowrap;
}
.scan-bar svg { width: 20px; height: 20px; }

.urun-grid {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow);
}
.kat-bar {
    display: flex; gap: 6px;
    padding: 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.kat-bar button {
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
}
.kat-bar button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.urun-list {
    flex: 1; overflow-y: auto;
    padding: 12px;
    display: grid;
    gap: 10px;
    align-content: start;
}
.urun-list[data-boyut="kucuk"] { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.urun-list[data-boyut="orta"] { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.urun-list[data-boyut="buyuk"] { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.urun-list[data-boyut="dev"]  { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.urun-list[data-boyut="kucuk"] .urun-card { padding: 6px; }
.urun-list[data-boyut="kucuk"] .uad { font-size: 11px; min-height: 2.4em; }
.urun-list[data-boyut="kucuk"] .ufiyat { font-size: 13px; }
.urun-list[data-boyut="buyuk"] .uad { font-size: 14px; }
.urun-list[data-boyut="buyuk"] .ufiyat { font-size: 18px; }
.urun-list[data-boyut="dev"] .urun-card { padding: 14px; }
.urun-list[data-boyut="dev"] .uad { font-size: 16px; min-height: 2.6em; }
.urun-list[data-boyut="dev"] .ufiyat { font-size: 24px; }
.urun-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all .12s;
    text-align: center;
    user-select: none;
}
.urun-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.urun-card .uimg { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; margin-bottom: 6px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.urun-card .uimg img { width: 100%; height: 100%; object-fit: cover; }
.urun-card .uimg-ph { color: var(--text-muted); }
.urun-card .uimg-ph svg { width: 32px; height: 32px; opacity: .4; }
.urun-card .uad { font-size: 13px; font-weight: 500; margin-bottom: 6px; line-height: 1.3; min-height: 2.6em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.urun-card .ufiyat { color: var(--primary); font-weight: 700; font-size: 15px; }
.urun-card .ustok { display: none; }
.urun-card.tukenmis { opacity: .5; pointer-events: none; }
.urun-card.drag-on { cursor: grab; }
.urun-card.drag-on:active { cursor: grabbing; }
.urun-card.dragging { opacity: .4; transform: scale(.95); }
body.sira-mod .urun-card { outline: 2px dashed transparent; }
body.sira-mod .urun-card { outline-color: var(--primary); }
body.sira-mod .urun-card:hover { background: var(--primary-l); }
body.sira-mod .ufiyat { opacity: .5; }

#siralaBar {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    background: #0f172a; color: #fff;
    padding: 10px 16px; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; z-index: 150;
}
#siralaBar svg { width: 18px; height: 18px; color: var(--warn); }

/* Sepet */
.sepet-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.sepet-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.sepet-head svg { width: 18px; height: 18px; color: var(--primary); }
.sepet-head { gap: 10px; }
.sepet-head select { font-size: 13px; padding: 6px 8px; }
.sepet-list { flex: 1; overflow-y: auto; padding: 8px; }
.sepet-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.sepet-empty svg { width: 48px; height: 48px; opacity: .3; margin-bottom: 10px; }
.sep-item {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 6px;
}
.sep-item .sep-r1 {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
}
.sep-item .sep-ad { font-weight: 500; font-size: 13px; flex: 1; }
.sep-item .sep-del {
    background: none; border: none; color: var(--danger); padding: 2px;
    display: inline-flex;
}
.sep-item .sep-del svg { width: 16px; height: 16px; }
.sep-item .sep-r2 {
    display: flex; align-items: center; justify-content: space-between;
}
.qty-ctrl { display: flex; align-items: center; gap: 4px; }
.qty-ctrl button {
    width: 26px; height: 26px;
    border: 1px solid var(--border-strong);
    background: #fff;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
}
.qty-ctrl input {
    width: 50px; padding: 4px;
    text-align: center;
    font-size: 13px;
    border-radius: 6px;
}
.sep-item .sep-tut { font-weight: 700; color: var(--primary); }
.sep-item .sep-r3 {
    display: flex; justify-content: space-between;
    margin-top: 4px; padding-top: 4px;
    border-top: 1px dashed var(--border);
    font-size: 11px; color: var(--text-muted);
}

.sepet-foot {
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    background: var(--surface-2);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}
.tot-row {
    display: flex; justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}
.tot-row.tot-big {
    font-size: 22px;
    font-weight: 700;
    border-top: 1px dashed var(--border-strong);
    padding-top: 10px;
    margin-top: 6px;
    color: var(--primary);
}
.pay-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}
.pay-btns button {
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
}
.btn-clear { width: 100%; margin-top: 6px; }

/* Modal */
.modal-bg {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9000;
    padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    max-height: 90vh; overflow-y: auto;
    display: flex; flex-direction: column;
}
.modal-h { flex-shrink: 0; }
.modal-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-f { flex-shrink: 0; }
.modal-h {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-h .x { background: none; border: none; padding: 4px; }
.modal-h .x svg { width: 20px; height: 20px; }
.modal-b { padding: 20px; }
.modal-f {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px; justify-content: flex-end;
}

.row { display: grid; gap: 12px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Aramalı Açılır Liste */
.srcsel { position: relative; display: block; }
.srcsel.disabled { opacity: .6; pointer-events: none; }
.srcsel-btn {
    width: 100%;
    padding: 10px 32px 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") right 10px center / 12px no-repeat;
    text-align: left;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.srcsel-btn.placeholder { color: var(--text-muted); }
.srcsel-btn:focus, .srcsel-dd.show ~ .srcsel-btn, .srcsel:focus-within .srcsel-btn {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-l);
}
.srcsel-dd {
    display: none;
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 200;
    overflow: hidden;
}
.srcsel-dd.show { display: block; }
.srcsel-inp {
    width: 100%; padding: 10px 12px;
    border: none; border-bottom: 1px solid var(--border);
    border-radius: 0;
    outline: none;
    font-size: 13px;
    background: var(--surface-2);
}
.srcsel-list { max-height: 260px; overflow-y: auto; }
.srcsel-it {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--surface-2);
    line-height: 1.4;
}
.srcsel-it:last-child { border-bottom: none; }
.srcsel-it.hi { background: var(--primary-l); color: var(--primary); }
.srcsel-it.sel { font-weight: 600; }
.srcsel-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Toast */
#toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: #0f172a;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    font-size: 14px;
    min-width: 240px;
    animation: tin .25s;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
@keyframes tin { from { transform: translateX(20px); opacity: 0; } }

/* Filter bar */
.fbar {
    display: flex; gap: 8px; margin-bottom: 14px; align-items: center;
}
.fbar input, .fbar select { max-width: 240px; }

/* Print */
@media print {
    .sidebar, .page-head, .no-print { display: none !important; }
    .main { padding: 0 !important; }
    body { background: #fff; }
}

/* Fis */
.fis {
    max-width: 320px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}
.fis h2 { text-align: center; margin: 0 0 4px; font-size: 18px; }
.fis .fis-sub { text-align: center; color: var(--text-muted); font-size: 11px; margin-bottom: 14px; }
.fis .fis-info { font-size: 11px; margin-bottom: 10px; }
.fis hr { border: none; border-top: 1px dashed #000; margin: 8px 0; }
.fis-tbl { width: 100%; font-size: 12px; }
.fis-tbl td { padding: 2px 0; }
.fis-tot { font-size: 15px; font-weight: 700; }

/* Responsive */
@media (max-width: 1024px) {
    .pos-grid { grid-template-columns: 1fr; height: auto; }
    .pos-right { min-height: 500px; }
}
@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .brand span, .menu a span, .usr div, .logout span { display: none; }
}

/* ════════════════════════════════════════════════
   TABLET (641-1024px) — admin sayfaları için ek stil
   ════════════════════════════════════════════════ */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Stat kartları 4 yerine 2 sütun */
    .stats { grid-template-columns: repeat(2, 1fr); }

    /* row-3 ve row-4 tek sütuna iniyor; row-2 kalıyor */
    .row-3, .row-4 { grid-template-columns: 1fr 1fr !important; }

    /* Tabloları yatay kaydırılabilir hale getir */
    .card > .tbl,
    .card > table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Sayfa başlığı butonları sığsın */
    .page-head { flex-wrap: wrap; gap: 10px; }
    .page-actions { flex-wrap: wrap; }

    /* Form filtre çubuğu */
    .fbar { flex-wrap: wrap; gap: 8px; }
    .fbar > * { min-height: 36px; }

    /* Modal genişliği daraltma */
    .modal { max-width: 92vw !important; }

    /* Padding'leri biraz azalt */
    .main { padding: 14px 16px !important; }
    .card-body { padding: 14px; }
    .tbl th, .tbl td { padding: 8px 10px; font-size: 13px; }

    /* Ayar sekmeleri taşmasın */
    .ayar-tabs, .et-tabs { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════
   MOBİL ADMİN PANELİ (≤ 640px)
   Sidebar hamburger menüye dönüşür,
   içerik tam ekranı kullanır.
   ═══════════════════════════════════════════════════ */

/* Mobil üst çubuk — sadece ≤640px'de görünür */
.mob-topbar {
    display: none;
}
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 998;
    background: rgba(0,0,0,.5);
}
.sidebar-overlay.show { display: block; }

@media (max-width: 640px) {

    /* Üst çubuk */
    .mob-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #0f172a;
        padding: 10px 14px;
        position: sticky; top: 0; z-index: 100;
        flex-shrink: 0;
    }
    .mob-ham {
        background: none; border: none; color: #94a3b8;
        padding: 4px; display: flex; align-items: center;
        cursor: pointer; flex-shrink: 0;
    }
    .mob-ham svg { width: 22px; height: 22px; }
    .mob-baslik {
        flex: 1; font-size: 15px; font-weight: 700; color: #f1f5f9;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .mob-satis {
        color: #fbbf24; display: flex; align-items: center;
        flex-shrink: 0;
    }
    .mob-satis svg { width: 20px; height: 20px; }

    /* Sidebar — gizle, soldan slide-in */
    .app { display: block; }
    .sidebar {
        position: fixed; top: 0; left: -260px; z-index: 999;
        width: 240px !important; height: 100%;
        transition: left .25s ease;
        overflow-y: auto;
        /* İkon-only modunu kapat, yazıları göster */
    }
    .sidebar.open { left: 0; }
    .brand span, .menu a span, .usr div, .logout span { display: initial !important; }
    .m-grp { display: block !important; }

    /* Main — sidebar'sız tam genişlik */
    .main {
        margin-left: 0 !important;
        padding: 10px !important;
        width: 100%;
        min-height: calc(100vh - 46px);
    }

    /* Sayfa başlığı */
    .page-head {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }
    .page-head h1 { font-size: 17px; }
    .page-head h1 svg { width: 18px; height: 18px; }
    .page-actions { flex-wrap: wrap; gap: 6px; }
    .page-actions .btn { font-size: 13px; padding: 7px 12px; }

    /* Kartlar */
    .card { border-radius: 8px; }

    /* Tablolar — yatay kaydırma */
    .card > .tbl,
    .card > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Form satırları — tek sütun */
    .row-2, .row-3, .row-4 { grid-template-columns: 1fr !important; }

    /* Stat kartları — 2 sütun */
    .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat { padding: 10px 12px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; }
    .stat-icon svg { width: 18px; height: 18px; }
    .stat-val { font-size: 18px; }

    /* Modal — tam genişlik */
    .modal-bg { padding: 0; align-items: flex-end; z-index: 9999; }
    .modal {
        max-width: 100% !important;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 88vh;
        display: flex; flex-direction: column;
        margin-bottom: 0;
    }
    /* Header her zaman üstte görünür, X butonu rahat tıklanabilsin */
    .modal-h {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 3;
        padding: 12px 12px 12px 16px !important;
    }
    .modal-h h3 { font-size: 16px !important; padding-right: 8px; }
    .modal-h .x {
        flex-shrink: 0;
        width: 40px; height: 40px;
        min-width: 40px;
        display: inline-flex; align-items: center; justify-content: center;
        background: #f1f5f9 !important;
        border-radius: 8px !important;
        margin-left: auto;
    }
    .modal-h .x svg { width: 22px !important; height: 22px !important; }
    .modal-b { overflow-y: auto; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
    .modal-f {
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 2;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -2px 10px rgba(0,0,0,.06);
    }

    /* Masaüstü-only öğeleri mobilde gizle */
    .pos-desktop-only { display: none !important; }

    /* Butonlar */
    .btn-sm { padding: 5px 8px; font-size: 11px; }

    /* Tablo hücreleri daha az padding */
    .tbl th, .tbl td { padding: 8px 8px; font-size: 12px; }

    /* Ayar sekmeleri */
    .ayar-tabs { gap: 2px; }
    .ayar-tab { padding: 7px 10px; font-size: 12px; }

    /* Alert */
    .alert { font-size: 12px; padding: 8px 12px; }

    /* Pagination */
    .pag-wrap { flex-wrap: wrap; gap: 4px; font-size: 12px; }
}

/* ════════════════════════════════════════
   MOBİL POS  (≤ 700 px)
   ════════════════════════════════════════ */
@media (max-width: 700px) {

    /* ── Shell ── */
    .pos-body { overflow: hidden; }
    .pos-shell { height: 100svh; height: 100vh; display: flex; flex-direction: column; }
    .pos-shell-grid { flex-direction: column; padding: 0; gap: 0; flex: 1; overflow: hidden; }
    .pos-splitter { display: none !important; }

    /* ── Mobil sekme çubuğu ── */
    .pos-mob-tabs { display: flex !important; background: #1e293b; flex-shrink: 0; border-bottom: 2px solid #334155; }
    .pos-mob-tab {
        flex: 1; padding: 11px 8px; border: none; background: transparent;
        color: #94a3b8; font-size: 13px; font-weight: 600;
        display: flex; align-items: center; justify-content: center; gap: 6px;
        cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
        transition: all .15s; font-family: inherit;
    }
    .pos-mob-tab.active { color: #fff; border-bottom-color: #4f46e5; background: rgba(79,70,229,.12); }
    .pos-mob-tab svg { width: 16px; height: 16px; }
    .pos-mob-badge {
        background: #ef4444; color: #fff; border-radius: 10px;
        font-size: 11px; padding: 1px 6px; font-weight: 700; display: none;
    }
    .pos-mob-badge.vis { display: inline; }

    /* ── Paneller ── */
    .pos-left2, .pos-right2 {
        width: 100% !important; min-width: 0 !important; max-width: 100% !important;
        margin: 0 !important; display: none; flex: 1; overflow: hidden;
    }
    .pos-left2.mob-on {
        display: flex; flex-direction: column;
        overflow: hidden; gap: 0 !important;
        /* Alttan stack: Paybar(66) + Paybar-ust(50) + Fiş Notu(38) + Summary(~108) = 262
           Sepet bu alanın üstünden başlamalı. */
        padding-bottom: calc(265px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .pos-right2.mob-on {
        display: flex;
        /* Ürün grid'i de paybar yüksekliği kadar alt boşluk bıraksın */
        padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Toolbar ── */
    .pos-toolbar { padding: 5px 6px; min-height: 0; flex-shrink: 0; }
    .kasa-tabs { gap: 3px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .kasa-tabs::-webkit-scrollbar { display: none; }
    .kasa-tab { padding: 5px 7px; font-size: 11px; white-space: nowrap; }
    .kasa-tab svg { width: 12px; height: 12px; }

    /* ── Barkod satırı ── */
    .tb-row2 { flex-wrap: nowrap; padding: 4px 6px; gap: 4px; flex-shrink: 0; }
    .tb-search { flex: 1; min-width: 0; }
    .tb-row2 select { max-width: 110px; font-size: 12px; }

    /* ── Sepet tablosu: gereksiz kolonları gizle (sıra ve birim) — barkod kalsın ── */
    .pos-cart-tbl .ct-sira,
    .pos-cart-tbl .ct-bir { display: none; }
    .pos-cart-tbl .ct-bk { font-size: 10px; padding-left: 4px !important; padding-right: 4px !important; max-width: 80px; }
    .pos-cart-tbl .ct-ad { font-size: 13px; }
    .ct-qty button { width: 28px; height: 28px; font-size: 15px; }
    .ct-qty input { width: 44px; font-size: 13px; }

    /* ── Sepet tablo alanı ── */
    .pos-cart-wrap { border-radius: 0 !important; box-shadow: none !important; }

    /* ── Özet — grid: 3 sütun üstte (Ara/KDV/İnd), TOPLAM tam genişlik altta
       MOBİLDE FIXED-POSITIONED: Fiş notunun ÜSTÜNDE, paybar stack'in icinde ── */
    .pos-summary {
        position: fixed !important;
        left: 0; right: 0;
        /* paybar (~66) + paybar-ust (~50) + fis-not (~38) = 154 */
        bottom: calc(154px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 488;
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px 10px;
        padding: 8px 10px 10px;
        background: #fff;
        flex-shrink: 0;
        border-top: 1px solid #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 -1px 4px rgba(0,0,0,.05);
        align-items: center;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .pos-summary .s-spacer { display: none !important; }
    /* TOPLAM = ikinci satırın tamamı, vurgu rengi + büyük font */
    .pos-summary .s-tot {
        grid-column: 1 / -1 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: var(--tot-bg, linear-gradient(135deg, #4f46e5 0%, #6366f1 100%));
        color: var(--tot-clr, #ffffff);
        border-radius: 8px;
        padding: 8px 14px;
        margin-top: 2px;
        border: 2px solid transparent;
        box-shadow: 0 3px 8px rgba(79,70,229,.22);
    }
    .pos-summary .s-tot small { font-size: 12px !important; color: var(--tot-clr, #ffffff) !important; opacity: .9; font-weight: 700 !important; }
    .pos-summary .s-tot b { font-size: var(--tot-fs, 22px) !important; color: var(--tot-clr, #ffffff) !important; font-weight: 800; }
    .s-it { display: flex !important; flex-direction: column !important; min-width: 0; }
    .s-it small { font-size: 10px; }
    .s-it b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #totInd { width: 100%; font-size: 13px; box-sizing: border-box; }

    /* ══════════════════════════════════════════════
       ÖDEME BARLARI — EKRANIN ALTINA SABİTLE
       pb-custom (display:block) ile çakışmayı önler
       ══════════════════════════════════════════════ */

    /* Yardımcı butonlar (Muhtelif/İskonto/Geçmiş) */
    .pos-paybar-ust,
    .pos-paybar-ust.pb-custom {
        position: fixed !important;
        left: 0 !important; right: 0 !important;
        bottom: 58px !important;          /* paybar yüksekliği kadar yukarı */
        z-index: 490 !important;
        display: flex !important;         /* pb-custom'ın display:block'unu ezer */
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        padding: 5px 6px !important;
        border-radius: 0 !important;
        margin: 0 !important;
        height: auto !important;
        box-shadow: 0 -2px 8px rgba(0,0,0,.08) !important;
    }
    .pos-paybar-ust > button,
    .pos-paybar-ust.pb-custom > button {
        position: static !important;
        flex: 1 1 0 !important;
        width: 0 !important; min-width: 0 !important;
        padding: 9px 2px !important;
        font-size: 11px !important; height: auto !important;
    }
    .pos-paybar-ust button svg { width: 13px !important; height: 13px !important; }

    /* Ana ödeme barı (Nakit/Pos/Kısmi/Beklet/İptal) */
    .pos-paybar,
    .pos-paybar.pb-custom {
        position: fixed !important;
        left: 0 !important; right: 0 !important;
        bottom: 0 !important;
        z-index: 491 !important;
        display: flex !important;         /* pb-custom'ın display:block'unu ezer */
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        padding: 6px 6px !important;
        border-radius: 0 !important;
        margin: 0 !important;
        height: auto !important;
        box-shadow: 0 -3px 12px rgba(0,0,0,.12) !important;
    }
    .pos-paybar > button,
    .pos-paybar.pb-custom > button {
        position: static !important;
        flex: 1 1 0 !important;
        width: 0 !important; min-width: 0 !important;
        padding: 13px 2px !important;
        font-size: 12px !important; height: auto !important;
    }
    .pos-paybar button svg  { width: 15px !important; height: 15px !important; }
    .pos-paybar button .pb-label,
    .pos-paybar-ust button .pb-label { font-size: 10px !important; }

    /* ── Ürün panel başlığı — tek satır (sekmeler + butonlar yan yana) ── */
    .pos-right-head {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        position: static !important;          /* desktop absolute konumunu iptal et */
        padding: 5px 6px !important;
        padding-right: 6px !important;        /* desktop calc(padding)'i sıfırla */
        gap: 5px !important;
        min-height: 0 !important;
    }
    .pos-right-head .pr-grup-tabs {
        order: 2;
        display: flex !important;
        flex: 0 0 auto !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        scrollbar-width: none;
        min-width: 0;
        width: 100%;
    }
    .pos-right-head .pr-grup-tabs::-webkit-scrollbar { display: none; }
    .pos-right-head .pgt { padding: 7px 12px; font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
    .pos-right-head .pr-acts {
        order: 1;
        position: static !important;
        width: 100% !important;
        flex-shrink: 0 !important;
        gap: 4px !important;
        background: transparent !important;
        justify-content: flex-start !important;
    }
    .pos-right-head .pr-act { padding: 6px 8px !important; font-size: 12px !important; }
    .pos-right-head .pr-act span { display: none !important; } /* sadece ikon göster */
    .pos-right-head .pr-act svg { width: 14px !important; height: 14px !important; }

    /* Sağ panel gap'ini kapat — başlık + grid arasında boşluk kalmasın */
    .pos-right2.mob-on { gap: 0 !important; }

    /* ── Ürün kartları — Mobilde 3 kolon, ferah layout ── */
    .pos-grid-scroll {
        gap: 10px !important;
        padding: 10px !important;
    }
    /* Mobilde SABİT 4 kolon — JS setKol veya kullanıcı ayarı etkilemez */
    .pos-grid-scroll,
    .pos-grid-scroll[data-boyut="kucuk"],
    .pos-grid-scroll[data-boyut="orta"],
    .pos-grid-scroll[data-boyut="buyuk"],
    .pos-grid-scroll[data-boyut="dev"] {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-auto-rows: minmax(116px, auto) !important;  /* JS inline'i ezer + iç içe geçmez */
    }

    .pos-prod {
        aspect-ratio: auto !important;       /* Mobilde icerige gore — sabit kare degil */
        padding: 6px 4px !important;
        gap: 4px !important;
        min-height: 116px !important;        /* Resim 50 + ad 26 + fyt 16 + padding 12 + gap 8 */
        height: auto !important;
        justify-content: flex-start !important; /* En ustte resim, sirayla altina */
    }
    .pos-prod .pp-img {
        flex: 0 0 50px !important;            /* Sabit 50px resim alani */
        height: 50px !important;
        width: 100% !important;
    }
    .pos-prod .pp-img img {
        max-width: 100% !important;
        max-height: 100% !important;
    }
    .pos-prod .pp-img svg { width: 26px !important; height: 26px !important; }
    .pos-prod .pp-ad {
        font-size: 11px !important;
        line-height: 1.2 !important;
        max-height: 2.4em !important;
        min-height: 2.4em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .pos-prod .pp-fyt { font-size: 13px !important; font-weight: 700; }

    /* ── Arama Dropdown'u — Mobilde tam genis + buyuk yazi ── */
    /* Toolbar'i stack'le ki search input tam genislik olsun → dropdown otomatik genis */
    .tb-row2 {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .tb-search {
        flex: 1 0 100% !important;     /* Tam genislik */
        order: -1;
    }
    .tb-row2 > div[style*="min-width:220px"],
    .tb-row2 > div:not(.tb-search) {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    /* Dropdown otomatik input genisliginde olur — yazi tipi ve item boyutu buyut */
    .search-pop {
        max-height: 55vh !important;
        font-size: 15px;
        box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
    }
    .search-pop .sp-it {
        padding: 12px 14px;
        gap: 12px;
    }
    .search-pop .sp-img {
        width: 48px; height: 48px;
    }
    .search-pop .sp-img svg { width: 24px; height: 24px; }
    .search-pop .sp-ad {
        font-size: 15px;
        white-space: normal;          /* Mobilde 2 satira sigsin */
        line-height: 1.25;
        max-height: 2.5em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .search-pop .sp-bk { font-size: 12px; }
    .search-pop .sp-fyt { font-size: 16px; }
    .search-pop .sp-empty { padding: 24px; font-size: 15px; }
}

/* ════ Fiyat Görüntüleme — Mobil ════ */
@media (max-width: 600px) {
    /* Sorgu çubuğu: input üste tam genişlik, butonlar alta */
    #sorToggle { padding: 10px 12px; font-size: 13px; }
    #sorIcerik { padding: 10px 10px; }
    #sorSatir {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 6px;
    }
    #barkodInp {
        grid-column: 1 / -1;  /* tam genişlik */
        grid-row: 1;
        font-size: 16px; padding: 12px 10px;
    }
    #s-kam { grid-row: 2; grid-column: 1; justify-content: center; padding: 11px 8px; }
    #s-sor { grid-row: 2; grid-column: 2; justify-content: center; padding: 11px 8px; }
    #sorSonuc { font-size: 14px; padding: 10px 12px; }
    #kamWrap { max-height: 240px; }
    /* Konum overlay mobil */
    .kov-baslik { font-size: clamp(16px,5vw,24px); }
}
