/* ==========================================================================
   Nefes Finans ERP — Tasarım sistemi
   Harici kütüphane yok. Token tabanlı, açık/koyu tema, erişilebilir kontrast.
   ========================================================================== */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --brand-900: #062f33; --brand-800: #0a434a; --brand-700: #0d5c63; --brand-600: #0f766e;
  --brand-500: #14918a; --brand-300: #5eead4; --brand-100: #ccfbf1; --brand-50: #f0fdfa;

  --bg: #f4f6f8; --surface: #ffffff; --surface-2: #f8fafb; --surface-3: #eef2f4;
  --border: #e3e8ec; --border-strong: #cfd7dd;
  --text: #0f1b24; --text-2: #46566a; --text-3: #6f7f92;
  --primary: var(--brand-700); --primary-hover: var(--brand-800); --primary-soft: var(--brand-50); --on-primary: #fff;
  --positive: #0f8a5f; --positive-soft: #e7f6ef;
  --negative: #c2362f; --negative-soft: #fdecea;
  --warning: #b26a00; --warning-soft: #fff4e0;
  --info: #2459c7; --info-soft: #e9f0ff;

  --chart-1: #0d5c63; --chart-2: #e0913a; --chart-3: #4a7fd6; --chart-4: #9b5cc4; --chart-5: #3aa17e; --chart-6: #c9576a;
  --sidebar-bg: #082a2f; --sidebar-text: #b9d1d3; --sidebar-active: #ffffff; --sidebar-hover: rgba(255,255,255,.06);

  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15,27,36,.06);
  --shadow: 0 1px 2px rgba(15,27,36,.05), 0 4px 16px rgba(15,27,36,.06);
  --shadow-lg: 0 12px 40px rgba(15,27,36,.18);
  --ring: 0 0 0 3px rgba(20,145,138,.28);
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1418; --surface: #111d22; --surface-2: #14232a; --surface-3: #1a2c33;
    --border: #22363e; --border-strong: #2e4650;
    --text: #e7eef1; --text-2: #a9bac2; --text-3: #7f939c;
    --primary: #17a398; --primary-hover: #1bb8ab; --primary-soft: rgba(23,163,152,.12); --on-primary: #04211f;
    --positive: #3ccf91; --positive-soft: rgba(60,207,145,.12);
    --negative: #ff7a70; --negative-soft: rgba(255,122,112,.12);
    --warning: #f5b453; --warning-soft: rgba(245,180,83,.12);
    --info: #7fa8ff; --info-soft: rgba(127,168,255,.12);
    --chart-1: #2dd4bf; --chart-2: #f5a65b; --chart-3: #7fa8ff; --chart-4: #c492e8; --chart-5: #5fd3a5; --chart-6: #f08a9b;
    --sidebar-bg: #071215;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1418; --surface: #111d22; --surface-2: #14232a; --surface-3: #1a2c33;
  --border: #22363e; --border-strong: #2e4650;
  --text: #e7eef1; --text-2: #a9bac2; --text-3: #7f939c;
  --primary: #17a398; --primary-hover: #1bb8ab; --primary-soft: rgba(23,163,152,.12); --on-primary: #04211f;
  --positive: #3ccf91; --positive-soft: rgba(60,207,145,.12);
  --negative: #ff7a70; --negative-soft: rgba(255,122,112,.12);
  --warning: #f5b453; --warning-soft: rgba(245,180,83,.12);
  --info: #7fa8ff; --info-soft: rgba(127,168,255,.12);
  --chart-1: #2dd4bf; --chart-2: #f5a65b; --chart-3: #7fa8ff; --chart-4: #c492e8; --chart-5: #5fd3a5; --chart-6: #f08a9b;
  --sidebar-bg: #071215;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.pos { color: var(--positive); } .neg { color: var(--negative); }
.right { text-align: right; } .center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-size: 17px; color: #fff; letter-spacing: -.02em; }
.logo b { font-weight: 700; color: var(--brand-300); margin-left: 2px; }
.logo__mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-700) url("/favicon.svg") center/cover; flex: none; }
.logo--lg { font-size: 22px; } .logo--lg .logo__mark { width: 38px; height: 38px; border-radius: 10px; }

