/* Genel görünüm: Roboto yazı tipi, açık gri zemin, camgöbeği vurgular, mavi düğmeler. Yazılar 15 px, alan adları 13 px kalın
   (Dr. Doğanay'ın isteği, 13.11.2026: tarayıcıyı büyütmeden okunsun). Ekranlara özgü parçalar ekranlar.css'te. */
:root {
  --bg: #f2f4f7; --panel: #fff; --ink: #212529; --muted: #6c757d; --line: #dee2e6; --line2: #e9ecef;
  --brand: #1d3557; --brand-dark: #142640;
  --accent: #2f7ea8; --accent-dark: #25688c; --accent-ink: #fff; --primary: #1d3557; --link: #25688c; --danger: #dc3545; --today: #e3f0f7;
  --label: #3d4650; --field-label: #3d4650; --field-line: #c3cad1; --radius: 4px;
  color-scheme: light;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.25rem; font-weight: 500; margin: 0; }
h2 { font-size: 1.1rem; font-weight: 500; margin: 0; }
h3 { font-weight: 500; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0 4px; }
.me { display: flex; gap: 12px; align-items: center; font-size: .85rem; white-space: nowrap; }
.me .email { color: var(--muted); }
.me:empty { display: none; }

main { padding: 15px; }

/* Düğmeler: Bootstrap */
button, .btn { font: inherit; font-size: 15px; line-height: 1.5; padding: 6px 12px; border: 1px solid #ced4da; background: #fff; color: var(--ink); border-radius: var(--radius); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
button:hover, .btn:hover { background: #f8f9fa; text-decoration: none; }
button:disabled { opacity: .65; cursor: default; }
button.on, .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary, button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.primary:hover, button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.danger { color: var(--danger); border-color: #f5c6cb; }
button.danger.fill, .btn.danger.fill { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon { border: 0; background: none; font-size: 1.1rem; padding: 4px 8px; }
.icon:hover { background: rgba(0,0,0,.05); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.toolbar .group { display: flex; gap: 4px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; max-width: 420px; }
.cal-title { flex: 1; text-align: center; min-width: 200px; font-weight: 400; font-size: 1.4rem; margin: 0; }

input, select, textarea { font: inherit; font-size: 15px; padding: 6px 10px; border: 1px solid #ced4da; border-radius: var(--radius); background: #fff; color: #495057; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #80bdff; box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; }

.cancel { opacity: .55; }
.cancel .cc-chip span { text-decoration: line-through; }
.badge { font-size: .65rem; background: var(--c); color: #fff; border-radius: 3px; padding: 0 4px; margin-left: 4px; font-weight: 600; text-decoration: none; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #dc3545; z-index: 1; pointer-events: none; }

/* Tablolar: beyaz zemin, açık gri başlık, satır çizgileri */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th, .list td { padding: 8px 12px; border-bottom: 1px solid var(--line2); text-align: left; white-space: nowrap; vertical-align: middle; }
.list th { font-weight: 600; color: #495057; background: #f8f9fa; border-bottom: 1px solid var(--line); }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: #f5f5f5; }
.list td.wrap { white-space: normal; min-width: 180px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 75%, #000); font-weight: 600; }

/* Kişi simgesi: Calypso'daki yuvarlak fotoğraf çerçevesi (fotoğraf yerine baş harfler) */
.avatar { --c: #6c757d; display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #fff; color: var(--c); font-weight: 500; font-size: 1rem; flex: none; border: 1px solid #eee; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar.xs { width: 22px; height: 22px; font-size: .62rem; box-shadow: none; }
.avatar.lg { width: 70px; height: 70px; font-size: 1.25rem; }
.avatar.xl { width: 110px; height: 110px; font-size: 2rem; }

/* Sekmeler: 15 px; seçili sekme kalın, altı renkli */
.tabs { display: flex; align-items: flex-end; gap: 0; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; min-height: 48px; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; text-decoration: none; color: #4a5560; font-size: 15px; border: 1px solid transparent; border-bottom: 0; border-radius: 5px 5px 0 0; background: none; white-space: nowrap; font-weight: 500; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: rgba(0,0,0,.87); background: rgba(0,0,0,.03); }
.tabs a.on, .tabs button.on { color: #0b7285; font-weight: 600; background: #fff; border-color: var(--line); box-shadow: inset 0 -3px 0 var(--accent); }
.tabs .mi { font-size: 21px; }
#tab { padding: 16px; }
.back { display: inline-block; margin-bottom: 8px; }
/* Kasa / banka hesabı ve depo kartı: beyaz kutu, üstte başlık */
.pcard { background: var(--panel); border-radius: var(--radius); box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2); }
.phead { display: flex; align-items: center; gap: 14px; padding: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.phead p { margin: 2px 0 0; }

/* Formlar (muhasebe ekranları): alanın adı üstte, 13 px kalın */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form.cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; color: var(--field-label); }
.form label input, .form label select, .form label textarea { font-weight: 400; }
.form .wide { grid-column: 1 / -1; }
.form h3.section { font-size: 1rem; font-weight: 400; margin: 10px 0 0; padding: 8px 12px; background: #f8f9fa; border: 1px solid var(--line); border-radius: var(--radius); }
.form h3.section:first-child { margin-top: 0; }
.form fieldset { border: 1px solid rgba(0,0,0,.12); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 12px; }
.form legend { font-size: 13px; font-weight: 600; color: var(--field-label); padding: 0 4px; }
.form label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; font-weight: 400; }
.form label.check input { width: auto; }
.form .calc { align-self: end; font-size: .85rem; color: var(--muted); padding-bottom: 8px; }
.actions { display: flex; gap: 8px; align-items: center; }
.err { color: var(--danger); margin: 0; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.timeline button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border-left: 4px solid var(--c); padding: 10px 12px; }

/* Pencereler: Calypso'daki camgöbeği başlıklı pencere */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, calc(100vw / var(--z, 1) - 32px)); max-height: calc(100vh / var(--z, 1) - 32px); box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), 0 24px 38px 3px rgba(0,0,0,.14), 0 9px 46px 8px rgba(0,0,0,.12); }
dialog::backdrop { background: rgba(0, 0, 0, .32); }
dialog .form { padding: 0 20px 20px; }
.dlg-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 -20px 4px; padding: 14px 20px; position: sticky; top: 0; z-index: 3; background: var(--brand); color: #fff; }
.dlg-head h2 { font-size: 1.05rem; font-weight: 500; }
.dlg-head small, .dlg-head .muted { color: rgba(255,255,255,.85); }
.dlg-head .icon, .dlg-head button { color: #fff; border: 0; background: none; }
.dlg-head .icon:hover { background: rgba(255,255,255,.15); }

@media (max-width: 640px) {
  main { padding: 10px; }
  .me .email { display: none; }
  .form { grid-template-columns: 1fr; }
  .cal-title { order: -1; flex-basis: 100%; font-size: 1.15rem; }
  .tabs a, .tabs button { padding: 0 14px; }
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; font-variant-numeric: slashed-zero; }
.tab-soon { padding: 9px 14px; color: #b0b5bb; white-space: nowrap; cursor: default; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.form input[type=color] { height: 38px; padding: 3px; }

/* ---------- Raporlar: Cari Hareket Raporu */
.small { font-size: .78rem; }
.print-only { display: none; }
.rep { display: flex; flex-direction: column; gap: 10px; }
.rep-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--accent); color: #fff; border-radius: var(--radius); padding: 6px 8px 6px 16px; }
.rep-head h1 { font-size: 1.2rem; flex: 1; min-width: 200px; }
.rep-tools { display: flex; align-items: stretch; gap: 2px; background: #fff; border-radius: 6px; padding: 2px; flex-wrap: wrap; }
.rep-tools .sep { width: 1px; background: var(--line); margin: 4px 3px; }
.tool { flex-direction: column; gap: 2px; border: 0; background: none; padding: 4px 8px; font-size: .72rem; color: var(--ink); min-width: 64px; }
.tool svg { color: var(--accent); }
.tool:hover { background: #e3f2fd; }
.tool[disabled] { opacity: .4; cursor: default; }
.sc-wrap { position: relative; display: flex; }
.menu { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 8px; width: 280px; display: flex; flex-direction: column; gap: 4px; }
.menu .sc-item { display: flex; gap: 4px; }
.menu .sc-item button:first-child { flex: 1; justify-content: flex-start; }
.menu .x { padding: 4px 10px; }
.menu p { margin: 4px 2px 0; }

.rep-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; align-items: start; }
.rep-filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 60px; max-height: calc(100vh / var(--z, 1) - 72px); overflow: auto; }
.ftabs { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.ftabs div { display: flex; }
.ftabs button { flex: 1; border: 0; border-radius: 0; background: none; padding: 5px 4px; font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; justify-content: center; }
.ftabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.fpane { display: flex; flex-direction: column; gap: 6px; }
.fpane h4 { margin: 6px 0 0; font-size: .85rem; }
.fpane p { margin: 2px 0; }
.frow { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 8px; }
.frow > span:first-child { text-align: right; font-weight: 600; font-size: .82rem; }
.frow input, .frow select, .pair input { width: 100%; padding: 4px 6px; font: inherit; font-size: .85rem; border: 1px solid #c9ced4; border-radius: 4px; background: #fff; min-width: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.fpane fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.fpane legend { font-size: .82rem; font-weight: 600; padding: 0 4px; }
.fpane .konum label, .fpane label.check { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.fpane .types label.check { flex-basis: 100%; }
.fbtns { display: flex; gap: 6px; }
.fbtns button { flex: 1; justify-content: center; }
.opts { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: .85rem; }
.opts label.check { display: flex; gap: 6px; align-items: center; }

.rep-main { display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; gap: 6px; }
.gtabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); }
.gtabs > span.on, .gtabs button { border: 0; border-radius: 6px 6px 0 0; background: none; padding: 5px 12px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.gtabs > span.on, .gtabs button.on { background: #e3f2fd; color: var(--ink); }
.gtabs #rinfo { padding: 0 6px; }
.gbox { overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.g-sum { max-height: 190px; }
.g-mov { height: max(260px, calc(100vh / var(--z, 1) - 470px)); }
table.gt { border-collapse: collapse; font-size: .8rem; width: max-content; min-width: 100%; }
.gt th, .gt td { padding: 4px 8px; border-right: 1px solid #edf0f2; border-bottom: 1px solid #edf0f2; white-space: nowrap; text-align: left; }
.gt th { position: sticky; top: 0; background: #f3f5f7; font-weight: 700; cursor: pointer; user-select: none; z-index: 1; }
.gt th.h-kpb { color: #1d4ed8; }
.gt th.h-dv, .gt th.h-acc { color: #8a7a00; }
.gt tbody tr:nth-child(even) { background: #fafbfc; }
.gt tbody tr[data-id], .gt tbody tr[data-cari] { cursor: pointer; }
.gt tbody tr:hover { background: #f5f5f5; }
.gt tbody tr.sel { background: #d1ecf1; }
.gt tr.devir td { font-style: italic; color: var(--muted); }
.gt tr.tot td { font-weight: 700; background: #f3f5f7; }
.gt tr.var td { color: var(--muted); font-size: .76rem; }
.gt tr.var td:nth-child(2) { padding-left: 18px; }
.gt td.empty { text-align: center; padding: 16px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .9rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

@media (max-width: 900px) {
  .rep-body { grid-template-columns: 1fr; }
  .rep-filters { position: static; max-height: none; }
  .g-mov { height: 420px; }
}
@media print {
  header.top, .rep-filters, .rep-tools, #btabs button:not(.on), #unsel { display: none !important; }
  .rep-body { display: block; }
  .rep-head { background: none; color: #000; padding: 0; }
  .print-only { display: block; }
  .gbox { overflow: visible; height: auto !important; max-height: none !important; border: 0; }
  table.gt { width: 100%; font-size: 9pt; }
  .gt th { position: static; }
  main { padding: 0; max-width: none; }
}

/* ---------- Hasta merkezli muhasebe: bakiye, ödeme, makbuz */
.bals { margin: 6px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.bals a { display: contents; text-decoration: none; }
.bal { font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #eef2f5; color: var(--muted); }
.bal.debt { background: #fef2f2; color: #b91c1c; }
.bal.credit { background: #ecfdf5; color: #047857; }
.debt-t { color: #b91c1c; }
.credit-t { color: #047857; }
.pay-who { margin: 0; line-height: 1.9; }
.pay-who .bal { margin-right: 4px; }
.acct-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.acct-sum { flex: 0 1 560px; }
.list tr.void td { color: var(--muted); text-decoration: line-through; }
.list tr.void td .tag { text-decoration: none; }
.list tr[data-kind] { cursor: pointer; }
.list td.wrap { white-space: normal; min-width: 180px; }
.receipt { border: 1px dashed #c9ced4; border-radius: 8px; padding: 16px 20px; position: relative; }
.receipt h3 { margin: 4px 0 8px; font-size: 1.05rem; }
.receipt .amount { font-size: 1.6rem; font-weight: 700; margin: 0 0 10px; }
.receipt .demo-mark { margin: 0; font-size: .72rem; letter-spacing: .08em; color: #b45309; font-weight: 700; }
.receipt .void { margin: 0 0 10px; color: #b91c1c; font-weight: 700; letter-spacing: .05em; }
.receipt.cancelled .amount { text-decoration: line-through; color: var(--muted); }
.receipt .sign { display: flex; justify-content: space-between; margin-top: 40px; font-size: .85rem; color: var(--muted); }
.receipt .sign span { border-top: 1px solid #9aa1a9; padding-top: 4px; width: 40%; text-align: center; }
@media print {
  body.print-receipt > *:not(dialog) { display: none !important; }
  body.print-receipt dialog { position: static; box-shadow: none; width: auto; max-height: none; overflow: visible; }
  body.print-receipt dialog::backdrop { background: none; }
  body.print-receipt .no-print { display: none !important; }
  body.print-receipt .receipt { border: 0; }
}

/* ---------- Kasa ve banka, günlük kasa raporu */
.toolbar .group.wrap { flex-wrap: wrap; }
.phead .group.wrap { display: flex; gap: 4px; flex-wrap: wrap; }
.cash-tot { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.cash-tot .ct { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; display: flex; flex-direction: column; min-width: 150px; }
.cash-tot b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.cash-h { margin: 16px 0 8px; font-size: 1rem; }
.cash-foot { margin: 16px 0 8px; flex-wrap: wrap; }
.cash-foot label.check { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.cash-foot label.check input { width: auto; }
.list tr.passive td { color: var(--muted); }
.rep-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.dk-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
.dk-bar input[type=date] { width: auto; }
.dk-bar .group { display: flex; gap: 2px; flex-wrap: wrap; margin-left: 8px; }
.dk-bar label.check { display: flex; align-items: center; gap: 6px; font-size: .85rem; margin-left: 8px; }
.dk-bar label.check input { width: auto; }
.g-dk { max-height: calc(100vh / var(--z, 1) - 420px); min-height: 200px; }
.gt td.in { color: #047857; }
.gt td.out { color: #b91c1c; }
@media print {
  .no-print, .rep-nav { display: none !important; }
  .g-dk { max-height: none; }
}

/* ---------- Teklif, taksit planı, vade raporları */
.bal.late { background: #b91c1c; color: #fff; }
h3.sub { font-size: 1rem; margin: 20px 0 8px; }
.plan-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 8px 10px; margin-bottom: 10px; }
.plan-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; font-size: .9rem; }
.plan-head .link { padding: 0; font-weight: 600; }
.items-t { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.items-t th { text-align: left; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 2px 4px; }
.items-t th.num { text-align: right; }
.items-t td { padding: 3px 4px; vertical-align: middle; }
.items-t td:first-child { width: auto; }
.items-t td input { width: 100%; }
.items-t td:last-child { width: 32px; }
#plan-form .items-t td:first-child { width: 48px; color: var(--muted); }
#offer-form .items-t td:nth-child(2) { width: 32%; }
.form .calc.bad { color: #b91c1c; font-weight: 600; }
.doc-t { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: .9rem; }
.doc-t th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 4px 6px; }
.doc-t td { border-bottom: 1px solid #eef0f2; padding: 5px 6px; }
.doc-t .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-t tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.offer-doc h4 { margin: 14px 0 0; font-size: .9rem; }
.print-doc { display: none; }
@media print {
  body.print-receipt #offer-form > :not(.print-doc) { display: none !important; }
  body.print-receipt #offer-form .print-doc { display: block; }
  body.print-receipt .offer-doc { border: 0; }
}
dialog .actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  .items-t td input[type=number], .items-t td input[type=date] { min-width: 0; }
  .plan-head { font-size: .85rem; }
  .receipt.offer-doc { padding: 12px 10px; }
  .doc-t { font-size: .8rem; }
  .doc-t th, .doc-t td { padding: 4px 3px; }
  .doc-t .tag { font-size: .68rem; padding: 1px 5px; }
}

/* ---------- Komisyon ve prim (hak ediş) */
.bal.wait { background: #fef3c7; color: #92400e; }
.bal.plan { background: #eff6ff; color: #1d4ed8; }
.wait-t { color: #b45309; }
.gt input.amt { width: 110px; text-align: right; padding: 2px 6px; font: inherit; }
.gt td input[type=checkbox], .gt th input[type=checkbox] { width: auto; margin: 0; }
.dk-bar input[type=month] { width: auto; }
@media print { .gt input.amt { border: 0; background: none; } }
.gtabs label.check { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin-right: 8px; }
.gtabs label.check input { width: auto; padding: 2px 6px; }
.dk-bar select { width: auto; }

/* ---------- Stok */
dialog.wide { width: min(1000px, calc(100vw / var(--z, 1) - 32px)); }
a.ct { text-decoration: none; color: inherit; }
a.ct:hover { border-color: #c9ced4; }
.warn-box { background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--radius); padding: 8px 12px 12px; margin: 10px 0; }
.warn-box p { margin: 4px 0 8px; }
.warn-box .list td { white-space: normal; }
#tab .toolbar select, .toolbar select { width: auto; }
.toolbar label.check { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.toolbar label.check input { width: auto; }
.stock-lines td select { min-width: 180px; }
.stock-lines td input[type=number] { width: 100px; }
.stock-lines td input[type=date] { width: 150px; }
.stock-lines td[data-amt], .stock-lines td[data-have] { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Çeşit seçimi (fiyat listesinde birden çok satırı olan malzeme): malzemenin altında */
.items-t td select.var-sel { display: block; width: 100%; margin-top: 4px; font-size: .85rem; color: var(--muted); }
.count-box .var-n { color: var(--muted); }
.sub-h { font-size: .95rem; margin: 14px 0 6px; }
.var-t { margin-bottom: 4px; }
.count-box { max-height: calc(52vh / var(--z, 1)); overflow: auto; }
.count-box input { width: 110px; }
.form label small { color: var(--muted); font-size: .75rem; }
@media (max-width: 640px) {
  .stock-lines td select { min-width: 130px; }
  .stock-lines td input[type=number] { width: 72px; }
  .stock-lines td input[type=date] { width: 128px; }
  .plan-box:has(.stock-lines), .count-box { overflow-x: auto; }
}
.count-box thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.warn-box p:last-child { margin-bottom: 4px; }
.stock-lines td:first-child { width: 60%; }

/* ---------- Merkez Bankası kuru (kur.js): kur kutusu, yenile düğmesi ve kaynağı */
.kur-in { display: flex; gap: 6px; }
.kur-in input { flex: 1; min-width: 0; }
.kur-ref { flex: none; padding: 4px 10px; font-size: 1rem; line-height: 1; }
.form label small.kur-note:empty { display: none; }
.form label small.kur-note.warn { color: #b45309; }
button.mini { margin-left: 6px; padding: 1px 8px; font-size: .75rem; vertical-align: 1px; }

/* ---------- Kasa / banka: hareketler ve hesap ekstresi */
.cash-tabs { margin: 12px 0; padding: 0; }
.mv-bar, .ek-bar { gap: 8px 10px; align-items: flex-end; }
.mv-bar label, .ek-bar label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.mv-bar label.check { flex-direction: row; align-items: center; gap: 6px; font-size: .85rem; padding-bottom: 8px; }
.mv-bar label.grow { flex: 1; min-width: 180px; }
.mv-bar select, .mv-bar input[type=date], .ek-bar input[type=date] { width: auto; }
.mv-list td.legs div { white-space: nowrap; }
.list tr.sum td { background: #f3f4f6; font-weight: 600; }
.list tr.sum:hover td { cursor: default; }
@media print {
  .pcard .phead .bals { margin-bottom: 0; }
}

/* ---------- Gider belgeleri ve ödenecekler (bills.js) */
.bill-lines td input:not([type=number]) { min-width: 140px; }
.bill-lines td input, .bill-lines td select, .bill-tools { font-size: .88rem; }
.bill-lines td input, .bill-lines td select { padding: 5px 7px; }
.bill-lines td select[data-f=kdv] { min-width: 72px; }
.bill-lines td:first-child { width: auto; }
.bill-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.bill-tools label.check { display: flex; align-items: center; gap: 6px; }
.bill-tools label.check input { width: auto; }
.bill-sum .sum-t { width: auto; min-width: 320px; margin-left: auto; }
.bill-sum .sum-t td { padding: 4px 10px; }
.receipt .bill-doc td, .receipt .bill-doc th { font-size: .85rem; }
.pay-sum { margin-bottom: 12px; }
.pay-list td .mini { white-space: nowrap; }
@media (max-width: 640px) {
  .bill-lines td input:not([type=number]) { min-width: 110px; }
  .bill-sum .sum-t { min-width: 0; width: 100%; }
}

/* ---------- Hasta kârlılığı (report-karlilik.js) */
.late-t { color: var(--danger); }
.profit-list tbody tr[data-i] { cursor: pointer; }
.profit-list tr.info td { color: var(--muted); }
.profit-list tr.tot td { font-weight: 700; background: #f3f5f7; }
.profit-list td.out { color: var(--danger); }

/* Para giriş / çıkış / transfer (tek ekran): tür seçimi ve kaynak / hedef kutuları */
dialog:has(.money-op) { width: min(780px, calc(100vw / var(--z, 1) - 32px)); }
.op-bar { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.op-bar > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.op-bar span { font-size: .75rem; color: var(--muted); width: 84px; }
.op-bar button { font-size: .82rem; padding: 5px 10px; }
.form .side-box { flex-direction: column; flex-wrap: nowrap; gap: 8px; margin: 0; min-width: 0; }
.form .side-box.wide { flex-direction: row; }
.form .side-box.wide label { flex: 1; min-width: 0; }
/* Kaynak / hedef kutusu: kasa ya da banka > banka hesabı > POS / kredi kartı, sonra para birimi */
.form .side-box .side-chain { display: contents; }
/* Hesap kartı: banka adı ve alt hesap no / bağlı banka hesabı yan yana; para birimleri ve açılış bakiyeleri */
.acc-form .acc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.acc-form .acc-curs { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 10px; }
.acc-form .acc-curs legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.acc-form .acc-curlist { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 8px; }
.acc-form .acc-opens { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.acc-list tr.acc-more td { border-top: 1px solid #f1f3f5; }
.acc-list td[rowspan] { vertical-align: top; }
.acc-curtabs { margin: 10px 0 0; }
@media (max-width: 640px) {
  .op-bar span { width: 100%; }
  .form .side-box.wide { flex-direction: column; }
  .acc-form .acc-row { grid-template-columns: minmax(0, 1fr); }
}
