/* ═══════════════════════════════════════════════════════════════════
   Finera — Bileşen katmanı
   Yalnızca tokens.css'teki değişkenleri kullanır; sabit renk/ölçü yok.
   DevExtreme Fluent temasının üzerine ince ayar; tema "hack"i içermez.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Temel ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--fx-bg);
  color: var(--fx-text);
  font-family: var(--fx-font);
  font-size: var(--fx-fs);
  line-height: var(--fx-lh);
  -webkit-font-smoothing: antialiased;
  /* Rakamlar her yerde eşit genişlikte: tutarlar alt alta hizalı okunur */
  font-variant-numeric: tabular-nums;
}
body { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--fx-accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:where(:root[data-theme="dark"]) a { color: var(--fx-accent); }   /* düşük özgüllük: sınıflı bağlantılar kendi rengini korur */
::selection { background: var(--fx-accent-soft); color: var(--fx-text); }

:focus-visible { outline: 2px solid var(--fx-accent); outline-offset: 2px; border-radius: var(--fx-r-sm); }
.dx-texteditor :focus-visible, .dx-datagrid :focus-visible { outline: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fx-border-strong); border-radius: var(--fx-r-pill); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--fx-text-3); }
::-webkit-scrollbar-track { background: transparent; }

.fx-mono { font-family: var(--fx-mono); font-size: .95em; }
.fx-muted { color: var(--fx-text-3); }
.fx-nowrap { white-space: nowrap; }
.fx-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ── 2. Uygulama kabuğu ───────────────────────────────────────────── */
.fx-app {
  height: 100%;
  display: grid;
  grid-template-rows: var(--fx-topbar-h) minmax(0, 1fr) var(--fx-statusbar-h);
  grid-template-columns: minmax(0, 1fr);
}
.fx-body .dx-drawer-wrapper, .fx-body .dx-drawer-content { min-width: 0; }
.fx-body .dx-drawer-content { overflow: hidden; }

/* Üst bar */
.fx-topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--fx-s-2);
  padding: 0 var(--fx-s-3) 0 var(--fx-s-2);
  background: var(--fx-surface);
  border-bottom: 1px solid var(--fx-border);
}
.fx-brand { display: flex; align-items: center; gap: var(--fx-s-2); color: var(--fx-text); font-weight: 600; font-size: var(--fx-fs-md); letter-spacing: -.01em; padding-right: var(--fx-s-2); }
.fx-brand:hover { text-decoration: none; }
.fx-brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.fx-brand b { color: var(--fx-accent); font-weight: 600; }

.fx-topbar-sep { width: 1px; height: 22px; background: var(--fx-border); margin: 0 var(--fx-s-1); flex-shrink: 0; }

/* Aktif şirket & mali dönem — her ekranda görünür */
.fx-ctx { display: flex; align-items: center; gap: var(--fx-s-2); min-width: 0; }
.fx-ctx-firm { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--fx-text); font-weight: 500; }
.fx-ctx-firm .dx-icon { color: var(--fx-text-3); font-size: 16px; }
.fx-ctx-firm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
/* Firma adı → firma seçimi (birden çok firması olan kullanıcı) */
.fx-ctx-firm--link { text-decoration: none; border-radius: var(--fx-r-sm, 6px); padding: 2px 6px; margin: -2px -6px; }
.fx-ctx-firm--link:hover, .fx-ctx-firm--link:focus-visible { background: var(--fx-surface-2, rgba(0,0,0,.05)); }
.fx-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 var(--fx-s-2);
  border: 1px solid var(--fx-border); border-radius: var(--fx-r-pill);
  background: var(--fx-surface-2); color: var(--fx-text-2);
  font-size: var(--fx-fs-sm); font-weight: 500; white-space: nowrap;
}
.fx-chip--accent { background: var(--fx-accent-soft); border-color: var(--fx-accent-border); color: var(--fx-accent-text); }
.fx-chip--warning { background: var(--fx-warning-soft); border-color: var(--fx-warning-border); color: var(--fx-text); }
.fx-chip--warning .dx-icon { color: var(--fx-warning); }

/* Salt okunur firma şeridi (sözleşmesi bitmiş) */
.fx-salt-serit {
  display: flex; align-items: center; gap: var(--fx-s-2);
  padding: var(--fx-s-2) var(--fx-content-pad);
  background: var(--fx-warning-soft); border-bottom: 1px solid var(--fx-warning-border);
  color: var(--fx-text); font-size: var(--fx-fs-sm); line-height: 1.45;
}
.fx-salt-serit > .dx-icon { color: var(--fx-warning); font-size: 16px; flex: none; }
.fx-salt-gizli { display: none !important; }

