/**
 * ==========================================
 * TABLOLAR
 * Tablo stilleri ve varyasyonları
 * ==========================================
 */

/* ============================================================
   TABLO İÇİ DROPDOWN – Bootstrap dropdown kesilmesin
   .table-responsive overflow: auto Popper konumunu bozabilir
   ============================================================ */
.table-responsive {
    overflow: visible !important;
}

/* ============================================================
   ANA TABLO - TÜM TABLOLAR İÇİN ORTAK STİLLER
   .table ve .ana-table aynı stili paylaşır
   ============================================================ */

/* Temel tablo yapısı – grid çok hafif, font net okunur (%60 nötr) */
.table,
.ana-table {
    font-family: var(--by-font-main) !important;
    font-size: var(--by-list-font-size) !important;
    border-color: #F1F3F5 !important;
    border-radius: 12px;
    overflow: visible !important;
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* Tablo köşelerini yuvarla */
.table thead tr:first-child th:first-child,
.ana-table thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.table thead tr:first-child th:last-child,
.ana-table thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

.table tbody tr:last-child td:first-child,
.ana-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.table tbody tr:last-child td:last-child,
.ana-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Tüm tablolarda son sütun (İşlemler) için overflow visible */
.table th:last-child,
.table td:last-child,
.ana-table th:last-child,
.ana-table td:last-child {
    overflow: visible !important;
    position: relative;
}

.table > :not(caption) > * > *,
.ana-table > :not(caption) > * > * {
    border-color: #F1F3F5 !important;
}

/* ========== BAŞLIK (TH) – Net çizgi, güçlü ========== */
.table thead th,
.ana-table thead th {
    font-size: var(--by-list-font-size-head) !important;
    font-weight: 600 !important;
    font-family: var(--by-font-main) !important;
    letter-spacing: 0.03em !important;
    color: #475569 !important;
    background-color: #F9FAFB !important;
    padding: 10px 14px !important;
    border-bottom: 2px solid #E5E7EB !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* ========== BY4 TABLO – Ortak (Gelirler, Giderler, Ödemeler vb.) ========== */
.by4-table-wrapper,
.by3-table-wrapper,
.gelirler-by3-table-wrapper {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.by4-table,
.by3-table,
.gelirler-by3-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--by-list-font-size);
    table-layout: fixed;
}

.by4-table thead,
.by3-table thead,
.gelirler-by3-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* BY4/BY3 tablo başlığı – dept ile 1:1
   Not: .table thead th kuralı !important + daha yüksek specificity olduğu için
   burada daha spesifik bir selector kullanıyoruz. */
.table.by4-table > thead > tr > th,
.ana-table.by4-table > thead > tr > th,
.table.by3-table > thead > tr > th,
.ana-table.by3-table > thead > tr > th,
.table.gelirler-by3-table > thead > tr > th,
.ana-table.gelirler-by3-table > thead > tr > th {
    background: #f8fafc !important;
    font-size: var(--by-list-font-size-head) !important;
    font-weight: 600 !important;
    color: #64748b !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 12px 14px !important;
    white-space: nowrap !important;
    letter-spacing: 0.025em !important;
    text-transform: none !important;
}

.by4-table tbody tr,
.by3-table tbody tr,
.gelirler-by3-table tbody tr {
    background: white;
    transition: background-color 0.2s;
    cursor: default;
    border-bottom: 1px solid #f9fafb;
}

.by4-table tbody tr:last-child,
.by3-table tbody tr:last-child,
.gelirler-by3-table tbody tr:last-child {
    border-bottom: none;
}

.by4-table tbody tr:hover,
.by3-table tbody tr:hover,
.gelirler-by3-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.by4-table td,
.by3-table td,
.gelirler-by3-table td {
    padding: 14px 14px;
}

/* BY4 tablo başlığı – global (Ek gelirler/Borçlandırma, Tahsilatlar, Kişiler aynı font) */
body.toplu-borclandirma-page .all-dept-gelirlerim .data-table.ana-table thead th,
body.borclandirma-page .all-dept-gelirlerim .data-table.ana-table thead th,
.all-dept-gelirlerim .data-table.ana-table thead th,
.all-dept-gelirlerim .data-table.table thead th,
body.odemeler-page .tahsilatlar-by4 .payment-table-wrapper .table.ana-table thead th,
body.odemeler-page .tahsilatlar-by4 .payment-table-wrapper .table thead th,
.tahsilatlar-by4 .payment-table-wrapper .table.ana-table thead th,
.tahsilatlar-by4 .payment-table-wrapper .table thead th,
body.odemeler-out-page .odemeler-by4 .payment-table-wrapper .table thead th,
.odemeler-out-page .odemeler-by4 .payment-table-wrapper .table thead th,
body.firmalar-page .firmalar-by .ana-table.company-table thead th,
.firmalar-by .ana-table.company-table thead th,
body.property-page .property-table thead th,
body.bagimsiz-page .property-table thead th,
.property-table thead.property-table-header th,
body.personel-page .by4-table-area .by4-table thead th,
body.personel-page .ana-table.by4-table thead th,
.kisiler-by .ana-table.kisiler-table thead th {
    background: #f9fafb !important;
    border-bottom: 1px solid #f3f4f6 !important;
    padding: 12px !important;
    font-size: var(--by-list-font-size-head) !important;
    font-weight: 700 !important;
    font-family: var(--by-font-main, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif) !important;
    color: #9ca3af !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* Bağımsızlar + Kişiler thead – birebir aynı */
body.property-page .property-table thead th,
body.bagimsiz-page .property-table thead th,
.property-table thead.property-table-header th,
.kisiler-by .ana-table.kisiler-table thead th {
    padding: 10px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: middle !important;
}

/* BY4 thead th içinde .text-dark / link başlık renginde kalsın */
body.toplu-borclandirma-page .all-dept-gelirlerim .data-table thead th .text-dark,
body.borclandirma-page .all-dept-gelirlerim .data-table thead th .text-dark,
.all-dept-gelirlerim .data-table thead th .text-dark,
body.odemeler-page .tahsilatlar-by4 .payment-table-wrapper .table thead th .text-dark,
.tahsilatlar-by4 .payment-table-wrapper .table thead th .text-dark,
body.odemeler-out-page .odemeler-by4 .payment-table-wrapper .table thead th .text-dark,
.odemeler-out-page .odemeler-by4 .payment-table-wrapper .table thead th .text-dark,
body.firmalar-page .firmalar-by .ana-table.company-table thead th .text-dark,
.firmalar-by .ana-table.company-table thead th .text-dark,
body.property-page .property-table thead th .text-dark,
.property-table thead.property-table-header th .text-dark,
body.personel-page .by4-table thead th .text-dark,
.kisiler-by .ana-table.kisiler-table thead th .text-dark,
.all-dept-gelirlerim .data-table thead th a,
.tahsilatlar-by4 .payment-table-wrapper .table thead th a,
.odemeler-out-page .odemeler-by4 .payment-table-wrapper .table thead th a,
.firmalar-by .ana-table.company-table thead th a,
.property-table thead.property-table-header th a,
body.personel-page .by4-table thead th a,
.kisiler-by .ana-table.kisiler-table thead th a {
    color: #9ca3af !important;
}

/* ========== HÜCRE (TD) STİLLERİ – Ferah satır, hafif gri metin ========== */
.table td,
.table th,
.ana-table td,
.ana-table th {
    padding: 14px 14px;
    font-size: var(--by-list-font-size) !important;
    font-weight: 500 !important;
    font-family: var(--by-font-main) !important;
    line-height: 1.45;
    vertical-align: middle !important;
}
.table td,
.ana-table td {
    color: #374151;
}

/* Durum badge'lerinde metin kaymasını engelle */
.table td .badge {
    white-space: nowrap !important; /* Asla alt satıra geçme */
    display: inline-flex !important; /* İçeriği hizalı tut */
    align-items: center !important; /* Dikey ortala */
    justify-content: center !important; /* Yatay ortala */
    min-width: 80px !important; /* Minimum genişlik vererek titremeyi önle */
}

/* ============================================================
   İŞLEMLER (DİŞLİ) DROPDOWN BUTONU — Yazı boyutuyla ölçeklenir
   Bina yazı boyutu değişince ( --by-list-font-size ) çark da büyüsün/küçülsün
   ============================================================ */
.table td .dropdown-toggle.kisiler-actions-toggle,
.ana-table td .dropdown-toggle.kisiler-actions-toggle,
.by4-table td .dropdown-toggle.kisiler-actions-toggle,
.by3-table td .dropdown-toggle.kisiler-actions-toggle {
    /* min-width:80px kuralını override et */
    min-width: 0 !important;
    /* btn-sm (12px) gibi sabit font-size'ları ez; em ölçeklenebilsin */
    font-size: inherit !important;
    width: clamp(26px, 2.1em, 44px) !important;
    height: clamp(26px, 2.1em, 44px) !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    border-radius: 0.6em !important;
    line-height: 1 !important;
}

.table td .dropdown-toggle.kisiler-actions-toggle::after,
.ana-table td .dropdown-toggle.kisiler-actions-toggle::after,
.by4-table td .dropdown-toggle.kisiler-actions-toggle::after,
.by3-table td .dropdown-toggle.kisiler-actions-toggle::after {
    display: none !important;
}

.table td .dropdown-toggle.kisiler-actions-toggle i,
.ana-table td .dropdown-toggle.kisiler-actions-toggle i,
.by4-table td .dropdown-toggle.kisiler-actions-toggle i,
.by3-table td .dropdown-toggle.kisiler-actions-toggle i {
    font-size: 0.95em !important;
    line-height: 1 !important;
}

/* Alt elemanlar font'u miras alsın */
.table td *,
.ana-table td * {
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* Font Awesome ikonları - kendi fontunu kullansın */
.table td i.fa,
.table td i.fas,
.table td i.far,
.table td i.fal,
.ana-table td i.fa,
.ana-table td i.fas,
.ana-table td i.far,
.ana-table td i.fal {
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/* ========== SATIR – Zebra yok, tüm satır beyaz, tek hover (Kişiler tasarımı) ========== */
.table tbody tr,
.ana-table tbody tr {
    background-color: #ffffff !important;
    transition: background 0.15s ease;
    border-bottom: 1px solid #F9FAFB;
}
/* table-striped sınıfı olsa bile zebra kapalı (properties, gelirler, giderler vb.) */
.table-striped tbody tr:nth-of-type(odd),
.table-striped tbody tr:nth-of-type(even),
.table.table-striped tbody tr,
.ana-table.table-striped tbody tr {
    background-color: #ffffff !important;
}
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #ffffff !important;
}
.table tbody tr:last-child,
.ana-table tbody tr:last-child {
    border-bottom: 0;
}

/* BY4 unified table actions baseline: fixed cog size and clear action column. */
:root {
    --by-actions-btn-size: 32px;
    --by-actions-col-width: 76px;
}

.table td .dropdown-toggle.kisiler-actions-toggle,
.ana-table td .dropdown-toggle.kisiler-actions-toggle,
.by4-table td .dropdown-toggle.kisiler-actions-toggle,
.by3-table td .dropdown-toggle.kisiler-actions-toggle,
.table td.col-actions > .dropdown > .dropdown-toggle,
.ana-table td.col-actions > .dropdown > .dropdown-toggle,
.by4-table td.col-actions > .dropdown > .dropdown-toggle,
.by3-table td.col-actions > .dropdown > .dropdown-toggle,
.table td.property-col-actions > .dropdown > .dropdown-toggle,
.ana-table td.property-col-actions > .dropdown > .dropdown-toggle,
.table td.company-col-actions > .dropdown > .dropdown-toggle,
.ana-table td.company-col-actions > .dropdown > .dropdown-toggle {
    min-width: var(--by-actions-btn-size) !important;
    width: var(--by-actions-btn-size) !important;
    height: var(--by-actions-btn-size) !important;
    min-height: var(--by-actions-btn-size) !important;
    padding: 0 !important;
    border-radius: 8px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.table td .dropdown-toggle.kisiler-actions-toggle::after,
.ana-table td .dropdown-toggle.kisiler-actions-toggle::after,
.by4-table td .dropdown-toggle.kisiler-actions-toggle::after,
.by3-table td .dropdown-toggle.kisiler-actions-toggle::after,
.table td.col-actions > .dropdown > .dropdown-toggle::after,
.ana-table td.col-actions > .dropdown > .dropdown-toggle::after,
.by4-table td.col-actions > .dropdown > .dropdown-toggle::after,
.by3-table td.col-actions > .dropdown > .dropdown-toggle::after,
.table td.property-col-actions > .dropdown > .dropdown-toggle::after,
.ana-table td.property-col-actions > .dropdown > .dropdown-toggle::after,
.table td.company-col-actions > .dropdown > .dropdown-toggle::after,
.ana-table td.company-col-actions > .dropdown > .dropdown-toggle::after {
    display: none !important;
}

.table td .dropdown-toggle.kisiler-actions-toggle i,
.ana-table td .dropdown-toggle.kisiler-actions-toggle i,
.by4-table td .dropdown-toggle.kisiler-actions-toggle i,
.by3-table td .dropdown-toggle.kisiler-actions-toggle i,
.table td.col-actions > .dropdown > .dropdown-toggle i,
.ana-table td.col-actions > .dropdown > .dropdown-toggle i,
.by4-table td.col-actions > .dropdown > .dropdown-toggle i,
.by3-table td.col-actions > .dropdown > .dropdown-toggle i,
.table td.property-col-actions > .dropdown > .dropdown-toggle i,
.ana-table td.property-col-actions > .dropdown > .dropdown-toggle i,
.table td.company-col-actions > .dropdown > .dropdown-toggle i,
.ana-table td.company-col-actions > .dropdown > .dropdown-toggle i {
    font-size: 14px !important;
    line-height: 1 !important;
}

.table th.col-actions,
.table td.col-actions,
.ana-table th.col-actions,
.ana-table td.col-actions,
.by4-table th.col-actions,
.by4-table td.col-actions,
.by3-table th.col-actions,
.by3-table td.col-actions,
.table th.property-col-actions,
.table td.property-col-actions,
.ana-table th.property-col-actions,
.ana-table td.property-col-actions,
.table th.company-col-actions,
.table td.company-col-actions,
.ana-table th.company-col-actions,
.ana-table td.company-col-actions {
    width: var(--by-actions-col-width) !important;
    min-width: var(--by-actions-col-width) !important;
    max-width: var(--by-actions-col-width) !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.table td.col-actions .dropdown,
.ana-table td.col-actions .dropdown,
.by4-table td.col-actions .dropdown,
.by3-table td.col-actions .dropdown,
.table td.property-col-actions .dropdown,
.ana-table td.property-col-actions .dropdown,
.table td.company-col-actions .dropdown,
.ana-table td.company-col-actions .dropdown {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.table td.col-actions .dropdown-menu,
.ana-table td.col-actions .dropdown-menu,
.by4-table td.col-actions .dropdown-menu,
.by3-table td.col-actions .dropdown-menu,
.table td.property-col-actions .dropdown-menu,
.ana-table td.property-col-actions .dropdown-menu,
.table td.company-col-actions .dropdown-menu,
.ana-table td.company-col-actions .dropdown-menu {
    min-width: 180px;
}
.table tbody tr:hover,
.ana-table tbody tr:hover,
.table-striped tbody tr:hover {
    background-color: #F8FAFC !important;
    transition: background 0.15s ease;
}

.table tbody tr:hover > td,
.ana-table tbody tr:hover > td,
.table-striped tbody tr:hover > td,
.table tbody tr:hover > th,
.ana-table tbody tr:hover > th,
.table-striped tbody tr:hover > th {
    background-color: #F8FAFC !important;
    transition: background 0.15s ease;
}

/* ========== BOŞ TABLO MESAJI ========== */
.table tbody tr.empty-table-row,
.table tbody tr.empty-table-row td,
.ana-table tbody tr.empty-table-row,
.ana-table tbody tr.empty-table-row td {
    --bs-table-accent-bg: #ffffff !important;
    --bs-table-striped-bg: #ffffff !important;
    --bs-table-bg-type: initial !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* ========== İLK SÜTUN (CHECKBOX) - Sadece ana-table için ========== */
.ana-table th:first-child,
.ana-table td:first-child {
    width: 40px !important;
    min-width: 40px !important;
    text-align: center !important;
}

/* ========== ROZET/BUTON YAZILARI ========== */
.table .badge,
.ana-table .badge {
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* ========== CARD İÇİ UYUM ========== */
.card-body.p-0 .table,
.card-body.p-0 .ana-table,
.card-flush .table,
.card-flush .ana-table {
    border-radius: 0;
    margin: 0;
}

.card-body.p-0 .table thead th:first-child,
.card-body.p-0 .ana-table thead th:first-child,
.card-flush .table thead th:first-child,
.card-flush .ana-table thead th:first-child {
    border-top-left-radius: 0;
}

.card-body.p-0 .table thead th:last-child,
.card-body.p-0 .ana-table thead th:last-child,
.card-flush .table thead th:last-child,
.card-flush .ana-table thead th:last-child {
    border-top-right-radius: 0;
}

/* ========== RESPONSİVE - MOBİL UYUM (global değişkenden türetilir) ========== */
@media (max-width: 768px) {
    .table td,
    .table th,
    .ana-table td,
    .ana-table th {
        padding: 8px 10px;
        font-size: calc(var(--by-list-font-size) - 2px) !important;
    }
    
    .table thead th,
    .ana-table thead th {
        font-size: calc(var(--by-list-font-size-head) - 2px) !important;
        padding: 8px 10px !important;
    }
}

/* ========== SIRALANABILIR BAŞLIKLAR ========== */
.table th,
.ana-table th {
    cursor: default;
    white-space: nowrap;
}

.table th.sortable,
.ana-table th.sortable,
.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.table th.sortable i,
.ana-table th.sortable i,
.sortable i.fa-sort,
.sortable i.fa-sort-up,
.sortable i.fa-sort-down {
    opacity: 0.3;
    margin-left: 4px;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.sortable:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
    color: #007bff !important;
}

.sortable:hover i {
    opacity: 0.7 !important;
}

.sortable:active {
    background-color: rgba(0, 123, 255, 0.2) !important;
    transform: scale(0.98);
}

/* ========== TIKLANABİLİR SATIR ========== */
.table tbody tr.clickable-row,
.ana-table tbody tr.clickable-row {
    cursor: pointer;
}


/* ========== DÜZENLENEBİLİR KAPI NO (td table-cell kalsın — zebra bozulmasın) ========== */
.editable-kapi-no {
    text-align: center;
    transition: background-color 0.2s ease;
    cursor: pointer;
    vertical-align: middle;
}

.editable-kapi-no:hover {
    background-color: #fff3cd !important;
    font-weight: 600;
}

.editable-kapi-no .no-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.editable-kapi-no:hover .no-badge::after {
    content: '✏️';
    font-size: 10px;
    line-height: 1;
    opacity: 0.65;
}

/* ========== DÜZENLENEBİLİR NET / BRÜT / TİP / ARSA (kapı no ile aynı işaret) ========== */
.editable-metrekare {
    transition: background-color 0.2s ease;
    cursor: pointer;
    vertical-align: middle;
    color: #374151;
}

.editable-metrekare:hover {
    background-color: #fff3cd !important;
    font-weight: 600;
}

.editable-metrekare .metrekare-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.editable-metrekare:hover .metrekare-badge::after {
    content: '✏️';
    font-size: 10px;
    line-height: 1;
    opacity: 0.65;
}

/* ========== DURUM DROPDOWN STİLLERİ ========== */
.durum-btn {
    border: 1px solid #dee2e6;
    background: white;
    transition: all 0.2s ease;
}

.durum-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.durum-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* ========== DAİRE SİL - KIRMIZI VURGU ========== */
.dropdown-item.text-danger:hover {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
    color: #721c24 !important;
    font-weight: 600;
}


/* ============================================================
   YARDIMCI SINIFLAR
   ============================================================ */

/* ========== TABLE RESPONSIVE ========== */
.table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
    display: block; /* Bazen flex yapısı yüksekliği bozar */
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.firmalar-table-responsive {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* ========== HÜCRE TAŞMA ÖNLEME ========== */
.cell-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ========== İSİMLİ SÜTUN SINIFLARI ========== */
/* nth-child yerine kullanılabilir, daha okunabilir */
.ana-table .col-checkbox { width: 40px; text-align: center; }
.ana-table .col-tarih { width: 100px; white-space: nowrap; }
.ana-table .col-bakiye { width: 120px; text-align: right; }
.ana-table .col-faiz { width: 100px; text-align: right; }
.ana-table .col-tutar { width: 110px; text-align: right; }
.ana-table .col-durum { width: 90px; text-align: center; }
.ana-table .col-islemler { width: 80px; text-align: center; }
.ana-table .col-telefon { width: 130px; }
.ana-table .col-aciklama { width: auto; min-width: 150px; }
.ana-table .col-kisi { width: 180px; }
.ana-table .col-blok { width: 60px; text-align: center; }
.ana-table .col-no { width: 50px; text-align: center; }

/* ========== TABLO HÜCRE FORMATLARI ========== */
.td-tarih {
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
}

.td-tutar {
    font-family: var(--by-font-main);
    font-weight: 700;
    text-align: right;
}

.td-aciklama {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-file-upload {
    text-align: center;
    border: 1px solid #dee2e6;
    padding: 4px;
    vertical-align: middle;
}

/* ========== TOPLAM SATIRLARI ========== */
.total-row td {
    font-weight: bold;
}

.total-value {
    font-weight: bold;
    color: var(--by-primary);
}

/* ============================================================
   ÖZEL TABLO TİPLERİ
   ============================================================ */

/* ========== BAŞLANGIÇ SATIRI ========== */
.start-row {
    background-color: #d4edda !important;
    border-left: 4px solid var(--by-success) !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-row:hover {
    background-color: #c3e6cb !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.start-row td,
.start-row:hover td {
    background-color: inherit !important;
}

/* ========== NORMAL SATIR ========== */
.normal-row {
    cursor: pointer;
    transition: all 0.3s ease;
}

.normal-row:hover,
.normal-row:hover td,
.normal-row:hover th {
    background-color: #f8f9fa !important;
}

/* ========== SAYAÇ TABLO ========== */
.sayac-th {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.sayac-td {
    border: 1px solid #ddd;
    padding: 4px;
    text-align: center;
}

.sayac-td-truncate {
    border: 1px solid #ddd;
    padding: 4px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== SAYAÇ INPUT ========== */
.input-sayac {
    width: 100%;
    max-width: 85px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 2px;
    text-align: center;
    box-sizing: border-box;
    font-size: 12px;
}

.input-sayac-readonly {
    width: 100%;
    max-width: 85px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 2px;
    text-align: center;
    background: #f8f9fa;
    box-sizing: border-box;
    font-size: 12px;
}

.input-tutar-result {
    width: 100%;
    max-width: 95px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 2px;
    text-align: center;
    background: #e8f5e9;
    font-weight: 600;
    color: #2e7d32;
    box-sizing: border-box;
    font-size: 12px;
}

/* ========== TOGGLE HEADER ========== */
.th-toggle-header {
    width: 15%;
    text-align: center;
    vertical-align: middle;
}

.toggle-label-active {
    font-size: 10px;
    color: white;
    font-weight: 500;
    margin-right: 5px;
    transition: all 0.3s;
}

.toggle-label-inactive {
    font-size: 10px;
    color: #6c757d;
    font-weight: 300;
    margin-left: 5px;
    transition: all 0.3s;
}

.toggle-switch-inline {
    display: inline-block;
    margin: 0 5px;
    vertical-align: middle;
}

.form-switch-inline {
    margin: 0;
}

.form-check-input-scaled {
    transform: scale(1.1);
    margin: 0;
}


/* ============================================================
   SAYFA BAZLI TABLO ÖZELLEŞTİRMELERİ
   (Sadece sütun genişlikleri ve sayfa-özel farklar)
   ============================================================ */

/* ---------- BAĞIMSIZLAR (RESPONSIVE) ---------- */
.ana-table.property-table {
    table-layout: fixed !important;
    width: 100% !important;
    border-radius: 8px !important;
    overflow: visible !important;
}

.ana-table.property-table th,
.ana-table.property-table td {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle !important;
    padding: 10px 6px !important;
    font-size: var(--by-list-font-size) !important;
}

/* Durumu ve Takip sütunları - dropdown için overflow visible */
.ana-table.property-table td:nth-child(6),
.ana-table.property-table td:nth-child(7),
.ana-table.property-table td:last-child {
    overflow: visible !important;
}

/* Rozet (Badge) ve Buton */
.ana-table.property-table td:nth-child(6) .badge,
.ana-table.property-table td:nth-child(6) .btn,
.ana-table.property-table td:nth-child(7) .badge,
.ana-table.property-table td:nth-child(7) .btn {
    font-size: 12px !important;
    padding: 5px 10px !important;
}

/* Durumu ve Takip ikonları büyük */
.ana-table.property-table td:nth-child(6) i,
.ana-table.property-table td:nth-child(7) i {
    font-size: 16px !important;
}

/* ===== RESPONSIVE SÜTUN GENİŞLİKLERİ (Yüzde Bazlı) ===== */
/* TOPLAM: 100% */

.ana-table.property-table th:first-child,
.ana-table.property-table td:first-child { width: 3%; }      /* Checkbox */

.ana-table.property-table th:nth-child(2),
.ana-table.property-table td:nth-child(2) { width: 5%; }     /* Blok */

.ana-table.property-table th:nth-child(3),
.ana-table.property-table td:nth-child(3) { width: 5%; }     /* Kapı No */

.ana-table.property-table th:nth-child(4),
.ana-table.property-table td:nth-child(4) { width: 16%; }    /* Kat Maliki */

.ana-table.property-table th:nth-child(5),
.ana-table.property-table td:nth-child(5) { width: 12%; }    /* Kiracı */

.ana-table.property-table th:nth-child(6),
.ana-table.property-table td:nth-child(6) { width: 8%; }     /* Durumu */

.ana-table.property-table th:nth-child(7),
.ana-table.property-table td:nth-child(7) { width: 8%; }     /* Takip */

.ana-table.property-table th:nth-child(8),
.ana-table.property-table td:nth-child(8) { width: 7%; }     /* Net Alan */

.ana-table.property-table th:nth-child(9),
.ana-table.property-table td:nth-child(9) { width: 10%; }    /* Kalan Bakiye */

.ana-table.property-table th:nth-child(10),
.ana-table.property-table td:nth-child(10) { width: 8%; }    /* Net Faiz */

.ana-table.property-table th:nth-child(11),
.ana-table.property-table td:nth-child(11) { width: 10%; }   /* Faizli Bakiye */

.ana-table.property-table th:last-child,
.ana-table.property-table td:last-child { width: 8%; }       /* İşlemler */

/* Bakiye sütunları sağa hizalı */
.ana-table.property-table td:nth-child(9),
.ana-table.property-table td:nth-child(10),
.ana-table.property-table td:nth-child(11) {
    text-align: right !important;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* İşlemler sütunu ortala */
.ana-table.property-table th:last-child,
.ana-table.property-table td:last-child {
    text-align: center !important;
}

/* ---------- BAĞIMSIZLAR DERNEK MODU (Blok, Aidat Sorumlusu, Durumu, Net Alan gizli, 8 sütun) ---------- */
.ana-table.property-table.property-table-association th:first-child,
.ana-table.property-table.property-table-association td:first-child { width: 4% !important; }
.ana-table.property-table.property-table-association th:nth-child(2),
.ana-table.property-table.property-table-association td:nth-child(2) { width: 8% !important; }
.ana-table.property-table.property-table-association th:nth-child(3),
.ana-table.property-table.property-table-association td:nth-child(3) { width: 28% !important; }
.ana-table.property-table.property-table-association th:nth-child(4),
.ana-table.property-table.property-table-association td:nth-child(4) { width: 10% !important; overflow: visible !important; }
.ana-table.property-table.property-table-association th:nth-child(5),
.ana-table.property-table.property-table-association td:nth-child(5) { width: 14% !important; }
.ana-table.property-table.property-table-association th:nth-child(6),
.ana-table.property-table.property-table-association td:nth-child(6) { width: 12% !important; }
.ana-table.property-table.property-table-association th:nth-child(7),
.ana-table.property-table.property-table-association td:nth-child(7) { width: 14% !important; }
.ana-table.property-table.property-table-association th:nth-child(8),
.ana-table.property-table.property-table-association td:nth-child(8) { width: 10% !important; overflow: visible !important; }
.ana-table.property-table.property-table-association th:nth-child(5),
.ana-table.property-table.property-table-association th:nth-child(6),
.ana-table.property-table.property-table-association th:nth-child(7),
.ana-table.property-table.property-table-association td:nth-child(5),
.ana-table.property-table.property-table-association td:nth-child(6),
.ana-table.property-table.property-table-association td:nth-child(7) {
    text-align: left !important;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}
.ana-table.property-table.property-table-association th:nth-child(8),
.ana-table.property-table.property-table-association td:nth-child(8) {
    text-align: center !important;
}
.ana-table.property-table.property-table-association th:nth-child(3),
.ana-table.property-table.property-table-association td:nth-child(3) {
    text-align: left !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* Dernek: toplam satırı (Tüm Üyeler Toplamı + tutarlar) sola dayalı */
.ana-table.property-table.property-table-association tfoot tr.table-info td {
    text-align: left !important;
}


/* ---------- KİŞİLER ---------- */
.ana-table.kisiler-table {
    table-layout: fixed;
    width: 100%;
    border-radius: 8px;
    overflow: visible;
}

/* Sütun genişlikleri: components/kisiler-table.css (sadece kişiler sayfasında yüklenir) */

.ana-table.kisiler-table td,
.ana-table.kisiler-table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 0 !important;
}

/* Not: Kişiler tablo header stili `kisiler-by.css` tarafından yönetiliyor
   (property-table-header). Burada `th` font kuralları tutulmaz ki
   Bootstrap (text-dark/text-muted) ile çakışıp "soft" efekti yaratmasın. */

/* Ad Soyad, Bağımsız ve İletişim sütunları sarılabilir */
.ana-table.kisiler-table td:nth-child(1),
.ana-table.kisiler-table td:nth-child(2),
.ana-table.kisiler-table td:nth-child(3) {
    white-space: normal;
    line-height: 1.3;
}

/* Son sütun (İşlemler) - Dropdown için overflow visible */
.ana-table.kisiler-table th:last-child,
.ana-table.kisiler-table td:last-child {
    overflow: visible !important;
    position: relative;
    text-align: center;
}

/* Araç Plaka sütunu gizli */
.ana-table.kisiler-table th.col-plaka-hidden,
.ana-table.kisiler-table td.col-plaka-hidden {
    display: none !important;
}

/* Araç Plaka sütunu: sola dayalı, dar */
.ana-table.kisiler-table th:nth-child(4),
.ana-table.kisiler-table td:nth-child(4) {
    text-align: left !important;
}

/* Bağımsız sütunu gizli (dernek modu) */
.ana-table.kisiler-table th.col-bagimsiz-hidden,
.ana-table.kisiler-table td.col-bagimsiz-hidden {
    display: none !important;
}

/* Durum sütunu - overflow visible (dropdown kesilmesin) */
.ana-table.kisiler-table th.col-durum-dropdown,
.ana-table.kisiler-table td.col-durum-dropdown {
    overflow: visible !important;
}
.ana-table.kisiler-table td.col-durum-dropdown .badge,
.ana-table.kisiler-table td.col-durum-dropdown .btn,
.ana-table.kisiler-table td.col-durum-dropdown .dropdown-toggle,
.ana-table.kisiler-table td.col-durum-dropdown .dropdown-menu {
    white-space: nowrap;
    overflow: visible;
}

/* Bakiye sütunları sağa hizalı */
.ana-table.kisiler-table td.col-balance,
.ana-table.kisiler-table th.col-balance,
.ana-table.kisiler-table td:nth-child(6),
.ana-table.kisiler-table td:nth-child(7),
.ana-table.kisiler-table td:nth-child(8) {
    text-align: right;
    font-weight: 600;
}

/* Kişiler: Kalan Bakiye / Net Faiz / Faizli Bakiye aynı ağırlık */
.ana-table.kisiler-table td.col-balance span,
.ana-table.kisiler-table td.col-interest span {
    font-weight: 600 !important;
    font-size: inherit !important;
    font-family: inherit !important;
}

/* Net Faiz (formatFaiz) global .bakiye-* efektlerini ez: boyut/kalınlık aynı olsun */
.ana-table.kisiler-table td.col-interest .bakiye-borc,
.ana-table.kisiler-table td.col-interest .bakiye-alacak,
.ana-table.kisiler-table td.col-interest .bakiye-sifir {
    font-size: inherit !important;
    font-weight: 600 !important;
    font-family: inherit !important;
}

/* E-posta ve Telefon sütunları: minimum genişlik (tablo yapısı bozulmasın) */
.ana-table.kisiler-table th.col-email,
.ana-table.kisiler-table td.col-email {
    min-width: 160px;
    max-width: 160px;
}
.ana-table.kisiler-table td.col-email {
    white-space: normal !important;
    word-break: break-all;
}
.ana-table.kisiler-table th.col-telefon,
.ana-table.kisiler-table td.col-telefon {
    min-width: 110px;
}

/* Bağımsız sütunu: maksimum genişlik (E-posta/Telefon’a yer kalsın) */
.ana-table.kisiler-table th.col-bagimsiz,
.ana-table.kisiler-table td.col-bagimsiz {
    max-width: 100px;
}


/* ---------- ÖZET (ZİRAAT) ---------- */
.ana-table.ozet-table th:nth-child(1) { width: 50px; }       /* No */
.ana-table.ozet-table th:nth-child(2) { width: 100px; }      /* İşlem Tarihi */
.ana-table.ozet-table th:nth-child(3) { width: auto; }       /* Açıklama (esnek) */
.ana-table.ozet-table th:nth-child(4) { width: 100px; }      /* Tutar */
.ana-table.ozet-table th:nth-child(5) { width: 100px; }      /* Bakiye */
.ana-table.ozet-table th:nth-child(6) { width: 150px; }      /* Öneriler */
.ana-table.ozet-table th:nth-child(7) { width: 50px; }       /* B/A */
.ana-table.ozet-table th:nth-child(8) { width: 120px; }      /* İşlemler */
.ana-table.ozet-table th:nth-child(9) { width: 60px; }       /* Edit */


/* ---------- FİRMALAR ---------- */
.firmalar-table-responsive .ana-table {
    min-width: 1070px;
    width: 100%;
    table-layout: fixed;
}
/* Boş liste mesajı tam genişlik (yan beyaz boşluk kalmasın) */
.firmalar-table-responsive .ana-table.company-table tbody td[colspan] {
    width: 100%;
}

.firmalar-table-responsive .ana-table.company-table th,
.firmalar-table-responsive .ana-table.company-table td {
    text-align: left !important;
}

/* Firmalar tablosu checkbox kuralını ez */
.firmalar-table-responsive .ana-table.company-table th:first-child,
.firmalar-table-responsive .ana-table.company-table td:first-child {
    width: 200px !important;
    min-width: 200px !important;
    text-align: left !important;
}

.firmalar-table-responsive .ana-table td {
    vertical-align: middle;
}

.firmalar-table-responsive .ana-table td:first-child {
    font-weight: 500;
}

.ana-table.company-table th:nth-child(1) { width: 200px; min-width: 200px; }    /* Firma Adı */
.ana-table.company-table th:nth-child(2) { width: 120px; min-width: 120px; }    /* İş Telefonu */
.ana-table.company-table th:nth-child(3) { width: 120px; min-width: 120px; }    /* Cep Telefonu */
.ana-table.company-table th:nth-child(4) { width: 180px; min-width: 180px; }    /* E-posta */
.ana-table.company-table th:nth-child(5) { width: 150px; min-width: 150px; }    /* Yetkili Kişi */
.ana-table.company-table th:nth-child(6) { width: 100px; min-width: 100px; }    /* Bakiye */
.ana-table.company-table th:nth-child(7) { width: 100px; min-width: 100px; }    /* Durum */
.ana-table.company-table th:nth-child(8) { width: 100px; min-width: 100px; }    /* İşlemler */
.ana-table.company-table td:nth-child(1) { width: 200px; min-width: 200px; }    /* Firma Adı */
.ana-table.company-table td:nth-child(2) { width: 120px; min-width: 120px; }    /* İş Telefonu */
.ana-table.company-table td:nth-child(3) { width: 120px; min-width: 120px; }    /* Cep Telefonu */
.ana-table.company-table td:nth-child(4) { width: 180px; min-width: 180px; }    /* E-posta */
.ana-table.company-table td:nth-child(5) { width: 150px; min-width: 150px; }    /* Yetkili Kişi */
.ana-table.company-table td:nth-child(6) { width: 100px; min-width: 100px; }    /* Bakiye */
.ana-table.company-table td:nth-child(7) { width: 100px; min-width: 100px; }    /* Durum */
.ana-table.company-table td:nth-child(8) { width: 100px; min-width: 100px; }    /* İşlemler */


/* ---------- PERSONEL ---------- */
.ana-table.personel-table th:nth-child(1) { width: 180px; }    /* Ad Soyad */
.ana-table.personel-table th:nth-child(2) { width: 150px; }    /* Görevi */
.ana-table.personel-table th:nth-child(3) { width: 120px; }    /* Telefon */
.ana-table.personel-table th:nth-child(4) { width: 120px; }    /* Acil Telefon No */
.ana-table.personel-table th:nth-child(5) { width: 100px; }    /* Bakiye */
.ana-table.personel-table th:nth-child(6) { width: 120px; }    /* Durumu */
.ana-table.personel-table th:nth-child(7) { width: 100px; }    /* İşlemler */


/* ---------- TAHSİLATLAR ---------- */
/* Sıralama: Checkbox, No, Tarih, Kişi/Firma, Bölüm, Açıklama, Tutar, Kasa, İşlemler */
.ana-table.payment-table th:nth-child(1) { width: 40px; }     /* Checkbox */
.ana-table.payment-table th:nth-child(2) { width: 120px; }    /* No */
.ana-table.payment-table th:nth-child(3) { width: 90px; }     /* Tarih */
.ana-table.payment-table th:nth-child(4) { width: 160px; }    /* Kişi/Firma */
.ana-table.payment-table th:nth-child(5) { width: 80px; }     /* Bölüm */
.ana-table.payment-table th:nth-child(6) { width: 240px; }    /* Açıklama */
.ana-table.payment-table th:nth-child(7) { width: 90px; }     /* Tutar */
.ana-table.payment-table th:nth-child(8) { width: 110px; }    /* Kasa */
.ana-table.payment-table th:nth-child(9) { width: 70px; }     /* İşlemler */

/* Tahsilat listesi özel stilleri */
.payment-list-page .table {
    font-size: 13px;
}

.payment-list-page .table th,
.payment-list-page .table td {
    font-size: 13px;
}

/* Checkbox header genişliği */
.payment-checkbox-header {
    width: 50px;
}

/* Delete button başlangıç durumu (JavaScript ile yönetiliyor) */
#deleteSelectedBtn {
    display: none;
}

/* Durum badge'leri için özel stiller */
.badge-aktif {
    background-color: #28a745;
    color: white;
}

.badge-pasif {
    background-color: #dc3545;
    color: white;
}

.badge-beklemede {
    background-color: #ffc107;
    color: #212529;
}


/* ---------- BORÇLANDIRMALAR ---------- */
.ana-table.dept-table th:nth-child(1) { width: 40px; }      /* Checkbox */
.ana-table.dept-table th:nth-child(2) { width: 150px; }     /* Kişi */
.ana-table.dept-table th:nth-child(3) { width: 80px; }      /* Kapı No */
.ana-table.dept-table th:nth-child(4) { width: 150px; }     /* Detay */
.ana-table.dept-table th:nth-child(5) { width: 120px; }     /* Borç Türü */
.ana-table.dept-table th:nth-child(6) { width: 80px; }      /* Gecikme */
.ana-table.dept-table th:nth-child(7) { width: 100px; }     /* Toplam */
.ana-table.dept-table th:nth-child(8) { width: 100px; }     /* Son Ödeme */
.ana-table.dept-table th:nth-child(9) { width: 80px; }      /* İşlemler */


/* ---------- TOPLU SMS ---------- */
.ana-table.sms-table th:nth-child(1) { width: 36px; }      /* Checkbox */
.ana-table.sms-table th:nth-child(2) { width: auto; }      /* Adı Soyadı */
.ana-table.sms-table th:nth-child(3) { width: 150px; }     /* Telefon */
.ana-table.sms-table th:nth-child(4) { width: 100px; }     /* Blok-No */


/* ---------- GİDERLER ---------- */
/* Eski nth-child düzeni (No/Firma/Açıklama sırası) güncel kolonlarla uyumsuz — iptal.
   Genişlikler: body.giderler-page / 2_expence_list.php sınıf kuralları. */
.giderler table.ana-table.expense-table,
.giderler table.table.ana-table.expense-table,
body.giderler-page table.ana-table.expense-table {
    table-layout: fixed;
    width: 100%;
}

body.giderler-page table.ana-table.expense-table th:nth-child(n),
body.giderler-page table.ana-table.expense-table td:nth-child(n),
.giderler table.ana-table.expense-table th:nth-child(n),
.giderler table.ana-table.expense-table td:nth-child(n),
.giderler table.table.ana-table.expense-table th:nth-child(n),
.giderler table.table.ana-table.expense-table td:nth-child(n) {
    width: auto;
    min-width: 0;
}

body.giderler-page table.ana-table.expense-table th:last-child,
body.giderler-page table.ana-table.expense-table td:last-child,
.giderler table.ana-table.expense-table th:last-child,
.giderler table.ana-table.expense-table td:last-child,
.giderler table.table.ana-table.expense-table th:last-child,
.giderler table.table.ana-table.expense-table td:last-child {
    overflow: visible;
    position: relative;
    text-align: center;
    white-space: nowrap;
}


/* ---------- DAİRE EKSTRESİ ---------- */
.ekstre-table th:nth-child(1) { min-width: 90px; }      /* Tarih */
.ekstre-table th:nth-child(2) { min-width: 90px; }      /* Vade */
.ekstre-table th:nth-child(3) { min-width: 50px; }      /* Gün */
.ekstre-table th:nth-child(4) { min-width: 70px; }      /* Faiz % */
.ekstre-table th:nth-child(5) { min-width: 60px; }      /* Tip */
.ekstre-table th:nth-child(6) { min-width: 140px; }     /* Detay */
.ekstre-table th:nth-child(7) { width: 130px; min-width: 130px; } /* Borçlandırılan */
.ekstre-table th:nth-child(8) { min-width: 90px; }      /* Borç */
.ekstre-table th:nth-child(9) { min-width: 90px; }      /* Alacak */
.ekstre-table th:nth-child(10) { min-width: 90px; }     /* Anapara */
.ekstre-table th:nth-child(11) { min-width: 90px; }     /* Faiz */
.ekstre-table th:nth-child(12) { min-width: 120px; }    /* Bakiye */
.ekstre-table th:nth-child(13) { min-width: 70px; }     /* İşlem */

/* Ekstre Özet Kartı */
.ekstre-summary-card {
    border-left: 5px solid #0d6efd;
}

/* Faiz Hesaplama Tablosu */
.faiz-hesap-table th:nth-child(1) { min-width: 60px; }   /* Gün */
.faiz-hesap-table th:nth-child(2) { min-width: 130px; }  /* İşlem Öncesi */
.faiz-hesap-table th:nth-child(3) { min-width: 80px; }   /* İşlem */
.faiz-hesap-table th:nth-child(4) { min-width: 130px; }  /* İşlem Sonrası */

.faiz-hesap-table th {
    font-size: 12px;
    padding: 6px 4px;
}


/* ---------- ZİRAAT BANKASI ---------- */
.ana-table.ziraat-table th:nth-child(1),
.ana-table.ziraat-table td:nth-child(1),
table.ziraat-table th:nth-child(1),
table.ziraat-table td:nth-child(1),
table.ziraat-banka-hareket th.ziraat-col-id,
table.ziraat-banka-hareket td.ziraat-col-id {
  width: 72px;
  max-width: 72px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}       /* No / hareket id */
.ana-table.ziraat-table th:nth-child(2) { width: 100px; }      /* İşlem Tarihi */
.ana-table.ziraat-table th:nth-child(3) { width: auto; }       /* Açıklama */
.ana-table.ziraat-table th:nth-child(4) { width: 100px; }      /* Tutar */
.ana-table.ziraat-table th:nth-child(5) { width: 100px; }      /* Bakiye */
.ana-table.ziraat-table th:nth-child(6) { width: 200px; }      /* Öneriler */
.ana-table.ziraat-table th:nth-child(7) { width: 50px; }       /* B/A */
.ana-table.ziraat-table th:nth-child(8) { width: 80px; }       /* İşlemler */
.ana-table.ziraat-table th:nth-child(9) { width: 80px; }       /* K.Onay */


/* ---------- İCRA DETAY TABLOLARI ---------- */
/* Telefon Görüşmeleri */
.icra-telefon-table th:nth-child(1) { width: 140px; }   /* Tarih */
.icra-telefon-table th:nth-child(2) { width: 150px; }   /* Görüşen Kişi */
.icra-telefon-table th:nth-child(3) { width: 150px; }   /* Görüşülen Kişi */
.icra-telefon-table th:nth-child(5) { width: 70px; }    /* İşlem */

/* Posta/Noter Gönderileri */
.icra-posta-table th:nth-child(1) { width: 100px; }    /* Tarih */
.icra-posta-table th:nth-child(2) { width: 120px; }    /* Gönderen */
.icra-posta-table th:nth-child(3) { width: 150px; }    /* Alıcı */
.icra-posta-table th:nth-child(4) { width: 200px; }    /* Adres */
.icra-posta-table th:nth-child(5) { width: 90px; }     /* Tip */
.icra-posta-table th:nth-child(6) { width: 100px; }    /* Masraf */
.icra-posta-table th:nth-child(8) { width: 70px; }     /* İşlem */

/* Masraflar */
.icra-masraf-table th:nth-child(1) { width: 100px; }   /* Tarih */
.icra-masraf-table th:nth-child(2) { width: 180px; }   /* Masraf Tipi */
.icra-masraf-table th:nth-child(3) { width: 120px; }   /* Tutar */
.icra-masraf-table th:nth-child(5) { width: 70px; }    /* İşlem */


/* ---------- DAİRE GEÇMİŞ TABLOSU ---------- */
.ana-table.gecmis-table {
    font-size: 13px;
}

.ana-table.gecmis-table th {
    font-size: 12px;
}

.ana-table.gecmis-table th:nth-child(1) { width: 40px; }   /* # */
.ana-table.gecmis-table th:nth-child(2) { width: auto; }   /* Kişi */
.ana-table.gecmis-table th:nth-child(3) { width: 100px; }  /* Durum */
.ana-table.gecmis-table th:nth-child(4) { width: 80px; }   /* Hisse */
.ana-table.gecmis-table th:nth-child(5) { width: 110px; }  /* Giriş Tarihi */
.ana-table.gecmis-table th:nth-child(6) { width: 110px; }  /* Çıkış Tarihi */
.ana-table.gecmis-table th:nth-child(7) { width: 120px; }  /* Telefon */


/* ---------- DAİRE GEÇMİŞ SAYFA ÖZEL ---------- */
.daire-gecmis-page .table-responsive {
    overflow-x: auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

.daire-gecmis-page .ana-table {
    table-layout: fixed !important;
    width: 100% !important;
}

.daire-gecmis-page .ana-table thead th:nth-child(1) { width: 5% !important; }
.daire-gecmis-page .ana-table thead th:nth-child(2) { width: 25% !important; }
.daire-gecmis-page .ana-table thead th:nth-child(3) { width: 12% !important; }
.daire-gecmis-page .ana-table thead th:nth-child(4) { width: 8% !important; }
.daire-gecmis-page .ana-table thead th:nth-child(5) { width: 15% !important; }
.daire-gecmis-page .ana-table thead th:nth-child(6) { width: 15% !important; }
.daire-gecmis-page .ana-table thead th:nth-child(7) { width: 20% !important; }

.daire-gecmis-page .ana-table td,
.daire-gecmis-page .ana-table th {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ---------- DAİRE GEÇMİŞİ TABLOSU ---------- */
table.table.ana-table.gecmis-table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* Sütun genişlikleri - yüzde ile */
table.gecmis-table th:nth-child(1),
table.gecmis-table td:nth-child(1) { 
    width: 50px !important; 
    text-align: center !important; 
}  /* # */

table.gecmis-table th:nth-child(2),
table.gecmis-table td:nth-child(2) { 
    width: 200px !important; 
}  /* Kişi */

table.gecmis-table th:nth-child(3),
table.gecmis-table td:nth-child(3) { 
    width: 120px !important; 
    text-align: center !important; 
}  /* Durum */

table.gecmis-table th:nth-child(4),
table.gecmis-table td:nth-child(4) { 
    width: 80px !important; 
    text-align: center !important; 
}  /* Hisse */

table.gecmis-table th:nth-child(5),
table.gecmis-table td:nth-child(5) { 
    width: 120px !important; 
    text-align: center !important; 
}  /* Giriş Tarihi */

table.gecmis-table th:nth-child(6),
table.gecmis-table td:nth-child(6) { 
    width: 120px !important; 
    text-align: center !important; 
}  /* Çıkış Tarihi */

table.gecmis-table th:nth-child(7),
table.gecmis-table td:nth-child(7) { 
    width: 140px !important; 
    text-align: center !important; 
}  /* Telefon */

/* Kişi adı ve ID stillleri */
table.gecmis-table td:nth-child(2) strong {
    display: block;
    font-weight: 600;
    color: #1f2933;
}

table.gecmis-table td:nth-child(2) small {
    font-size: 11px;
    color: #6b7280;
}

/* Badge stilleri */
table.gecmis-table .badge {
    font-size: 12px;
    padding: 5px 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Hücre padding */
table.gecmis-table th,
table.gecmis-table td {
    padding: 12px 10px !important;
    vertical-align: middle !important;
}

/* Responsive - Küçük ekranlar */
@media (max-width: 1200px) {
    .daire-gecmis-page .table-responsive {
        overflow-x: auto !important;
    }
    
    table.gecmis-table {
        min-width: 850px !important;
    }
}

@media (max-width: 768px) {
    table.gecmis-table th,
    table.gecmis-table td {
        padding: 8px 6px !important;
        font-size: 12px !important;
    }
    
    table.gecmis-table .badge {
        font-size: 11px;
        padding: 4px 8px;
    }
}


/* ---------- YETKİLİ OLUŞTUR (ROLES) ---------- */
.ana-table.roles-table th:nth-child(1) { width: 35%; }     /* Kişi */
.ana-table.roles-table th:nth-child(2) { width: 20%; }     /* Yetki Türü */
.ana-table.roles-table th:nth-child(3) { width: 25%; }     /* İletişim */
.ana-table.roles-table th:nth-child(4) { width: 15%; }     /* Güncelleme */
.ana-table.roles-table th:nth-child(5) { width: 25%; }     /* İşlemler */


/* ---------- ALACAK YÖNETİMİ ---------- */
.ana-table.debt-mgmt-table th.col-arama { width: 60px; }
.ana-table.debt-mgmt-table th.col-icra { width: 105px; }


/* ---------- MESAİ TABLOSU ---------- */
.ana-table.mesai-table th.col-islemler { width: 120px; }

/* ---------- ALACAK YÖNETİMİ ---------- */
.ana-table.debt-mgmt-table th.col-arama { width: 60px; }
.ana-table.debt-mgmt-table th.col-icra { width: 105px; }


/* ---------- MESAİ TABLOSU ---------- */
.ana-table.mesai-table th.col-islemler { width: 120px; }
