/* ZAEYON GRUP — A · PRESTİJ tasarım sistemi
   Lacivert + altın. Altın yalnızca vurgu içindir. */
:root {
  --navy-900: #0B1527;
  --navy-850: #0E1A2E;
  --navy-800: #101D33;   /* ana arka plan */
  --navy-700: #1B2D49;   /* ikincil lacivert */
  --navy-600: #253A5C;
  --navy-500: #34507A;
  --gold: #C6A35E;
  --gold-soft: #F1E4C8;
  --white: #FFFFFF;
  --surface-light: #F8FAFC;

  --bg: var(--navy-800);
  --bg-deep: var(--navy-900);
  --surface: #15253F;
  --surface-2: var(--navy-700);
  --surface-hover: #1F3352;
  --line: rgba(241, 228, 200, 0.09);
  --line-strong: rgba(241, 228, 200, 0.16);
  --text: #EEF2F8;
  --text-2: #A9B6CB;
  --text-3: #7F8DA6;
  --accent: var(--gold);
  --accent-ink: #1A1408;
  --accent-soft: rgba(198, 163, 94, 0.14);
  --danger: #E06A6A;
  --danger-soft: rgba(224, 106, 106, 0.13);
  --success: #4FB98A;
  --success-soft: rgba(79, 185, 138, 0.13);
  --warn: #E2A94B;
  --warn-soft: rgba(226, 169, 75, 0.14);
  --info: #6FA3E0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow: 0 6px 22px rgba(3, 8, 18, .35);
  --shadow-lg: 0 18px 50px rgba(3, 8, 18, .55);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 252px;
  --sidebar-mini: 72px;
  --t-fast: 150ms;
  --t: 220ms;
  --t-slow: 320ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --chart-1: #C6A35E;
  --chart-2: #6FA3E0;
  --chart-3: #E06A6A;
  --chart-4: #4FB98A;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF2F7;
  --bg-deep: #E4EAF2;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-hover: #F1F5FA;
  --line: rgba(16, 29, 51, 0.09);
  --line-strong: rgba(16, 29, 51, 0.16);
  --text: #101D33;
  --text-2: #475873;
  --text-3: #6B7A92;
  --accent: #A8853F;
  --accent-soft: rgba(198, 163, 94, 0.16);
  --danger: #C0392B;
  --danger-soft: rgba(192, 57, 43, 0.09);
  --success: #1E8A5A;
  --success-soft: rgba(30, 138, 90, 0.1);
  --warn: #B7791F;
  --warn-soft: rgba(183, 121, 31, 0.12);
  --info: #2F6DB5;
  --shadow-sm: 0 1px 2px rgba(16, 29, 51, .06);
  --shadow: 0 6px 20px rgba(16, 29, 51, .08);
  --shadow-lg: 0 18px 48px rgba(16, 29, 51, .18);
  --chart-1: #B08D45;
  --chart-2: #2F6DB5;
  --chart-3: #C0392B;
  --chart-4: #1E8A5A;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Marka ---------- */
.brand-word {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-word .b-sub { display: block; font-family: var(--font); font-size: 9.5px; letter-spacing: .34em; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.brand-logo-img { max-height: 40px; max-width: 160px; object-fit: contain; display: block; }

/* ---------- Giriş ekranı ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(198,163,94,.10), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(52,80,122,.35), transparent 60%),
    var(--navy-800);
  color: #EEF2F8;
}
:root[data-theme="light"] .login-wrap { color: #EEF2F8; }
.login-card {
  width: 100%; max-width: 410px; padding: 40px 36px 32px;
  background: linear-gradient(180deg, rgba(27,45,73,.92), rgba(16,29,51,.94));
  border: 1px solid rgba(198,163,94,.22);
  border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: rise 520ms var(--ease) both;
  --text: #EEF2F8; --text-2: #A9B6CB; --text-3: #7F8DA6; --surface-2: #1B2D49; --line-strong: rgba(241,228,200,.16); --accent: #C6A35E;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-word { font-size: 28px; color: #F1E4C8; animation: fadeIn 700ms var(--ease) 120ms both; }
.login-brand .brand-word .b-sub { font-size: 10px; margin-top: 8px; }
.login-brand .brand-logo-img { margin: 0 auto 12px; max-height: 64px; animation: fadeIn 700ms var(--ease) 120ms both; }
.gold-rule { height: 1px; width: 120px; margin: 16px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); transform-origin: center; animation: drawLine 700ms var(--ease) 420ms both; }
.login-card h1 { font-size: 15px; font-weight: 600; margin: 0 0 18px; color: var(--text-2); text-align: center; }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--text-3); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px; color: var(--text-3); cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { color: var(--text); }

@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawLine { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

/* ---------- Uygulama iskeleti ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; transition: grid-template-columns var(--t-slow) var(--ease); }
.app.mini { grid-template-columns: var(--sidebar-mini) 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden auto;
  background: linear-gradient(180deg, #0E1A2E, #0B1527);
  border-right: 1px solid rgba(241,228,200,.07);
  display: flex; flex-direction: column; z-index: 40;
  --text: #E6ECF5; --text-2: #A9B6CB; --text-3: #7F8DA6;
  color: var(--text);
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; min-height: 76px; border-bottom: 1px solid rgba(241,228,200,.06); }
.sb-brand .brand-word { font-size: 17px; color: #F1E4C8; }
.sb-mono { display: none; width: 36px; height: 36px; border: 1px solid rgba(198,163,94,.5); border-radius: 9px; color: #C6A35E; font-family: var(--font-brand); font-weight: 700; font-size: 19px; place-items: center; flex: none; }
.app.mini .sb-brand { justify-content: center; padding: 20px 0 16px; }
.app.mini .sb-brand .brand-word, .app.mini .sb-brand .brand-logo-img { display: none; }
.app.mini .sb-mono { display: grid; }

.nav { padding: 12px 10px 20px; flex: 1; }
.nav-sec { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 6px; white-space: nowrap; }
.app.mini .nav-sec { visibility: hidden; height: 10px; padding: 0; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0; border-radius: 9px;
  color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a svg { flex: none; width: 19px; height: 19px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.045); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(198,163,94,.14), rgba(198,163,94,.03)); color: #F1E4C8; }
.nav a.active svg { color: #C6A35E; opacity: 1; }
.nav a::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: #C6A35E; transform: scaleY(0); transition: transform var(--t) var(--ease);
}
.nav a.active::before { transform: scaleY(1); }
.nav .soon { margin-left: auto; font-size: 9.5px; letter-spacing: .06em; padding: 2px 6px; border-radius: 20px; border: 1px solid rgba(241,228,200,.14); color: var(--text-3); }
.app.mini .nav a { justify-content: center; padding: 10px 0; }
.app.mini .nav a span, .app.mini .nav .soon { display: none; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(241,228,200,.06); }
.sb-collapse { width: 100%; display: flex; align-items: center; gap: 10px; justify-content: flex-start; background: none; border: 0; color: var(--text-3); padding: 9px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.sb-collapse:hover { color: var(--text); background: rgba(255,255,255,.04); }
.sb-collapse svg { transition: transform var(--t-slow) var(--ease); flex: none; }
.app.mini .sb-collapse { justify-content: center; }
.app.mini .sb-collapse span { display: none; }
.app.mini .sb-collapse svg { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px;
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tb-title { font-size: 16px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-title small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: .02em; }
.tb-spacer { flex: 1; }
.tb-date { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; transform: translate(40%, -40%); }
.menu-btn { display: none; }
.profile { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: linear-gradient(135deg, #C6A35E, #8E713A); color: #1A1408; flex: none; }
.profile-btn .pn { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-btn .pr { font-size: 11px; color: var(--text-3); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transform-origin: top right;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown button, .dropdown a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; background: none; border: 0; border-radius: 8px; text-align: left; cursor: pointer; text-decoration: none; color: var(--text); }
.dropdown button:hover, .dropdown a:hover { background: var(--surface-hover); }
.dropdown .dd-head { padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown .dd-head small { color: var(--text-3); display: block; }
.notif-item { display: block !important; border-bottom: 1px solid var(--line); border-radius: 0 !important; }
.notif-item:last-child { border-bottom: 0; }

.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page { animation: pageIn var(--t) var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { text-decoration: none; color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform 90ms var(--ease), color var(--t-fast);
}
.btn:hover { background: var(--surface-hover); border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
.btn:active { transform: scale(.975); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: linear-gradient(180deg, #D3B26E, #BE9A52); border-color: #B08D45; color: #1A1408; box-shadow: 0 4px 14px rgba(198,163,94,.22); }
.btn-primary:hover { background: linear-gradient(180deg, #DBBC7A, #C6A35E); border-color: #C6A35E; box-shadow: 0 6px 20px rgba(198,163,94,.32); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: transparent; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; padding: 0; }
.btn[disabled], .btn.loading { opacity: .65; cursor: not-allowed; transform: none; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(26,20,8,.75) rgba(26,20,8,.75) rgba(26,20,8,.2) rgba(26,20,8,.2); animation: spin .7s linear infinite; }
.btn:not(.btn-primary).loading::after { border-color: var(--text) var(--text) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kartlar ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .sub { color: var(--text-3); font-size: 12px; font-weight: 500; }
.lift { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease); }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; padding: 18px 18px 16px; overflow: hidden; text-decoration: none; display: block; }
.kpi::after { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 70%, transparent), transparent); opacity: .55; }
.kpi .k-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 550; }
.kpi .k-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi .k-ico svg { width: 16px; height: 16px; }
.kpi .k-val { font-size: 23px; font-weight: 680; letter-spacing: -.015em; margin-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.kpi.danger .k-ico { background: var(--danger-soft); color: var(--danger); }
.kpi.danger .k-val { color: var(--danger); }
.kpi.warn .k-ico { background: var(--warn-soft); color: var(--warn); }
.kpi.success .k-ico { background: var(--success-soft); color: var(--success); }
.kpi.info .k-ico { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.kpi.highlight { animation: glow 1.2s var(--ease) 1; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(198,163,94,.0); } 30% { box-shadow: 0 0 0 4px rgba(198,163,94,.25); } 100% { box-shadow: var(--shadow-sm); } }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 16px; }
.stagger > * { animation: rise 360ms var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: 40ms; } .stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; } .stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; } .stagger > *:nth-child(n+7) { animation-delay: 230ms; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr { transition: background var(--t-fast) var(--ease); }
.t tbody tr:hover { background: var(--surface-hover); }
.t tbody tr.click { cursor: pointer; }
.t tbody tr:last-child td { border-bottom: 0; }
.t .num, .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t tfoot td { font-weight: 700; padding: 12px 14px; border-top: 1px solid var(--line-strong); }
.t tr.muted td { color: var(--text-3); }
.t tr.muted td s { text-decoration-color: var(--text-3); }
.t th.sortable { cursor: pointer; user-select: none; }
.t th.sortable:hover { color: var(--text); }
.empty { padding: 44px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 38px; height: 38px; opacity: .5; margin-bottom: 8px; }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-3); }
.pos { color: var(--danger); } /* borç artışı */
.neg { color: var(--success); } /* ödeme */
.mov-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; margin-right: 8px; vertical-align: middle; }
.mov-ico svg { width: 14px; height: 14px; }
.mov-ico.debit { background: var(--danger-soft); color: var(--danger); }
.mov-ico.credit { background: var(--success-soft); color: var(--success); }
.mov-ico.rev { background: var(--warn-soft); color: var(--warn); }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.b-gold { background: var(--accent-soft); color: var(--accent); }
.b-green { background: var(--success-soft); color: var(--success); }
.b-red { background: var(--danger-soft); color: var(--danger); }
.b-amber { background: var(--warn-soft); color: var(--warn); }
.b-gray { background: color-mix(in srgb, var(--text-3) 16%, transparent); color: var(--text-2); }
.b-blue { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }

/* ---------- Araç çubuğu / filtreler ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; max-width: 380px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 36px; }
.seg { display: inline-flex; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 550; transition: background var(--t-fast), color var(--t-fast); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }
:root[data-theme="light"] .seg button.on { background: #fff; }

/* ---------- Formlar ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.req::after { content: " *"; color: var(--accent); }
.input, input.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t);
  outline: none;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A9B6CB' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong)); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input.num { text-align: right; }
.input[readonly] { background: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.form-error svg { flex: none; width: 17px; height: 17px; margin-top: 1px; }

/* ---------- Açılır pencere ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(5, 10, 20, .55); backdrop-filter: blur(2px);
  animation: fadeIn var(--t) var(--ease) both;
}
.modal-back.closing { animation: fadeOut 160ms var(--ease) both; }
.modal {
  width: 100%; max-width: 640px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: modalIn 240ms var(--ease) both;
}
.modal.wide { max-width: 920px; }
.modal.narrow { max-width: 440px; }
.modal-back.closing .modal { animation: modalOut 160ms var(--ease) both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-head h3::before { content: ""; display: inline-block; width: 3px; height: 15px; background: var(--accent); border-radius: 2px; margin-right: 10px; vertical-align: -2px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------- Bildirimler ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  animation: toastIn 260ms var(--ease) both;
}
.toast.out { animation: toastOut 200ms var(--ease) both; }
.toast .ti { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.toast.ok .ti { background: var(--success-soft); color: var(--success); }
.toast.err .ti { background: var(--danger-soft); color: var(--danger); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.toast .tt { flex: 1; font-size: 13.5px; }
.toast .tt b { display: block; margin-bottom: 2px; }
.toast .tx { background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 2px; }
.check-anim path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: dash 420ms var(--ease) 120ms forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Grafikler ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); }
.chart .axis-label { fill: var(--text-3); font-size: 11px; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: barUp 700ms var(--ease) both; transition: opacity var(--t-fast); }
.chart .bar:hover, .chart .bar.hl { opacity: .78; }
.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: lineDraw 850ms var(--ease) 100ms forwards; }
.chart .area { animation: fadeIn 800ms var(--ease) 300ms both; }
.chart .pt { animation: fadeIn 300ms var(--ease) 800ms both; }
.chart .hover-col { fill: transparent; cursor: crosshair; }
.chart .hover-col:hover { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
@keyframes barUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes lineDraw { to { stroke-dashoffset: 0; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip {
  position: fixed; z-index: 300; pointer-events: none; padding: 9px 11px; border-radius: 9px; font-size: 12.5px;
  background: #0B1527; color: #EEF2F8; border: 1px solid rgba(198,163,94,.35); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  opacity: 0; transition: opacity 120ms; white-space: nowrap;
}
.tip.on { opacity: 1; }
.tip b { color: #F1E4C8; font-weight: 600; display: block; margin-bottom: 3px; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

.meter { height: 8px; background: var(--bg-deep); border-radius: 6px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 6px; background: var(--success); transform-origin: left; animation: fillX 800ms var(--ease) both; transition: background var(--t-slow); }
.meter > i.crit { background: var(--danger); }
.meter > i.low { background: var(--warn); }
@keyframes fillX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Liste öğeleri ---------- */
.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(--line); }
.list li:last-child { border-bottom: 0; }
.list a.row { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 1; min-width: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .ttl { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { font-size: 12px; color: var(--text-3); }

/* ---------- Varlık kartları (toptancı / malzeme) ---------- */
.ent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; padding: 16px; }
.ent { display: block; padding: 18px; text-decoration: none; }
.ent-top { display: flex; gap: 12px; align-items: center; }
.ent-mono { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--accent); overflow: hidden; }
.ent-mono img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.ent:hover .ent-mono img { transform: scale(1.08); }
.ent-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-meta { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ent-stats .l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.ent-stats .v { font-weight: 650; margin-top: 2px; }

.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; }
.summary-strip > div { padding: 18px 20px; border-right: 1px solid var(--line); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip .l { font-size: 12px; color: var(--text-3); font-weight: 550; }
.summary-strip .v { font-size: 22px; font-weight: 680; margin-top: 6px; letter-spacing: -.01em; }
.summary-strip .v.big { font-size: 26px; }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; word-break: break-word; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs button { position: relative; border: 0; background: none; padding: 13px 14px; color: var(--text-2); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform var(--t) var(--ease); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { transform: scaleX(1); }

/* ---------- Satın alma satırları ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; text-align: left; padding: 0 6px 8px; }
.lines td { padding: 5px 6px; vertical-align: top; }
.lines tr.new { animation: rowIn 260ms var(--ease) both; }
.lines .lt { padding-top: 14px; font-weight: 650; white-space: nowrap; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.totals-card { position: sticky; top: 84px; }
.totals-card .row { display: flex; justify-content: space-between; padding: 7px 0; color: var(--text-2); }
.totals-card .row b { color: var(--text); font-weight: 600; }
.totals-card .grand { border-top: 1px solid var(--line-strong); margin-top: 8px; padding-top: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.totals-card .grand span { color: var(--text-2); font-weight: 600; }
.totals-card .grand b { font-size: 24px; color: var(--accent); letter-spacing: -.01em; }

.upload { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 12px; transition: border-color var(--t), background var(--t); }
.upload:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload .prog { height: 4px; border-radius: 3px; background: var(--bg-deep); overflow: hidden; margin-top: 6px; }
.upload .prog i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 120ms linear; }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); font-size: 13.5px; }
.notice svg { flex: none; color: var(--accent); width: 18px; height: 18px; margin-top: 1px; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.warn svg { color: var(--warn); }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice.danger svg { color: var(--danger); }

.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }

.loading-page { display: grid; place-items: center; min-height: 50vh; color: var(--text-3); gap: 12px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-hover), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.gold { color: var(--accent); }
.danger-t { color: var(--danger); }
.success-t { color: var(--success); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.flex { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mb { margin-bottom: 16px; }
.small { font-size: 12.5px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }

.scrim { display: none; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .g-21, .g-12, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app, .app.mini { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform var(--t-slow) var(--ease); box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.mini .sb-brand .brand-word { display: block; } .app.mini .sb-mono { display: none; }
  .app.mini .nav a span, .app.mini .nav .soon { display: inline; }
  .app.mini .nav a { justify-content: flex-start; padding: 9px 12px; }
  .sb-collapse { display: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(5,10,20,.5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity var(--t-slow); }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; gap: 10px; }
  .tb-date, .profile-btn .pn-wrap { display: none; }
  .content { padding: 18px 14px 60px; }
  .g-2 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.g3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-val { font-size: 18px; }
  .page-head h2 { font-size: 19px; }
  .btn { height: 42px; }
  .btn-sm { height: 36px; }
  .modal-back { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .summary-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .t.stack thead { display: none; }
  .t.stack tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .t.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .t.stack td::before { content: attr(data-l); color: var(--text-3); font-size: 12px; text-align: left; }
  .t.stack td.num { text-align: right; }
  .t.stack tfoot { display: block; }
  .totals-card { position: static; }
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .lines td { padding: 0; }
  .lines td.mat { grid-column: 1 / -1; }
  .toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr; } }

/* ---------- Azaltılmış hareket ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .lift:hover { transform: none; }
  .chart .line { stroke-dashoffset: 0; }
}
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
:root.reduce-motion .chart .line { stroke-dashoffset: 0; }

/* ---------- Yazdırma (PDF) ---------- */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff !important; color: #101D33 !important; font-size: 11px; }
  #root, .toasts, .modal-back, .tip { display: none !important; }
  #print-area { display: block; }
  .pr-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #C6A35E; padding-bottom: 10px; margin-bottom: 14px; }
  .pr-brand { font-family: Georgia, serif; font-size: 20px; letter-spacing: .25em; color: #101D33; font-weight: 700; }
  .pr-brand img { max-height: 46px; display: block; margin-bottom: 4px; }
  .pr-co { font-size: 9.5px; color: #475873; line-height: 1.5; }
  .pr-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
  .pr-sub { color: #475873; margin-bottom: 12px; }
  .pr-sum { display: flex; gap: 20px; margin-bottom: 12px; flex-wrap: wrap; }
  .pr-sum div { border: 1px solid #dfe5ee; border-radius: 6px; padding: 6px 10px; }
  .pr-sum small { display: block; color: #6B7A92; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
  .pr-sum b { font-size: 13px; }
  #print-area table { width: 100%; border-collapse: collapse; }
  #print-area th { background: #101D33; color: #fff; font-size: 9.5px; text-align: left; padding: 6px; }
  #print-area td { border-bottom: 1px solid #e3e8ef; padding: 5px 6px; font-size: 10.5px; }
  #print-area td.num, #print-area th.num { text-align: right; white-space: nowrap; }
  #print-area tfoot td { font-weight: 700; border-top: 1.5px solid #101D33; }
  #print-area tr { page-break-inside: avoid; }
  .pr-foot { margin-top: 14px; font-size: 9px; color: #6B7A92; border-top: 1px solid #e3e8ef; padding-top: 6px; }
}

[hidden] { display: none !important; }
.t td a { text-decoration: none; }
.t td a:hover { text-decoration: underline; color: var(--accent); }
.lines th:first-child { min-width: 280px; }
@media (max-width: 860px) {
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip > div { padding: 14px 16px; }
  .summary-strip .v, .summary-strip .v.big { font-size: 17px; white-space: nowrap; }
  .page-head p { font-size: 13px; }
}


/* =====================================================================
   AŞAMA 2 — ek bileşenler (A · PRESTİJ dili korunarak)
   ===================================================================== */

/* Sorun 1: Uzun firma adları — menüde ve giriş ekranında kesilmeden, kutudan taşmadan sarılır */
.brand-word { overflow-wrap: anywhere; }
.sb-brand { min-width: 0; }
.sb-brand .brand-word { white-space: normal; line-height: 1.3; min-width: 0; }
.sb-brand .brand-word.long { font-size: 14px; letter-spacing: .18em; }
.sb-brand .brand-word.xlong { font-size: 12.5px; letter-spacing: .12em; }
.login-brand .brand-word { white-space: normal; line-height: 1.25; }
.login-brand .brand-word.long { font-size: 22px; letter-spacing: .2em; }
.login-brand .brand-word.xlong { font-size: 18px; letter-spacing: .14em; }
.pr-brand { overflow-wrap: anywhere; }

/* Sekmeler kart başlığında */
.tabs.in-card { border-bottom: 1px solid var(--line); }
.tab-panel { animation: pageIn var(--t) var(--ease) both; }

/* Yatay kategori çubukları (gider dağılımı vb.) */
.hbars { display: grid; gap: 12px; }
.hbar .hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hbar .hb-top b { font-weight: 650; }
.hbar .meter { margin-top: 6px; height: 9px; }
.hbar .meter > i { background: var(--accent); }

/* Borç takvimi */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cal-head h3 { margin: 0; font-size: 16px; min-width: 170px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.slide-l { animation: slideL 240ms var(--ease) both; }
.slide-r { animation: slideR 240ms var(--ease) both; }
@keyframes slideL { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.cal-dow { padding: 8px 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 108px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background var(--t-fast); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-hover); }
.cal-day.out { opacity: .45; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.sel { background: var(--accent-soft); }
.cal-day .dn { font-size: 12px; font-weight: 650; color: var(--text-2); display: flex; justify-content: space-between; }
.cal-day .dn .sum { color: var(--text); font-variant-numeric: tabular-nums; }
.cal-chip { font-size: 11.5px; padding: 3px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.cal-chip.overdue { border-color: var(--danger); background: var(--danger-soft); }
.cal-chip.partial { border-color: var(--warn); background: var(--warn-soft); }
.cal-chip.paid { border-color: var(--success); background: var(--success-soft); color: var(--text-2); }
.cal-chip.plan { border-left-style: dashed; }
.cal-more { font-size: 11px; color: var(--text-3); }
.week-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.week-col { border-right: 1px solid var(--line); min-height: 260px; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.week-col:last-child { border-right: 0; }
.week-col .wh { font-size: 12px; color: var(--text-3); font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.week-col .wh b { display: block; color: var(--text); font-size: 15px; }
.week-col.today .wh b { color: var(--accent); }
.bucket { padding: 16px 18px; border-right: 1px solid var(--line); }
.bucket:last-child { border-right: 0; }
.bucket .l { font-size: 12px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bucket .v { font-size: 20px; font-weight: 680; margin-top: 6px; letter-spacing: -.01em; }
.bucket .n { font-size: 12px; color: var(--text-3); }
.dot-ind { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Fiyat karşılaştırma */
.price-bars { display: grid; gap: 10px; }
.price-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr auto; gap: 12px; align-items: center; }
.price-row .track { height: 12px; background: var(--bg-deep); border-radius: 6px; overflow: hidden; }
.price-row .track i { display: block; height: 100%; border-radius: 6px; background: var(--chart-2); transform-origin: left; animation: fillX 700ms var(--ease) both; }
.price-row.best .track i { background: var(--success); }
.price-row.worst .track i { background: var(--danger); }
.past-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); }

/* Sayım tablosu */
.count-input { width: 120px; }
.diff-pos { color: var(--success); font-weight: 650; }
.diff-neg { color: var(--danger); font-weight: 650; }
tr.changed td { background: var(--warn-soft); }

/* Fiyat sapma uyarısı satırda */
.warn-line { color: var(--warn); font-size: 12px; display: flex; gap: 4px; align-items: center; margin-top: 3px; }

/* Mutabakat mektubu (yazdırma) */
@media print {
  .letter { font-size: 11.5px; line-height: 1.6; color: #101D33; }
  .letter h2 { text-align: center; font-size: 15px; letter-spacing: .08em; margin: 18px 0 14px; }
  .letter .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 10px 0 16px; }
  .letter .parties div { border: 1px solid #dfe5ee; border-radius: 6px; padding: 8px 10px; }
  .letter .parties small { display: block; text-transform: uppercase; letter-spacing: .06em; color: #6B7A92; font-size: 8.5px; margin-bottom: 2px; }
  .letter .amount { border: 1.5px solid #C6A35E; border-radius: 6px; padding: 10px 12px; margin: 12px 0; font-size: 13px; }
  .letter .amount b { font-size: 16px; }
  .letter .opts { margin: 14px 0; }
  .letter .opts div { margin: 6px 0; }
  .letter .box { display: inline-block; width: 11px; height: 11px; border: 1.2px solid #101D33; margin-right: 8px; vertical-align: -1px; }
  .letter .signs { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 26px; }
  .letter .signs div { border-top: 1px solid #101D33; padding-top: 6px; min-height: 70px; font-size: 10.5px; }
  .letter .fill { border-bottom: 1px dotted #6B7A92; display: inline-block; min-width: 160px; }
}

@media (max-width: 860px) {
  .cal-day { min-height: 64px; padding: 5px; }
  .cal-chip { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .cal-day .dn .sum { display: none; }
  .week-cols { grid-template-columns: 1fr; }
  .week-col { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .bucket { border-right: 0; border-bottom: 1px solid var(--line); }
  .price-row { grid-template-columns: 1fr auto; }
  .price-row .track { grid-column: 1 / -1; grid-row: 2; }
  .count-input { width: 96px; }
}

/* ===================== Aşama 3: Satış ve kârlılık ===================== */
.nav .cnt { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; min-width: 20px; text-align: center; padding: 2px 6px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); }
.app.mini .nav .cnt { display: none; }
.pmode { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; margin-top: 4px; }
.pmode button { border: 0; background: transparent; color: var(--text-3); font-size: 11px; font-weight: 600; padding: 3px 8px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.pmode button.on { background: var(--accent-soft); color: var(--accent); }
.pother { font-size: 11px; color: var(--text-3); margin-top: 3px; white-space: nowrap; }
.secret-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.cost-unknown { color: var(--warn); font-size: 12px; font-weight: 600; }
.profit-pos { color: var(--success); }
.profit-neg { color: var(--danger); }
.lock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--warn); }
.diff-ok { color: var(--success); } .diff-warn { color: var(--warn); } .diff-bad { color: var(--danger); }
.ret-line td { vertical-align: top; }
.cond-seg { display: inline-flex; gap: 0; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.cond-seg label { padding: 4px 9px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.cond-seg input { display: none; }
.cond-seg input:checked + span { color: var(--accent); font-weight: 650; }
.cond-seg label:has(input:checked) { background: var(--accent-soft); }
.coverage { margin: 0 0 12px; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mini-kpis > div { background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.mini-kpis .l { font-size: 11.5px; color: var(--text-3); }
.mini-kpis .v { font-size: 16px; font-weight: 650; margin-top: 3px; }
/* Satış ayrıntısı: maliyet/kâr sütunları açıkken ürün tablosu tam genişlikte, yan kartlar altta iki sütun */
.g-12w { grid-template-columns: minmax(0, 1fr); }
.g-12w > .grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
@media (max-width: 860px) { .g-12w > .grid { grid-template-columns: minmax(0, 1fr); } }
