/* =====================================================================================================================
   ATMOSTRADE — ortak (trade-page, tr-*), Genel Bakış (td-*), Ayarlar (ts-*), Ürünler (tp-*), Stok (tk-*). Ortak bileşenler cf-* (27-cafe.css),
   KPI ve kartlar sd-* (28-school.css). js/pages/trade-*.js
   ===================================================================================================================== */

/* ---- Ortak ---- */
.trade-page { display: flex; flex-direction: column; gap: 14px; }
.trade-page [hidden], .modal-overlay[data-trade] [hidden] { display: none !important; }   /* display:flex/grid verilen öğelerde hidden geçerli kalsın */
.trade-page .btn-sm, .modal-overlay[data-trade] .btn-sm { width: auto; }
.trade-page .cf-tr[data-id], .trade-page .cf-tr[data-doc] { cursor: pointer; }
.trade-page .cf-tr[data-id]:hover, .trade-page .cf-tr[data-doc]:hover { background: var(--bg-elevated); }
.trade-page .cf-tr > span, .modal-overlay[data-trade] .cf-tr > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trade-page .cf-tr > span:last-child svg { width: 16px; height: 16px; color: var(--text-muted); }
.trade-page .cf-tr > span > .cf-chip, .modal-overlay[data-trade] .cf-tr > span > .cf-chip { align-self: flex-start; }   /* dikey hücrede etiket satırı boydan boya kaplamasın */
.modal.tr-wide { max-width: 860px; }
.modal-overlay[data-trade] .modal { max-height: 92vh; overflow-y: auto; }
.modal-overlay[data-trade] .cf-tabs { margin-bottom: 12px; }
.tr-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-search { min-width: 220px; flex: 1; }
.wf-check.tr-inline { display: inline-flex; margin: 0; white-space: nowrap; }
.tr-grow { flex: 2 !important; }
.tr-pager { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tr-neg { color: #c2262c; }
.tr-void { text-decoration: line-through; opacity: .6; }
.tr-pos { color: #15803d; }
.tr-in { width: 100%; max-width: 130px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13px; }
.tr-row-acts { flex-direction: row !important; justify-content: flex-end; }

/* ---- Genel Bakış ---- */
.trade-page a.sd-kpi { color: inherit; text-decoration: none; }
.trade-page a.sd-kpi:hover { border-color: var(--accent); }
.tr-mini-list { display: flex; flex-direction: column; gap: 4px; }
.tr-mini { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--bg-elevated); font-size: 13px; }

/* ---- Tablolar ---- */
.tr-prod-table .cf-tr { grid-template-columns: 2.4fr 1.1fr 1fr 1.1fr 1fr 24px; }
.tr-stock-table .cf-tr { grid-template-columns: 2.4fr 1.1fr .8fr 1fr 1fr 1fr; }
.tr-doc-table .cf-tr { grid-template-columns: 1.8fr 1fr 1.6fr .9fr 1fr 24px; }
.tr-move-table .cf-tr { grid-template-columns: 1.3fr .9fr .8fr 1.1fr 2fr; }
.tr-lines .cf-tr { grid-template-columns: 2.4fr 1.3fr 1.2fr 1fr; }
.tr-count-table .cf-tr { grid-template-columns: 2.4fr 1fr 1.2fr 1fr; }
.tr-whstock .cf-tr { grid-template-columns: 2fr 1fr 1fr 1fr; }
.tr-wh-table .cf-tr { grid-template-columns: 2.2fr 1fr 1.2fr 1.3fr 24px; }
.tr-pl-table .cf-tr { grid-template-columns: 2.2fr 1fr .8fr .8fr 60px; }
.tr-seq-table .cf-tr { grid-template-columns: 1.6fr 1.2fr 1.2fr .8fr 1.4fr; }
.tr-count-table, .tr-lines { max-height: 46vh; overflow-y: auto; }
.tr-count-table .cf-th, .tr-lines .cf-th { position: sticky; top: 0; z-index: 1; }

/* ---- Ürün kartı: birim / barkod / fiyat satırları ---- */
.tr-rows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
.tr-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-row input[type="text"], .tr-row select { flex: 1; min-width: 110px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13px; }
.tr-row input.tr-num { flex: 0 0 96px; min-width: 0; }
.tr-users { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); }

/* ---- İçe aktarma ---- */
.tr-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; margin: 10px 0; }
.tr-map .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.tr-map .field span { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.tr-sample { overflow-x: auto; margin-top: 10px; }
.tr-sample .cf-table { min-width: max-content; }
.tr-errors { display: flex; flex-direction: column; gap: 3px; max-height: 200px; overflow-y: auto; margin-top: 10px; }

/* ---- Ürün seçici (arama + barkod) ---- */
.tr-picker { position: relative; }
.tr-pick-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; margin-top: 4px;
    border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface); box-shadow: 0 10px 28px rgba(15, 27, 45, .18); }
