:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --border: #e2e7ee;
  --text: #172230;
  --muted: #5d6b7e;
  --primary: #1d6fd1;
  --primary-hover: #185fb4;
  --primary-soft: #e8f1fc;
  --green: #147a4a;
  --green-soft: #e3f4ea;
  --red: #c0392b;
  --red-soft: #fbe9e7;
  --orange: #b9680a;
  --orange-soft: #fdf1df;
  --purple: #6b4bb8;
  --purple-soft: #efeafb;
  --btn-primary: #1d6fd1;
  --side-bg: #1f2b38;
  --side-text: #b9c5d2;
  --side-muted: #7d8da0;
  --btn-green: #147a4a;
  --btn-red: #c0392b;
  --shadow: 0 1px 2px rgba(16, 32, 48, .04);
  --shadow-lg: 0 10px 40px rgba(16, 32, 48, .2);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: 224px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b; --surface: #171e27; --surface-2: #1d2530; --border: #2a3441; --text: #e7ecf2; --muted: #95a3b4;
    --primary: #5a9fe0; --primary-hover: #74b0ea; --primary-soft: #1d3247;
    --green: #4cc38a; --green-soft: #173427; --red: #f0776a; --red-soft: #3c1f1c;
    --orange: #f0a54a; --orange-soft: #3a2a14; --purple: #a88ff0; --purple-soft: #2a2340; --btn-primary: #2f6fae; --btn-green: #1b7a4c; --btn-red: #b3392d; --side-bg: #141b23;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --surface: #171e27; --surface-2: #1d2530; --border: #2a3441; --text: #e7ecf2; --muted: #95a3b4;
  --primary: #5a9fe0; --primary-hover: #74b0ea; --primary-soft: #1d3247;
  --green: #4cc38a; --green-soft: #173427; --red: #f0776a; --red-soft: #3c1f1c;
  --orange: #f0a54a; --orange-soft: #3a2a14; --purple: #a88ff0; --purple-soft: #2a2340; --btn-primary: #2f6fae; --btn-green: #1b7a4c; --btn-red: #b3392d; --side-bg: #141b23;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden, .tip-gizli { display: none !important; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Yerleşim ---------- */
.layout { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--side-bg); border-right: 0;
  display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-weight: 700; font-size: 1rem; color: #fff; }
.brand .logo { width: 30px; height: 30px; border-radius: 6px; background: var(--btn-primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.brand small { display: block; font-weight: 400; color: var(--side-muted); font-size: .78rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 500; margin-bottom: 1px; }
.nav a svg.i { width: 18px; height: 18px; opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 #4ea1ff; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 10px 6px; }
.nav .cap { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 12px 4px; font-weight: 600; }
.nav .cap:empty { padding: 6px 0; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; background: var(--surface);
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border);
}
.topbar .title { font-weight: 600; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back { display: none; }
.search-wrap { position: relative; width: min(380px, 40vw); }
.search-wrap input { padding-left: 36px; }
.search-wrap > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 60vh; overflow-y: auto; z-index: 30; }
.content { padding: 20px 24px 40px; width: 100%; max-width: 1280px; }

.bottom-nav { display: none; }
.fab-menu { display: none; }

@media (max-width: 899px) {
  body { font-size: 16px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); width: 280px; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 19; }
  .main { margin-left: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--surface); }
  .topbar .back { display: inline-flex; }
  .topbar .desk-only { display: none; }
  .search-wrap { display: none; width: auto; }
  .search-wrap.open { display: block; position: absolute; left: 12px; right: 12px; top: calc(100% + 6px); }
  .content { padding: 14px 16px 24px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 18; background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: .7rem; color: var(--muted);
    background: none; border: 0; font-family: inherit; cursor: pointer;
  }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .fab { position: relative; top: -16px; }
  .bottom-nav .fab span.circle {
    width: 54px; height: 54px; border-radius: 50%; background: var(--btn-primary); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg);
  }
  .bottom-nav .fab svg.i { width: 26px; height: 26px; }
}
@media (min-width: 900px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 899px) {
  .desk-only-inline { display: none !important; }
}
@media (max-width: 640px) {
  .hide-m { display: none !important; }
}

