/* Bayi otomasyonu — tek stil dosyası.
 * Fikir: vitrindeki fiyat etiketi. Sarı etiket yalnızca fiyatlarda kullanılır; geri kalan her şey sakin kalır. */
:root {
  --ink: #12233b;
  --ink-2: #3c4d66;
  --muted: #6a7a90;
  --paper: #f4f5f7;
  --card: #ffffff;
  --line: #dfe3ea;
  --line-2: #eef0f4;
  --blue: #0b5fd6;
  --blue-ink: #ffffff;
  --blue-soft: #e6effc;
  --tag: #ffd23f;
  --tag-ink: #2a2100;
  --good: #0f7b4b;
  --good-soft: #e1f4ea;
  --bad: #c2352b;
  --bad-soft: #fbe9e7;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --shadow: 0 1px 2px rgba(18, 35, 59, 0.06), 0 6px 20px -8px rgba(18, 35, 59, 0.14);
  --r: 12px;
  --r-sm: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #eaf0f8;
    --ink-2: #bcc8d8;
    --muted: #8d9db3;
    --paper: #0e1622;
    --card: #162234;
    --line: #26364d;
    --line-2: #1d2b40;
    --blue: #5aa2ff;
    --blue-ink: #06162e;
    --blue-soft: #16304f;
    --good: #55d398;
    --good-soft: #12372a;
    --bad: #ff8a80;
    --bad-soft: #3d1f1f;
    --warn: #ffc15a;
    --warn-soft: #3a2c10;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px -8px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
}
body.lock { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.ic { display: inline-flex; vertical-align: middle; }
.ic svg { display: block; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-sm);
  font-weight: 600; background: var(--card); color: var(--ink); border-color: var(--line);
  transition: background 0.12s, transform 0.06s, opacity 0.12s; text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.busy { opacity: 0.6; pointer-events: none; }
.btn.primary { background: var(--blue); color: var(--blue-ink); border-color: transparent; }
.btn.secondary { background: var(--card); }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost.light { color: #fff; }
.btn.ghost.light.active { background: rgba(255, 255, 255, 0.22); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.icon { padding: 0; width: 44px; }
.btn.sm.icon { width: 34px; }
.btn.block { flex: 1; width: 100%; }
.btn.big { min-height: 56px; font-size: 18px; }
.btn.link { background: none; border: 0; color: var(--blue); min-height: 0; padding: 0; font-weight: 600; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 13px; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink); appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus { border-color: var(--blue); outline: 3px solid var(--blue-soft); outline-offset: 0; }
.input.invalid { border-color: var(--bad); outline: 3px solid var(--bad-soft); }
.select {
  padding-right: 34px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%236a7a90' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
textarea.input { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--card); }
.seg button { flex: 1; min-height: 44px; border: 0; background: transparent; font-weight: 600; color: var(--ink-2); padding: 0 10px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed='true'] { background: var(--blue); color: var(--blue-ink); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); }

/* ---------- Fiyat etiketi (imza öğe) ---------- */
.tag {
  display: inline-flex; align-items: baseline; gap: 2px; background: var(--tag); color: var(--tag-ink);
  padding: 4px 12px 4px 20px; font-weight: 800; line-height: 1.1; white-space: nowrap; position: relative;
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%);
  border-radius: 0 4px 4px 0;
}
.tag::before { content: ''; position: absolute; left: 9px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: rgba(42, 33, 0, 0.55); }
.tag-cur { font-size: 0.7em; font-weight: 700; }
.tag-int { font-size: 1em; letter-spacing: -0.01em; }
.tag-dec { font-size: 0.62em; }
.tag.lg { font-size: 44px; padding: 8px 22px 8px 34px; clip-path: polygon(20px 0, 100% 0, 100% 100%, 20px 100%, 0 50%); }
.tag.lg::before { left: 17px; width: 8px; height: 8px; margin-top: -4px; }
.tag.md { font-size: 24px; padding: 5px 14px 5px 24px; }
.tag.sm { font-size: 16px; padding: 3px 10px 3px 17px; clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%); }
.tag.sm::before { left: 7px; width: 4px; height: 4px; margin-top: -2px; }