.tr-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text-primary); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tr-pick:last-child { border-bottom: 0; }
.tr-pick small { color: var(--text-muted); font-size: 12px; }
.tr-pick:hover, .tr-pick.on { background: var(--bg-elevated); }
.tr-pick-none { padding: 10px 12px; }

/* ---- Cariler ---- */
.tr-party-table .cf-tr { grid-template-columns: 2.2fr 1fr 1.7fr 1fr 1fr 24px; }
.tr-st-table .cf-tr { grid-template-columns: 1fr 2.2fr 1fr 1fr 1.1fr 32px; }
.tr-aging-table .cf-tr { grid-template-columns: .7fr repeat(6, 1fr); }
.tr-st-table { max-height: 46vh; overflow-y: auto; margin-top: 10px; }
.tr-st-table .cf-th { position: sticky; top: 0; z-index: 1; }
.tr-open { background: var(--bg-elevated); }
.tr-chips { flex-direction: row !important; flex-wrap: wrap; gap: 4px !important; }
.tr-checks { display: flex; gap: 14px; padding: 8px 0; }
.tr-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.tr-date input { padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 13px; }
.tc-entry-acts { margin-top: 8px; }
#tcCardBalances { margin-bottom: 8px; align-items: center; }

/* ---- Tahsilat ve ödeme ---- */
.tr-pay-table .cf-tr { grid-template-columns: 1.4fr 1.8fr 1.2fr 1.3fr 1fr 24px; }
.tr-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tr-account { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated);
    color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.tr-account:disabled { cursor: default; }
.tr-account:not(:disabled):hover { border-color: var(--accent); }
.tr-account.off { opacity: .55; }
.tr-account-bal { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.tr-rates { display: flex; gap: 10px; flex-wrap: wrap; }
.tr-rate { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); min-width: 120px; }
.tr-rate span { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); }
.tr-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; }
.tr-kv > div { display: flex; flex-direction: column; gap: 2px; }

/* ---- Ayarlar ---- */
.ts-general { display: flex; flex-direction: column; gap: 14px; }
.ts-general .sd-card .field { margin-bottom: 0; }

