/* ============================================================
   İNŞAAT ERP — COMPONENTS CSS
   Anayasa V2.0 — Bölüm 6 / EK2 — Bölüm 3, 7, 8
   Table, Modal, Form, Button, Sidebar, Tab, KPI, Badge, Subtotal
   ============================================================ */

/* ============================================================
   1. BUTONLAR  (min 44x44px, Anayasa EK2 — Bölüm 8)
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-sky);
  color: #ffffff;
  border-color: var(--accent-sky);
}

.btn-primary:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--status-error);
  color: #ffffff;
  border-color: var(--status-error);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-icon {
  min-width: var(--touch-min);
  padding: 0.5rem;
}

.btn-block {
  width: 100%;
}

/* ============================================================
   BUTTON-TEXT pattern (Anayasa konvansiyonu — HER YERDE):
   Tüm butonlarda metin <span class="btn-text">...</span> içinde tutulur.
   Default: btn-text GİZLİ (icon-only her yerde). title="..." tooltip sağlar.
   Bu sayede butonlar minimal ve simetrik kalır.

   Tam metin istemek için: <span class="btn-text btn-text-keep">...</span>
   ============================================================ */
.btn .btn-text { display: none; }
.btn .btn-text.btn-text-keep { display: inline; }    /* opt-in tam metin */
/* Icon-only butonlar kare/dar olsun */
.btn:has(.btn-text):not(:has(.btn-text-keep))    { min-width: 40px; padding-left: 0.5rem; padding-right: 0.5rem; }
.btn-sm:has(.btn-text):not(:has(.btn-text-keep)) { min-width: 36px; padding-left: 0.5rem; padding-right: 0.5rem; }

/* ============================================================
   🆕 İŞLEM BARLARINDA BUTON ETİKETLERİ (Seçenek A — icon + isim)
   Sadece sayfa başlığı (.page-header) ve detay aksiyon barı (.id-actions)
   butonlarında metin GÖRÜNÜR olur; sığmazsa alta sarar.
   Kenar çubuğu / tablo / modal butonları icon-only KALIR (genel tasarım korunur).
   ============================================================ */
.page-header .btn .btn-text,
.id-actions  .btn .btn-text { display: inline; }
/* Dar ekranda: başlık tam satır → sayfa başlığı aksiyon butonları (Yeni Alış/Yeni Satış vb.)
   TEK SATIRDA birlikte kalsın (etiketli butonlar tek tek alt satıra kırılmasın). */
@media (max-width: 600px) {
  .page-header { justify-content: flex-end; }
  .page-header .page-title { flex-basis: 100%; min-width: 0; }
}
/* Bu barlarda ikon-only kare/dar kuralı iptal — buton içeriğe göre genişler */
.page-header .btn:has(.btn-text):not(:has(.btn-text-keep)),
.id-actions  .btn:has(.btn-text):not(:has(.btn-text-keep)) {
  min-width: 0;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}
/* Detay aksiyon barı: TEK SATIR + genişliğe göre dinamik taşma (action-overflow.js).
   Sığmayan butonlar "⋯ Diğer" menüsüne taşınır → bar hep tek satır, simetrik kalır. */