/* ---------- Giriş ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login__brand {
  background: radial-gradient(1200px 600px at 10% 10%, #0f6b6f 0%, transparent 60%),
              radial-gradient(800px 500px at 90% 90%, #0a3d5c 0%, transparent 60%), var(--brand-900);
  color: #d5e8ea; display: flex; align-items: center; padding: 64px;
}
.login__brand-inner { max-width: 520px; }
.login__brand h1 { font-size: 38px; color: #fff; margin: 48px 0 16px; letter-spacing: -.03em; font-weight: 650; }
.login__brand p { font-size: 16px; opacity: .85; }
.login__features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; }
.login__features li { padding-left: 28px; position: relative; }
.login__features li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-300) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23062f33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.login__form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--surface); }
.login__form { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login__form h2 { font-size: 24px; }
.form-error { color: var(--negative); min-height: 20px; margin: 0; font-size: 13px; }

/* ---------- Kabuk ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar__head { padding: 20px 20px 16px; }
.sidebar__foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav__group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f8f93; padding: 16px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-weight: 500; text-decoration: none; transition: background .12s, color .12s; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a[aria-current="page"] { background: rgba(94,234,212,.12); color: var(--sidebar-active); box-shadow: inset 2px 0 0 var(--brand-300); }
.nav a[aria-current="page"] svg { color: var(--brand-300); opacity: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: #fff; }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-600); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.user-chip small { display: block; color: #8fb0b4; font-size: 11.5px; text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 32px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar__title { flex: 1; min-width: 0; }
.topbar__title h1 { font-size: 19px; font-weight: 650; }
.topbar__title p { margin: 2px 0 0; font-size: 12.5px; }
.topbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view { padding: 28px 32px 48px; outline: none; max-width: 1480px; width: 100%; }
.only-mobile { display: none; }

/* ---------- Butonlar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--danger { color: var(--negative); }
.btn--danger:hover { background: var(--negative-soft); border-color: var(--negative); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--block { width: 100%; height: 42px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.field small { font-weight: 400; color: var(--text-3); }
.field .err { color: var(--negative); font-weight: 500; font-size: 12px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  height: 38px; padding: 0 12px; width: 100%; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--negative); }
input.num { text-align: right; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.search { position: relative; }
.search input { padding-left: 36px; min-width: 260px; }
.search svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--text-3); }
.seg { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 550; color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Kartlar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card__head h3 { font-size: 15px; font-weight: 650; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 20px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 550; font-size: 13px; }
.kpi__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi__icon svg { width: 16px; height: 16px; }
.kpi__value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.kpi__meta { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; padding: 1px 6px; border-radius: 999px; font-size: 12px; }
.delta--up { color: var(--positive); background: var(--positive-soft); }
.delta--down { color: var(--negative); background: var(--negative-soft); }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; white-space: nowrap; user-select: none; }
.table th[data-sort] { cursor: pointer; }
.table th[data-sort]:hover { color: var(--text); }
.table th[aria-sort="ascending"]::after { content: " ↑"; }
.table th[aria-sort="descending"]::after { content: " ↓"; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 2px solid var(--border-strong); border-bottom: 0; }
.table .right, .table th.right { text-align: right; }
.table tr.indent td:first-child { padding-left: 32px; }
.table tr.section td { background: var(--surface-3); font-weight: 650; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-3); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok { color: var(--positive); background: var(--positive-soft); }
.badge--warn { color: var(--warning); background: var(--warning-soft); }
.badge--bad { color: var(--negative); background: var(--negative-soft); }
.badge--info { color: var(--info); background: var(--info-soft); }
.badge--muted { color: var(--text-3); background: var(--surface-3); }

.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.skeleton { height: 96px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Listeler ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.dot svg { width: 16px; height: 16px; }
.dot--in { background: var(--positive-soft); color: var(--positive); }
.dot--out { background: var(--negative-soft); color: var(--negative); }
.dot--neutral { background: var(--info-soft); color: var(--info); }

.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 20px; }
.bar-row .track { grid-column: span 2; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* ---------- Grafikler ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .axis { stroke: var(--border-strong); }
.chart rect.bar { transition: opacity .15s; }
.chart rect.bar:hover, .chart path.slice:hover { opacity: .8; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip { position: fixed; pointer-events: none; background: var(--text); color: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow-lg); z-index: 100; white-space: nowrap; }
.donut-wrap { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; }
.donut-legend { display: grid; gap: 8px; font-size: 13px; }
.donut-legend div { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6,20,24,.48); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 24px; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
.modal--wide { max-width: 1040px; }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: 17px; }
.modal__body { padding: 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Bildirimler ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 60; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--positive); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 280px; max-width: 420px; animation: pop .2s; }
.toast--error { border-left-color: var(--negative); }
.toast strong { display: block; margin-bottom: 2px; }

/* ---------- Fatura editörü ---------- */
.lines-table input, .lines-table select { height: 34px; }
.lines-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); }
.lines-table th { padding: 8px 6px; font-size: 11.5px; color: var(--text-3); text-transform: uppercase; text-align: left; letter-spacing: .04em; }
.totals { margin-left: auto; width: 320px; display: grid; gap: 6px; margin-top: 16px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--border-strong); }