/* ---- Stok ---- */
.tk-count-edit { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.tk-count-edit .tr-picker { flex: 1; min-width: 220px; margin: 0; }

/* ---- Satış belgeleri (trade-sales.js) ---- */
.modal.tr-xwide { max-width: 1080px; }
.tr-sales-table .cf-tr { grid-template-columns: 1.3fr 2fr 1.2fr 1.5fr 1fr 24px; }
.tr-ed-lines .cf-tr { grid-template-columns: 2.4fr 1.5fr 1fr .7fr .7fr 1.1fr 32px; }
.tr-ed-lines .tr-in { max-width: none; }
.tr-ed-lines .tr-qty { display: flex; align-items: center; gap: 6px; }
.tr-ed-lines .tr-qty .tr-in:first-child { max-width: 90px; }
.tr-ed-lines .tr-unit { max-width: 90px; padding: 5px 4px; }
.tr-ed-lines .tr-desc { max-width: none; }
.tr-dt-lines .cf-tr { grid-template-columns: 2.4fr 1.2fr 1.1fr .9fr 1.1fr; }
.tr-totals { display: flex; flex-direction: column; gap: 3px; margin: 10px 0 4px auto; width: min(320px, 100%); font-size: 13px; }
.tr-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.tr-totals > div:nth-last-child(1) b, .tr-totals > div b { font-size: 15px; }
.tr-dt-extra { margin-top: 12px; }
.tr-link { width: 100%; border: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.tr-link:hover { outline: 1px solid var(--accent); }
.tr-dt-acts { flex-wrap: wrap; gap: 8px; }
.tr-hide { display: none !important; }
.tr-exp-table .cf-tr { grid-template-columns: 1.3fr 2fr 1.3fr 1fr 1fr 32px; }

/* ---- Raporlar ve panel (trade-reports.js, trade-dashboard.js) ---- */
.tr-rep-table .cf-tr { grid-template-columns: 2.4fr 1fr 1.2fr 1.1fr 1.1fr .7fr .6fr; }
.tr-rep-table.tr-rep-purchase .cf-tr { grid-template-columns: 2.6fr 1fr 1.3fr .6fr; }
.tr-rep-aging .cf-tr { grid-template-columns: 2.2fr 1.1fr 1.1fr 1fr 1fr 1fr 1fr; min-width: 0; }
.tr-bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 6px; }
.tr-bar { flex: 1; min-width: 3px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; }
.tr-bar.neg { background: var(--danger); }
.tr-bar:hover { opacity: 1; }

@media (max-width: 760px) {
    .tr-prod-table .cf-tr { grid-template-columns: 2fr 1fr 1fr 24px; }
    .tr-prod-table .cf-tr > span:nth-child(2), .tr-prod-table .cf-tr > span:nth-child(3) { display: none; }
    .tr-stock-table .cf-tr { grid-template-columns: 2fr 1fr 1fr; }
    .tr-stock-table .cf-tr > span:nth-child(3), .tr-stock-table .cf-tr > span:nth-child(5), .tr-stock-table .cf-tr > span:nth-child(6) { display: none; }
    .tr-doc-table .cf-tr { grid-template-columns: 1.6fr 1fr 1fr 24px; }
    .tr-doc-table .cf-tr > span:nth-child(3), .tr-doc-table .cf-tr > span:nth-child(4) { display: none; }
    .tr-move-table .cf-tr { grid-template-columns: 1.2fr .8fr .8fr; }
    .tr-move-table .cf-tr > span:nth-child(4), .tr-move-table .cf-tr > span:nth-child(5) { display: none; }
    .tr-wh-table .cf-tr, .tr-pl-table .cf-tr { grid-template-columns: 2fr 1fr 24px; }
    .tr-wh-table .cf-tr > span:nth-child(2), .tr-wh-table .cf-tr > span:nth-child(3), .tr-pl-table .cf-tr > span:nth-child(3), .tr-pl-table .cf-tr > span:nth-child(4) { display: none; }
    .tr-party-table .cf-tr { grid-template-columns: 2fr 1.4fr 24px; }
    .tr-party-table .cf-tr > span:nth-child(2), .tr-party-table .cf-tr > span:nth-child(4), .tr-party-table .cf-tr > span:nth-child(5) { display: none; }
    .tr-pay-table .cf-tr { grid-template-columns: 1.2fr 1.4fr 1.2fr 24px; }
    .tr-pay-table .cf-tr > span:nth-child(3), .tr-pay-table .cf-tr > span:nth-child(5) { display: none; }
    .tr-st-table .cf-tr { grid-template-columns: .9fr 1.6fr 1fr 1fr 28px; }
    .tr-st-table .cf-tr > span:nth-child(3), .tr-st-table .cf-tr > span:nth-child(4) { display: none; }
    .tr-aging-table { overflow-x: auto; }
    .tr-aging-table .cf-tr { min-width: 620px; }
    .tr-seq-table .cf-tr { grid-template-columns: 1.2fr 1fr 1fr; }
    .tr-seq-table .cf-tr > span:nth-child(4), .tr-seq-table .cf-tr > span:nth-child(5) { display: none; }
    .tr-sales-table .cf-tr { grid-template-columns: 1.2fr 1.4fr 1.1fr 1fr 24px; }
    .tr-sales-table .cf-tr > span:nth-child(5) { display: none; }
    .tr-ed-lines { overflow-x: auto; }
    .tr-ed-lines .cf-tr { min-width: 720px; }
    .tr-dt-lines .cf-tr { grid-template-columns: 2fr 1fr 1fr; }
    .tr-dt-lines .cf-tr > span:nth-child(3), .tr-dt-lines .cf-tr > span:nth-child(4) { display: none; }
    .tr-exp-table .cf-tr { grid-template-columns: 1.3fr 1fr 1fr 32px; }
    .tr-exp-table .cf-tr > span:nth-child(2), .tr-exp-table .cf-tr > span:nth-child(3) { display: none; }
    .tr-rep-table .cf-tr { grid-template-columns: 1.8fr 1.1fr 1fr; }
    .tr-rep-table .cf-tr > span:nth-child(n+4) { display: none; }
    .tr-rep-table .cf-tr > span:nth-child(2) { display: none; }
    .tr-rep-table .cf-tr > span:nth-child(5) { display: block; }
    .tr-rep-aging { overflow-x: auto; }
    .tr-rep-aging .cf-tr { min-width: 680px; }
}

/* ---- Depo / plasiyer uygulaması (Depo.cshtml, Saha.cshtml — js/pages/trade-mobile|depot|field.js): telefon öncelikli, büyük dokunma alanları ---- */
.tm-page { max-width: 720px; margin: 0 auto; width: 100%; gap: 12px; }
.tm-page > div:not(.tm-net):not(.wf-banner) { display: flex; flex-direction: column; gap: 12px; }
.tm-page .btn { width: auto; padding: 11px 16px; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-primary); }
.tm-page .btn.btn-primary { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #07221b; }
.tm-page .btn:disabled { opacity: .55; pointer-events: none; }
.tm-page .btn-sm { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.tm-page .btn-sm svg { width: 15px; height: 15px; }
.tm-big { width: 100% !important; min-height: 52px; font-size: 16px !important; }
.tm-in { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: 16px; }
textarea.tm-in { min-height: 64px; resize: vertical; }
.tm-top, .tm-head, .tm-scanbar { display: flex; align-items: center; gap: 8px; }
.tm-top .tm-in, .tm-grow { flex: 1; min-width: 0; }
.tm-head { position: sticky; top: 0; z-index: 3; padding: 6px 0; background: var(--bg-base); }
.tm-head > b { flex: 1; font-size: 17px; }
.tm-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-title span { font-size: 12.5px; color: var(--text-muted); }
.tm-head .icon-mini, .tm-top .icon-mini { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; }
.tm-scanbar .tm-in { flex: 1; min-width: 0; }
.tm-cam { width: 56px !important; min-height: 46px; padding: 0 !important; display: grid !important; place-items: center; }
.tm-cam svg { width: 22px; height: 22px; }
.tm-sec-h { font-weight: 700; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }

/* bağlantı şeridi */
.tm-net { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; font-size: 13px; background: var(--bg-elevated); color: var(--text-muted); }
.tm-net svg { width: 16px; height: 16px; flex-shrink: 0; }
.tm-net span { flex: 1; }
.tm-net.on { display: none; }
.tm-net.off { background: rgba(148, 163, 184, .2); color: var(--text-primary); }
.tm-net.wait { background: rgba(245, 158, 11, .14); color: #b45309; }
.tm-net.bad { background: rgba(240, 85, 109, .14); color: var(--danger); }

/* ana ekran kutucukları */
.tm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; min-height: 112px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-surface); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.tm-tile svg { width: 28px; height: 28px; color: var(--accent); }
.tm-tile b { font-size: 15.5px; }
.tm-tile span { font-size: 12.5px; color: var(--text-muted); }
.tm-tile:active { transform: scale(.98); }
.tm-codes { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.tm-codes svg { width: 16px; height: 16px; }
.tm-codes span { flex: 1; }

/* belge / müşteri listesi */
.tm-docs { display: flex; flex-direction: column; gap: 8px; }
.tm-doc { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-surface); color: var(--text-primary); font: inherit; text-align: left; }
button.tm-doc { cursor: pointer; }
.tm-doc-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tm-doc-h b { font-size: 15px; }
.tm-doc-m { font-size: 12.5px; color: var(--text-muted); }

/* okutma sonucu + satırlar */
.tm-last { padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.tm-last.ok { background: rgba(21, 128, 61, .12); color: #15803d; }
.tm-last.bad { background: rgba(240, 85, 109, .14); color: var(--danger); }
.tm-lines { display: flex; flex-direction: column; gap: 8px; }
.tm-line { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface); }
.tm-line.part { border-left-color: var(--warning); }
.tm-line.done { border-left-color: #16a34a; }
.tm-line.flash { animation: tmFlash .7s ease; }
@keyframes tmFlash { from { background: var(--accent-soft); } to { background: var(--bg-surface); } }
.tm-line-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tm-line-m { font-size: 12.5px; color: var(--text-muted); }
.tm-shelf { flex-shrink: 0; padding: 2px 8px; border-radius: 8px; background: var(--bg-elevated); font-weight: 700; font-size: 12px; }
.tm-big-n { font-size: 18px; white-space: nowrap; }
.tm-step { display: flex; align-items: center; gap: 6px; }
.tm-st { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-elevated); color: var(--text-primary); cursor: pointer; }
.tm-st svg { width: 20px; height: 20px; }
.tm-st.tm-add { background: var(--accent-soft); border-color: transparent; color: var(--accent-bright); }
.tm-qty { width: 90px; text-align: center; font-weight: 700; }
.tm-unit { font-size: 13px; color: var(--text-muted); min-width: 36px; }
.tm-unit-sel { width: auto; min-width: 84px; }
.tm-n { min-width: 36px; text-align: center; font-size: 16px; }
.tm-foot { position: sticky; bottom: 0; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--bg-base); }
.tm-foot-2 { flex-direction: row; }
.tm-foot-2 .btn { flex: 1; }

/* kartlar, göstergeler */
.tm-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-surface); }
.tm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.tm-kpis > span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg-elevated); }
.tm-kpis small { font-size: 11.5px; color: var(--text-muted); }
.tm-kpis b { font-size: 15px; }
.tm-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tm-contact .cf-sub { width: 100%; }
.tm-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tm-total { display: flex; justify-content: space-between; font-size: 16px; padding: 4px 2px; }
.tm-amount { display: flex; align-items: center; gap: 8px; }
.tm-amount .tm-in { font-size: 22px; font-weight: 700; }
.tm-page .field { display: flex; flex-direction: column; gap: 4px; }
.tm-page .field label { font-size: 13px; color: var(--text-muted); }