.id-actions {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;          /* taşan butonlar JS ile menüye gider; arada kalan klips gizlenir */
  gap: 0.4rem;
  align-items: center;
  position: relative;        /* açılır menü konumlandırma referansı */
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
/* "Diğer" açılır menüsü — body'ye eklenir (bar overflow'undan kaçar), konum JS ile (position:fixed) */
.id-more-menu {
  position: fixed;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  padding: 5px;
  min-width: 200px;
  max-width: 260px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Bar butonları DOĞAL genişlikte kalsın (shrink ile ezilmesin) → gerçek taşma oluşur,
   JS sığmayanları menüye taşır. */
.id-actions > .btn { flex: 0 0 auto; }
.id-more-menu[hidden] { display: none; }
.id-more-menu .btn {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
}
/* Menü öğelerinde isim GÖRÜNÜR (menü body'de olduğu için .id-actions scope'u dışında kalır) */
.id-more-menu .btn .btn-text { display: inline; }
.id-more-menu .btn:hover { background: var(--bg-hover, #f1f5f9); }

/* SVG icon-only butonlar — Lucide-tarzı (action ikonları, export, columns) */
.icon-btn-sm {
  min-width: 32px !important;
  width: 32px;
  height: 32px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn-sm svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.icon-btn-sm:hover svg {
  transform: scale(1.1);
  transition: transform 0.1s;
}
.icon-btn-sm .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.55rem !important;
  padding: 0.05rem 0.3rem !important;
  min-width: 16px;
}

/* ============================================================
   2. FORMLAR
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-label .required {
  color: var(--status-error);
  margin-left: 0.2rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.625rem 0.875rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  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='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}

.form-textarea {
  min-height: 88px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .form-row.two-col {
    grid-template-columns: 1fr 1fr;
  }
  .form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.form-error {
  font-size: 0.75rem;
  color: var(--status-error);
  margin-top: 0.25rem;
}

/* ============================================================
   3. TABLO  (.data-table)
   Mobilde JS ile kart listesine dönüşür.
   ============================================================ */

/* Üst yatay kaydırma çubuğu — tablo wrapper'ı ile senkron (uzun tabloda
   en alta inmeden kaydırabilmek için). JS .data-table-wrapper'dan önce ekler. */
.dt-hscroll-top {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  margin-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.dt-hscroll-top::-webkit-scrollbar {
  height: 10px;
  background: transparent;
}
.dt-hscroll-top::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}
.dt-hscroll-top::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.dt-hscroll-top-inner {
  height: 1px;
}

.data-table-wrapper {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  /* Yatayda taşan tabloyu kaydırma çubuğu ile göster (önceden 'hidden' idi → kesip atıyordu) */
  overflow-x: auto;
  overflow-y: hidden;
  /* iOS momentum scroll */
  -webkit-overflow-scrolling: touch;
  /* Tarayıcı scroll bar rengi */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.data-table-wrapper::-webkit-scrollbar {
  height: 10px;
  background: transparent;
}
.data-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}
.data-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.data-table {
  /* min-width: 100% → wrapper'ı her zaman doldur; ama content daha genişse büyüsün
     ve wrapper'ın overflow-x: auto'su yatay scroll bar'ı göstersin. */
  width: auto;
  min-width: 100%;
  border-collapse: separate;     /* sticky thead için collapse yerine separate */
  border-spacing: 0;
  font-size: 0.875rem;
  table-layout: auto;
}

/* === Modern başlık bar — indigo aksent, soft gradient === */
.data-table thead {
  background: linear-gradient(180deg, #f5f7ff 0%, #eef2ff 100%);
  position: sticky;
  top: 0;
  z-index: 5;
  /* Alt çizgi indigo aksent → tablo "bar"ı belli olur */
  box-shadow: 0 2px 0 var(--accent-sky);
}
[data-theme="dark"] .data-table thead {
  background: linear-gradient(180deg, rgba(99,102,241,0.10) 0%, rgba(99,102,241,0.04) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 0 var(--accent-sky);
}

.data-table th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 0.7rem;          /* 11px */
  font-weight: 700;            /* indigo aksent vurguya hafif kalın */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4338ca;              /* indigo-700 — pastel zemin üstünde okunaklı */
  border-bottom: 1px solid var(--border);
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
[data-theme="dark"] .data-table th {
  color: #c7d2fe;              /* indigo-200 */
}
/* Sortable hover: hafif highlight */
.data-table th.sortable:hover {
  background: rgba(99, 102, 241, 0.10);
  color: #312e81;              /* indigo-900 */
}
[data-theme="dark"] .data-table th.sortable:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #e0e7ff;
}
/* Aktif sıralı kolon vurgusu */
.data-table th.sort-asc,
.data-table th.sort-desc {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-sky);
}

.data-table th.sortable {
  cursor: pointer;
}

.data-table th.sortable::after {
  content: ' ↕';
  opacity: 0.4;
  font-size: 0.7rem;
}

.data-table th.sort-asc::after {
  content: ' ↑';
  opacity: 1;
  color: var(--accent-sky);
}

.data-table th.sort-desc::after {
  content: ' ↓';
  opacity: 1;
  color: var(--accent-sky);
}

.data-table td {
  padding: 0.55rem 0.75rem;     /* daha kompakt */
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.8125rem;          /* 13px — referans örnek */
  /* Hücreler doğal genişliğinde kalsın → tablo gerektiğinde wrapper'ı taşar
     ve yatay scroll bar görünür. Çok uzun metinler için max-width + ellipsis: */
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Açıklama gibi gerçekten uzun olabilen kolonlar için opt-in */
.data-table td.cell-wrap {
  white-space: normal;
  max-width: none;
}

.data-table tbody tr {
  transition: background-color 0.1s;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .td-right {
  text-align: right;
}

.data-table .td-center {
  text-align: center;
}

/* Mobil kart listesi (tablo yerine) */
.data-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.data-card.expanded {
  border-color: var(--accent-sky);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

/* Header-wrap: checkbox + (toggle butonu) tek satırda */
.data-card-header-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
}
/* Sol checkbox alanı — tıklanabilir, akordiyonu açmaz */
.data-card-select {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border-right: 1px solid var(--border);
  background: var(--bg-input);
  flex-shrink: 0;
}
.data-card-select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-sky);
}

/* Akordiyon header (her zaman görünür, tıklanabilir) — DİKEY iki satır */
.data-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.875rem;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s;
}
.data-card-header:hover  { background: var(--bg-hover); }
.data-card-header:active { background: var(--bg-input); }

/* Üst satır: Başlık (tam genişlik) + chevron (minik sağ üst) */
.data-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}
.data-card-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;     /* başlık tüm yatay alanı kaplasın */
}
.data-card-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.25;
  word-break: break-word;
}
.data-card-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Alt satır: chips (sol, esnek) + badge (sağ, sabit) — simetrik */
.data-card-chips-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}
.data-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}
.data-card-badge {
  flex-shrink: 0;
}
.data-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.data-card-chip-brand {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}
.data-card-chip-price {
  color: var(--status-success);
  border-color: var(--status-success);
  background: rgba(34, 197, 94, 0.08);
  font-weight: 700;
}

.data-card-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.25rem;
  transition: transform 0.2s ease;
  display: inline-block;
}
.data-card.expanded .data-card-chevron {
  transform: rotate(180deg);
  color: var(--accent-sky);
}

/* Akordiyon body — varsayılan kapalı */
.data-card-body {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.875rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-input);
}
.data-card.expanded .data-card-body {
  display: flex;
  animation: accordion-slide 0.2s ease;
}
@keyframes accordion-slide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.data-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.625rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.data-card-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.2rem 0;
  border-bottom: 1px dashed var(--border);
}
.data-card-meta-row:last-child { border-bottom: 0; }
.data-card-meta-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  flex-shrink: 0;
}
.data-card-meta-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.data-card-actions {
  display: flex;
  gap: 0.4rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

/* Alt toplam barı — modern indigo aksent */
.subtotal-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  border-top: 2px solid var(--accent-sky);   /* indigo aksent çizgi */
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 0.8125rem;
}
[data-theme="dark"] .subtotal-bar {
  background: linear-gradient(180deg, rgba(99,102,241,0.10), rgba(99,102,241,0.05));
  border-top-color: var(--accent-sky);
}