/* ---------- Rozetler / yardımcı ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 20px; color: var(--muted); }
.empty strong { color: var(--ink); font-size: 17px; }
.empty-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 40px; color: var(--muted); }
.spin { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.confirm-text { color: var(--ink-2); margin-bottom: 4px; }

/* ---------- Bildirim ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(86px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); max-width: 480px; animation: toast-in 0.18s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }
.toast.out { opacity: 0; transition: opacity 0.2s; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Pencere (sheet) ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(10, 20, 35, 0.5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
.sheet-back.out { opacity: 0; transition: opacity 0.15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--paper); width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: rise 0.2s ease-out; }
.sheet.wide { max-width: 860px; }
@keyframes rise { from { transform: translateY(24px); opacity: 0.4; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 8px 18px; }
.sheet-title { font-size: 19px; font-weight: 800; }
.sheet-body { padding: 4px 18px 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--card); }
@media (min-width: 720px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 16px; max-height: 88vh; }
}

/* ---------- Giriş / kurulum ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, var(--paper), var(--line-2)); }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.auth-brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand p { color: var(--muted); }
.auth form { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.auth .err { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 8px; font-weight: 600; margin-bottom: 14px; }

/* ---------- Uygulama kabuğu ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--paper); padding: calc(10px + var(--safe-t)) 14px 10px; display: flex; align-items: center; gap: 10px; }
:root[data-theme='light'] .topbar, .topbar { color: #f4f6fa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .topbar { background: #0a111b; border-bottom: 1px solid var(--line); } }
.topbar .shop { font-weight: 800; letter-spacing: -0.01em; font-size: 17px; }
.topbar .who { font-size: 13px; opacity: 0.75; }
.topbar .btn { color: #f4f6fa; }
.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 14px calc(96px + var(--safe-b)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-b); }
.tabbar button { flex: 1; min-height: 62px; border: 0; background: none; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: var(--muted); position: relative; }
.tabbar button[aria-current='page'] { color: var(--blue); }
.tabbar button[aria-current='page']::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--blue); border-radius: 0 0 3px 3px; }
.tabbar .dot { position: absolute; top: 8px; margin-left: 20px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* Yönetici: masaüstünde yan menü */
.shell-admin { display: block; }
.side { display: none; }
@media (min-width: 900px) {
  .shell-admin { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
  .shell-admin .tabbar { display: none; }
  .side { display: flex; flex-direction: column; gap: 4px; background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
  .side .brand { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; padding: 4px 10px 14px; }
  .side button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; background: none; border-radius: 8px; font-weight: 600; color: var(--ink-2); text-align: left; }
  .side button:hover { background: var(--line-2); }
  .side button[aria-current='page'] { background: var(--blue-soft); color: var(--blue); }
  .side .sep { height: 1px; background: var(--line); margin: 10px 4px; }
  .shell-admin .topbar { display: none; }
  .shell-admin .main { max-width: 1120px; padding: 24px 28px 48px; }
  .shell-admin .toasts { bottom: 24px; }
}
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-right: auto; }
.sub { color: var(--muted); font-size: 14px; }

/* ---------- Çalışan: Satış ekranı ---------- */
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbox { position: relative; flex: 1; }
.searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox .input { padding-left: 40px; min-height: 50px; font-size: 17px; }
.scan-btn { min-height: 50px; padding: 0 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 -14px 10px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.section-label { font-size: 13px; color: var(--muted); font-weight: 700; margin: 6px 2px 8px; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); width: 100%; text-align: left; min-height: 64px; }
.pitem:active { background: var(--line-2); }
.pitem .meta { flex: 1; min-width: 0; }
.pitem .name { font-weight: 700; overflow-wrap: anywhere; }
.pitem .sub { font-size: 13px; }
.stock-low { color: var(--warn); font-weight: 700; }
.stock-out { color: var(--bad); font-weight: 700; }

.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(72px + var(--safe-b)); z-index: 25; max-width: 736px; margin: 0 auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; border: 0; border-radius: 14px; min-height: 58px; padding: 0 16px; box-shadow: 0 10px 30px -8px rgba(10, 20, 35, 0.5); width: auto; text-align: left; }
.cartbar .count { background: var(--tag); color: var(--tag-ink); border-radius: 99px; min-width: 28px; height: 28px; display: grid; place-items: center; font-weight: 800; padding: 0 8px; }
.cartbar strong { font-size: 19px; }
.cartbar .go { margin-left: auto; font-weight: 700; display: flex; align-items: center; gap: 4px; }
@media (min-width: 900px) { .shell-admin .cartbar { bottom: 20px; } }