/* gönderim kuyruğu */
.tm-out { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(245, 158, 11, .1); }
.tm-out.bad { background: rgba(240, 85, 109, .12); }
.tm-out > span { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-out small { font-size: 12px; color: var(--text-muted); }
.tm-outbox { display: flex; flex-direction: column; gap: 6px; }

/* katalog */
.tm-cat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 72px; }
.tm-prod { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-surface); }
.tm-prod.on { border-color: var(--accent); }
.tm-prod-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tm-cart-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20; width: min(680px, calc(100% - 28px));
    display: flex; align-items: center; gap: 10px; padding: 14px 18px; border: 0; border-radius: 16px; background: var(--accent); color: #07221b; font: inherit; font-weight: 700; font-size: 15px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25); cursor: pointer; }
.tm-cart-bar span { flex: 1; text-align: left; }
.tm-cart-bar svg { width: 20px; height: 20px; }

/* kamera okuyucu (tam ekran katman) */
.tm-scan { position: fixed; inset: 0; z-index: 1000; background: #000; }
.tm-scan[hidden] { display: none; }
.tm-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tm-scan-frame { position: absolute; left: 50%; top: 42%; width: min(78vw, 420px); height: min(34vw, 190px); transform: translate(-50%, -50%); border: 3px solid rgba(255, 255, 255, .9); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .38); }
.tm-scan-top, .tm-scan-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: #fff; }
.tm-scan-top { top: 0; padding-top: calc(14px + env(safe-area-inset-top)); justify-content: space-between; font-size: 16px; }
.tm-scan-bottom { bottom: 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); flex-direction: column; }
.tm-scan-x { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer; }
.tm-scan-x svg { width: 22px; height: 22px; }
.tm-scan-last { width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .55); font-weight: 600; text-align: center; }
.tm-scan-last.ok { background: rgba(22, 163, 74, .85); }
.tm-scan-last.bad { background: rgba(220, 38, 38, .85); }
.tm-scan-bottom .btn { background: rgba(255, 255, 255, .18); color: #fff; border: 0; }
html.tm-scanning, html.tm-scanning body { overflow: hidden; }
/* Tarayıcıda (kurulu uygulama dışında) dar ekranda sitenin alt menüsü (.bottom-nav, 62px) açık: sabit alt düğmeler onun üstünde dursun */
@media (max-width: 860px) {
    html:not(.pwa-app) .tm-foot { bottom: calc(62px + env(safe-area-inset-bottom)); }
    html:not(.pwa-app) .tm-cart-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ---- Entegrasyonlar (Entegrasyon.cshtml — js/pages/trade-integrations.js) ---- */
.ti-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ti-act { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated);
    color: var(--text-primary); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.ti-act:hover { border-color: var(--accent); }
.ti-act svg { width: 22px; height: 22px; color: var(--accent); }
.ti-act span { font-size: 12.5px; color: var(--text-muted); }
.ti-docs { margin-top: 12px; }
.ti-list { display: flex; flex-direction: column; gap: 10px; }
.ti-item { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-surface); }
.ti-item-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ti-item code, .ti-doc code { font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: var(--bg-elevated); word-break: break-all; }
.ti-item-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ti-item-acts .danger:hover { color: var(--danger); }
.ti-doc summary { cursor: pointer; }
.ti-doc-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; font-size: 13.5px; line-height: 1.55; }
.ti-doc-body p { margin: 0; }
.ti-doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ti-doc-table th, .ti-doc-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ti-code, .ti-payload { margin: 0; padding: 12px; border-radius: 12px; background: var(--bg-elevated); font-size: 12.5px; overflow-x: auto; white-space: pre; }
.ti-payload { max-height: 260px; margin-top: 10px; }
.ti-checks { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.ti-checks .wf-check { margin: 0; }
.ti-secret { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.ti-secret code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-elevated); font-size: 13px; word-break: break-all; user-select: all; }
.ti-warn { margin: 0; }
.ti-log-table .cf-tr { grid-template-columns: 1.4fr 1fr 1.6fr 2fr; }
.ti-log-msg { font-size: 12.5px; color: var(--text-muted); }
.ti-del-table .cf-tr { grid-template-columns: 1.4fr 1.1fr 1.6fr .8fr 80px; }
@media (max-width: 720px) {
    .ti-log-table .cf-tr, .ti-del-table .cf-tr { grid-template-columns: 1fr 1fr; }
}