.subtotal-bar-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-sky);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.subtotal-bar-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #3730a3;          /* indigo-800 — yoğun */
}
[data-theme="dark"] .subtotal-bar-value {
  color: #a5b4fc;
}

/* Alttaki Excel/PDF/CSV export barını gizle — kullanıcı isteği:
   buton tekrarı olmasın, sayfa üst header'da olur. */
.dt-export { display: none !important; }

/* Sayfalama */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.pagination-size {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* ============================================================
   4. MODAL  (.modal-overlay, .modal-content)
   Anayasa EK2 — Bölüm 2.3, 8 (silme onayı)
   ============================================================ */

/* === MODAL — modern, merkezi, sticky header + footer === */
.modal-overlay {
  position: fixed;
  inset: 0;
  /* Karartılmış arkaplan + blur efekti */
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Tam merkez — flex */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, backdrop-filter 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;        /* daha yumuşak */
  width: 100%;
  max-width: 480px;            /* default md daha geniş */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  /* Daha güçlü gölge — modal'ın "yüzdüğü" hissi */
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.25),
              0 8px 16px -8px rgba(0, 0, 0, 0.15),
              0 0 0 1px rgba(99, 102, 241, 0.06);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  /* Tam merkez konum garantili (margin auto fallback) */
  margin: auto;
}

.modal-overlay.open .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.65);
}
[data-theme="dark"] .modal-content {
  background: #1e293b;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6),
              0 8px 16px -8px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(99, 102, 241, 0.20);
}

/* Boyutlar — masaüstünde geniş, mobile @media (max-width: 640px) full-width */
.modal-content.size-sm  { max-width: 420px;  }
.modal-content.size-md  { max-width: 680px;  }
.modal-content.size-lg  { max-width: 980px;  }
.modal-content.size-xl  { max-width: 1200px; }
.modal-content.size-2xl { max-width: 1400px; }
/* Çok büyük ekranlar için 92vw cap */
@media (min-width: 1280px) {
  .modal-content.size-lg  { max-width: min(980px,  92vw); }
  .modal-content.size-xl  { max-width: min(1200px, 92vw); }
  .modal-content.size-2xl { max-width: min(1400px, 92vw); }
}

/* === HEADER — indigo aksent ile === */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: inherit;
  border-radius: 16px 16px 0 0;
  z-index: 2;
  /* Üstte hafif indigo gradient — başlığa karakter */
  background: linear-gradient(180deg, #f5f7ff 0%, var(--bg-card) 100%);
}
[data-theme="dark"] .modal-header {
  background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, #1e293b 100%);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.10);
  color: var(--status-error);
  transform: rotate(90deg);
}

/* === BODY === */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* === FOOTER === */
.modal-footer {
  display: flex;
  justify-content: flex-end;     /* butonlar sağa hizalı (Cancel/Save) */
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg-input);    /* hafif gri ton */
  border-radius: 0 0 16px 16px;
  z-index: 2;
}
[data-theme="dark"] .modal-footer {
  background: rgba(15, 23, 42, 0.6);
}

.modal-footer .btn {
  flex: 0 0 auto;                /* button width = content */
  min-width: 100px;
}
.modal-footer .btn-secondary {
  /* İptal butonu hafif daha sönük */
  font-weight: 500;
}

/* Mobile — full-height bottom-sheet stilinde */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-content {
    max-width: 100% !important;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    /* Slide-up from bottom on mobile */
    transform: translateY(40px);
  }
  .modal-header,
  .modal-footer {
    border-radius: 0;
  }
  .modal-overlay.open .modal-content {
    transform: translateY(0);
  }
  .modal-footer .btn { flex: 1; }   /* mobile'da full-width */
}

/* Silme onay modalı için özel ikon */
.modal-icon-warning {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 6px rgba(245, 158, 11, 0.3));
}

/* ============================================================
   5. SİDEBAR  (.sidebar)
   Anayasa EK2 — Bölüm 3.1
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width 0.2s ease, transform 0.2s ease;
  overflow-y: auto;
  overflow-x: hidden;
  /* iOS notch + dinamik ada: sidebar üstü status bar ile çakışmasın */
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left:  env(safe-area-inset-left, 0);
}

[data-theme="dark"] .sidebar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar-collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .section-title,
.sidebar-collapsed .sidebar-brand,
.sidebar-collapsed .sidebar-toggle {
  display: none;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
}

/* Daraltılmışken header: logo tek başına ortalanır ve tıklanabilir hale gelir */
.sidebar-collapsed .sidebar-header {
  padding: 0.5rem;
  justify-content: center;
  cursor: pointer;
}

.sidebar-collapsed .sidebar-logo {
  cursor: pointer;
  position: relative;
}

/* Daraltılmışken logo üzerine hover'da "aç" hint'i */
.sidebar-collapsed .sidebar-header:hover .sidebar-logo {
  box-shadow: 0 0 0 2px var(--accent-sky);
}

