/* Tablo bileseni - mac-table/lines-table/dtable, satir yardimcilari, sayfalama, sirala gostergesi, uygulanan filtre cipleri */

/* ============================================================
   12. TABLES (lines-table, dtable)
   ============================================================ */
.mac-table-wrap, .table-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.mac-table, .lines-table, .dtable {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.mac-table thead th, .lines-table thead th, .dtable thead th {
  background: var(--gray-surface);
  text-align: left;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.mac-table thead th.right, .lines-table thead th.right, .dtable thead th.right { text-align: right; }
.mac-table thead th.center, .lines-table thead th.center, .dtable thead th.center { text-align: center; }
.mac-table tbody td, .lines-table tbody td, .dtable tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.mac-table tbody tr:last-child td,
.lines-table tbody tr:last-child td,
.dtable tbody tr:last-child td { border-bottom: none; }
.mac-table tbody tr, .dtable tbody tr {
  cursor: pointer; transition: background 0.15s ease;
}
.mac-table tbody tr:hover, .dtable tbody tr:hover { background: var(--row-hover-bg); }
.mac-table td.right, .lines-table td.right, .dtable td.right { text-align: right; font-variant-numeric: tabular-nums; }
.mac-table td.center, .lines-table td.center, .dtable td.center { text-align: center; }
.mac-table td.muted, .lines-table td.muted, .dtable td.muted { color: var(--muted); }
.mac-table td.num, .lines-table td.num, .dtable td.num { font-variant-numeric: tabular-nums; }

/* Row helpers */
.row-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gray-surface); color: var(--muted);
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.prod-cell { line-height: 1.35; min-width: 200px; max-width: 360px; }
.prod-name { font-size: 13px; font-weight: 500; color: var(--text); }
.prod-code {
  font-size: 11px; color: var(--muted);
  margin-top: 2px; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 6px;
}
.prod-code .bullet { color: rgba(0,0,0,0.18); }
.depo-cell { font-size: 12px; line-height: 1.35; }
.depo-name { font-weight: 500; color: var(--text); }
.depo-loc { color: var(--muted); margin-top: 2px; font-size: 11px; }
.lot-cell { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* .empty modifier'i bos-durum bileseninin global `.empty { display:flex }` kuraliyla
   cakisir; tablo hucresinde flex satir yuksekligini bozar (hucre kisalir, alt-border
   yukari kayar). Tablo-hucre davranisini geri sabitle. */
.lot-cell.empty { color: rgba(134,134,139,0.6); display: table-cell; text-align: left; }
.qty-cell { font-size: 13px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.qty-cell .qty-unit { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 3px; }
.reason-cell { font-size: 12px; color: var(--text); line-height: 1.4; max-width: 320px; }
.tutar { font-size: 13px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }

.row-action {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.row-action:hover { background: var(--hover-bg); color: var(--text); }

.add-row {
  padding: 12px 14px;
  border-top: 1px dashed var(--border);
  background: rgba(0,122,255,0.02);
}
.add-row a {
  font-size: 12px; color: var(--mac-blue);
  cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.add-row a:hover { text-decoration: underline; }
.add-row a i { font-size: 11px; }

/* Table footer (pagination) */
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; gap: 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}
.footer-left {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.per-page { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.per-page-drop {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 500;
}
.per-page-drop:hover { background: var(--gray-surface); }
.per-page-drop i { font-size: 9px; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: 4px; }
.pg-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 8px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
.pg-btn:hover { background: var(--gray-surface); border-color: var(--border-strong); }
.pg-btn.active {
  background: var(--mac-blue); border-color: var(--mac-blue); color: #fff;
  box-shadow: 0 1px 2px rgba(0,122,255,0.25);
}
.pg-btn.icon i { font-size: 12px; color: var(--muted); }
.pg-btn.icon:hover i { color: var(--text); }
.pg-ellipsis { padding: 0 6px; color: var(--muted); font-size: 13px; user-select: none; }

/* ============================================================
   25. SORT INDICATOR (table)
   ============================================================ */

.dtable th.sortable,
.lines-table th.sortable,
.mac-table th.sortable {
  cursor: pointer; user-select: none;
  padding-right: 22px; position: relative;
  transition: background 0.12s ease;
}
.dtable th.sortable:hover,
.lines-table th.sortable:hover,
.mac-table th.sortable:hover { background: var(--hover-bg); }

.dtable th.sortable::after,
.lines-table th.sortable::after,
.mac-table th.sortable::after {
  content: ''; position: absolute; right: 8px; top: 50%;
  width: 0; height: 0; transform: translateY(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--border-strong);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.dtable th.sortable:hover::after,
.lines-table th.sortable:hover::after,
.mac-table th.sortable:hover::after { opacity: 0.5; }

.dtable th.sort-asc::after,
.lines-table th.sort-asc::after,
.mac-table th.sort-asc::after {
  border-top: none;
  border-bottom: 5px solid var(--mac-blue);
  opacity: 1;
}
.dtable th.sort-desc::after,
.lines-table th.sort-desc::after,
.mac-table th.sort-desc::after {
  border-top: 5px solid var(--mac-blue);
  border-bottom: none;
  opacity: 1;
}
.dtable th.sort-asc,
.dtable th.sort-desc,
.lines-table th.sort-asc,
.lines-table th.sort-desc {
  color: var(--mac-blue);
}

/* Element-agnostik siralama basligi — mac-table <th> disi, grid-liste <div> basliklari
   (Denetim/AsistanKonusma vb.) icin. Ayni backend sort deseni (tablo-sirala.js) + ayni
   asc/desc ok davranisi. Kullanim: <div class="p360-sirali sort-asc" data-sira="tarih"
   hx-get=... hx-target=... hx-include=... hx-swap="innerHTML">Baslik</div> */
.p360-sirali {
  cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  transition: color 0.12s ease;
}
.p360-sirali::after {
  content: ''; flex: none;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--border-strong);
  opacity: 0; transition: opacity 0.15s ease;
}
.p360-sirali:hover::after { opacity: 0.5; }
.p360-sirali.sort-asc::after {
  border-top: none; border-bottom: 5px solid var(--mac-blue); opacity: 1;
}
.p360-sirali.sort-desc::after {
  border-top: 5px solid var(--mac-blue); border-bottom: none; opacity: 1;
}
.p360-sirali.sort-asc, .p360-sirali.sort-desc { color: var(--mac-blue); }

/* ============================================================
   26. APPLIED FILTERS CHIP ROW
   ============================================================ */

.applied-filters {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; flex-wrap: wrap;
  background: rgba(0,122,255,0.04);
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.applied-filters .af-label {
  color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.4px;
  font-size: 10px; margin-right: 4px;
}
.applied-filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 12px; color: var(--text);
}
.applied-filter-chip .af-key {
  color: var(--muted); font-weight: 400; margin-right: 2px;
}
.applied-filter-chip .af-val { font-weight: 500; }
.applied-filter-chip .af-x {
  width: 18px; height: 18px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.06);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  transition: all 0.12s ease;
}
.applied-filter-chip .af-x:hover { background: var(--red); color: #fff; }
.applied-filter-chip .af-x i { font-size: 9px; }
.applied-filters .af-clear {
  background: transparent; border: 0; color: var(--mac-blue);
  font-size: 12px; font-weight: 500; cursor: pointer;
  margin-left: auto; padding: 4px 8px;
}
.applied-filters .af-clear:hover { text-decoration: underline; }
