/*  ____   ___  _   _ _   _ ____ _____ _   _ ____
 * |  _ \ / _ \| \ | | | | / ___|_   _| | | |  _ \
 * | | | | | | |  \| | | | \___ \ | | | | | | |_) |
 * | |_| | |_| | |\  | |_| |___) || | | |_| |  _ <
 * |____/ \___/|_| \_|\___/|____/ |_|  \___/|_| \_\
 *
 * donustur.net · app/static/css/xml_view.css
 * XML dosyası açma aracına özgü parçalar: sekmeler, sanal ağaç, düğüm ayrıntısı, e-Fatura yönlendirmesi, hata bağlamı.
 * NOT: standart bileşenler (lfield, lfacts, btn, chip, tb-pv / tb-tb önizleme tablosu) local.css, pratik.css ve tablo.css'ten
 * gelir; burada kopyalanmaz. Renkler yalnız site belirteçleriyle (koyu tema kendiliğinden).
 * DİKKAT: .xv-r yüksekliği xml-ui.js ROW_H (26 px) ile aynı kalmalı; sanal liste satırı bu sayıyla konumlar.
 */
/* sonuç kutusu büyük sayının yanında değil, altında tam genişlik (ağaç dar sütuna sığmaz) */
.res--local .lbox:has(.xv-res) { grid-column: 1 / -1; grid-row: auto; align-self: start; }
.xv-res { display: grid; gap: 16px; min-width: 0; margin-top: 18px; }
.xv-b { min-height: 40px; padding-inline: 14px; font-size: 14px; }
/* XML adları olduğu gibi: büyük harfe çevrilmez (Türkçe yerelde "Invoice" → "INVOİCE" olurdu) */
.xv-code, .xv-pane .tb-tb thead th { font-family: var(--f-mono); text-transform: none; letter-spacing: 0; }
.xv-pane .tb-tb thead th { text-align: start; }

/* seçim kartı + e-Fatura yönlendirmesi (dosya seçilir seçilmez) */
.xv-sel { display: grid; gap: 10px; justify-items: start; }
.xv-sel .chip { width: 100%; }
.xv-efslot:empty { display: none; }
.xv-ef { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--ink); border-inline-start: 4px solid var(--signal); background: var(--paper); }
.xv-ef__h { font-weight: 650; }
.xv-ef__l { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* özet */
.xv-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; border-top: 1px solid var(--ink); font-size: 15px; }
.xv-facts dt, .xv-facts dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.xv-facts dt { padding-inline-end: 18px; font: 500 12.5px/1.9 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.xv-facts dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* sekmeler */
.xv-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ink); overflow-x: auto; }
.xv-tab { min-height: 44px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: none; font: 600 14px/1 var(--f-sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: color .25s var(--e-out), border-color .25s var(--e-out); }
.xv-tab:hover { color: var(--ink); }
.xv-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--signal); }
.xv-tab:focus-visible { outline: 2px solid var(--signal-strong); outline-offset: -2px; }
.xv-pane { display: grid; gap: 12px; min-width: 0; }
.xv-pane[hidden] { display: none; }

/* arama çubuğu */
.xv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.xv-q { flex: 1 1 220px; min-width: 0; }
.xv-q .lfield__i { min-height: 40px; font-size: 15px; }
.xv-nav { width: 40px; min-height: 40px; border: 1px solid var(--ink); border-radius: var(--r-1); background: var(--paper); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.xv-nav:hover { background: var(--ink); color: var(--paper); }
.xv-cnt { font: 500 13px/1 var(--f-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.xv-cnt:empty { display: none; }
.xv-oc { display: inline-flex; gap: 14px; margin-inline-start: auto; }

/* ağaç + ayrıntı */
.xv-tg2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); gap: 14px; align-items: start; }
.xv-tree { position: relative; height: min(62vh, 560px); overflow: auto; border: 1px solid var(--ink); background: var(--paper); overscroll-behavior: contain; contain: strict; }
.xv-tree:focus-visible { outline: 2px solid var(--signal-strong); outline-offset: 2px; }
.xv-tree__pad { position: relative; min-width: 100%; }
.xv-r { position: absolute; top: 0; left: 0; right: 0; height: 26px; padding-inline-end: 10px; font: 400 13px/26px var(--f-mono); white-space: pre; overflow: hidden; text-overflow: ellipsis; color: var(--ink); cursor: pointer; }
.xv-r:hover { background: var(--paper-2); }
.xv-r.is-hit { box-shadow: inset 3px 0 0 var(--signal); }
.xv-r.is-sel { background: var(--ink); color: var(--paper); }
.xv-r.is-sel :is(.xv-n, .xv-an, .xv-av, .xv-tx, .xv-cd, .xv-cm, .xv-pi, .xv-p, .xv-more) { color: inherit; }
.xv-tg { display: inline-block; width: 14px; color: var(--ink-3); }
.xv-n { color: var(--c-doc, #2E6BE6); font-weight: 600; }
.xv-an { color: var(--c-aud, #7A4FE0); }
.xv-av { color: var(--c-xls, #1E8A4F); }
.xv-tx { color: var(--ink); }
.xv-cd { color: var(--c-img, #C77700); }
.xv-cm, .xv-pi { color: var(--ink-3); font-style: italic; }
.xv-p { color: var(--ink-3); }
.xv-more { color: var(--ink-3); }
.xv-det { display: grid; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid var(--rule); background: var(--paper); position: sticky; top: 72px; max-height: min(62vh, 560px); overflow: auto; }
.xv-det__b { display: grid; gap: 8px; min-width: 0; }
.xv-det__f, .xv-det__a { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: 14px; }
.xv-det__f dt, .xv-det__a dt { color: var(--ink-2); }
.xv-det__f dd, .xv-det__a dd { margin: 0; overflow-wrap: anywhere; }
.xv-det__v { max-height: 220px; overflow: auto; margin: 0; padding: 8px 10px; border: 1px solid var(--rule); background: var(--paper-2); font: 13px/1.45 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.xv-det__c { flex-wrap: wrap; gap: 8px; }

/* metin ve tablo */
.xv-text { min-height: 360px; font-size: 13px; white-space: pre; overflow: auto; }
.xv-tbs { max-width: 420px; }
.xv-tba { flex-wrap: wrap; gap: 10px; }

/* hata bağlamı: hatalı satır ve imleç */
.xv-errx { display: grid; gap: 10px; margin-top: 12px; }
.xv-ctx { margin: 0; padding: 10px 12px; border: 1px solid var(--rule); background: var(--paper); font: 13px/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.xv-ctx__at { background: var(--signal); color: var(--paper); padding: 0 1px; }

/* yan panel: yapıştır */
.xv-paste { border-top: 1px solid var(--rule); padding-top: 10px; }
.xv-paste[open] { display: grid; gap: 10px; }
.xv-paste__s { min-height: 40px; display: flex; align-items: center; font-weight: 560; cursor: pointer; }

@media (max-width: 899.98px) {
  .xv-tg2 { grid-template-columns: minmax(0, 1fr); }
  .xv-det { position: static; max-height: none; }
  .xv-tree { height: min(58vh, 480px); }
}
@media (max-width: 479.98px) {
  .xv-q { flex-basis: 100%; }
  .xv-bar .y10-act { font-size: 13.5px; }
  .xv-facts { grid-template-columns: minmax(0, 1fr); }
  .xv-facts dt { padding-bottom: 0; border-bottom: 0; }
  .xv-tab { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .xv-tab { transition: none; }
}