.sidebar-collapsed .sidebar-header::after {
  content: '☰';
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 0.6rem;   /* yatay padding kısıldı → marka + toggle birlikte sığsın */
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-blue));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  /* Yer dar kalırsa marka kısalsın — toggle butonunun alanını çalmasın */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  margin-left: auto;
  width: 32px;
  height: 32px;
  flex-shrink: 0;          /* asla küçülmesin — tıklanabilir kalsın (13px'e sıkışıyordu) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.05rem;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-group {
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.625rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.82rem;
  min-height: 32px;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(14, 165, 233, 0.12);
  color: var(--accent-sky);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.sidebar-label {
  flex: 1;
}

/* 🆕 Sidebar collapsible alt menü */
.nav-submenu {
  max-height: 600px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}
.nav-submenu:not(.open) {
  max-height: 0;
  opacity: 0;
}
.nav-submenu .nav-sub {
  padding-left: 2rem;
  font-size: 0.78rem;
  position: relative;
}
.nav-submenu .nav-sub::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border, #e2e8f0);
  opacity: 0.5;
}
.nav-submenu .nav-sub .nav-icon {
  font-size: 0.95rem;
  width: 20px;
}
.nav-parent .nav-toggle {
  transition: transform 0.2s ease;
  display: inline-block;
}
.nav-parent[aria-expanded="false"] .nav-toggle {
  transform: rotate(-90deg);
}

/* 🆕 R-fix: Mobilde sidebar gizli — eski 1023px çok agresifti, 767'ye indi.
   Tablet ve dar laptop ekranlarda (768-1023px) sidebar görünür kalır;
   kullanıcı dar bulursa toggle ile daraltabilir. */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* Desktop + tablet'te ana içerik sidebar payı */
@media (min-width: 768px) {
  .main-with-sidebar {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.2s ease;
  }
  .main-with-sidebar.collapsed {
    margin-left: var(--sidebar-collapsed-width);
  }
}

/* ============================================================
   6. APP HEADER  (üst bar — desktop ve mobile)
   ============================================================ */

.app-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  z-index: 40;
}

/* Mobile bar (header) — < 1024px aralığında görünür */
.mobile-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* iOS notch/Android status-bar için top padding:
     max(env, 12px) → cihaz safe-area bildirse de bildirmese de
     en az 12px boşluk garantili. Standalone PWA'da 24-44px döner. */
  padding-top:    max(env(safe-area-inset-top, 0), 22px);
  padding-right:  max(env(safe-area-inset-right, 0), 0.875rem);
  padding-bottom: 0;
  padding-left:   max(env(safe-area-inset-left, 0), 0.875rem);
  /* Header yüksekliği = standart + safe-area top */
  min-height: calc(var(--header-height) + max(env(safe-area-inset-top, 0), 22px));
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  -webkit-tap-highlight-color: transparent;
  /* Touch hedef alanları yukarı kaymasın */
  box-sizing: border-box;
}
.mobile-bar > * {
  /* İçerikleri safe-area altında dikey hizala */
  align-self: center;
  margin-top: 0;
  position: relative;
  z-index: 1; /* mobile-bar background'ın üstünde, tıklanabilir kalsın */
}
/* Mobile menü butonu özellikle ön plana çıksın */
#mobile-menu-btn {
  position: relative;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
}
[data-theme="dark"] .mobile-bar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.mobile-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-blue));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
}

/* Mobil arama satırı (mobile-bar altında ayrı satır) */
.mobile-search-row {
  padding: 0.5rem 1rem 0.25rem;
}

/* ============================================================
   Mobil filtre accordion
   - Mobilde (<768px) "🔧 Filtreler" butonuyla aç/kapa
   - Desktop'ta toggle butonu gizli, filtreler her zaman görünür
   ============================================================ */
.filters-mobile-toggle { display: none; }

/* Mobil "Tümünü Seç" satırı — sadece mobilde görünür */
.mobile-only-select-bar { display: none !important; }
@media (max-width: 768px) {
  .mobile-only-select-bar { display: flex !important; }
}

.filters-collapsible {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex: 1 1 auto;
}

@media (max-width: 768px) {
  .filters-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;   /* sağa it */
  }
  .filters-mobile-toggle .badge {
    padding: 0.05rem 0.4rem;
    font-size: 0.7rem;
    min-width: 18px;
    text-align: center;
  }

  /* Filtre dropdown'ları mobilde varsayılan olarak gizli */
  .filters-collapsible {
    display: none;
    width: 100%;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 0.25rem;
    animation: filters-slide 0.18s ease;
  }
  .filters-collapsible.expanded { display: flex; }
  .filters-collapsible select,
  .filters-collapsible .btn {
    width: 100%;
    min-height: 40px;
  }
  .filters-collapsible label {
    padding: 0.5rem 0.25rem;
  }
}
@keyframes filters-slide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobil: dt-toolbar (Sütunlar / Excel / PDF) — search + Filtreler ile aynı satırda hizalı kalır.
   Yer yetmediğinde flex-wrap doğal olarak alt satıra atar. */
@media (max-width: 768px) {
  #product-filters .dt-toolbar {
    padding: 0 !important;
    min-height: 40px !important;
    align-items: center;
  }
  #product-filters .dt-cols-wrapper {
    display: inline-flex;
    align-items: center;
  }
}

/* ⚠ ESKİ per-ID filtre kuralları (40px yükseklik, #product-filters desktop-wrap,
   filters-mobile-toggle) KALDIRILDI. Tüm filtre barları artık dosya sonundaki
   tek "STANDART FİLTRE BARI" bloğu (.page-filters / .tx-filters) ile yönetilir. */

/* Mobil "Tümünü Seç" satırı: kendi satırında, kart listesinden hemen önce */
.mobile-only-select-bar {
  margin-top: 0.25rem;
}

/* ============================================================
   BULK ACTION BAR — Toplu işlem popover'ı
   Pozisyon: viewport ALT-ORTA (modern app pattern — Notion/Linear/Figma)
   Sidebar etkisi yok çünkü viewport center kullanılıyor
   ============================================================ */
