/* Ortak kart / amblem sistemi: istatistik kartları, ödeme kutucukları, hesap kartları, POS ödeme düğmeleri. */
:root {
  --pay-cash: #12804a; --pay-bancontact: #005498; --pay-card: #4338ca; --pay-transfer: #475569; --pay-credit: #b45309;
  --pay-total: #1f5f8b;
}
@media (prefers-color-scheme: dark) {
  :root { --pay-cash: #2fa96a; --pay-bancontact: #2f7fd0; --pay-card: #7c74f0; --pay-transfer: #8796ab; --pay-credit: #e08a2e; --pay-total: #4b9cd6; }
}
.pay-cash, .acct-cash, .emb-cash { --c: var(--pay-cash); }
.pay-bancontact, .acct-bancontact, .emb-bancontact { --c: var(--pay-bancontact); }
.pay-card, .acct-tile.acct-card, .emb-card { --c: var(--pay-card); }
.pay-transfer, .acct-bank, .emb-transfer, .emb-bank { --c: var(--pay-transfer); }
.pay-credit, .emb-credit { --c: var(--pay-credit); }
.emb-total { --c: var(--pay-total); }

/* ---- Amblem: renkli yuvarlatılmış kare + simge ---- */
.emblem { width: 42px; height: 42px; flex: none; display: inline-grid; place-items: center; border-radius: 11px;
  background: var(--c, var(--primary)); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.emblem .icon { width: 24px; height: 24px; }
.emb-bancontact .icon { width: 30px; height: 30px; }
.emb-card { background: linear-gradient(135deg, #312e81, var(--pay-card)); }
.emb-card .icon { width: 30px; height: 30px; }
.emblem-sm { width: 30px; height: 30px; border-radius: 8px; }
.emblem-sm .icon { width: 18px; height: 18px; }
.emblem-sm.emb-bancontact .icon, .emblem-sm.emb-card .icon { width: 22px; height: 22px; }
.card-marks { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; vertical-align: middle; }
.card-marks .mark-visa { width: 30px; height: 11px; color: #1a1f71; }
.card-marks .mark-mc { width: 18px; height: 18px; }
@media (prefers-color-scheme: dark) { .card-marks .mark-visa { color: #c9ccff; } }

/* ---- İstatistik kartları ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.stat { display: flex; flex-direction: column; gap: var(--s1); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--s4); box-shadow: var(--shadow); color: var(--text); text-decoration: none; min-width: 0;
  transition: transform .12s, box-shadow .12s, border-color .12s; }
a.stat, a.stat:hover { color: var(--text); text-decoration: none; }
.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--t, var(--primary)); }
.stat-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.stat-top { display: flex; align-items: center; gap: var(--s2); }
.stat-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent); }
.stat-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: var(--s1); }
.stat-sub { color: var(--muted); font-size: .8rem; }
.tone-primary { --t: var(--primary); } .tone-ok { --t: var(--ok); } .tone-danger { --t: var(--danger); }
.tone-warn { --t: var(--warn); } .tone-info { --t: var(--info); } .tone-muted { --t: var(--muted); }

/* ---- Kart başlığı toplamı / alt not ---- */
.head-total { display: flex; gap: var(--s2); align-items: baseline; font-variant-numeric: tabular-nums; }
.head-total strong { font-size: 1.3rem; font-weight: 800; }
.card-foot { margin: var(--s3) 0 0; padding-top: var(--s3); border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

/* ---- Ödeme kutucukları ---- */
@media (min-width: 1400px) { .stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.pay-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: var(--s3); }
.pay-tile { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; min-width: 0; }
.pay-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.pt-body { min-width: 0; display: flex; flex-direction: column; }
.pt-name { font-size: .8rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.pt-amount { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.pt-count { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.pt-name { overflow: hidden; text-overflow: ellipsis; }
.pay-tile.is-zero .pt-amount { color: var(--muted); font-weight: 650; }
.pay-tile.is-zero .emblem { opacity: .45; filter: saturate(.5); }

/* ---- Hesap kartları ---- */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s3); }
.acct-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--s3); align-items: center;
  padding: var(--s3) var(--s4); border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface);
  font: inherit; color: var(--text); text-align: left; min-width: 0; }
.acct-tile .emblem { grid-row: span 2; }
button.acct-tile { cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
button.acct-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--c); }
.ac-name { font-size: .8rem; font-weight: 650; color: var(--muted); display: flex; flex-direction: column; }
.ac-name small { font-weight: 500; font-size: .72rem; }
.ac-bal { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ac-bal.neg { color: var(--danger); }
.acct-onhand { grid-column: 1 / -1; border: 2px solid var(--pay-total);
  background: linear-gradient(120deg, color-mix(in srgb, var(--pay-total) 12%, var(--surface)), var(--surface) 70%); }
.acct-onhand .ac-name { color: var(--pay-total); font-size: .85rem; }
.acct-onhand .ac-bal { font-size: 1.9rem; color: var(--text); }
@media (max-width: 860px) {
  .acct-onhand { grid-column: 1 / -1; }
  .stat-value { font-size: 1.3rem; }
  .pt-amount, .ac-bal { font-size: 1.2rem; }
  .acct-onhand .ac-bal { font-size: 1.5rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- POS ödeme düğmeleri: aynı amblemler ---- */
.pay-btn { padding: var(--s2) var(--s1); text-align: center; font-size: .85rem; line-height: 1.15; min-width: 0; gap: 6px !important; }
.pay-btn .emblem { width: 30px; height: 30px; border-radius: 8px; }
.pay-btn .emblem .icon { width: 18px; height: 18px; color: #fff; }
.pay-btn.pay-bancontact .emblem .icon, .pay-btn.pay-card .emblem .icon { width: 24px; height: 24px; }
.pay-btn .card-marks { display: none; }
.pay-btn.pay-cash, .pay-btn.pay-bancontact { flex-direction: row !important; justify-content: flex-start !important; gap: var(--s3) !important;
  padding: 0 var(--s3); text-align: left; }
.pay-btn.pay-cash .emblem, .pay-btn.pay-bancontact .emblem { width: 40px; height: 40px; border-radius: 10px; }
.pay-btn.pay-cash .emblem .icon { width: 24px; height: 24px; }
.pay-btn.pay-bancontact .emblem .icon { width: 30px; height: 30px; }
.pay-btn[aria-pressed=true] .emblem { background: rgba(255, 255, 255, .2); box-shadow: none; }

@media (max-width: 600px) {
  .pay-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .pay-tile { padding: var(--s2) var(--s3); gap: var(--s2); }
  .pay-tile .emblem { width: 32px; height: 32px; border-radius: 8px; }
  .pay-tile .emblem .icon { width: 18px; height: 18px; }
  .pay-tile.pay-bancontact .emblem .icon, .pay-tile.pay-card .emblem .icon { width: 22px; height: 22px; }
  .pt-amount { font-size: 1.05rem; }
  .pay-tile .card-marks .mark-visa { width: 24px; }
  .acct-grid { gap: var(--s2); }
  .acct-tile { grid-template-columns: auto 1fr auto; grid-template-rows: auto; padding: var(--s2) var(--s3); }
  .acct-tile .emblem { grid-row: auto; width: 32px; height: 32px; border-radius: 8px; }
  .acct-tile .emblem .icon { width: 18px; height: 18px; }
  .ac-bal { font-size: 1.05rem; }
  .acct-onhand .ac-bal { font-size: 1.35rem; }
  .head-total strong { font-size: 1.1rem; }
}

/* ---- Defter özeti ---- */
.emblem-xs { width: 22px; height: 22px; border-radius: 6px; box-shadow: none; }
.emblem-xs .icon { width: 14px; height: 14px; }
.emblem-xs.emb-bancontact .icon, .emblem-xs.emb-card .icon { width: 18px; height: 18px; }
.bar-label-emb, .acct-tag, .pay-tag { display: inline-flex; align-items: center; gap: var(--s2); }
.flow-item strong { white-space: nowrap; }
.pay-tag, .acct-tag { white-space: nowrap; }
.lines td, .lines th { padding-left: 6px; padding-right: 6px; }
.tbl.lines thead th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
.tbl.lines td:first-child { min-width: 110px; }
.qty-cell .cell-input { width: 58px; min-width: 52px; }
.qty-cell .btn-icon, .qty-cell .btn { min-width: 28px; padding: 0 4px; }
.lines .cell-input.w-xs { width: 52px; min-width: 48px; }
.lines td:last-child .btn { padding: 0 6px; min-width: 32px; }
@media (max-width: 600px) {
  .tbl.lines thead { display: none; }
  .tbl.lines, .tbl.lines tbody { display: block; }
  .tbl.lines tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
  .tbl.lines td { border: 0; padding: 0 4px; }
  .tbl.lines td:first-child { flex: 1 1 calc(100% - 60px); min-width: 0; }
  .tbl.lines td:last-child { order: -1; margin-left: auto; }
  .tbl.lines td:first-child { order: -2; }
  .tbl.lines td.num:nth-last-child(2) { margin-left: auto; font-weight: 700; }
}
@media (max-width: 600px) {
  .tbl.lines td[data-label]::before { content: attr(data-label); display: block; font-size: .68rem; color: var(--muted); text-align: left; }
  .tbl.lines td:last-child { order: 0; margin-left: 0; }
  .tbl.lines td:first-child { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .flow-item { padding: var(--s2) var(--s3); }
  .flow-item strong { font-size: 1.05rem; }
}