/* Hızlı arama tetikleyicisi */
.fx-search-trigger {
  flex: 0 1 380px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--fx-s-2);
  height: 32px; padding: 0 var(--fx-s-2) 0 var(--fx-s-3);
  border: 1px solid var(--fx-border); border-radius: var(--fx-r);
  background: var(--fx-surface-2); color: var(--fx-text-3);
  font: inherit; cursor: pointer; text-align: left;
  transition: border-color .15s var(--fx-ease), background .15s var(--fx-ease);
}
.fx-search-trigger:hover { border-color: var(--fx-border-strong); background: var(--fx-surface); }
.fx-search-trigger .dx-icon { font-size: 16px; }
.fx-search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.fx-topbar-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.fx-search-trigger + .fx-topbar-actions { margin-left: 0; }

.fx-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fx-accent); color: var(--fx-text-on-accent);
  font-size: var(--fx-fs-xs); font-weight: 600; letter-spacing: .02em;
}
.fx-user { display: flex; align-items: center; gap: var(--fx-s-2); padding: 3px var(--fx-s-2) 3px 3px; border-radius: var(--fx-r-pill); cursor: pointer; border: 1px solid transparent; background: none; font: inherit; color: var(--fx-text); }
.fx-user:hover { background: var(--fx-surface-3); }
.fx-user-name { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Global yükleme çizgisi (AJAX süresince üst barın altında) */
.fx-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.fx-progress.is-on { opacity: 1; }
.fx-progress::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--fx-accent); animation: fx-progress 1.1s var(--fx-ease) infinite; }
@keyframes fx-progress { from { left: -40%; } to { left: 100%; } }

/* Gövde: drawer + içerik */
.fx-body { min-height: 0; }
.fx-body > .dx-drawer { height: 100%; }
.fx-body .dx-drawer-content { display: flex; flex-direction: column; min-width: 0; }

/* Yan menü */
.fx-nav {
  height: 100%;
  display: flex; flex-direction: column;
  width: var(--fx-nav-w);
  background: var(--fx-surface);
  border-right: 1px solid var(--fx-border);
}
.dx-drawer-opened .fx-nav, .fx-nav { transition: width .2s var(--fx-ease); }
.fx-nav-search { padding: var(--fx-s-2) var(--fx-s-2) var(--fx-s-1); }
.fx-nav-tree { flex: 1; min-height: 0; padding: var(--fx-s-1) 0 var(--fx-s-2); }
.fx-nav-foot { border-top: 1px solid var(--fx-border); padding: var(--fx-s-2); display: flex; flex-direction: column; gap: 2px; }

.fx-nav .dx-treeview-node { padding-left: 0 !important; }
.fx-nav .dx-treeview-item {
  min-height: 32px; margin: 1px var(--fx-s-2); padding: 0 var(--fx-s-2) 0 var(--fx-s-2);
  border-radius: var(--fx-r); color: var(--fx-text-2);
  display: flex; align-items: center;
}
.fx-nav .dx-treeview-item .dx-icon { color: var(--fx-text-3); font-size: 18px; width: 18px; height: 18px; margin-right: 10px; }
.fx-nav .dx-treeview-item .dx-treeview-item-content > span { font-weight: 500; }
/* Favori yıldızı (menü öğesi): üzerine gelince görünür, favorideyse hep görünür */
.fx-nav .dx-treeview-item-content { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.fx-nav .dx-treeview-item .fx-nav-star { margin: 0 0 0 auto; font-size: 14px; width: 14px; height: 14px; opacity: 0; cursor: pointer; transition: opacity .12s; }
.fx-nav .dx-treeview-item:hover .fx-nav-star, .fx-nav .dx-treeview-item .fx-nav-star.is-on { opacity: 1; }
.fx-nav .dx-treeview-item .fx-nav-star.is-on, .fx-fav-btn.is-on .dx-icon { color: var(--fx-warning); }
.fx-nav.is-mini .fx-nav-star { display: none; }
.fx-fav-btn:empty { display: none; }
.fx-nav .dx-treeview-node-container .dx-treeview-node-container .dx-treeview-item { padding-left: 38px; min-height: 30px; }
.fx-nav .dx-treeview-node-container .dx-treeview-node-container .dx-treeview-item-content > span { font-weight: 400; }
.fx-nav .dx-treeview-toggle-item-visibility { left: auto !important; right: var(--fx-s-3); color: var(--fx-text-3); }
.fx-nav .dx-treeview-node.dx-state-hover:not(.dx-state-focused) > .dx-treeview-item,
.fx-nav .dx-treeview-item.dx-state-hover { background: var(--fx-surface-3); color: var(--fx-text); }
.fx-nav .dx-treeview-node.dx-state-selected > .dx-treeview-item {
  background: var(--fx-accent-soft); color: var(--fx-accent-text);
  position: relative;
}
.fx-nav .dx-treeview-node.dx-state-selected > .dx-treeview-item .dx-icon { color: var(--fx-accent); }
.fx-nav .dx-treeview-node.dx-state-selected > .dx-treeview-item::before {
  content: ''; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fx-accent);
}
.fx-nav .dx-treeview-node.dx-state-focused > .dx-treeview-item { background: var(--fx-surface-3); }
.fx-nav .dx-treeview-search { margin: 0; }

