/* bum. CRM — arayüz stilleri */
:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --ink: #111114;
  --ink-2: #4b4b55;
  --muted: #8a8a96;
  --line: #e4e4ea;
  --brand: #0d0d0f;
  --accent: #e31e24;
  --accent-ink: #ffffff;
  --green: #17803d; --green-bg: #e3f5ea;
  --amber: #a15c00; --amber-bg: #fff1d6;
  --blue: #1d4ed8;  --blue-bg: #e3ebff;
  --red: #c41419;   --red-bg: #fde4e4;
  --gray: #55555f;  --gray-bg: #ececf0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --map-empty: #e7e7ec;
  --map-stroke: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: rgba(0,0,0,.25); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 1.2em; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); } .neg { color: var(--red); }
code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; }

/* ---------- Yerleşim ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--brand); color: #fff;
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: flex-end; gap: 8px; padding: 4px 10px 22px; text-decoration: none; color: #fff; }
.brand img { height: 30px; }
.brand span { font-size: 11px; letter-spacing: .2em; color: #9a9aa5; padding-bottom: 3px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: #c9c9d1; text-decoration: none; font-weight: 500;
}
.sidebar nav a svg { width: 18px; height: 18px; fill: currentColor; opacity: .85; }
.sidebar nav a:hover { background: #1d1d22; color: #fff; }
.sidebar nav a.active { background: #fff; color: var(--ink); }
.btn-new {
  margin: 18px 0 0; text-align: center; padding: 11px; border-radius: 9px; background: var(--accent);
  color: #fff; text-decoration: none; font-weight: 600;
}
.btn-new:hover { color: #fff; filter: brightness(1.08); }
.userbox { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 8px 0; border-top: 1px solid #26262c; }
.userbox strong { display: block; font-size: 13px; }
.userbox small { color: #9a9aa5; }
.userbox a { color: #c9c9d1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #2a2a31; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.menu-btn { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.content { padding: 14px 28px 40px; max-width: 1500px; width: 100%; }

/* ---------- Bileşenler ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card .pad, .card.flush > h2 { padding: 16px 20px 0; }
.card.narrow { max-width: 520px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > .card { margin-bottom: 18px; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
.cols.wide-left { grid-template-columns: 2fr 1fr; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #c8c8d0; color: var(--ink); background: #fafafb; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2a31; color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red-bg); color: var(--red); border-color: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 15px; color: var(--muted); padding: 6px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--gray-bg); color: var(--ink); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: var(--gray-bg); color: var(--gray); }
.user-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; background: var(--gray-bg); padding: 2px 9px 2px 4px; border-radius: 99px; white-space: nowrap; }
.user-chip::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 12c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4zm0 2c-2.7 0-8 1.3-8 4v2h16v-2c0-2.7-5.3-4-8-4z'/%3E%3C/svg%3E") center/10px no-repeat; }

.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; font-weight: 500; }
.alert.success { background: var(--green-bg); color: var(--green); }
.alert.error { background: var(--red-bg); color: var(--red); }

/* ---------- Formlar ---------- */
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #d6d6de; border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0;
}
input[type=checkbox] { width: auto; accent-color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.form-actions.sticky { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 2px; border-top: 1px solid var(--line); justify-content: space-between; }
.pw-row { display: flex; gap: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; }
.filters input[type=search] { flex: 1 1 220px; }
.filters select { width: auto; flex: 0 1 auto; }
.filters label.inline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.filters label.inline input[type=date] { width: auto; }

.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.summary { color: var(--ink-2); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.seg a.active { background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-color: var(--ink); }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafafb; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafafb; }
tr.inactive td { opacity: .55; }
tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
tfoot tr.grand td { font-size: 16px; }
td.empty { text-align: center; color: var(--muted); padding: 30px; }
.thumb-cell { width: 44px; }
.thumb { width: 34px; height: 46px; object-fit: cover; border-radius: 4px; display: block; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.pager a, .pager span { padding: 6px 11px; border-radius: 7px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); }
.pager a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; }
.quick-forms { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.quick-forms form { display: flex; gap: 6px; }
.quick-forms select { width: auto; }
.danger-zone { margin-top: 10px; text-align: right; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi strong { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.kpi strong.sm { font-size: 17px; }
.kpi small { color: var(--ink-2); }
a.kpi:hover { border-color: #c8c8d0; color: var(--ink); }
.kpi.warn { border-color: #f3b4b4; background: #fff7f7; }
.kpi.warn strong { color: var(--red); }

/* ---------- Harita ---------- */
.map-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.map-wrap { position: relative; }
#trMap { width: 100%; height: auto; display: block; }
#trMap path { fill: var(--map-empty); stroke: var(--map-stroke); stroke-width: 1; cursor: pointer; transition: fill .15s, opacity .15s; }
#trMap path:hover { stroke: var(--ink); stroke-width: 1.6; }
#trMap path.selected { stroke: var(--ink); stroke-width: 2.4; }
#trMap:hover path:not(:hover) { opacity: .92; }
.map-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); z-index: 5; }
.map-tip strong { display: block; font-size: 13px; }
.legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 26px; height: 10px; border-radius: 2px; }
.city-panel { border-left: 1px solid var(--line); padding-left: 18px; max-height: 520px; overflow: auto; }
.city-panel .firm { padding: 10px 0; border-bottom: 1px solid var(--line); }
.city-panel .firm:last-child { border-bottom: 0; }
.city-panel .firm strong { display: block; }
.city-panel .firm .meta { display: flex; gap: 10px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.city-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; position: sticky; top: 0; background: var(--surface); padding-bottom: 6px; }

.rank { list-style: none; padding: 0; margin: 0; }
.rank li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank li > span:first-child, .rank li > a:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank.with-img img { width: 22px; height: 30px; object-fit: cover; border-radius: 3px; vertical-align: middle; margin-right: 8px; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 16px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar .b { width: 100%; max-width: 22px; background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar .v { font-size: 11px; color: var(--ink-2); margin-bottom: 2px; }
.bar .l { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; line-height: 1.2; }

/* ---------- Ürünler ---------- */
.stock { font-weight: 700; }
.stock.low { color: var(--amber); }
.stock.out { color: var(--red); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.product-card.inactive { opacity: .5; }
.product-card .img { aspect-ratio: 400 / 579; background: #f1f1f3; }
.product-card .img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card .code { font-size: 12px; font-weight: 700; color: var(--accent); }
.product-card .name { font-weight: 600; }
.product-card .meta { display: flex; justify-content: space-between; font-size: 12px; }
.product-card .actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.preview { max-width: 100%; max-height: 420px; border-radius: 8px; }

.bulk-top { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bulk-top input { flex: 1 1 240px; }
.bulk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.form .bulk-item { flex-direction: row; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; margin: 0; font-weight: 500; }
.bulk-item img { width: 34px; height: 46px; object-fit: cover; border-radius: 4px; }
.bulk-item .info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bulk-item .info small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bulk-item input { width: 76px; text-align: right; }
.bulk-item.has-value { border-color: var(--ink); background: #fafafb; }

/* ---------- Sipariş formu ---------- */
.search-wrap { position: relative; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 20; display: none; overflow: hidden; }
.suggest.open { display: block; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 9px 12px; cursor: pointer; font: inherit; border-bottom: 1px solid var(--line); }
.suggest button:hover, .suggest button.hl { background: #f4f4f6; }
.suggest small { color: var(--muted); font-weight: 400; }
table.items td { padding: 6px 8px; }
table.items select, table.items input { padding: 7px 9px; }
table.items .item-qty { width: 80px; }
table.items .item-price { width: 110px; }
.items-actions { display: flex; gap: 8px; margin: 10px 0; }
.totals { margin-left: auto; max-width: 340px; display: flex; flex-direction: column; gap: 6px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.totals input { width: 130px; text-align: right; }
.totals .grand { font-size: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.stock-warn { color: var(--red); font-weight: 600; }

.modal { position: fixed; inset: 0; background: rgba(10,10,12,.5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 14px; width: min(980px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-box.small { width: min(420px, 100%); padding: 18px 20px; }
.modal-head { display: flex; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.modal-box.small .modal-head { padding: 0 0 10px; margin-bottom: 10px; }
.modal-head h3 { margin: 0; flex: 1; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 14px; overflow: auto; }
.picker-grid button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px; cursor: pointer; font: inherit; text-align: left; }
.picker-grid button:hover { border-color: var(--ink); }
.picker-grid img { width: 100%; aspect-ratio: 400/579; object-fit: contain; background: #f1f1f3; border-radius: 6px; display: block; }
.picker-grid span { display: block; font-size: 12px; margin-top: 4px; }
.picker-grid em { font-style: normal; font-size: 11px; color: var(--muted); }

/* ---------- Giriş ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--brand); }
.auth-card { background: #fff; border-radius: 16px; padding: 32px 30px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.auth-card.wide { width: min(640px, 100%); }
.auth-logo { display: block; height: 56px; margin: 0 auto 8px; }
.auth-card h2 { text-align: center; }
.auth-card h3 { margin-top: 18px; font-size: 14px; }

.print-only { display: none; }

/* ---------- Duyarlı ---------- */
@media (max-width: 1200px) {
  .cols.three { grid-template-columns: 1fr 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .city-panel { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; max-height: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: block; }
  .topbar { padding: 12px 16px 4px; }
  .content { padding: 10px 16px 30px; }
  .cols, .cols.three, .cols.wide-left { grid-template-columns: 1fr; gap: 0; }
  .grid2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 110px 1fr; }
  .filters select, .filters label.inline { flex: 1 1 140px; }
  .totals { max-width: none; }
}
@media print {
  .sidebar, .topbar, .no-print, .page-actions, .danger-zone { display: none !important; }
  .print-only { display: flex; }
  .print-head { justify-content: space-between; align-items: center; margin-bottom: 16px; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .content { padding: 0; }
  .cols { grid-template-columns: 1fr 1fr; }
}

/* Kenar çubuğu uzun sayfalarda da tam boy görünsün */
@media (min-width: 901px) { .layout { background: linear-gradient(to right, var(--brand) 236px, var(--bg) 236px); } }
.rank li > .user-chip:first-child { flex: 0 1 auto; margin-right: auto; }

/* ---------- Komisyon ---------- */
.tier-strip { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 14px; }
.tier-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; white-space: nowrap; }
.slices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 230px; }
.slices li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.slices li small { grid-column: 1; font-size: 11px; }
.slices li strong { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 600; }
.big-num { font-size: 15px; font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; width: 130px; margin-bottom: 4px; }
.progress span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.pay-form input { padding: 6px 8px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 12px; }
.link-btn:hover { color: var(--red); }
.rank.weeks li { gap: 8px; }
.rank.weeks li > a { flex: 1; }
.rank.weeks li.current { font-weight: 700; }
.commission-table td { vertical-align: top; }
#tierTable input { width: 100%; }
.form-like { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.calc-out { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.calc-out .row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.calc-out .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 16px; font-weight: 700; }
.pay-form { flex-direction: column; align-items: stretch; width: 150px; }
.pay-form input { width: 100%; }
.commission-table tfoot td { white-space: nowrap; }
.rank.weeks li { display: grid; grid-template-columns: 1fr auto auto 64px; } .rank.weeks li > a { white-space: nowrap; } .rank.weeks .badge { justify-self: end; }
.weekly-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1640px) { .weekly-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Raporlar ---------- */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.report-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; padding-bottom: 14px; border-bottom: 2.5px solid var(--ink); margin-bottom: 16px; }
.report-head h2 { font-size: 22px; margin: 0; }
.report-period { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.report-meta { text-align: right; color: var(--muted); font-size: 12px; }
.print-only-logo { display: none; height: 34px; margin-bottom: 8px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.report-kpis .kpi { box-shadow: none; padding: 11px 13px; }
.report-kpis .kpi strong { font-size: 19px; }
.report-kpis.small-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.report-kpis.small-kpis .kpi strong { font-size: 16px; }
.chg { font-weight: 700; font-size: 12px; }
.chg.up { color: var(--green); } .chg.down { color: var(--red); } .chg.flat { color: var(--muted); }
.report-sec { margin-top: 22px; break-inside: avoid; }
.report-sec h3 { font-size: 15px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.report-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.report-2col.map-col { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.rmap { width: 100%; height: auto; display: block; }
.rtable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rtable th { background: transparent; border-bottom: 1.5px solid var(--ink); padding: 7px 8px; }
.rtable td { padding: 6px 8px; font-size: 13px; }
.rtable.compact td { padding: 5px 6px; }
.rtable.small-table td { font-size: 12px; padding: 5px 6px; }
.rtable tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.rtable tr.cancelled td .badge { text-decoration: none; }
.rbars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; margin-bottom: 10px; }
.rbars.dense { gap: 3px; }
.rbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.rbar .b { width: 100%; max-width: 46px; background: var(--ink); border-radius: 3px 3px 0 0; min-height: 1px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rbar .v { font-size: 10.5px; color: var(--ink-2); margin-bottom: 2px; white-space: nowrap; }
.rbars.dense .rbar .v { font-size: 9px; }
.rbar .l { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: center; line-height: 1.2; }
.hbar { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.hbar .ht { height: 12px; background: var(--gray-bg); border-radius: 3px; overflow: hidden; }
.hbar .ht i { display: block; height: 100%; background: var(--accent); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.hbar .hv { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.report-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
pre.code { background: var(--gray-bg); border-radius: 8px; padding: 10px 12px; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 0 0 10px; }
.send-actions { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.send-actions .btn { width: 100%; }
@media (max-width: 1100px) {
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-kpis.small-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-2col, .report-2col.map-col { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  @page { size: A4; margin: 11mm 10mm 12mm; }
  .tabs { display: none !important; }
  .report { border: 0; box-shadow: none; padding: 0; }
  .print-only-logo { display: block; }
  .report-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .report-kpis.small-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .report-2col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .report-2col.map-col { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) !important; }
  .kpi { break-inside: avoid; border-color: #ccc; }
  .rtable tr { break-inside: avoid; }
  .report-sec { break-inside: auto; }
  .report-sec h3 { break-after: avoid; }
  .page-break { break-before: page; }
  .layout { background: #fff !important; }
  .main, .content { padding: 0 !important; max-width: none; }
  a { text-decoration: none; color: inherit; }
  .user-chip::before { display: none; }
  .user-chip { padding: 0; background: none; }
  .thumb { width: 22px; height: 30px; }
  body { font-size: 12px; }
}
.rtable td.right, .rtable td.code, .rtable td.ono { white-space: nowrap; }

/* ---------- Sistem ---------- */
.steps { padding-left: 20px; line-height: 1.6; margin: 0 0 12px; }
.steps li { margin-bottom: 6px; }
.steps ~ h3 { margin-top: 22px; }

/* ---------- İşlem geçmişi ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline .tl-day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.timeline .tl-day:first-child { padding-top: 0; }
.timeline .tl-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline .tl-time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; font-size: 13px; padding-top: 1px; }
.timeline .tl-body { min-width: 0; line-height: 1.7; }
.timeline .tl-ip { display: block; font-size: 11px; line-height: 1.3; }
.tl-details summary { cursor: pointer; font-size: 12px; color: var(--ink-2); display: inline-block; }
.tl-details[open] summary { margin-bottom: 6px; }
table.diff { width: auto; min-width: 60%; margin: 4px 0 6px; font-size: 12.5px; }
table.diff th { background: transparent; padding: 4px 8px; }
table.diff td { padding: 4px 8px; }
table.diff td.old { color: var(--red); text-decoration: line-through; text-decoration-color: rgba(196,20,25,.4); }
table.diff td.new { color: var(--green); font-weight: 600; }
.diff-items { margin: 4px 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.dense-bars { gap: 2px; height: 150px; }
.dense-bars .bar .b { max-width: 14px; }
.hours .bar .b { background: var(--accent); }
.app-version { font-size: 11px; color: #6f6f7a; padding: 10px 10px 0; margin-top: auto; }
.app-version + .userbox { margin-top: 8px; }
.users-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.users-layout > .card { margin-bottom: 18px; }
.users-layout td { white-space: nowrap; }
@media (max-width: 1520px) { .users-layout { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   Mobil / telefon (1.0.5)
   ========================================================= */
.topbar-logo, .bottom-nav, .sidebar-backdrop, .filter-toggle { display: none; }
.cv { display: contents; }

@media (max-width: 900px) {
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* Üst çubuk sabit */
  .topbar { position: sticky; top: 0; z-index: 40; background: rgba(244,244,246,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
            padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); }
  .topbar h1 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-logo { display: block; }
  .topbar-logo img { height: 22px; display: block; }
  .menu-btn { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
  .menu-btn:active { background: var(--gray-bg); }
  .content { padding: 12px 12px 24px; }

  /* Yan menü çekmece */
  .sidebar { width: min(290px, 84vw); height: 100%; height: 100dvh; overflow-y: auto; padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .sidebar nav a { padding: 12px; font-size: 15px; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(10,10,12,.45); z-index: 45; }
  .menu-open .sidebar-backdrop { display: block; }
  .menu-open { overflow: hidden; }

  /* Alt menü */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 42;
                background: #fff; border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0,0,0,.05); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px;
                border: 0; background: none; font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .bottom-nav svg { width: 22px; height: 22px; fill: currentColor; }
  .bottom-nav a.active { color: var(--ink); }
  .bottom-nav a.new span { width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 28px; line-height: 44px; text-align: center; font-weight: 400; box-shadow: 0 4px 12px rgba(227,30,36,.35); }
  .bottom-nav a.new { color: var(--ink); }

  /* Dokunmatik boyutlar; iOS'ta odaklanınca yakınlaşmayı önlemek için 16px */
  input, select, textarea { font-size: 16px; padding: 10px 12px; }
  .btn { padding: 10px 14px; }
  .btn.sm { padding: 8px 11px; }
  .card { padding: 14px; border-radius: 12px; margin-bottom: 12px; }
  .card .pad, .card.flush > h2 { padding: 14px 14px 0; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
  .kpi { padding: 12px; }
  .kpi strong { font-size: 19px; }
  .kpi span { font-size: 11px; }
  .page-actions { gap: 8px; }
  .page-actions .summary { flex: 1 1 100%; }
  .page-actions .spacer { display: none; }
  .page-actions > .btn { flex: 1 1 auto; }
  .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .seg a { white-space: nowrap; flex: 0 0 auto; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; }
  .quick-forms form { flex: 1 1 100%; }
  .quick-forms select { flex: 1; }
  .dl { grid-template-columns: 100px minmax(0, 1fr); }
  .dl dd { overflow-wrap: anywhere; }
  .modal { padding: 0; align-items: end; }
  .modal-box, .modal-box.small { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .picker-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
  .pager a, .pager span { padding: 9px 14px; }
  .users-layout { gap: 0; }
  .bulk-grid { grid-template-columns: 1fr; }
  .bulk-item input { width: 84px; }
  .rank li { padding: 10px 0; }
  pre.code { font-size: 11px; }
  .danger-zone { text-align: center; }
}

/* ---------- Telefon: tablolar kart görünümüne geçer ---------- */
@media (max-width: 760px) {
  .card.flush { overflow: visible; }
  .table-wrap:has(> table.list) { overflow: visible; }
  table.list, table.list > tbody, table.list > tbody > tr, table.list > tbody > tr > td { display: block; }
  table.list > thead { display: none; }
  table.list > tbody > tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.list > tbody > tr:last-child { border-bottom: 0; }
  table.list > tbody > tr > td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0; border: 0;
                                   text-align: right; white-space: normal; min-height: 0; }
  table.list > tbody > tr > td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
  table.list > tbody > tr > td:not([data-label])::before, table.list > tbody > tr > td[data-label=""]::before { content: none; }
  table.list > tbody > tr > td > .cv { display: block; min-width: 0; overflow-wrap: anywhere; }
  table.list > tbody > tr > td.m-empty { display: none; }
  table.list > tbody > tr > td[data-label=""] { justify-content: flex-end; }
  table.list > tbody > tr > td[data-label=""] > .cv { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; width: 100%; padding-top: 6px; }
  /* Kartın başlığı: ilk sütun */
  table.list > tbody > tr > td:first-child:not(.thumb-cell),
  table.list > tbody > tr > td.thumb-cell + td { font-size: 15px; justify-content: flex-start; text-align: left; padding-bottom: 6px; }
  table.list > tbody > tr > td:first-child:not(.thumb-cell)::before,
  table.list > tbody > tr > td.thumb-cell + td::before { content: none; }
  /* Görselli satırlar */
  table.list > tbody > tr:has(> td.thumb-cell img) { padding-left: 64px; min-height: 84px; }
  table.list > tbody > tr > td.thumb-cell { position: absolute; left: 14px; top: 12px; width: auto; padding: 0; }
  table.list > tbody > tr > td.thumb-cell .thumb { width: 40px; height: 54px; }
  table.list > tbody > tr > td.empty { display: block; text-align: center; }
  tr.clickable:active { background: #f6f6f8; }
  tr.clickable:hover td { background: transparent; }
  /* Başlıksız listeler (gösterge paneli son siparişler) */
  table.list.nohead > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
  table.list.nohead > tbody > tr > td { display: block; padding: 0; font-size: 14px; text-align: left; }
  table.list.nohead > tbody > tr > td:first-child { font-size: 14px; padding: 0; }
  table.list.nohead > tbody > tr > td.right { text-align: right; font-weight: 700; }
  table.list.nohead > tbody > tr > td:nth-child(4) { grid-column: 1; }
  table.list.nohead > tbody > tr > td:nth-child(5) { text-align: right; }
  /* Sipariş ürünleri (sipariş detay) */
  table.list.items-view > tfoot, table.list.items-view > tfoot > tr { display: block; }
  table.list.items-view > tfoot > tr { display: flex; justify-content: space-between; padding: 6px 14px 6px 0; }
  table.list.items-view > tfoot > tr > td { padding: 0; border: 0; }
  table.list.items-view > tfoot > tr.grand { border-top: 1px solid var(--line); padding-top: 10px; }
  table.list.items-view > tbody > tr { padding-left: 64px; padding-right: 0; }
  table.list.items-view > tbody > tr > td.thumb-cell { left: 0; }

  /* Filtreler: sadece arama + "Filtreler" düğmesi; diğerleri açılınca */
  .filter-toggle { display: inline-flex; }
  .filters { padding: 10px; }
  .filters input[type=search] { flex: 1 1 0; }
  .filters.collapsible:not(.open) > :not(input[type=search]):not(.filter-toggle):not([type=hidden]) { display: none; }
  .filters.open > select, .filters.open > label.inline, .filters.open > input:not([type=search]) { flex: 1 1 100%; width: 100%; }
  .filters label.inline { justify-content: space-between; font-size: 13px; }
  .filters label.inline input[type=date] { flex: 0 1 60%; }
  .filters.open > .btn:not(.filter-toggle) { flex: 1 1 40%; }

  /* Sipariş formu: ürün satırları kart olarak */
  table.items, table.items > tbody { display: block; }
  table.items > thead { display: none; }
  table.items > tbody > tr.item-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 8px; padding: 10px; margin-bottom: 8px;
                                       border: 1px solid var(--line); border-radius: 10px; background: #fafafb; position: relative; }
  table.items > tbody > tr > td { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; text-align: left; }
  table.items > tbody > tr > td::before { content: attr(data-label); font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  table.items td.it-prod { grid-column: 1 / -1; padding-right: 40px; }
  table.items td.it-prod::before, table.items td.it-rm::before { content: none; }
  table.items td.it-rm { position: absolute; top: 10px; right: 6px; }
  table.items td.it-rm .icon-btn { width: 36px; height: 40px; font-size: 17px; }
  table.items td.item-stock { grid-column: 1 / -1; flex-direction: row; gap: 6px; align-items: baseline; font-size: 13px; }
  table.items td.item-total { grid-column: 3; justify-content: flex-end; font-weight: 700; font-size: 15px; }
  table.items td.item-total::before { align-self: flex-start; }
  table.items .item-qty, table.items .item-price { width: 100%; text-align: right; }
  .items-actions { gap: 8px; }
  .items-actions .btn { flex: 1; }
  .totals { gap: 8px; }
  .totals input { width: 140px; }
  /* Kaydet düğmeleri alt menünün üstünde sabit */
  .order-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 30; margin: 0 -12px; padding: 10px 12px;
                   background: rgba(244,244,246,.95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
                   display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }
  .order-actions .btn { padding-left: 8px; padding-right: 8px; white-space: normal; line-height: 1.2; min-height: 44px; }

  /* Raporlar: tablolar yatay kaydırılır */
  .report { padding: 14px; }
  .report-head h2 { font-size: 19px; }
  .report-meta { text-align: left; }
  .report-kpis.small-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report .rtable { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .report .rtable td { white-space: nowrap; }
  .hbar { grid-template-columns: 92px minmax(0, 1fr) auto; font-size: 12px; }
  .rbar .v { font-size: 9px; }
  /* Zaman çizelgesi */
  .timeline .tl-item { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
  table.diff { display: block; overflow-x: auto; min-width: 0; }
}
@media (max-width: 380px) {
  .bottom-nav a, .bottom-nav button { font-size: 10px; }
  .kpi strong { font-size: 17px; }
}
@media print {
  .bottom-nav, .sidebar-backdrop, .filter-toggle { display: none !important; }
  .main { padding-bottom: 0 !important; }
}
@media (max-width: 760px) {
  /* Sipariş listesi: kompakt kart */
  table.orders-list > tbody > tr { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 4px 6px; align-items: center; }
  table.orders-list > tbody > tr > td { display: block; padding: 0; text-align: left; font-size: 13px; min-width: 0; }
  table.orders-list > tbody > tr > td::before { content: none !important; }
  table.orders-list > tbody > tr > td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; font-size: 15px; padding: 0; }
  table.orders-list > tbody > tr > td:nth-child(6) { grid-column: 3; grid-row: 1; font-weight: 700; font-size: 15px; text-align: right; }
  table.orders-list > tbody > tr > td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; font-size: 14px; }
  table.orders-list > tbody > tr > td:nth-child(3) br { display: none; }
  table.orders-list > tbody > tr > td:nth-child(3) small::before { content: " · "; }
  table.orders-list > tbody > tr > td:nth-child(4) { grid-column: 1 / 3; grid-row: 3; color: var(--ink-2); }
  table.orders-list > tbody > tr > td:nth-child(2) { grid-column: 3; grid-row: 3; color: var(--muted); font-size: 12px; text-align: right; }
  table.orders-list > tbody > tr > td:nth-child(7) { grid-column: 1; grid-row: 4; }
  table.orders-list > tbody > tr > td:nth-child(8) { grid-column: 2; grid-row: 4; }
  table.orders-list > tbody > tr > td:nth-child(9) { grid-column: 3; grid-row: 4; text-align: right; }
  table.orders-list > tbody > tr > td:nth-child(5), table.orders-list > tbody > tr > td:nth-child(10) { display: none; }
}
@media (max-width: 760px) {
  table.items td.item-total { justify-content: space-between; align-items: flex-end; padding-bottom: 11px; }
  .filters:not(.collapsible) input[type=search] { flex: 1 1 100%; }
  .filters:not(.collapsible) > select { flex: 1 1 auto; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card .body { padding: 8px 10px 10px; }
  .product-card .actions .btn { flex: 1 1 auto; }
}

/* ---------- Müşteri sipariş linki (1.0.7) ---------- */
.nav-count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; }
.sidebar nav a.active .nav-count { background: var(--accent); color: #fff; }
.bottom-nav a { position: relative; }
.bottom-nav .dot { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--accent); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; }
.link-card .link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: center; }
.link-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.link-card p { margin: 0; }
.link-actions input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: #fafafb; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn-row form { margin: 0; }
.btn.wa-btn { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.wa-btn:hover { background: #17924a; color: #fff; }
.btn.copied { background: var(--green-bg); border-color: var(--green-bg); color: var(--green); }
.approve-card { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; border: 2px solid #f0c36d; background: #fffbf2; }
.approve-card h2 { margin-bottom: 4px; }
.approve-card p { margin: 0 0 8px; }
.approve-actions { display: flex; flex-direction: column; gap: 8px; }
.approve-actions form { margin: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.reject-box summary { list-style: none; }
.reject-box summary::-webkit-details-marker { display: none; }
.reject-box[open] summary { margin-bottom: 8px; }
.reject-box .form label { margin-bottom: 8px; }
.req-alert { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius); background: #fffbf2; border: 2px solid #f0c36d; text-decoration: none; color: var(--ink); }
.req-alert:hover { color: var(--ink); border-color: #e3a93a; }
.req-alert .req-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.req-alert strong { display: block; font-size: 15px; }
.req-alert small { color: var(--ink-2); }
.req-alert .req-go { margin-left: auto; font-weight: 700; white-space: nowrap; }
.form.narrow-wide { max-width: 900px; }
@media (max-width: 900px) {
  .link-card .link-row, .approve-card { grid-template-columns: 1fr; gap: 12px; }
  .btn-row .btn { flex: 1 1 auto; }
  .req-alert .req-go { display: none; }
}

/* ---------- Sürüm notları ---------- */
@media (min-width: 901px) { .sidebar { z-index: 30; } }
.app-version { position: relative; padding: 10px 6px 0; }
.ver-btn { background: none; border: 0; padding: 4px; margin: 0; font: inherit; font-size: 11px; color: #8a8a96; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; text-align: left; }
.ver-btn:hover, .app-version.open .ver-btn { color: #fff; background: #1d1d22; }
.ver-new { background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; letter-spacing: .02em; }
.ver-new[hidden] { display: none; }
.ver-pop { display: none; position: absolute; left: 0; bottom: 100%; padding-bottom: 8px; width: 360px; z-index: 70; }
.app-version:hover .ver-pop, .app-version:focus-within .ver-pop, .app-version.open .ver-pop { display: block; }
.ver-card { background: #fff; color: var(--ink); border-radius: 12px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.35); border: 1px solid var(--line); }
.ver-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ver-head strong { font-size: 14px; }
.ver-head small { color: var(--muted); white-space: nowrap; }
.ver-title { margin: 2px 0 8px; color: var(--accent); font-weight: 700; font-size: 13px; }
.ver-card ul { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); max-height: 50vh; overflow-y: auto; }
.ver-card li { margin-bottom: 4px; }
.ver-card a { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.releases { max-width: 820px; }
.release.current { border: 2px solid var(--ink); }
.release-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.release-head h2 { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.release-title { margin: 4px 0 8px; color: var(--accent); font-weight: 700; }
.release ul { margin: 0; padding-left: 20px; line-height: 1.6; }
@media (max-width: 900px) { .ver-pop { width: auto; right: 0; } }

/* ---------- WhatsApp'tan yapıştır (1.0.8) ---------- */
.paste-card { padding: 0; border: 2px dashed #b9e5c8; background: #f6fcf8; }
.paste-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.paste-card > summary::-webkit-details-marker { display: none; }
.paste-card > summary strong { display: block; font-size: 15px; }
.paste-card > summary small { color: var(--ink-2); }
.paste-card > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.paste-card[open] > summary::after { content: "▴"; }
.paste-ico { width: 38px; height: 38px; border-radius: 50%; background: #1fa855; color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.paste-form { padding: 0 18px 16px; }
.paste-form textarea { font-size: 14px; background: #fff; }
.paste-form .form-actions { justify-content: space-between; flex-wrap: wrap; }
.block-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.block-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.block-item pre { margin: 0; white-space: pre-wrap; font: 12px/1.45 system-ui, sans-serif; color: var(--ink-2); flex: 1; }
.parse-result { border: 2px solid #b9e5c8; }
.parse-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.parse-found, .parse-warn { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.parse-found li { color: var(--green); font-weight: 600; }
.parse-warn li { background: var(--amber-bg); color: var(--amber); padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.parse-raw summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.parse-raw pre { margin: 0; white-space: pre-wrap; background: #fafafb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.5 system-ui, sans-serif; max-height: 260px; overflow: auto; }
.form .auto-filled, .auto-filled { background: #f0faf3; border-color: #9fd8b2; }
.form .need-fill, .need-fill { background: #fff6e0; border-color: #f0b84c; box-shadow: 0 0 0 2px rgba(240,184,76,.25); }
.msg-total { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); padding-top: 4px; }
.msg-total b { font-weight: 700; }
.badge.stand { background: #ece6ff; color: #5b3cc4; }
@media (max-width: 900px) { .parse-cols { grid-template-columns: 1fr; } }

/* ---------- Adede göre fiyat (1.0.9) ---------- */
.tier-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); background: #fafafb; border: 1px dashed var(--line); border-radius: 8px; padding: 7px 10px; }
.tier-note.on { background: var(--green-bg); color: var(--green); border-color: #9fd8b2; font-weight: 600; }
.item-price.tiered { background: #f0faf3; border-color: #9fd8b2; }
.tier-table { width: 100%; margin-bottom: 10px; }
.tier-table th, .tier-table td { padding: 6px 8px; }
.tier-table input { max-width: 200px; }
.tier-preview { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; background: #fafafb; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.tier-preview span { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }

/* ---------- Listede hızlı durum / ödeme (1.1.0) ---------- */
select.quick-badge { -webkit-appearance: none; appearance: none; width: auto; min-width: 0; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
  padding: 3px 22px 3px 10px; border-radius: 99px; line-height: 1.35; outline-offset: 1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='currentColor' fill='none' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 8px 5px; }
select.quick-badge.gray { background-color: var(--gray-bg); color: var(--gray); }
select.quick-badge.amber { background-color: var(--amber-bg); color: var(--amber); }
select.quick-badge.blue { background-color: var(--blue-bg); color: var(--blue); }
select.quick-badge.green { background-color: var(--green-bg); color: var(--green); }
select.quick-badge.red { background-color: var(--red-bg); color: var(--red); }
select.quick-badge:hover { box-shadow: 0 0 0 1.5px currentColor inset; }
select.quick-badge:focus { outline: 2px solid var(--ink); }
select.quick-badge.saving { opacity: .55; }
select.quick-badge option { background: #fff; color: var(--ink); font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18); max-width: calc(100vw - 32px); }
.toast.ok { background: var(--ink); color: #fff; }
.toast.err { background: var(--red); color: #fff; }
.toast[hidden] { display: none; }
.ship-auto { font-weight: 500; font-size: 11px; }
@media (max-width: 900px) {
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  select.quick-badge { font-size: 13px; padding: 5px 24px 5px 11px; }
}

/* ---------- Basit Kargo (1.2.0) ---------- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.bk-card h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; margin: 4px 0 12px; }
.bk-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bk-grid strong { font-size: 15px; overflow-wrap: anywhere; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bk-send { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .7fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.bk-send label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.bk-send .bk-note { align-self: center; }
.btn.danger-text { color: var(--red); }
.btn.saving { opacity: .6; pointer-events: none; }
.bk-pick-wrap { display: inline-flex; align-items: center; padding: 4px 8px 4px 0; cursor: pointer; vertical-align: middle; }
.bk-pick-wrap input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
a.bk-mini { font-size: 11px; text-decoration: none; margin-top: 4px; display: inline-block; }
.bk-bulk { position: sticky; bottom: 12px; z-index: 30; margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  background: var(--ink); color: #fff; padding: 12px 14px; border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.bk-bulk[hidden] { display: none; }
.bk-bulk strong { margin-right: auto; }
.bk-bulk .btn { background: #fff; color: var(--ink); border-color: #fff; }
.bk-bulk .btn.primary { background: #1fa855; border-color: #1fa855; color: #fff; }
.bk-bulk .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.bk-bulk .btn:disabled { opacity: .8; }
.bk-log { flex-basis: 100%; list-style: none; margin: 6px 0 0; padding: 8px 0 0; border-top: 1px solid rgba(255,255,255,.2); max-height: 220px; overflow: auto; font-size: 13px; }
.bk-log li { padding: 3px 0; }
.bk-log li.ok { color: #9be7b6; } .bk-log li.err { color: #ffb4b4; }
.bk-log .btn { margin-top: 6px; }
tr.row-warn > td { background: #fff7f7; }
.bk-hook { display: flex; gap: 8px; margin: 8px 0; }
.bk-hook input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
@media (max-width: 900px) {
  .bk-send { grid-template-columns: 1fr 1fr; }
  .bk-grid { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .bk-send .btn { grid-column: 1 / -1; }
  .bk-actions .btn { flex: 1 1 100%; }
  .bk-bulk { position: fixed; left: 10px; right: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); margin: 0; }
  .bk-bulk strong { flex-basis: 100%; }
  .bk-bulk .btn { flex: 1 1 auto; }
}

/* Ödeme yöntemi uyarısı (1.2.1) */
.pm-req { color: var(--red); }
.pm-hint { font-weight: 500; font-size: 12px; line-height: 1.45; color: var(--muted); }
.pm-field.pm-empty select { border-color: var(--red); background-color: #fff5f5; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.pm-field.pm-empty .pm-hint { color: var(--red); font-weight: 600; }
.pm-field.pm-cod .pm-hint { color: #8a5a00; }

/* Minimum sipariş (1.2.2) */
.min-note { margin: 8px 0 0; font-size: 13px; }
.min-note.short { background: #fff5f5; border: 1px solid #f3b4b4; padding: 8px 10px; border-radius: 8px; }

/* 1.3.0 · Sipariva */
.powered { display: inline-block; font-size: 10.5px; color: #6f6f7a; text-decoration: none; letter-spacing: .01em; }
.powered:hover { color: #F2541B; }
.powered.side { display: block; padding: 2px 4px 0; }
.powered.powered-auth { display: block; text-align: center; margin-top: 14px; }
.alert.demo-note { background: #fff4ec; border-color: #f7c6a8; color: #7a3410; }
.alert.demo-note a { color: #c2410c; font-weight: 600; }
.demo-cred { background: #fff4ec; border: 1px dashed #f2a679; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #7a3410; margin-bottom: 12px; }
.demo-cred code { background: #fff; padding: 1px 6px; border-radius: 5px; font-weight: 700; }
.settings-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.logo-prev { display: flex; align-items: center; justify-content: center; min-height: 64px; border-radius: 10px; padding: 10px; border: 1px solid var(--line, #e3e3e8); }
.logo-prev.dark { background: #0d0d0f; }
.logo-prev img { max-height: 44px; max-width: 100%; }
.import-preview td.err { color: #b42318; }
.import-preview td.new { color: #127a57; font-weight: 600; }
.alias-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.alias-chips span { font-size: 11px; background: #f1f1f4; border-radius: 999px; padding: 1px 8px; color: #555; }
.mod-list { display: grid; gap: 10px; margin: 6px 0 4px; }
.mod-item { display: flex !important; flex-direction: row !important; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.mod-item input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.mod-item span { display: grid; gap: 3px; }
.mod-item:has(input:checked) { border-color: #F2541B; background: #fff8f4; }

/* 1.3.1 · barkod & hızlı satış */
.scan-row { display: flex; gap: 8px; align-items: stretch; margin: 10px 0; }
.scan-row > input, .scan-row > select { flex: 1; min-width: 0; }
.scan-input { font-size: 18px !important; padding: 14px 16px !important; border: 2px solid #F2541B !important; border-radius: 12px !important; }
.scan-input:focus { box-shadow: 0 0 0 4px rgba(242,84,27,.15); outline: none; }
.scan-unknown { background: #fff4ec; border: 1px solid #f7c6a8; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.scan-list tr.flash td { animation: scanflash 1s ease; }
@keyframes scanflash { from { background: #fde3d6; } to { background: transparent; } }
.scan-list .thumb { width: 28px; height: 28px; vertical-align: middle; border-radius: 6px; object-fit: cover; }
td.pos { color: var(--green); font-weight: 700; } td.neg { color: var(--red); font-weight: 700; }
.tips { display: grid; gap: 8px; padding-left: 18px; margin: 8px 0 14px; }
.scan-modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.75); display: grid; place-items: center; padding: 16px; }
.scan-modal[hidden] { display: none; }
.scan-box { background: #fff; border-radius: 16px; width: min(520px, 100%); padding: 14px; }
.scan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#scanReader { width: 100%; border-radius: 10px; overflow: hidden; background: #000; min-height: 240px; }
#scanReader video { width: 100% !important; }
.scan-last { margin-top: 10px; font-size: 14px; }
.scan-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 300; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.order-scan { display: flex; gap: 8px; margin: 0 0 12px; }
.order-scan input { flex: 1; }
/* hızlı satış */
.kasa { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.kasa-cart td { vertical-align: middle; }
.kasa-cart .qbtn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.kasa-cart .qv { width: 56px; text-align: center; }
.kasa-sum { position: sticky; top: 16px; }
.kasa-total { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.02em; margin: 6px 0 14px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
.pay-grid label { display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: 6px; border: 2px solid var(--line); border-radius: 10px; padding: 12px; font-weight: 700; cursor: pointer; }
.pay-grid input { display: none; }
.pay-grid label:has(input:checked) { border-color: #F2541B; background: #fff4ec; color: #c2410c; }
.kasa-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kasa-quick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.badge.kasa { background: #fff1e8; color: #c2410c; }
@media (max-width: 900px) { .kasa { grid-template-columns: 1fr; } .kasa-sum { position: static; } }
.item-row.flash td { animation: scanflash 1s ease; }
.scan-list .thumb { display: inline-block; margin-right: 8px; }
@media (max-width: 700px) {
  .kasa-cart, .kasa-cart tbody { display: block; width: 100%; }
  .kasa-cart thead { display: none; }
  .kasa-cart tbody tr { display: grid !important; grid-template-columns: 1fr auto; grid-template-areas: "n rm" "q t" "p p"; gap: 8px 10px; align-items: center; padding: 12px 0 !important; border-bottom: 1px solid var(--line); margin: 0 !important; box-shadow: none !important; background: none !important; }
  .kasa-cart td { display: block !important; padding: 0 !important; border: 0 !important; text-align: left !important; }
  .kasa-cart td::before { display: none !important; }
  .kasa-cart td:nth-child(1) { grid-area: n; } .kasa-cart td:nth-child(2) { grid-area: q; }
  .kasa-cart td:nth-child(3) { grid-area: p; } .kasa-cart td:nth-child(4) { grid-area: t; text-align: right !important; font-size: 16px; }
  .kasa-cart td:nth-child(5) { grid-area: rm; }
  .kasa-cart td:nth-child(3) input { width: 110px !important; }
  .kasa-cart td.empty { grid-column: 1 / -1; }
}
.kpi-edit { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); text-decoration: underline; cursor: pointer; }