/* ---------- Belge (fatura görüntüleme / yazdırma) ---------- */
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; max-width: 920px; }
.doc__head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid var(--text); }
.doc__head .logo { color: var(--text); }
.doc__meta { display: grid; grid-template-columns: auto auto; gap: 4px 16px; font-size: 13px; text-align: right; }
.doc__meta dt { color: var(--text-3); } .doc__meta dd { margin: 0; font-weight: 600; }
.doc__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.doc__parties h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }

.callout { padding: 14px 16px; border-radius: 10px; background: var(--info-soft); color: var(--text); border: 1px solid transparent; font-size: 13.5px; }
.callout--ok { background: var(--positive-soft); } .callout--bad { background: var(--negative-soft); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { padding: 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.stat span { font-size: 12.5px; color: var(--text-3); font-weight: 550; }
.stat b { display: block; font-size: 20px; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Duyarlı yerleşim ---------- */
@media (max-width: 1200px) {
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__brand { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .only-mobile { display: grid; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; }
  .topbar__actions { order: 5; width: 100%; }
  .view { padding: 20px 16px 40px; }
  .grid--halves, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .search input { min-width: 0; width: 100%; }
  .toolbar > * { flex: 1 1 auto; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .doc { padding: 20px; } .doc__head, .doc__parties { grid-template-columns: 1fr; flex-direction: column; }
  .totals { width: 100%; }
}
@media (max-width: 560px) {
  .grid--kpi { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Yazdırma ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; } .view { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; }
}
.mt { margin-top: 18px; }
.track-stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); margin-bottom: 14px; gap: 2px; }
.seg-fill { height: 100%; }
.kpi[aria-current="true"] { border-color: var(--primary); box-shadow: var(--ring); }
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--border-strong); }

/* --- Görsel QA düzeltmeleri --- */
.icon-btn.only-mobile { display: none; }
.card__head { flex-wrap: wrap; }
.lines-table { min-width: 1040px; border-collapse: collapse; }
.lines-table td:nth-child(1) { min-width: 240px; }
.lines-table td:nth-child(2), .lines-table td:nth-child(5) { width: 84px; }
.lines-table td:nth-child(3) { width: 104px; }
.lines-table td:nth-child(4) { width: 130px; }
.lines-table td:nth-child(6) { width: 88px; }
.lines-table td:nth-child(7) { width: 220px; }
.lines-table td:nth-child(8) { width: 120px; }
.lines-table select { padding: 0 8px; }
.chart text.center { font-size: 13px; font-weight: 650; fill: var(--text); }
@media (max-width: 900px) {
  .icon-btn.only-mobile { display: grid; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .kpi__value { font-size: 23px; }
}
.stack, .grid { grid-template-columns: minmax(0, 1fr); }
.grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1200px) { .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .grid--halves { grid-template-columns: minmax(0, 1fr); } .toolbar input, .toolbar select { min-width: 0; } }
@media (max-width: 560px) { .grid--kpi { grid-template-columns: minmax(0, 1fr); } }
.kpi__meta.mono { overflow-wrap: anywhere; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: none; }

/* ---------- Ürünlü satır editörü ---------- */
.lines-table--product { min-width: 1240px; }
.lines-table--product td:nth-child(1) { width: 210px; min-width: 210px; }
.lines-table--product td:nth-child(2) { min-width: 220px; }
.lines-table--product td:nth-child(3), .lines-table--product td:nth-child(6) { width: 84px; }
.lines-table--product td:nth-child(4) { width: 100px; }
.lines-table--product td:nth-child(5) { width: 124px; }
.lines-table--product td:nth-child(7) { width: 84px; }
.lines-table--product td:nth-child(8) { width: 200px; }
.lines-table--product td:nth-child(9) { width: 116px; }
.lines-table tr.row-error td { background: var(--negative-soft); }
.lines-table select:disabled { opacity: .7; }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.lines-foot .totals { margin-top: 0; }

/* ---------- Belge başlığı ---------- */
.doc__title { font-size: 13px; letter-spacing: .2em; color: var(--text-3); margin-top: 10px; font-weight: 700; }

/* ---------- Hızlı satış (POS) ---------- */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.pos__catalog { display: grid; gap: 14px; min-width: 0; }
.pos__catalog .search input { height: 48px; font-size: 16px; min-width: 0; width: 100%; }
.pos__catalog .search svg { top: 15px; }
.pos__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pos__item { display: grid; gap: 4px; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font: inherit; color: inherit; transition: border-color .12s, transform .08s, box-shadow .12s; min-height: 118px; align-content: start; }
.pos__item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.pos__item:active { transform: scale(.98); }
.pos__item:disabled { opacity: .45; cursor: not-allowed; }
.pos__item b { font-size: 16px; margin-top: 4px; }
.pos__name { font-weight: 600; line-height: 1.3; }
.pos__cart { position: sticky; top: 96px; display: flex; flex-direction: column; max-height: calc(100vh - 120px); }
.pos__cart .list { overflow-y: auto; flex: 1; min-height: 120px; }
.pos__pay { padding: 16px 20px 20px; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.pos__pay .totals { width: 100%; margin: 0; }
.pos__charge { height: 52px; font-size: 16px; }
.qty-ctl { display: flex; align-items: center; gap: 6px; }
.qty-ctl .icon-btn { width: 28px; height: 28px; font-size: 16px; }
.qty-ctl b { min-width: 22px; text-align: center; }

/* ---------- 2FA ---------- */
.steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 10px; }
.secret { font-size: 16px; letter-spacing: .08em; padding: 10px 12px; background: var(--surface-3); border-radius: 8px; margin: 8px 0; word-break: break-all; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.callout ul { margin: 8px 0 0; padding-left: 18px; }

@media (max-width: 1100px) { .pos-layout { grid-template-columns: 1fr; } .pos__cart { position: static; max-height: none; } }

/* ---------- Hatırlatma ---------- */
.mail-preview { white-space: pre-wrap; font: 13px/1.55 var(--font); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 0; max-height: 420px; overflow: auto; }
.kpi__icon { font-weight: 700; }

/* ---------- Alt bilgi çubuğu (destek) ---------- */
.appbar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 32px 18px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); margin-top: auto; }
.appbar__id { border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 6px; padding: 3px 8px; font: inherit; cursor: pointer; }
.appbar__id:hover { border-color: var(--primary); color: var(--text); }
@media (max-width: 900px) { .appbar { padding: 10px 16px 18px; } }

/* ---------- Nereden başlayayım? ---------- */
.onb { border-color: var(--primary); }
.onb__track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.onb__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 20px; }
.onb__list li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.onb__list li.is-done .title { color: var(--text-3); text-decoration: line-through; }
.onb__check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; flex: none; }
.is-done .onb__check { background: var(--positive); border-color: var(--positive); color: #fff; }
.onb__track .fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .6s ease; }