/* Daraltılmış (mini) menü: yalnız ikonlar */
.fx-nav.is-mini { width: var(--fx-nav-mini-w); }
.fx-nav.is-mini .fx-nav-search,
.fx-nav.is-mini .dx-treeview-item-content > span,
.fx-nav.is-mini .dx-treeview-toggle-item-visibility,
.fx-nav.is-mini .dx-treeview-node-container .dx-treeview-node-container,
.fx-nav.is-mini .fx-nav-foot span { display: none; }
.fx-nav.is-mini .dx-treeview-item { justify-content: center; padding: 0; }
.fx-nav.is-mini .dx-treeview-item .dx-icon { margin: 0; }
.fx-nav.is-mini .fx-nav-foot .dx-button { justify-content: center; }

/* İçerik alanı */
.fx-main { flex: 1; min-height: 0; overflow: auto; scroll-padding-top: 96px; }

/* Sayfa başlığı (yapışkan: aksiyonlar her zaman görünür) */
.fx-pagehead {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--fx-s-4); flex-wrap: wrap;
  padding: var(--fx-s-3) var(--fx-content-pad);
  background: color-mix(in srgb, var(--fx-bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.fx-pagehead.is-stuck { border-bottom-color: var(--fx-border); background: color-mix(in srgb, var(--fx-surface) 92%, transparent); }
.fx-pagehead-text { min-width: 0; flex: 1 1 auto; }
.fx-crumbs { display: flex; align-items: center; gap: 4px; color: var(--fx-text-3); font-size: var(--fx-fs-sm); margin-bottom: 2px; }
.fx-crumbs .dx-icon { font-size: 12px; }
.fx-title-row { display: flex; align-items: center; gap: var(--fx-s-2); flex-wrap: wrap; min-width: 0; }
.fx-title { font-size: var(--fx-fs-xl); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; color: var(--fx-text); }
.fx-subtitle { color: var(--fx-text-3); font-size: var(--fx-fs); }
.fx-actions { display: flex; align-items: center; gap: var(--fx-s-2); flex-wrap: wrap; margin-left: auto; }

.fx-content { padding: var(--fx-s-1) var(--fx-content-pad) var(--fx-s-8); display: flex; flex-direction: column; gap: var(--fx-s-4); }

/* Durum çubuğu */
.fx-statusbar {
  display: flex; align-items: center; gap: var(--fx-s-3);
  padding: 0 var(--fx-s-3);
  background: var(--fx-surface); border-top: 1px solid var(--fx-border);
  color: var(--fx-text-3); font-size: var(--fx-fs-xs); white-space: nowrap; overflow: hidden;
}
.fx-statusbar .sep { width: 1px; height: 12px; background: var(--fx-border); }
.fx-statusbar .push { margin-left: auto; }
.fx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fx-success); display: inline-block; }
.fx-statusbar button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.fx-statusbar button:hover { color: var(--fx-text); }

/* ── 3. Kart / panel ──────────────────────────────────────────────── */
.fx-card {
  background: var(--fx-surface);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-r-lg);
  box-shadow: var(--fx-shadow-1);
  min-width: 0;
}
.fx-card-head {
  display: flex; align-items: center; gap: var(--fx-s-2); flex-wrap: wrap;
  min-height: 44px; padding: var(--fx-s-2) var(--fx-card-pad);
  border-bottom: 1px solid var(--fx-border);
}
.fx-card-title { font-size: var(--fx-fs-md); font-weight: 600; color: var(--fx-text); display: flex; align-items: center; gap: var(--fx-s-2); }
.fx-card-title .dx-icon { color: var(--fx-text-3); font-size: 18px; }
.fx-card-head .fx-actions { margin-left: auto; }
.fx-card-body { padding: var(--fx-card-pad); }
.fx-card--flush > .fx-card-body { padding: 0; }
.fx-card--flush .dx-datagrid { border-radius: 0 0 var(--fx-r-lg) var(--fx-r-lg); }