/* ---------- Bileşenler ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { flex: 1; }
.card-b { padding: 16px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .toolbar + .card, .card + .toolbar { margin-top: 16px; }

.grid { display: grid; gap: 16px; }
.grid > * { margin-top: 0 !important; min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .lbl { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .val { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .sub { font-size: .8rem; color: var(--muted); }
a.stat:hover { border-color: #c9d3de; }
@media (max-width: 640px) { .stat .val { font-size: 1.1rem; } .stat { padding: 12px; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 14px; min-height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--btn-primary); border-color: var(--btn-primary); color: #fff; }
.btn.primary:hover, .btn.green:hover, .btn.red:hover { filter: brightness(1.08); }
.btn.green { background: var(--btn-green); border-color: var(--btn-green); color: #fff; }
.btn.red { background: var(--btn-red); border-color: var(--btn-red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger-text { color: var(--red); }
.btn.sm { padding: 3px 10px; min-height: 28px; font-size: .85rem; }
.btn.lg { padding: 8px 18px; min-height: 40px; }
.btn.icon { padding: 6px; min-width: 34px; }
.btn.block { width: 100%; }
@media (max-width: 899px) { .btn { min-height: 44px; white-space: normal; text-align: center; } .btn.sm { min-height: 36px; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar select, .toolbar input { width: auto; }
@media (max-width: 640px) {
  .toolbar .grow { flex-basis: 100%; }
  .toolbar > select, .toolbar > input[type=date] { flex: 1 1 calc(50% - 5px); min-width: 0; }
}

.page-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-h h1 { flex: 1; min-width: 200px; font-size: 1.3rem; font-weight: 600; }
.page-h .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .page-h h1 { display: none; } .page-h .actions { width: 100%; } .page-h .actions .btn { flex: 1; } }

/* Form */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--muted); min-width: 0; }
label.f > span.req::after { content: " *"; color: var(--red); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; min-height: 34px; font-weight: 400;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
input.money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; }
@media (max-width: 899px) { input, select, textarea { min-height: 46px; font-size: 16px; } }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-sec { font-weight: 700; margin: 18px 0 10px; font-size: .9rem; color: var(--text); grid-column: 1 / -1; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; }

/* Segment / seçim butonları */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.seg.big button { padding: 8px 16px; }
@media (max-width: 640px) { .seg { display: flex; width: 100%; } .seg button { flex: 1; } }

.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.pay-methods button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 500; font-size: .8rem; cursor: pointer; color: var(--text);
}
.pay-methods button svg.i { width: 20px; height: 20px; color: var(--muted); }
.pay-methods button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pay-methods button.on svg.i { color: var(--primary); }
@media (max-width: 640px) { .pay-methods { grid-template-columns: repeat(4, 1fr); gap: 6px; } .pay-methods button { font-size: .72rem; padding: 10px 2px; } }

.pay-line { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); position: relative; }
.pay-line + .pay-line { margin-top: 12px; }
.pay-h { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 10px; font-weight: 700; font-size: .85rem; color: var(--muted); min-height: 32px; }