.bulk-action-bar {
  position: fixed;
  /* Alt orta — sidebar genişliğini hesaba kat */
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  /* Desktop: sidebar açıkken sidebar'dan sonraki alanı ortala */
  margin-left: calc(var(--sidebar-width) / 2);
  /* Layout — yatayda gruplu (inline style="display:none" gizler) */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Görünüm — kalın indigo gradient + güçlü cam efekti */
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.97) 0%, rgba(139, 92, 246, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 0.5rem 0.6rem;
  /* Çok katmanlı gölge — "yüzen" his */
  box-shadow:
    0 24px 60px -12px rgba(99, 102, 241, 0.50),
    0 12px 24px -8px rgba(0, 0, 0, 0.20),
    0 0 0 1px rgba(255, 255, 255, 0.10) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 90;
  color: #fff;
  /* Slide-up animasyon */
  animation: bulkBarSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bulkBarSlideIn {
  from { opacity: 0; transform: translate(calc(-50% + var(--sidebar-width) / 2), 30px) scale(0.92); }
  to   { opacity: 1; transform: translate(calc(-50% + var(--sidebar-width) / 2), 0) scale(1); }
}
/* Sidebar daraltılmışsa, margin-left ona göre güncelle */
.sidebar-collapsed ~ #main .bulk-action-bar,
.sidebar-collapsed + .bulk-action-bar,
body:has(.sidebar.sidebar-collapsed) .bulk-action-bar {
  margin-left: calc(var(--sidebar-collapsed-width) / 2);
}
/* Mobil: sidebar yok, ortala */
@media (max-width: 1024px) {
  .bulk-action-bar {
    margin-left: 0;
  }
  @keyframes bulkBarSlideIn {
    from { opacity: 0; transform: translate(-50%, 30px) scale(0.92); }
    to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
  }
}
[data-theme="dark"] .bulk-action-bar {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(139, 92, 246, 0.92) 100%);
  box-shadow:
    0 24px 60px -12px rgba(99, 102, 241, 0.60),
    0 12px 24px -8px rgba(0, 0, 0, 0.40),
    0 0 0 1px rgba(255, 255, 255, 0.10) inset;
}

/* Sayı göstergesi — beyaz pill (gradient zemin üstünde) */
.bulk-bar-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.20);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.bulk-bar-count .bulk-bar-icon { font-size: 0.85rem; opacity: 0.9; }
.bulk-bar-count .bulk-bar-count-num {
  font-size: 1.05rem;
  min-width: 18px;
  text-align: center;
  /* Pulse animasyon (yeni seçim olduğunda dikkat çek) */
}
.bulk-bar-count .bulk-bar-count-label { font-weight: 500; opacity: 0.85; font-size: 0.75rem; }

/* Buton grupları — yarı saydam ayraçlarla */
.bulk-bar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}
.bulk-bar-group:first-of-type {
  padding-left: 0;
  border-left: 0;
}
.bulk-bar-group.bulk-bar-danger {
  border-left-color: rgba(239, 68, 68, 0.40);
}

/* Icon butonları — beyaz icon, hover'da glassmorphism efekti */
.bulk-action-bar .icon-btn-sm {
  background: transparent;
  color: #fff !important;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.bulk-action-bar .icon-btn-sm:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.20);
}
.bulk-action-bar .icon-btn-sm:active {
  transform: translateY(0) scale(0.98);
}
.bulk-action-bar .bulk-bar-danger .icon-btn-sm:hover {
  background: rgba(239, 68, 68, 0.30);
}

/* Temizle butonu — sağ ucu, beyaz outline */
.bulk-action-bar .bulk-bar-close {
  margin-left: auto;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.20) !important;
  color: #fff !important;
  height: 34px;
  min-height: 34px !important;
  font-weight: 600;
}
.bulk-action-bar .bulk-bar-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Mobile — alt-ortada, ekran genişliğine yayılır (sidebar yok) */
@media (max-width: 768px) {
  .bulk-action-bar {
    /* base'deki bottom: 1.5rem ve transform geçerli kalır — sadece konumu sıkılaştır */
    bottom: 0.75rem;
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-width: none;
    transform: none;       /* translateX(-50%) iptal — left/right ile zaten ortalı */
    margin-left: 0;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
    animation: bulkBarSlideInMobile 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  @keyframes bulkBarSlideInMobile {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .bulk-action-bar .bulk-bar-close {
    margin-left: auto;
    padding-left: 0.5rem;
  }
  .bulk-action-bar .bulk-bar-count .bulk-bar-count-label {
    display: none;   /* mobilde sadece sayı + ✓ */
  }
}

/* 🆕 R-fix: Responsive görünürlük — eskiden 1024px breakpoint, şimdi 768 (tablet/dar laptop sidebar görür) */
.desktop-only { display: none; }

@media (min-width: 768px) {
  .desktop-only       { display: flex; }
  .mobile-only-bar    { display: none; }
  .mobile-search-row  { display: none; }
}

[data-theme="dark"] .app-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-header-title {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.app-header-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.app-header-search input {
  width: 100%;
  height: 38px;
  padding: 0 0.875rem 0 2.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}

.app-header-search input:focus {
  border-color: var(--accent-sky);
}

.app-header-search::before {
  content: '🔍';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.7;
  pointer-events: none;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.icon-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  position: relative;
  font-size: 1.05rem;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.icon-btn .badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--status-error);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.profile-chip:hover {
  background: var(--bg-hover);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-pink));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================================
   7. TAB BAR  (.tab-bar)
   Anayasa EK2 — Bölüm 2.2
   ============================================================ */

.tab-bar {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;       /* iOS akıcı yatay kaydırma */
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0 0.25rem;
  flex-wrap: nowrap;                        /* tek satır — taşan kısım kaydırılır */
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 0.7rem 1rem;
  font-size: 0.8125rem;          /* 13px — referans */
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;   /* 3px (referansla aynı) */
  white-space: nowrap;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  background: transparent;
  border-radius: 0;
  flex: 0 0 auto;                          /* daralmasın → metin kesilmesin */
  scroll-snap-align: start;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

/* Mobil: sekmeler daha kompakt → daha fazlası görünür, kalanı kaydırılır */
@media (max-width: 640px) {
  .tab {
    padding: 0.6rem 0.7rem;
    font-size: 0.78rem;
    gap: 0.3rem;
  }
}

.tab:hover {
  color: var(--accent-sky);
  background: rgba(99, 102, 241, 0.05);   /* indigo soft hover */
}

.tab-active {
  color: var(--accent-sky);
  border-bottom-color: var(--accent-sky);
  font-weight: 600;
  background: transparent;
}

/* ============================================================
   8. MODÜL KART GRİDİ (mobil ana sayfa)
   Anayasa EK2 — Bölüm 2.1
   ============================================================ */

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
}

@media (min-width: 768px) {
  .module-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
  }
}

@media (min-width: 1024px) {
  .module-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.625rem;
    padding: 0.75rem 1rem;
  }
}