/* ── 4. KPI kutucukları ──────────────────────────────────────────── */
.fx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--fx-s-3); }
.fx-kpi {
  position: relative; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--fx-s-3) var(--fx-s-4);
  background: var(--fx-surface); border: 1px solid var(--fx-border); border-radius: var(--fx-r-lg);
  box-shadow: var(--fx-shadow-1); font: inherit; color: inherit;
  transition: border-color .15s var(--fx-ease), box-shadow .15s var(--fx-ease);
}
button.fx-kpi { cursor: pointer; }
button.fx-kpi:hover { border-color: var(--fx-border-strong); box-shadow: var(--fx-shadow-2); }
.fx-kpi.is-active { border-color: var(--fx-accent); box-shadow: 0 0 0 1px var(--fx-accent); }
.fx-kpi-label { display: flex; align-items: center; gap: 6px; color: var(--fx-text-2); font-size: var(--fx-fs-sm); font-weight: 500; }
.fx-kpi-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fx-neutral); }
.fx-kpi-value { font-size: var(--fx-fs-2xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--fx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-kpi-value small { font-size: var(--fx-fs-md); font-weight: 500; color: var(--fx-text-3); margin-left: 3px; }
.fx-kpi-meta { color: var(--fx-text-3); font-size: var(--fx-fs-sm); }
.fx-kpi.is-success .dot { background: var(--fx-success); }
.fx-kpi.is-warning .dot { background: var(--fx-warning); }
.fx-kpi.is-danger  .dot { background: var(--fx-danger); }
.fx-kpi.is-info    .dot { background: var(--fx-info); }
.fx-kpi.is-accent  .dot { background: var(--fx-accent); }
.fx-kpi.is-danger .fx-kpi-value.has-value { color: var(--fx-danger); }

/* ── 5. Rozetler (belge durumları) ───────────────────────────────── */
.fx-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--fx-r-pill); border: 1px solid var(--fx-neutral-border);
  background: var(--fx-neutral-soft); color: var(--fx-neutral);
  font-size: var(--fx-fs-sm); font-weight: 500; line-height: 1; white-space: nowrap;
  vertical-align: middle;
}
.fx-badge .dx-icon { font-size: 13px; width: 13px; height: 13px; color: inherit; }
.fx-badge.is-success { background: var(--fx-success-soft); border-color: var(--fx-success-border); color: var(--fx-success); }
.fx-badge.is-danger  { background: var(--fx-danger-soft);  border-color: var(--fx-danger-border);  color: var(--fx-danger); }
.fx-badge.is-warning { background: var(--fx-warning-soft); border-color: var(--fx-warning-border); color: var(--fx-warning); }
.fx-badge.is-info    { background: var(--fx-info-soft);    border-color: var(--fx-info-border);    color: var(--fx-info); }
.fx-badge.is-accent  { background: var(--fx-accent-soft);  border-color: var(--fx-accent-border);  color: var(--fx-accent-text); }
.fx-badge--sm { height: 18px; padding: 0 6px; font-size: var(--fx-fs-xs); }
.fx-badge.is-strike { text-decoration: line-through; }

/* ── 6. Tutarlar ──────────────────────────────────────────────────── */
.fx-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-neg, .dx-datagrid .fx-neg { color: var(--fx-amount-neg); }
.fx-pos { color: var(--fx-amount-pos); }
.fx-zero { color: var(--fx-text-3); }
.fx-cur { color: var(--fx-text-3); font-size: .9em; margin-left: 2px; }
.fx-ba { color: var(--fx-text-3); font-size: .85em; margin-left: 3px; font-weight: 500; }
.fx-neg .fx-ba { color: inherit; }

/* ── 7. Filtre çubuğu ─────────────────────────────────────────────── */
.fx-filterbar {
  display: flex; align-items: flex-end; gap: var(--fx-s-3); flex-wrap: wrap;
  padding: var(--fx-s-3) var(--fx-card-pad);
}
.fx-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-field > label, .fx-label { font-size: var(--fx-fs-sm); font-weight: 500; color: var(--fx-text-2); }
.fx-filterbar .fx-spacer { flex: 1; }

/* Segment (sekme benzeri filtre) — dxButtonGroup kullanılır, ince ayar: */
.fx-segment .dx-button { min-width: 0; }