/* Tablo: masaüstünde tablo, mobilde kart */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.tbl tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 760px) {
  table.tbl.cards thead { display: none; }
  table.tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td, .tbl.cards tfoot { display: block; width: 100%; }
  .tbl.cards tr { padding: 10px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
  .tbl.cards td { border: 0; padding: 0; text-align: left !important; }
  .tbl.cards td[data-l]:not(.main-col):not(.amt-col)::before { content: attr(data-l) ": "; color: var(--muted); font-size: .8rem; }
  .tbl.cards td:not(.main-col):not(.amt-col) { grid-column: 1; font-size: .85rem; color: var(--muted); }
  .tbl.cards td.main-col { grid-column: 1; grid-row: 1; order: -1; font-weight: 600; font-size: .95rem; }
  .tbl.cards td.amt-col { grid-column: 2; grid-row: 1 / span 2; order: -1; text-align: right !important; align-self: center; font-weight: 700; }
  .tbl.cards td.empty-m { display: none; }
  .tbl.cards td.act { grid-column: 1 / -1; }
  .tbl.cards tfoot tr { background: var(--surface-2); }
  .tbl.cards tfoot td:empty { display: none; }
}

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.orange { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.badge.blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg.i { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list li .grow { flex: 1; min-width: 0; }
.list li .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li.click { cursor: pointer; }
.list li.click:hover { background: var(--surface-2); }
.list .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.list .ico.green { background: var(--green-soft); color: var(--green); }
.list .ico.red { background: var(--red-soft); color: var(--red); }
.list .ico.orange { background: var(--orange-soft); color: var(--orange); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.balance-hero { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.balance-hero .big { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .balance-hero .big { font-size: 1.6rem; }
  .balance-hero .right { text-align: left; }
  .btn-row { display: grid !important; grid-template-columns: 1fr 1fr; }
  .btn-row .btn.ghost.icon, .btn-row > .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.quick a:hover { border-color: var(--primary); text-decoration: none; }
.quick a .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
@media (max-width: 640px) { .quick { grid-template-columns: repeat(2, 1fr); } .quick a { padding: 12px; font-size: .9rem; } }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding: 10px 4px 0; }
.bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .b { width: min(22px, 40%); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b.s { background: var(--primary); }
.bars .b.t { background: var(--green); }
.bars .lbl { font-size: .72rem; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--text); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; display: flex; gap: 10px; align-items: center; }
.alert.orange { background: var(--orange-soft); color: var(--orange); }
.alert.red { background: var(--red-soft); color: var(--red); }
.alert.blue { background: var(--primary-soft); color: var(--primary); }

/* Otomatik tamamlama */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 60; max-height: 280px; overflow-y: auto; }
.ac-item { padding: 10px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: 0; }
.ac-item.on, .ac-item:hover { background: var(--primary-soft); }
.ac-item .s { font-size: .8rem; color: var(--muted); }
.ac-sel { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: var(--radius-sm); min-height: 40px; }
.ac-sel .grow { flex: 1; min-width: 0; }
.ac-sel .t { font-weight: 700; color: var(--text); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 30, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; display: flex; flex-direction: column; max-height: 90vh; }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-h h2 { flex: 1; font-size: 1.05rem; font-weight: 600; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 94vh; animation: up .18s; }
  .modal-f { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }

.sheet-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sheet-actions a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: var(--radius); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .85rem; text-align: center; }
.sheet-actions a:hover { text-decoration: none; background: var(--primary-soft); }
.sheet-actions .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }

/* Toast */
#toast-root { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1f2a36; color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: 90vw; animation: up .18s; pointer-events: auto; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@media (max-width: 899px) { #toast-root { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* Giriş */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth .brand { padding: 0 0 18px; justify-content: center; font-size: 1.3rem; }

.spin { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: sp .7s linear infinite; margin: 40px auto; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Fatura kalemleri */
.lines .line { display: grid; grid-template-columns: minmax(180px, 3fr) 90px 130px 70px 84px 120px 40px; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.lines .line .tot { text-align: right; font-weight: 700; padding: 10px 0; font-variant-numeric: tabular-nums; }
.lines .head { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; padding-bottom: 0; border: 0; }
@media (max-width: 1000px) {
  .lines .line { grid-template-columns: 1fr 1fr 1.4fr; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
  .lines .line > :first-child { grid-column: 1 / -1; }
  .lines .line .tot { grid-column: span 2; }
  .lines .head { display: none; }
}
.lines .lbl-m { display: none; font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
@media (max-width: 1000px) { .lines .lbl-m { display: block; } }
.totals { margin-left: auto; max-width: 340px; width: 100%; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .g { font-size: 1.2rem; font-weight: 800; border-top: 2px solid var(--border); padding-top: 8px; margin-top: 4px; }

.sticky-save { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; z-index: 5; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 899px) { .sticky-save { bottom: calc(62px + env(safe-area-inset-bottom)); border-radius: 0; margin: 0 -16px; } .sticky-save .btn { flex: 1; } }

/* ---------- Yazdırma ---------- */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  #app, #modal-root, #toast-root { display: none !important; }
  #print-area { display: block; }
  .pr-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
  .pr-head h1 { font-size: 15pt; }
  .pr-head .firma { font-size: 9pt; }
  .pr table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .pr th, .pr td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
  .pr th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr .r { text-align: right; }
  .pr tfoot td { font-weight: bold; }
  .pr .kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; }
  .pr .kv dt { color: #444; }
  .pr .kv dd { margin: 0; }
  .pr .box { border: 1px solid #999; padding: 8px 10px; }
  .pr .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .pr .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; text-align: center; }
  .pr .sign div { border-top: 1px solid #000; padding-top: 4px; }
  .pr .totals { margin-left: auto; width: 260px; margin-top: 8px; }
  .pr .totals div { display: flex; justify-content: space-between; padding: 2px 0; }
  .pr .totals .g { font-size: 12pt; font-weight: bold; border-top: 1px solid #000; }
  .pr .note { margin-top: 12px; font-size: 9pt; }
  .pr tr { break-inside: avoid; }
  .pr .fis { width: 72mm; font-size: 9.5pt; font-family: "DejaVu Sans Mono", monospace; }
  .pr .fis hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
  .pr .fis-baslik { text-align: center; margin-bottom: 6px; }
  .pr .fis-s { display: flex; justify-content: space-between; gap: 8px; }
  .pr .fis-top { font-size: 12pt; font-weight: bold; margin-top: 2px; }
  .pr .fis-alt { text-align: center; margin-top: 8px; }
}

/* Açılır menü */
.dropdown { position: absolute; z-index: 150; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; min-width: 190px; }
.dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--text); border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.dropdown button:hover { background: var(--surface-2); }
.dropdown button svg.i { width: 17px; height: 17px; color: var(--muted); }
.dropdown button.neg, .dropdown button.neg svg.i { color: var(--red); }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-btn { background: rgba(255, 255, 255, .18); border: 0; color: #fff; font: inherit; font-weight: 600; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.list li.neg { color: var(--red); }

/* ---------- Canlı düğmeler ---------- */
.btn {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 1px 2px rgba(16, 32, 48, .08), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, filter .14s ease;
}
.btn:hover { transform: translateY(-1px); border-color: #b9c6d4; box-shadow: 0 4px 12px rgba(16, 32, 48, .12); background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: inset 0 2px 5px rgba(16, 32, 48, .15); }
.btn.primary { background: linear-gradient(180deg, #3b8cf0 0%, #1d6fd1 100%); border-color: #1964bf; box-shadow: 0 2px 6px rgba(29, 111, 209, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(29, 111, 209, .45); filter: brightness(1.04); }
.btn.green { background: linear-gradient(180deg, #25b06b 0%, #148a4f 100%); border-color: #127a46; box-shadow: 0 2px 6px rgba(20, 138, 79, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.green:hover { box-shadow: 0 6px 18px rgba(20, 138, 79, .45); }
.btn.red { background: linear-gradient(180deg, #ea5c4e 0%, #c0392b 100%); border-color: #ad3326; box-shadow: 0 2px 6px rgba(192, 57, 43, .35), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn.red:hover { box-shadow: 0 6px 18px rgba(192, 57, 43, .45); }
.btn.orange { background: linear-gradient(180deg, #f5a340 0%, #d9821a 100%); border-color: #c47416; color: #fff; box-shadow: 0 2px 6px rgba(217, 130, 26, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.orange:hover { box-shadow: 0 6px 18px rgba(217, 130, 26, .45); }
.btn.purple { background: linear-gradient(180deg, #8a6ce0 0%, #6b4bb8 100%); border-color: #5f42a6; color: #fff; box-shadow: 0 2px 6px rgba(107, 75, 184, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; transform: none; }
.btn:disabled { transform: none !important; box-shadow: none !important; filter: grayscale(.3); }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); animation: ripple .55s ease-out forwards; background: rgba(255, 255, 255, .55); }
.btn:not(.primary):not(.green):not(.red):not(.orange):not(.purple) .ripple, .pay-methods .ripple, .dropdown .ripple { background: rgba(29, 111, 209, .18); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

.pay-methods button, .dropdown button, .list li.click, .sheet-actions a, a.stat, .cmd { position: relative; overflow: hidden; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease; }
.pay-methods button:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(16, 32, 48, .1); border-color: #b9c6d4; }
.pay-methods button:active { transform: scale(.96); }
.pay-methods button.on { box-shadow: 0 0 0 3px rgba(29, 111, 209, .15); }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 32, 48, .08); }
.seg button { transition: background .14s, color .14s, box-shadow .14s; }
.modal { animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.dropdown { animation: pop .14s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .btn, .pay-methods button, a.stat, .modal, .dropdown { transition: none; animation: none; }
  .btn:hover, .pay-methods button:hover, a.stat:hover { transform: none; }
  .ripple { display: none; }
}

/* Sidebar "Satış Yap" düğmesi */
.nav .satis-btn { margin: 4px 4px 10px; justify-content: center; color: #fff !important; font-weight: 600; padding: 10px 12px; }
.nav .satis-btn svg.i { opacity: 1; }

/* ---------- Hızlı satış ---------- */
.modal.xl { max-width: 1060px; }
.satis { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; min-height: 420px; }
.satis-sol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.satis-ara { position: relative; }
.satis-ara > svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.satis-ara input { padding-left: 40px; min-height: 46px; font-size: 1.05rem; border-width: 2px; }
.sepet { border: 1px solid var(--border); border-radius: var(--radius); flex: 1; overflow-y: auto; max-height: 55vh; }
.sepet .empty { padding: 60px 20px; }
.sepet-satir { display: grid; grid-template-columns: minmax(0, 1fr) 124px 100px 96px 34px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); animation: pop .15s ease-out; }
.sepet-satir:last-child { border-bottom: 0; }
.sp-ad { display: flex; flex-direction: column; min-width: 0; }
.sp-ad b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-fiyat { min-height: 34px; }
.sp-tutar { text-align: right; font-weight: 700; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.stepper button { width: 34px; height: 34px; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; transition: background .12s; }
.stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.stepper button:active { transform: scale(.92); }
.stepper button svg.i { width: 16px; height: 16px; }
.stepper input { border: 0; border-radius: 0; text-align: center; min-height: 34px; padding: 4px; width: 100%; min-width: 0; font-weight: 600; }
.satis-sag { display: flex; flex-direction: column; gap: 14px; }
.satis-toplam { background: linear-gradient(135deg, #1f2b38, #2c3e52); color: #fff; border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 6px 18px rgba(31, 43, 56, .25); }
.satis-toplam span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.satis-toplam b { font-size: 2rem; font-weight: 700; }
.satis-odeme { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.satis-odeme .btn { min-height: 56px; flex-direction: column; gap: 4px; font-weight: 600; }
.satis-odeme .btn svg.i { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .satis { grid-template-columns: 1fr; min-height: 0; gap: 12px; }
  .sepet { max-height: none; }
  .sepet-satir { grid-template-columns: 100px minmax(0, 1.1fr) minmax(0, 1fr) 34px; grid-template-areas: "ad ad ad x" "st fy tt tt"; row-gap: 8px; }
  .sepet-satir .sp-ad { grid-area: ad; }
  .sepet-satir .stepper { grid-area: st; }
  .sepet-satir .sp-fiyat { grid-area: fy; }
  .sepet-satir .sp-tutar { grid-area: tt; }
  .sepet-satir [data-a="x"] { grid-area: x; }
  .satis-sag { position: sticky; bottom: -18px; background: var(--surface); padding: 12px 0 calc(6px + env(safe-area-inset-bottom)); margin: 0 -2px; border-top: 1px solid var(--border); }
  .satis-toplam { flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 14px; }
  .satis-toplam b { font-size: 1.5rem; }
  .satis-odeme { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .satis-odeme .btn { min-height: 58px; font-size: .78rem; padding: 4px; }
  .stepper button { width: 30px; }
}

.kbd { font-size: .68rem; opacity: .75; border: 1px solid rgba(255, 255, 255, .45); border-radius: 3px; padding: 0 4px; margin-left: 4px; font-weight: 500; }
@media (max-width: 899px) { .kbd { display: none; } }
.cikti { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) { .cikti { width: 100%; } .cikti .btn { flex: 1 1 calc(50% - 4px); } }

.modal .sticky-save { bottom: -18px !important; margin: 0 -18px -18px; border-radius: 0; }
.fatura-modal .card { border: 0; box-shadow: none; }
.fatura-modal .card-b { padding: 0; }

/* ---------- Tipografi ---------- */
body { font-size: 14px; line-height: 1.5; font-feature-settings: "tnum" 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, .modal-h h2, .topbar .title, .brand { font-family: var(--font-display); text-wrap: balance; letter-spacing: -.01em; }
h1, .page-h h1 { font-size: 1.625rem; font-weight: 700; }
h2, .modal-h h2 { font-size: 1.125rem; font-weight: 600; }
h3, .card-h h3 { font-size: 1rem; font-weight: 600; }
.topbar .title { font-size: 1.125rem; font-weight: 600; }
.small { font-size: .8125rem; }
.num, .stat .val, .balance-hero .big, .tbl td.r, .totals, .satis-toplam b, input.money { font-variant-numeric: tabular-nums; }
.stat .val, .balance-hero .big, .satis-toplam b, .totals .g { font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; }
.stat .val { font-size: 1.625rem; }
.balance-hero .big { font-size: 2rem; }
.stat .lbl, .tbl th, .nav .cap, .satis-toplam span, label.f > span { letter-spacing: .06em; }
.stat .lbl, .tbl th, .nav .cap { font-size: .6875rem; font-weight: 600; text-transform: uppercase; }
label.f > span { font-size: .75rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.btn { font-weight: 500; letter-spacing: .005em; }
.tbl td { padding-block: 10px; }
.card { box-shadow: none; }
.nav a { font-weight: 500; }
@media (max-width: 640px) {
  h1, .page-h h1 { font-size: 1.375rem; }
  .stat .val { font-size: 1.3rem; }
  .balance-hero .big { font-size: 1.75rem; }
}

/* ---------- Yükleme göstergeleri ---------- */
.yukleme-cubugu { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.yukleme-cubugu.acik { opacity: 1; }
.yukleme-cubugu::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: akis 1s ease-in-out infinite; }
@keyframes akis { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.donen { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: sp .7s linear infinite; flex: none; vertical-align: middle; }
.topbar .donen { color: var(--primary); opacity: 0; transition: opacity .15s; }
.topbar .donen.acik { opacity: 1; }
.spin { width: 22px; height: 22px; border-width: 2.5px; margin: 48px auto; opacity: 0; animation: sp .7s linear infinite, belir .2s ease .12s forwards; }
@keyframes belir { to { opacity: 1; } }
.content.giris > * { animation: icerik .18s ease-out; }
@keyframes icerik { from { opacity: 0; transform: translateY(4px); } }
.btn.bekliyor { color: transparent !important; pointer-events: none; }
.btn.bekliyor::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: sp .7s linear infinite; }
.btn.bekliyor:not(.primary):not(.green):not(.red):not(.orange):not(.purple)::after { border-color: color-mix(in srgb, var(--primary) 25%, transparent); border-top-color: var(--primary); }
@media (prefers-reduced-motion: reduce) {
  .yukleme-cubugu::before, .content.giris > * { animation: none; }
}

/* ---------- KDV sorusu, ürün geçmişi ---------- */
.kdv-modal { max-width: 420px; }
.kdv-sor { display: grid; gap: 10px; }
.kdv-sor .btn { display: flex; justify-content: space-between; align-items: center; min-height: 64px; padding: 12px 18px; font-size: 1rem; text-align: left; }
.kdv-sor .btn small { display: block; font-weight: 500; opacity: .75; font-size: .78rem; }
.kdv-sor .btn b { font-family: var(--font-display, inherit); font-size: 1.2rem; }
.urun-ozet { display: flex; gap: 10px; margin-bottom: 14px; }
.urun-ozet > div { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.urun-ozet b { font-size: 1.15rem; }

/* ---------- Telefon: uygulama hissi ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
* { -webkit-tap-highlight-color: transparent; }
a, button, input, select, textarea, label, .click { touch-action: manipulation; }
.layout, .main, .auth { min-height: 100dvh; }
.kv { margin: 0; }
.m-goster { display: none; }
.aksiyonlar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.aksiyonlar .btn > span { display: inline; }

@media (max-width: 640px) {
  body { overscroll-behavior-y: none; }
  .m-gizle { display: none; }
  .m-goster { display: inline; }

  /* Cari işlemleri: bankacılık uygulamalarındaki gibi ikon satırı */
  .aksiyonlar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 16px -4px 0; }
  .aksiyonlar .btn { flex-direction: column; gap: 6px; min-height: 0; padding: 4px 0; background: none; border: 0; box-shadow: none;
    color: var(--text); font-size: .74rem; font-weight: 600; line-height: 1.2; }
  .aksiyonlar .btn svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--primary); box-sizing: border-box; transition: transform .12s; }
  .aksiyonlar .btn:active svg { transform: scale(.92); }
  .aksiyonlar .btn.primary svg { background: linear-gradient(180deg, #2f86eb, #1b64c9); color: #fff; border: 0; box-shadow: 0 4px 12px rgba(27, 100, 201, .3); }
  .aksiyonlar .btn.purple svg { background: linear-gradient(180deg, #8b6ce0, #6b4fc4); color: #fff; border: 0; box-shadow: 0 4px 12px rgba(107, 79, 196, .3); }
  .aksiyonlar .btn::after { display: none; }
  .balance-hero { gap: 6px; }

  /* Çıktı düğmeleri: tek satır, ikon üstte */
  .cikti { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; width: 100%; }
  .cikti .btn { flex-direction: column; gap: 3px; min-height: 54px; padding: 6px 2px; font-size: .74rem; }
  .cikti .btn svg { width: 20px; height: 20px; }

  /* Pencereler: tam ekran sayfa gibi alttan kayar */
  .modal-bg { padding: 0; align-items: flex-end; overflow: hidden; }
  .modal, .modal.wide, .modal.xl { max-width: none; width: 100%; border-radius: 16px 16px 0 0; max-height: calc(100dvh - 12px - env(safe-area-inset-top));
    animation: sheet .26s cubic-bezier(.2, .8, .2, 1); }
  .modal.wide, .modal.xl { height: calc(100dvh - 12px - env(safe-area-inset-top)); }
  .modal::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 8px auto -4px; flex: none; }
  .modal-h { padding: 10px 12px 10px 16px; }
  .modal-h h2 { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .modal-b { padding: 14px 16px; flex: 1; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal-f { flex-wrap: wrap; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .modal-f .cikti { flex: 1 1 100%; order: -1; }
  .modal-f > .btn { flex: 1 1 0; min-height: 48px; }
  .modal-f > span:not(.cikti):empty { display: none; }
  .modal .grid.g2 { gap: 10px; }
  .modal .card-b { padding: 12px 14px; }
  .belge-modal .card + .card { margin-top: 10px; }

  /* Sekmeler: kaydırılabilir hap düğmeler */
  .tabs { border: 0; gap: 6px; margin: 0 -16px 14px; padding: 0 16px 2px; }
  .tabs a { border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; background: var(--surface); font-size: .88rem; }
  .tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }

  /* Listeler: kart yerine düz liste, dokununca geri bildirim */
  tr.click:active td { background: var(--surface-2); }
  .toolbar { gap: 8px; }
  .toolbar .seg { flex: 1 1 100%; }
  .kdv-sor .btn { min-height: 72px; }
}
@media (prefers-reduced-motion: reduce) { .modal, .modal.wide, .modal.xl { animation: none; } }
@keyframes sheet { from { transform: translateY(100%); } }
@media (max-width: 640px) { .modal-f > span:has(.cikti) { flex: 1 1 100%; order: -1; } }
@media (max-width: 640px) {
  .btn-row.aksiyonlar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .btn-row.aksiyonlar > .btn:last-child:nth-child(odd) { grid-column: auto; }
}
@media (max-width: 640px) {
  .sepet-satir { grid-template-columns: 104px minmax(92px, 1fr) minmax(64px, auto); grid-template-areas: "ad ad x" "st fy tt"; column-gap: 8px; }
  .sepet-satir [data-a="x"] { justify-self: end; }
  .sepet-satir .sp-fiyat { padding-left: 8px; padding-right: 8px; }
  .toolbar > span:has(.cikti) { flex: 1 1 100%; margin-left: 0 !important; }
}
@media (max-width: 640px) {
  .btn-row.aksiyonlar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .aksiyonlar .btn.green svg { background: linear-gradient(180deg, #2fb36a, #1d8f50); color: #fff; border: 0; box-shadow: 0 4px 12px rgba(29, 143, 80, .3); }
}
.tbl tbody tr.fazla { display: none !important; }
.daha-fazla { margin: 8px 0 4px; }