@media (min-width: 1280px) {
  .module-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 1600px) {
  .module-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.module-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.625rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 78px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--module-color, var(--accent-sky));
}

.module-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--module-color, var(--accent-sky));
}

.module-card-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.module-card-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.15;
}

.module-card-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-card.span-2 {
  grid-column: span 2;
}

/* Modül renk varyantları (utility class — module-card için) */
.mc-dashboard    { --module-color: #3b82f6; }
.mc-budget       { --module-color: #10b981; }
.mc-quotes       { --module-color: #8b5cf6; }
.mc-products     { --module-color: #f59e0b; }
.mc-expenses     { --module-color: #ef4444; }
.mc-invoices     { --module-color: #06b6d4; }
.mc-finance      { --module-color: #14b8a6; }
.mc-creditcards  { --module-color: #f97316; }
.mc-accounts     { --module-color: #6366f1; }
.mc-projects     { --module-color: #ec4899; }
.mc-workplan     { --module-color: #0ea5e9; }
.mc-personnel    { --module-color: #a855f7; }
.mc-pdks         { --module-color: #22c55e; }
.mc-quicksale    { --module-color: #eab308; }
.mc-checks       { --module-color: #64748b; }
.mc-reports      { --module-color: #0891b2; }
.mc-settings     { --module-color: #78716c; }

/* ============================================================
   9. KPI ÖZET BARI (mobil header altı)
   ============================================================ */

.kpi-strip {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.kpi-strip::-webkit-scrollbar {
  display: none;
}

.kpi-chip {
  flex-shrink: 0;
  min-width: 110px;
  padding: 0.4rem 0.625rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.kpi-chip-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.1;
}

.kpi-chip-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-chip-value.warning { color: var(--status-warning); }
.kpi-chip-value.danger  { color: var(--status-error); }
.kpi-chip-value.success { color: var(--status-success); }

/* ============================================================
   10. FİLTRE BARI
   ============================================================ */

.filter-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0.375rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--accent-sky);
}

.filter-chip.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: var(--accent-sky);
  color: var(--accent-sky);
}

/* ============================================================
   11b. DATA TABLE — SÜTUN GİZLE/GÖSTER POPOVER
   ============================================================ */

.dt-cols-wrapper {
  position: relative;
}

.dt-cols-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: 280px;
  max-height: 60vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="dark"] .dt-cols-popover {
  background: #1e293b;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dt-cols-popover[hidden] {
  display: none;
}

.dt-cols-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dt-cols-popover-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.3rem;
}

.dt-cols-popover-footer {
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-input);
}

.dt-col-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.dt-col-item:hover {
  background: var(--bg-hover);
}

.dt-col-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-sky);
}

.dt-col-item input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dt-col-item input[type="checkbox"]:disabled + span {
  color: var(--text-muted);
}

/* ============================================================
   11. TOAST / BİLDİRİM (placeholder — JS ile yönetilir)
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 92vw;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  pointer-events: auto;
}

.toast-success { border-color: var(--status-success); }
.toast-error   { border-color: var(--status-error); }
.toast-warning { border-color: var(--status-warning); }


/* ============================================================
   14. SKELETON YÜKLEME (loading placeholders)
   Kullanım: <div class="skeleton skeleton-text"></div>
            <div class="skeleton skeleton-row"></div>
            <div class="skeleton skeleton-circle"></div>
   ============================================================ */

.skeleton {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--bg-input) 0%,
    rgba(99, 102, 241, 0.08) 50%,
    var(--bg-input) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(99, 102, 241, 0.14) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text   { width: 100%; height: 0.9rem; border-radius: 4px; }
.skeleton-text-sm{ width: 60%;  height: 0.75rem; border-radius: 4px; }
.skeleton-text-lg{ width: 80%;  height: 1.3rem; border-radius: 6px; }
.skeleton-circle { width: 36px; height: 36px;   border-radius: 50%; }
.skeleton-row    { width: 100%; height: 2.5rem; border-radius: 6px; margin-bottom: 0.5rem; }
.skeleton-card   { width: 100%; height: 5rem;   border-radius: 8px; margin-bottom: 0.6rem; }

.skeleton-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}


/* ============================================================
   15. EMPTY STATE — Boş durum kartı
   Kullanım:
     <div class="empty-state">
       <div class="empty-state-icon">📦</div>
       <div class="empty-state-title">Henüz kayıt yok</div>
       <div class="empty-state-text">Sağ üstte "+ Yeni" ile başla.</div>
       <button class="btn btn-primary btn-sm empty-state-cta">+ Yeni Kayıt</button>
     </div>
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
}

.empty-state.compact {
  padding: 1.25rem 1rem;
}

.empty-state-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  opacity: 0.7;
}
.empty-state.compact .empty-state-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.empty-state.compact .empty-state-title { font-size: 0.92rem; }

.empty-state-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 0.75rem;
  line-height: 1.45;
}
.empty-state.compact .empty-state-text { font-size: 0.8rem; margin-bottom: 0.5rem; }

.empty-state-cta {
  margin-top: 0.35rem;
}


/* ============================================================
   16. STANDART FİLTRE BAR (page-level)
   .page-filters — sayfa başında inline filtre satırı için ortak class.
   Mobilde otomatik collapsible (UI.bindFilterBarToggle ile).
   ============================================================ */

/* ============================================================
   STANDART FİLTRE BARI — TEK STANDART (tüm liste sayfaları + detay ekstre sekmeleri)
   Masaüstü & mobil: tek satır 3D blok + yatay kaydırma. Collapse YOK.
   Export/kolon butonları (.dt-toolbar) blok içinde sağ uçta.
   Kapsam: .page-filters (liste barları) + .tx-filters (ekstre barları)
   ============================================================ */
.page-filters,
.tx-filters {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.4rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 0.45rem 0.6rem !important;
  margin: 0 0 0.75rem !important;   /* varsayılan: yatay margin yok */
  width: auto;
  background: linear-gradient(135deg, var(--bg-card, #fff) 0%, var(--bg-input) 135%) !important;
  /* Hafif renkli (indigo tonlu) çerçeve — tüm filtrelerde standart */
  border: 1px solid rgba(99, 102, 241, 0.30) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08), 0 1px 3px rgba(2, 6, 23, 0.05) !important;
}
.page-filters::-webkit-scrollbar,
.tx-filters::-webkit-scrollbar { height: 6px; }
.page-filters::-webkit-scrollbar-thumb,
.tx-filters::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Liste sayfalarında (.page-filters doğrudan <main> altında, girintisiz) 1rem yatay
   margin → kpi/tab/tablo ile aynı hizada. .tx-filters'a UYGULANMAZ çünkü o her zaman
   .tab-content-wrapper içinde (zaten 1rem padding'li) — çift girinti olmasın. */
.page-filters { margin-left: 1rem !important; margin-right: 1rem !important; }
/* İstisna: .page-content zaten 1rem yatay padding veriyor (Cari/Dashboard) → sıfırla. */
.page-content .page-filters { margin-left: 0 !important; margin-right: 0 !important; }

/* filters-collapsible (ürünler sayfası) — her boyutta şeffaf sarmalayıcı */
.page-filters .filters-collapsible { display: contents !important; }

/* Kontroller: kompakt, sabit yükseklik, küçülmesin (nowrap için flex:0 0 auto) */
.page-filters .form-input,
.page-filters .form-select,
.tx-filters .form-input,
.tx-filters .form-select {
  min-height: 36px !important;
  height: 36px !important;
  font-size: 0.8rem !important;
  /* Dikey padding'i kıs → metin 36px içine sığsın, dikeyde ortalansın (clip olmasın) */
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
  line-height: 1.2 !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 90px;
}
/* Select açılır ok'u için sağ padding korunur */
.page-filters .form-select,
.tx-filters .form-select { padding-right: 1.9rem !important; }
/* Arama kutusu — esner ama görünür kalır */
.page-filters .form-input[type="search"],
.page-filters #flt-search,
.tx-filters input[type="search"],
.tx-filters input[type="text"] {
  flex: 1 1 220px !important;   /* boşluğu yutsun → export butonları sağ uca tam yaslanır */
  min-width: 180px !important;
  max-width: none !important;
}
/* Tarih inputları */
.page-filters input[type="date"],
.tx-filters input[type="date"] {
  max-width: 150px;
  min-width: 130px;
}
/* Etiketler */
.page-filters > label,
.tx-filters > label {
  font-size: 0.78rem !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
  color: var(--text-muted);
}
/* Butonlar (Temizle vb.) */
.page-filters .btn,
.tx-filters .btn {
  min-height: 36px !important;
  height: 36px !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
}
.page-filters .btn-sm,
.page-filters #btn-clear-filters,
.tx-filters #btn-clear-filters,
.tx-filters [data-flt-clear] {
  font-size: 0.74rem !important;
  padding: 0.3rem 0.6rem !important;
}
/* Export + kolon butonları (.dt-toolbar): sağ uca yasla, tek satır */
.page-filters .dt-toolbar,
.tx-filters .dt-toolbar {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  margin-left: auto !important;
  gap: 0.3rem !important;
  padding: 0 !important;
  min-height: 0 !important;
}
.page-filters .dt-toolbar > div[style*="flex:1"],
.tx-filters .dt-toolbar > div[style*="flex:1"],
.page-filters .dt-toolbar > div[style*="flex: 1"],
.tx-filters .dt-toolbar > div[style*="flex: 1"] { display: none !important; }
.page-filters .dt-toolbar .btn,
.tx-filters .dt-toolbar .btn,
.page-filters .btn.icon-btn-sm,
.tx-filters .btn.icon-btn-sm {
  min-height: 36px !important;
  height: 36px !important;
  width: 36px;
  padding: 0 !important;
  flex: 0 0 auto !important;
}

/* Collapse KALDIRILDI — toggle butonları her boyutta gizli, içerik hep açık */
.filters-toggle-btn,
.filters-mobile-toggle,
#btn-toggle-filters,
.page-filters .filters-toggle-btn { display: none !important; }

@media (max-width: 768px) {
  .page-filters,
  .tx-filters {
    padding: 0.45rem 0.55rem !important;
    gap: 0.35rem !important;
  }
  /* Mobilde de tek satır + yatay kaydırma; arama biraz daha küçülebilir */
  .page-filters .form-input[type="search"],
  .page-filters #flt-search,
  .tx-filters input[type="search"],
  .tx-filters input[type="text"] {
    flex: 1 0 150px !important;
    min-width: 140px !important;
    max-width: none !important;
  }
}


/* ============================================================
   17. MODAL — Mobil & tablet ek polish (640-768px geçişi)
   Mevcut @media (max-width: 640px) bottom-sheet zaten var.
   Burada 641-768px tablet aralığı için ek düzeltmeler.
   ============================================================ */

@media (min-width: 641px) and (max-width: 768px) {
  .modal-content.size-xl,
  .modal-content.size-lg {
    max-width: 92vw !important;
  }
  .modal-body {
    padding: 0.85rem !important;
  }
}

/* Modal içi form satırlarını mobilde tek kolona indir */
@media (max-width: 640px) {
  .modal-body .form-row.two-col {
    grid-template-columns: 1fr !important;
    display: grid !important;
    gap: 0.5rem !important;
  }
}


/* ============================================================
   18. DARK MODE POLISH — eksik component override'ları
   Audit ile tespit edilen: kpi-card, form-input, data-card,
   tab-bar, badge, page-filters renk düzeltmeleri.
   ============================================================ */

[data-theme="dark"] .kpi-card,
[data-theme="dark"] .kpi-chip {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .empty-state {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  border-color: var(--accent-sky);
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .form-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .filter-chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .filter-chip.active {
  background: rgba(14, 165, 233, 0.20);
  border-color: var(--accent-sky);
  color: var(--accent-sky);
}

[data-theme="dark"] .filters-toggle-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .tab {
  color: var(--text-secondary);
}
[data-theme="dark"] .tab.tab-active,
[data-theme="dark"] .tab[aria-selected="true"] {
  color: var(--accent-sky);
}

[data-theme="dark"] .badge {
  filter: brightness(0.95);
}
[data-theme="dark"] .badge-neutral {
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
}


/* ============================================================
   19. SIDEBAR aktif modül vurgusu — js/sidebar.setActiveByPath ile
   ============================================================ */

.sidebar .nav-item.nav-active {
  background: rgba(14, 165, 233, 0.10);
  color: var(--accent-sky);
  font-weight: 600;
  border-right: 3px solid var(--accent-sky);
}
[data-theme="dark"] .sidebar .nav-item.nav-active {
  background: rgba(14, 165, 233, 0.18);
}
.sidebar .nav-item.nav-active .nav-icon {
  filter: drop-shadow(0 0 4px rgba(14, 165, 233, 0.35));
}

.toast-info    { border-color: var(--status-info); }

/* ============================================================
   EKSTRE ÖZET BANDI (.tx-summary) — Cari/Proje/Banka hareket özeti
   ============================================================ */
.tx-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tx-summary-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 0;
  min-width: 130px;
  padding: 0.3rem 0.9rem;
  border-right: 1px solid var(--border);
}
.tx-summary-item:last-child { border-right: none; }
.tx-summary-item .lbl {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tx-summary-item .val {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
@media (max-width: 680px) {
  .tx-summary-item {
    flex: 1 1 45%;
    min-width: 45%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.3rem 0.6rem 0.45rem;
  }
  .tx-summary-item:nth-last-child(-n+1) { border-bottom: none; }
  .tx-summary-item .val { font-size: 0.95rem; }
}

/* ============================================================
   EKSTRE FİLTRE BARI (.tx-filters)
   → Artık STANDART FİLTRE BARI bloğu (.page-filters / .tx-filters birlikte)
     tarafından yönetiliyor. Buradaki ayrı/eski kurallar kaldırıldı.
   ============================================================ */

/* ============================================================
   🆕 INFO-TIP — Uzun bilgilendirme yazıları yerine ⓘ hover tooltip
   Kullanım:
     <span class="info-tip" data-tip="Açıklama metni"></span>
     <span class="info-tip" data-tip="..." data-tip-pos="right"></span>
   ============================================================ */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: serif;
  cursor: help;
  position: relative;
  vertical-align: middle;
  user-select: none;
  flex-shrink: 0;
  border: 1px solid #7dd3fc;
}
.info-tip::before { content: "i"; font-style: italic; }
.info-tip:hover { background: #bae6fd; color: #0c4a6e; }
.info-tip[data-tip]:hover::after,
.info-tip[data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  font-family: inherit;
  font-style: normal;
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: 360px;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.info-tip[data-tip][data-tip-pos="right"]:hover::after {
  bottom: 50%; left: calc(100% + 8px); transform: translateY(50%);
}
.info-tip[data-tip][data-tip-pos="left"]:hover::after {
  bottom: 50%; left: auto; right: calc(100% + 8px); transform: translateY(50%);
}
.info-tip[data-tip][data-tip-pos="bottom"]:hover::after {
  top: calc(100% + 6px); bottom: auto;
}
