/* ============================================
   TAM TASDİK ÜCRET TAKİBİ - Stiller
   ============================================ */

/* Renkli header modal close butonları */
.modal-header[style*="background"] .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px;
    transition: var(--transition);
    color: white !important;
}

.modal-header[style*="background"] .modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ---- Özet İstatistik Kartları ---- */
.td-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.td-stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: var(--transition);
}

.td-stat-card:hover {
    box-shadow: var(--shadow-md);
}

.td-stat-card h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.td-stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.td-stat-card.success .value {
    color: var(--success);
}

.td-stat-card.danger .value {
    color: var(--danger);
}

.td-stat-card.info .value {
    color: var(--primary-light);
}

/* ---- Tablo Container ---- */
.td-table-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.td-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 12px;
}

.td-table-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.td-table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.td-search {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    min-width: 200px;
    transition: var(--transition);
}

.td-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* ---- Tablo ---- */
.td-table {
    width: 100%;
    border-collapse: collapse;
}

.td-table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    font-weight: 600;
}

.td-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.td-table tbody tr {
    cursor: pointer;
    transition: var(--transition);
}

.td-table tbody tr:hover {
    background: var(--bg-light);
}

.td-table .tutar {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.td-table .tutar.danger {
    color: var(--danger);
}

.td-table .tutar.success {
    color: var(--success);
}

/* ---- Badge'ler ---- */
.td-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.td-badge.odendi {
    background: var(--success-bg);
    color: var(--success);
}

.td-badge.kismi {
    background: var(--warning-bg);
    color: var(--warning);
}

.td-badge.odenmedi {
    background: var(--danger-bg);
    color: var(--danger);
}

.td-badge.fatura_yok {
    background: var(--bg-light);
    color: var(--text-muted);
}

/* ---- İkon Butonlar ---- */
.td-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.td-btn-icon:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.td-btn-icon.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ---- Progress Bar ---- */
.td-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.td-progress-bar .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.td-progress-bar .fill.success {
    background: var(--success);
}

.td-progress-bar .fill.warning {
    background: var(--warning);
}

.td-progress-bar .fill.danger {
    background: var(--danger);
}

/* ---- Boş Durum ---- */
.td-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.td-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.td-empty h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.td-empty p {
    font-size: 0.85rem;
}

/* ============================================
   DETAY SAYFASI
   ============================================ */

/* Geri linki */
.td-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 8px;
    transition: var(--transition);
}

.td-back-link:hover {
    color: var(--text-dark);
}

/* Mükellef Header */
.td-mukellef-header {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 24px;
}

.td-mukellef-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.td-mukellef-header .meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Finansal özet kartları */
.td-finance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.td-finance-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.td-finance-card label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.td-finance-card .val {
    font-size: 1.3rem;
    font-weight: 700;
}

.td-finance-card .val.blue {
    color: var(--primary-light);
}

.td-finance-card .val.green {
    color: var(--success);
}

.td-finance-card .val.red {
    color: var(--danger);
}

/* Container */
.td-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 24px;
}

.td-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 10px;
}

.td-container-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Fatura tablosu */
.td-fatura-table {
    width: 100%;
    border-collapse: collapse;
}

.td-fatura-table th {
    text-align: left;
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
}

.td-fatura-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.td-fatura-table tbody tr:hover {
    background: var(--bg-light);
}

.td-fatura-table .tutar {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Expand edilebilir fatura satırı */
.td-expandable {
    cursor: pointer;
    transition: var(--transition);
}

.td-expandable td:first-child::before {
    content: '▸ ';
    color: var(--text-muted);
}

.td-expandable.expanded td:first-child::before {
    content: '▾ ';
}

/* Tahsilat alt satırı */
.td-tahsilat-row {
    background: var(--bg-light) !important;
}

.td-tahsilat-row td {
    padding: 8px 20px 8px 44px;
    font-size: 0.82rem;
}

/* Mini buton */
.td-btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.td-btn-sm:hover {
    background: var(--bg-light);
    border-color: var(--border);
}

.td-btn-sm.danger {
    color: var(--danger);
}

.td-btn-sm.danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.td-btn-sm.success {
    color: var(--success);
}

.td-btn-sm.success:hover {
    background: var(--success-bg);
    border-color: var(--success-border);
}

/* Fatura tip seçici */
.td-tip-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.td-tip-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-light);
    border: none;
    transition: var(--transition);
    border-right: 1px solid var(--border);
    font-family: inherit;
}

.td-tip-tab:last-child {
    border-right: none;
}

.td-tip-tab.active {
    background: var(--primary);
    color: white;
}

.td-tip-tab:hover:not(.active) {
    background: var(--border-light);
}

.td-tip-content {
    display: none;
}

.td-tip-content.active {
    display: block;
}

/* Yıl filtresi */
.td-yil-filter {
    display: flex;
    gap: 6px;
    align-items: center;
}

.td-yil-filter label {
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 500;
    color: var(--text-secondary);
}

.td-yil-filter select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
}

/* Boş mesaj (fatura tablosu) */
.td-fatura-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {

    .td-table th:nth-child(2),
    .td-table td:nth-child(2) {
        display: none;
    }

    .td-fatura-table th:nth-child(4),
    .td-fatura-table td:nth-child(4) {
        display: none;
    }

    .td-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .td-finance-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}