.cline { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cline:last-child { border-bottom: 0; }
.cline .name { font-weight: 700; overflow-wrap: anywhere; }
.cline .ctl { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.stepper button { width: 42px; height: 42px; border: 0; background: none; display: grid; place-items: center; }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; }
.priceinput { position: relative; width: 132px; }
.priceinput .input { min-height: 42px; padding-left: 26px; text-align: right; font-weight: 700; }
.priceinput::before { content: '₺'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; z-index: 1; }
.cline .was { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.cline .disc { font-size: 13px; color: var(--warn); font-weight: 700; }
.totalbox { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 14px; margin: 12px 0; }
.totalbox .line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.totalbox .line + .line { margin-top: 8px; }
.totalbox .final { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.totalbox .final-input { position: relative; flex: 1; max-width: 200px; margin-left: auto; }
.totalbox .final-input .input { min-height: 56px; font-size: 26px; font-weight: 800; text-align: right; padding-left: 36px; }
.totalbox .final-input::before { content: '₺'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 800; color: var(--muted); z-index: 1; }
.discount-note { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px; }

/* ---------- Fiyat sorgu ekranı ---------- */
.lookup-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 28px 16px; }
.lookup-hero .btn { min-width: 220px; }
.pcard { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.pcard .name { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.pcard .price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pcard .facts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Kamera ---------- */
.scan { position: fixed; inset: 0; z-index: 300; background: #05090f; color: #fff; display: flex; flex-direction: column; }
.scan-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-t)) 14px 10px; }
.scan-count { font-size: 13px; opacity: 0.8; background: rgba(255, 255, 255, 0.14); padding: 2px 10px; border-radius: 99px; }
.scan-count:empty { display: none; }
.scan-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-hl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scan-msg { position: absolute; left: 16px; right: 16px; bottom: 20px; background: rgba(0, 0, 0, 0.72); padding: 12px 14px; border-radius: 10px; font-weight: 600; text-align: center; }
.scan-bottom { padding: 12px 14px calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; background: #0b1420; }
.scan-manual { display: flex; gap: 8px; }
.scan-manual .input { background: #162234; border-color: #2a3b55; color: #fff; }
.scan-result { display: none; border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.scan-result.show { display: block; }
.scan-result.ok { background: #12372a; border: 1px solid #1f6b4b; }
.scan-result.bad { background: #3d1f1f; border: 1px solid #7a3530; }
.scan-result .tag { margin-top: 6px; }
.scan-result .sr-name { font-size: 18px; font-weight: 800; }

/* ---------- Satışlarım ---------- */
.stat-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { padding: 14px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.sale { padding: 14px; margin-bottom: 10px; }
.sale.void { opacity: 0.65; }
.sale .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sale .head .t { font-weight: 700; }
.sale .items { margin: 8px 0; color: var(--ink-2); font-size: 15px; }
.sale .items div { display: flex; justify-content: space-between; gap: 10px; }
.sale .foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.closed-note { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }

/* ---------- Yönetici ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 14px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0; }
.kpi .note { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.panel { padding: 0; overflow: hidden; margin-bottom: 12px; }
.panel > h2 { font-size: 15px; font-weight: 800; padding: 14px 16px 10px; display: flex; align-items: center; gap: 8px; }
.panel > h2 .sub { margin-left: auto; font-weight: 500; }
.panel .pad { padding: 0 16px 16px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; font-size: 14.5px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.good { background: var(--good-soft); color: var(--good); }
.alert .ic { flex: none; margin-top: 1px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 4px 16px 0; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bars .bar { width: 100%; max-width: 44px; background: var(--blue); border-radius: 5px 5px 0 0; min-height: 3px; }
.bars .col.today .bar { background: var(--tag); outline: 2px solid var(--tag-ink); outline-offset: -2px; }
.bars .v { font-size: 11px; color: var(--muted); font-weight: 600; }
.bars-x { display: flex; gap: 8px; padding: 4px 16px 14px; }
.bars-x span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.t th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); position: sticky; top: 0; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.r, .t th.r { text-align: right; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: var(--line-2); }
.t .name { font-weight: 700; }
.t .sub { font-size: 12.5px; }
.t .code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters .input { width: auto; min-width: 140px; flex: 1; }
.filters .grow { flex: 2; min-width: 200px; }
.list-rows .lr { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line-2); }
.list-rows .lr:first-child { border-top: 0; }
.list-rows .lr .l { min-width: 0; }
.list-rows .lr .l strong { overflow-wrap: anywhere; }
.pbar { height: 6px; background: var(--line-2); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.mv-in { color: var(--good); font-weight: 700; }
.mv-out { color: var(--bad); font-weight: 700; }
.audit-row { padding: 10px 16px; border-top: 1px solid var(--line-2); }
.audit-row:first-child { border-top: 0; }
.audit-row .when { font-size: 12.5px; color: var(--muted); }
.fab { position: fixed; right: 16px; bottom: calc(84px + var(--safe-b)); z-index: 24; box-shadow: 0 10px 24px -8px rgba(10, 20, 35, 0.5); }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }

/* ---------- QR etiket yazdırma ---------- */
.labels-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.qrlabel { border: 1px dashed var(--line); border-radius: 8px; padding: 8px; background: #fff; color: #000; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.qrlabel svg { width: 100%; max-width: 110px; height: auto; }
.qrlabel .ln { font-size: 12px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.qrlabel .lp { font-size: 15px; font-weight: 800; }
.qrlabel .lc { font-size: 10.5px; font-family: ui-monospace, Menlo, Consolas, monospace; color: #444; }
.print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { display: grid !important; position: absolute; left: 0; top: 0; width: 100%; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff; }
  .print-area .qrlabel { border: 1px dashed #999; border-radius: 0; break-inside: avoid; padding: 3mm; height: 40mm; justify-content: center; }
  .print-area .qrlabel svg { max-width: 22mm; }
  @page { margin: 8mm; }
}

@media (max-width: 640px) { .hide-sm { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Kategori sekmeleri ve yinelenen ürün uyarısı */
.cat-tabs { margin: 0 0 12px; padding-left: 0; padding-right: 0; }
.chip.on { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.chip-n { margin-left: 7px; font-size: 12px; font-weight: 700; opacity: 0.75; background: rgba(127, 127, 127, 0.18); padding: 1px 7px; border-radius: 99px; }
.chip.on .chip-n { background: rgba(255, 255, 255, 0.22); opacity: 1; }
.dup-warn { margin: 0 0 14px; padding: 12px; border-radius: var(--r-sm); background: var(--warn-soft); border: 1px solid var(--warn); color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.dup-warn[hidden] { display: none; }
.dup-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dup-item .name { font-weight: 700; }

/* Prim (Türk Telekom) */
.bar { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 8px 0; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--blue); transition: width 0.4s ease; }
.bar > i.good { background: var(--good); }
.tt-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tt-big { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.tt-big small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tt-today { text-align: right; }
.tt-today strong { font-size: 20px; color: var(--good); }
.tt-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.tt-line .good, strong.good, .sub.good { color: var(--good); }
.tt-note { padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.tt-note.bad { background: var(--bad-soft); color: var(--bad); }
.tt-forecast { padding: 10px 12px; border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 4px; }
.tt-forecast.good { background: var(--good-soft); color: var(--good); }
.tt-forecast.warn { background: var(--warn-soft); color: var(--warn); }
.tt-forecast .sub { color: inherit; opacity: 0.9; }
.tt-tier { padding: 10px 12px; border-radius: var(--r-sm); background: var(--line-2); }
.tt-tier-now { font-weight: 800; font-size: 17px; margin: 2px 0; }
.tt-needs-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tt-pill { padding: 4px 10px; border-radius: 99px; background: var(--line-2); font-size: 13px; font-weight: 600; }
.tt-qrow { margin-top: 6px; }
.tt-form { margin-bottom: 14px; }
.tt-h { font-size: 17px; margin-bottom: 10px; }
.tt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tt-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14.5px; color: var(--ink); text-align: left; }
.tt-chip b { background: var(--tag); color: #1b1b1b; border-radius: 99px; padding: 1px 8px; font-size: 12.5px; }
.tt-chip.on { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.tt-preview { margin: 6px 0 12px; font-weight: 600; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.qty button { width: 48px; height: 44px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; }
.qty .qty-val { min-width: 44px; text-align: center; font-weight: 800; font-size: 18px; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line-2); }
.row-item:first-child { border-top: 0; }
.row-item.void { opacity: 0.55; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .name { font-weight: 700; overflow-wrap: anywhere; }
.tt-pts { color: var(--good); white-space: nowrap; }
.row-item.void .tt-pts { color: var(--muted); text-decoration: line-through; }
.pthumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--line-2); flex: none; }
.pthumb.ph { display: grid; place-items: center; color: var(--muted); }
.photo-box { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.photo-box .pthumb { width: 76px; height: 76px; border-radius: 14px; }
.tier-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-2); }
.tier-row:first-child { border-top: 0; }
.tier-label { flex: 1 1 140px; }
.tier-num { flex: 1 1 110px; }
.tier-row .btn.icon { margin-bottom: 4px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.margin { min-height: 22px; margin: 4px 0 10px; font-size: 14.5px; }
.kpi .value.bad { color: var(--bad); }
.kpi .value.good { color: var(--good); }

/* Servis, müşteri, alış, kasa */
.svc{display:block;width:100%;text-align:left;margin-bottom:8px}
.svc .head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:4px}
.svc .name{font-weight:600}
.sub-h{font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#667);margin:14px 0 6px}
.lr-btn{width:100%;text-align:left;background:none;border:0;cursor:pointer;display:flex;align-items:center;gap:10px}
.purchase-in{display:flex;gap:8px}
.purchase-in label{display:flex;flex-direction:column;gap:2px}
.check{display:flex;align-items:center;gap:8px;margin:8px 0}

/* Prim: hedef kartları */
.tt-wrap{display:flex;flex-direction:column;gap:12px;margin-bottom:14px}
.tt-hero{background:var(--ink);color:#fff;border-color:var(--ink)}
.tt-hero .sub,.tt-hero .tt-today strong{color:inherit;opacity:.85}
.tt-hero-top{display:flex;justify-content:space-between;gap:12px}
.tt-hero-big{font-size:40px;font-weight:800;letter-spacing:-.02em;line-height:1.1;margin:4px 0}
.tt-hero-fc{margin-top:8px;padding:8px 12px;border-radius:10px;background:rgba(255,255,255,.14)}
.tt-hero-meta{margin-top:8px}
.goals{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:12px}
.goal{display:flex;flex-direction:column;gap:8px}
.goal-head{display:flex;justify-content:space-between;gap:10px}
.goal-name{font-weight:700;font-size:16px}
.goal-reward{font-weight:800;font-size:18px;text-align:right;display:flex;flex-direction:column}
.goal-reward small{font-weight:500;font-size:11px;opacity:.8}
.goal-num strong{font-size:28px;font-weight:800;letter-spacing:-.02em}
.goal-bar{position:relative}
.goal-bar .bar{margin:4px 0}
.goal-bar .marks{position:absolute;inset:0;pointer-events:none}
.goal-bar .mk{position:absolute;top:0;bottom:0;width:3px;margin-left:-1px;background:var(--muted,#889);opacity:.5;border-radius:2px}
.goal-bar .mk.on{background:var(--good);opacity:1}
.goal-levels{display:flex;flex-wrap:wrap;gap:6px}
.lvl{padding:3px 9px;border-radius:99px;background:var(--line-2);font-size:12.5px;font-weight:600}
.lvl.on{background:var(--good-soft);color:var(--good)}
.lvl.soon{outline:1.5px dashed var(--good)}
.goal-next{font-size:14px}
.goal-fc{font-size:13.5px;padding-top:6px;border-top:1px dashed var(--line)}
.goal-fc.good{color:var(--good)}
.tt-line-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--line)}
.tt-chip.bundle{background:var(--line-2)}
.rule-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;padding:10px 0;border-bottom:1px solid var(--line)}
.rule-k{flex:1 1 150px}.rule-n{flex:1 1 110px}

/* Cari hesaplar */
.cari-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.cari-bal{font-size:22px;font-weight:700;margin:10px 0 12px;letter-spacing:-.02em}
.cari-bal.good{color:var(--good)}.cari-bal.bad{color:var(--bad)}
.cari-actions{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
@media(min-width:700px){.cari-actions{grid-template-columns:repeat(4,1fr)}}
/* Ortak: salt okunur — kaydetme/ekleme düğmeleri gizli */
body.ro .page-head .btn.primary,body.ro .sheet-foot,body.ro .cari-actions,body.ro .fab{display:none!important}
/* Müdür: personel ve prim ekranları salt okunur */
body.mgr[data-view="users"] .page-head .btn.primary,body.mgr[data-view="ttadmin"] .page-head .btn.primary{display:none!important}

/* ---------- Telefonda ürün listesi: tablo yerine kart satırı ---------- */
@media (max-width: 640px) {
  .prodt, .prodt tbody, .prodt tr, .prodt td { display: block; }
  .prodt thead { display: none; }
  .prodt tr { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .prodt tr:last-child { border-bottom: 0; }
  .prodt td { padding: 0; border: 0; min-width: 0; }
  .prodt td:first-child { grid-column: 1 / -1; }
  .prodt .name { overflow-wrap: anywhere; }
  .prodt .c-cost { grid-column: 2; text-align: left; color: var(--muted); font-size: 13.5px; }
  .prodt .c-cost::before { content: attr(data-l) ' '; }
  .prodt .c-price { grid-column: 3; }
  .prodt .hide-sm { display: none; }
  .filters .input { min-width: 0; }
  .filters .grow { min-width: 0; flex: 1 1 100%; }
  .filters select.input { flex: 1 1 100%; }
}

/* Telefonda tablolar ekrana sığsın (taşarsa yana kayar) */
@media (max-width: 640px) {
  table.t { font-size: 13.5px; }
  .t th { padding: 8px 7px; font-size: 12px; }
  .t td { padding: 10px 7px; }
  .prodt td { padding: 0; }
}