/* ---- Pazaryerleri (Entegrasyon.cshtml → Pazaryerleri — js/pages/trade-marketplace.js) ---- */
.tmk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tmk-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 180px; }
.tmk-title b { font-size: 18px; }
.tmk-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tmk-table .cf-tr { grid-template-columns: 2fr 1fr .9fr .9fr 1.6fr 96px; }
.trade-page .cf-tr > span.tmk-row-acts { display: flex; flex-direction: row; align-items: center; gap: 2px; justify-content: flex-end; }
.tmk-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.tmk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); font-size: 13px; }
.tmk-chip small { color: var(--text-muted); }
.tmk-chip button { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.tmk-chip button:hover { color: var(--danger); }
.tmk-attrs { margin-bottom: 8px; }
.tmk-attr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
@media (max-width: 720px) {
    .tmk-table .cf-tr { grid-template-columns: 1fr 1fr; }
    .trade-page .cf-tr > span.tmk-row-acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- e-Fatura (Entegrasyon.cshtml → e-Fatura — js/pages/trade-einvoice.js) ---- */
.te-table .cf-tr { grid-template-columns: 1.4fr 1.4fr .9fr 1.6fr 96px; }
@media (max-width: 720px) { .te-table .cf-tr { grid-template-columns: 1fr 1fr; } }