/* ── 8. Form yerleşimi ───────────────────────────────────────────── */
.fx-split { display: grid; grid-template-columns: minmax(0, 1fr) var(--fx-summary-w); gap: var(--fx-s-4); align-items: start; }
.fx-aside { position: sticky; top: 76px; display: flex; flex-direction: column; gap: var(--fx-s-4); }
.fx-stack { display: flex; flex-direction: column; gap: var(--fx-s-4); min-width: 0; }

/* dxForm ince ayarları */
.dx-form .dx-field-item-label-text { font-weight: 500; color: var(--fx-text-2); }
.dx-form .dx-field-item-required-mark { color: var(--fx-danger); }
.dx-form .dx-form-group-caption { font-size: var(--fx-fs-md); font-weight: 600; color: var(--fx-text); }
.dx-form .dx-form-group-with-caption > .dx-form-group-content { border-top-color: var(--fx-border); }
.dx-form-validation-summary { margin-top: var(--fx-s-3); }
.fx-form-hint { color: var(--fx-text-3); font-size: var(--fx-fs-sm); margin-top: 4px; }

/* Salt okunur (kilitli) editörler daha belirgin */
.dx-texteditor.dx-state-readonly.dx-editor-outlined { background: var(--fx-surface-2); border-style: dashed; }

/* ── 9. Özet paneli (fatura toplamları) ──────────────────────────── */
.fx-sum { padding: var(--fx-s-3) var(--fx-card-pad) var(--fx-card-pad); }
.fx-sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--fx-s-3); padding: 5px 0; }
.fx-sum-row > span:first-child { color: var(--fx-text-2); }
.fx-sum-row > span:last-child { font-weight: 500; text-align: right; white-space: nowrap; }
.fx-sum-row.is-sub > span { font-size: var(--fx-fs-sm); color: var(--fx-text-3) !important; font-weight: 400 !important; }
.fx-sum-row.is-sub > span:first-child { padding-left: var(--fx-s-3); }
.fx-sum-sep { height: 1px; background: var(--fx-border); margin: var(--fx-s-2) 0; }
.fx-sum-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-top: var(--fx-s-2); }
.fx-sum-total .lbl { align-self: stretch; display: flex; justify-content: space-between; color: var(--fx-text-2); font-weight: 600; }
.fx-sum-total .val { font-size: var(--fx-fs-3xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; color: var(--fx-text); }
.fx-sum-total .val small { font-size: var(--fx-fs-lg); color: var(--fx-text-3); font-weight: 500; margin-left: 4px; }
.fx-sum-total .tl { color: var(--fx-text-3); font-size: var(--fx-fs-sm); }
.fx-sum-meta { display: flex; justify-content: space-between; color: var(--fx-text-3); font-size: var(--fx-fs-sm); padding-top: var(--fx-s-2); }

/* Cari bilgi kartı */
.fx-party { padding: var(--fx-s-3) var(--fx-card-pad); display: grid; grid-template-columns: 1fr 1fr; gap: var(--fx-s-2) var(--fx-s-3); }
.fx-party-name { grid-column: 1 / -1; font-weight: 600; color: var(--fx-text); line-height: 1.3; }
.fx-party-name small { display: block; font-weight: 400; color: var(--fx-text-3); font-size: var(--fx-fs-sm); }
.fx-party dt { color: var(--fx-text-3); font-size: var(--fx-fs-sm); }
.fx-party dd { margin: 0; font-weight: 500; }
.fx-party .fx-meter { grid-column: 1 / -1; }
.fx-meter { height: 6px; border-radius: var(--fx-r-pill); background: var(--fx-surface-3); overflow: hidden; }
.fx-meter > i { display: block; height: 100%; background: var(--fx-success); border-radius: inherit; transition: width .3s var(--fx-ease); }
.fx-meter.is-warning > i { background: var(--fx-warning); }
.fx-meter.is-danger > i { background: var(--fx-danger); }
.fx-empty-note { padding: var(--fx-s-4) var(--fx-card-pad); color: var(--fx-text-3); font-size: var(--fx-fs-sm); display: flex; align-items: center; gap: var(--fx-s-2); }

/* ── 10. Uyarı şeritleri ─────────────────────────────────────────── */
.fx-banner {
  display: flex; align-items: flex-start; gap: var(--fx-s-3);
  padding: var(--fx-s-3) var(--fx-s-4);
  border: 1px solid var(--fx-info-border); border-radius: var(--fx-r-lg);
  background: var(--fx-info-soft); color: var(--fx-text);
}
.fx-banner > .dx-icon { font-size: 18px; color: var(--fx-info); margin-top: 1px; }
.fx-banner b { font-weight: 600; }
.fx-banner .fx-banner-text { flex: 1; }
.fx-banner .fx-banner-text p { color: var(--fx-text-2); margin-top: 2px; }
.fx-banner.is-warning { border-color: var(--fx-warning-border); background: var(--fx-warning-soft); }
.fx-banner.is-warning > .dx-icon { color: var(--fx-warning); }
.fx-banner.is-danger { border-color: var(--fx-danger-border); background: var(--fx-danger-soft); }
.fx-banner.is-danger > .dx-icon { color: var(--fx-danger); }
.fx-banner.is-locked { border-color: var(--fx-neutral-border); background: var(--fx-neutral-soft); }
.fx-banner.is-locked > .dx-icon { color: var(--fx-neutral); }

/* ── 11. Klavye kısayol gösterimi ────────────────────────────────── */
.fx-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--fx-border-strong); border-bottom-width: 2px; border-radius: var(--fx-r-sm);
  background: var(--fx-surface); color: var(--fx-text-2);
  font-family: var(--fx-mono); font-size: var(--fx-fs-xs); font-weight: 500; line-height: 1;
}
.fx-keys-group { margin-bottom: var(--fx-s-4); }
.fx-keys-group h4 { font-size: var(--fx-fs-sm); color: var(--fx-text-3); font-weight: 600; margin-bottom: var(--fx-s-1); text-transform: uppercase; letter-spacing: .04em; }
.fx-keys-row { display: flex; align-items: center; justify-content: space-between; gap: var(--fx-s-3); padding: 6px 0; border-bottom: 1px solid var(--fx-border); }
.fx-keys-row:last-child { border-bottom: 0; }
.fx-keys-row .k { display: flex; gap: 3px; }

/* ── 12. Boş / yükleniyor / hata durumları ──────────────────────── */
.fx-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--fx-s-2); padding: var(--fx-s-8) var(--fx-s-4); color: var(--fx-text-3); text-align: center; }
.fx-empty .dx-icon { font-size: 32px; color: var(--fx-border-strong); }
.fx-empty b { color: var(--fx-text-2); font-weight: 600; font-size: var(--fx-fs-md); }
.fx-skel { border-radius: var(--fx-r-sm); background: linear-gradient(90deg, var(--fx-surface-3) 25%, var(--fx-surface-2) 50%, var(--fx-surface-3) 75%); background-size: 200% 100%; animation: fx-shimmer 1.2s infinite linear; }
@keyframes fx-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── 13. Hızlı arama (komut paleti) ──────────────────────────────── */
.fx-palette .dx-popup-content { padding: 0 !important; }
.fx-palette-input { padding: var(--fx-s-3); border-bottom: 1px solid var(--fx-border); }
.fx-palette-list { max-height: 420px; }
.fx-palette-item { display: flex; align-items: center; gap: var(--fx-s-3); min-width: 0; }
.fx-palette-item .dx-icon { color: var(--fx-text-3); font-size: 18px; flex-shrink: 0; }
.fx-palette-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-palette-item .t small { color: var(--fx-text-3); margin-left: var(--fx-s-2); }
.fx-palette-item .m { color: var(--fx-text-3); font-size: var(--fx-fs-sm); white-space: nowrap; }
.fx-palette-foot { display: flex; gap: var(--fx-s-4); padding: var(--fx-s-2) var(--fx-s-3); border-top: 1px solid var(--fx-border); color: var(--fx-text-3); font-size: var(--fx-fs-sm); }
.fx-palette-list { overflow-y: auto; padding: var(--fx-s-1) var(--fx-s-2) var(--fx-s-2); }
.fx-palette-group { padding: var(--fx-s-2) var(--fx-s-2) 2px; color: var(--fx-text-3); font-size: var(--fx-fs-xs); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.fx-palette-row { padding: 7px var(--fx-s-2); border-radius: var(--fx-r); cursor: pointer; }
.fx-palette-row:hover { background: var(--fx-surface-3); }
.fx-palette-row.is-active { background: var(--fx-accent-soft); }
.fx-palette-row.is-active .dx-icon { color: var(--fx-accent); }
.fx-palette-foot .fx-kbd { margin-right: 2px; }

/* Buton içi yükleniyor ikonu (Fx.busy) */
.dx-icon-fx-spin::before {
  content: ''; display: inline-block; box-sizing: border-box; width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: fx-spin .7s linear infinite; vertical-align: -2px;
}
@keyframes fx-spin { to { transform: rotate(360deg); } }

#fxConn.is-off .fx-dot { background: var(--fx-danger); }
.fx-nav-help.dx-button .dx-button-content { justify-content: flex-start; }
.fx-act-danger .dx-icon, .dx-link.fx-act-danger { color: var(--fx-danger) !important; }

/* Lookup açılır liste öğesi (cari/stok) */
.fx-li { display: flex; align-items: center; gap: var(--fx-s-3); min-width: 0; line-height: 1.3; }
.fx-li-main { flex: 1; min-width: 0; }
.fx-li-title { color: var(--fx-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-li-sub { color: var(--fx-text-3); font-size: var(--fx-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-li-side { text-align: right; white-space: nowrap; font-size: var(--fx-fs-sm); color: var(--fx-text-2); }
.fx-li-side b { display: block; color: var(--fx-text); font-weight: 500; font-size: var(--fx-fs); }
.fx-li mark { background: var(--fx-warning-soft); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ── 14. DevExtreme ince ayarları ────────────────────────────────── */
/* DataGrid */
.dx-datagrid { color: var(--fx-text); }
.dx-datagrid-headers .dx-header-row > td { font-weight: 600; color: var(--fx-text-2); }
.dx-datagrid-headers { background: var(--fx-surface-2); }
.dx-datagrid .dx-row > td.fx-num-cell, .dx-datagrid .dx-row > td.fx-num-cell .dx-datagrid-summary-item { font-variant-numeric: tabular-nums; }
.dx-datagrid-total-footer { background: var(--fx-surface-2); }
.dx-datagrid-summary-item { color: var(--fx-text); font-weight: 600; }
.dx-datagrid-group-panel { margin-left: var(--fx-s-4, 16px); }
.dx-datagrid-group-panel .dx-group-panel-message { color: var(--fx-text-3); }
.dx-datagrid-rowsview .dx-row.fx-row-muted > td { color: var(--fx-text-3); }
.dx-datagrid-rowsview .dx-row.fx-row-cancel > td { color: var(--fx-text-3); text-decoration: line-through; text-decoration-color: var(--fx-border-strong); }
.dx-datagrid-rowsview .dx-row.fx-row-cancel > td .fx-badge { text-decoration: none; }
.dx-datagrid .dx-link.dx-link-icon { color: var(--fx-text-2); }
.dx-datagrid .dx-link.dx-link-icon:hover { color: var(--fx-accent); }
.dx-datagrid-rowsview .dx-data-row a.fx-doc-link { font-weight: 500; color: var(--fx-accent-text); }
:root[data-theme="dark"] .dx-datagrid-rowsview .dx-data-row a.fx-doc-link { color: var(--fx-accent); }
.dx-datagrid .dx-toolbar .dx-toolbar-items-container { min-height: 40px; }
.fx-grid-host { min-height: 240px; }
.dx-datagrid .dx-row > td.fx-strong { font-weight: 600; }
.dx-datagrid .dx-data-row > td.fx-zero { color: var(--fx-text-3); }
.dx-datagrid .dx-data-row > td.fx-neg { color: var(--fx-amount-neg); }
/* Kompakt yoğunluk: muhasebeci ekranda daha çok satır görür (~32px satır) */
:root[data-density="compact"] .dx-datagrid-rowsview .dx-data-row > td,
:root[data-density="compact"] .dx-datagrid-rowsview .dx-group-row > td { padding-top: 6px; padding-bottom: 6px; }
:root[data-density="compact"] .dx-datagrid-rowsview .dx-data-row > td.dx-editor-cell { padding-top: 0; padding-bottom: 0; }
.dx-datagrid .fx-badge { height: 20px; }
.dx-datagrid .fx-badge--sm { height: 18px; }
.dx-datagrid .dx-master-detail-cell { background: var(--fx-surface-2); padding: var(--fx-s-2) var(--fx-s-4) !important; }
.fx-grid-fill .dx-datagrid { height: 100%; }

/* Grid içi düzenlenebilir hücreler (fatura satırları) */
.fx-lines .dx-datagrid-rowsview .dx-data-row > td.fx-editable { background: var(--fx-surface); }
.fx-lines .dx-datagrid-rowsview .dx-data-row > td.fx-calc { background: var(--fx-surface-2); color: var(--fx-text-2); }
.fx-lines .dx-datagrid-rowsview .dx-data-row > td.fx-calc.fx-total-cell { color: var(--fx-text); font-weight: 600; }
.fx-lines .dx-row-removed > td { opacity: .5; }
.fx-lines .fx-line-no { color: var(--fx-text-3); }
.fx-lines .dx-data-row > td.fx-warn-cell { background: var(--fx-warning-soft) !important; color: var(--fx-warning); font-weight: 600; }
.fx-lines .dx-data-row > td.fx-placeholder-cell::after { content: attr(data-ph); color: var(--fx-text-3); font-style: italic; }
.fx-lines .dx-datagrid-rowsview .dx-data-row > td.fx-editable.dx-focused { box-shadow: inset 0 0 0 2px var(--fx-accent); }

/* Buton sırası: birincil eylem her zaman sağda */
.dx-button.fx-btn-wide { min-width: 120px; }
.dx-button .fx-kbd { margin-left: 6px; height: 18px; min-width: 18px; background: transparent; border-color: currentColor; opacity: .55; color: inherit; }

/* Popup başlığı */
.dx-popup-title.dx-toolbar { border-bottom: 1px solid var(--fx-border); }
.dx-popup-title .dx-toolbar-label { font-weight: 600; font-size: var(--fx-fs-lg) !important; }
.dx-popup-bottom.dx-toolbar { border-top: 1px solid var(--fx-border); }

/* Toast'lar sağ altta, gölgeli */
.dx-toast-content { box-shadow: var(--fx-shadow-pop); border-radius: var(--fx-r); }

/* Onay diyaloğu mesajı */
.fx-dialog-msg { max-width: 440px; line-height: 1.5; }
.fx-dialog-msg p + p { margin-top: var(--fx-s-2); color: var(--fx-text-2); }

/* ── 15. Duyarlı düzen ───────────────────────────────────────────── */
@media (max-width: 1280px) {
  :root { --fx-summary-w: 280px; }
}
@media (max-width: 1100px) {
  .fx-split { grid-template-columns: minmax(0, 1fr); }
  .fx-aside { position: static; }
}
@media (max-width: 900px) {
  .fx-ctx-firm span { max-width: 140px; }
  .fx-search-trigger span, .fx-search-trigger .fx-kbd { display: none; }
  .fx-search-trigger { flex: 0 0 auto; margin: 0 0 0 auto; padding: 0 var(--fx-s-2); }
  .fx-user-name { display: none; }
}
@media (max-width: 640px) {
  :root { --fx-content-pad: var(--fx-s-4); }
  .fx-ctx-firm, .fx-brand span, .fx-topbar-sep { display: none; }
  .fx-pagehead { padding-top: var(--fx-s-2); padding-bottom: var(--fx-s-2); }
  .fx-actions { width: 100%; justify-content: flex-end; }
  .fx-title { font-size: var(--fx-fs-lg); }
  .fx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fx-s-2); }
  .fx-kpi { padding: var(--fx-s-2) var(--fx-s-3); }
  .fx-kpi-value { font-size: var(--fx-fs-lg); }
  .fx-kpi-meta { font-size: var(--fx-fs-xs); }
  /* İkincil sayfa butonları yalnız ikon; birincil eylem metniyle kalır */
  .fx-actions .dx-button:not(.dx-button-default):not(.dx-button-danger) .dx-button-text { display: none; }
  .fx-actions .dx-button:not(.dx-button-default):not(.dx-button-danger) { min-width: 32px; }
  .fx-actions .dx-button:not(.dx-button-default):not(.dx-button-danger) .dx-button-content { padding-left: 6px; padding-right: 6px; }
  .fx-actions .dx-button .dx-icon { margin-right: 0; }
  .fx-actions .dx-button-default .dx-icon { margin-right: 6px; }
  .fx-filterbar .fx-field, .fx-filterbar .dx-dateRangeBox, .fx-filterbar .dx-selectbox { width: 100% !important; }
  .fx-segment { overflow-x: auto; max-width: 100%; }
  .fx-statusbar .hide-sm { display: none; }
}

/* ── 16. Baskı ───────────────────────────────────────────────────── */
@media print {
  html, body { height: auto; overflow: visible; background: #fff; color: #000; }
  .fx-app { display: block; }
  .fx-topbar, .fx-statusbar, .fx-nav, .fx-actions, .dx-datagrid-header-panel, .dx-datagrid-pager, .fx-no-print { display: none !important; }
  .fx-main { overflow: visible; }
  .fx-pagehead { position: static; background: none; backdrop-filter: none; }
  .fx-card { box-shadow: none; break-inside: avoid; }
}
