﻿/* Genel Stil Ayarları */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
}

/* tam genişlikli konteyner */
.cf-container {
    width: 100%;
    padding: 0 20px;
    margin: 0 auto;
}

/* Kontrol Paneli */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

    .card-title i {
        color: #3498db;
    }

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Kontrol Paneli Butonları */
.control-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.control-btn-primary {
    background: #3498db;
    color: white;
}

    .control-btn-primary:hover {
        background: #2980b9;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

.control-btn-secondary {
    background: #2ecc71;
    color: white;
}

    .control-btn-secondary:hover {
        background: #27ae60;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

@media (max-width: 768px) {
    .control-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Tablo Stilleri */
#cashflow-table-container {
    background: white;
    border-radius: 15px;
    overflow-x: auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
    margin-bottom: 40px;
}

#cashflow-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

    #cashflow-table thead th,
    #cashflow-table tbody td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 10px 8px;
    }

    #cashflow-table thead th {
        background-color: #3498db;
        color: white;
        font-weight: 600;
        text-align: center;
        border: 1px solid rgba(255,255,255,0.2);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    #cashflow-table tbody tr:nth-child(even) {
        background-color: #f8f9fa;
    }

    #cashflow-table tbody tr:hover {
        background-color: #f0f0f0;
    }

#cashflow-table thead tr:first-child th:first-child {
    position: sticky;
    left: 0;
    background: #3498db;
    z-index: 12;
    box-shadow: 2px 0 4px -2px #ccc;
}
#cashflow-table thead th:first-child {
    position: static;
    background: #3498db;
    z-index: 10;
    box-shadow: none;
}

#cashflow-table tbody td:first-child {
    position: sticky;
    left: 0;
    background: #f8f9fa;
    z-index: 11;
    box-shadow: 2px 0 4px -2px #ccc;
}

.income-cell {
    background-color: rgba(46,204,113,0.05);
    color: #27ae60;
    font-weight: 600;
}

.expense-cell {
    background-color: rgba(231,76,60,0.05);
    color: #c0392b;
    font-weight: 600;
}

.group-toggler, .toggle-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid #bdbdbd;
    border-radius: 6px;
    background: #f5f5f5;
    color: #222;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: none;
    cursor: pointer;
    margin: 0 4px 2px 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    outline: none;
}
.group-toggler:hover, .toggle-detail:hover {
    background: #e0e0e0;
    border-color: #888;
    color: #111;
    transform: scale(1.04);
}
thead .group-toggler {
    position: relative;
    top: -4px;
    left: -2px;
    margin-bottom: 2px;
}
tbody .toggle-detail {
    margin-bottom: 2px;
}

.expense-cell .sub-detail-list,
.expense-cell .sub-detail-list li {
    color: #444 !important;
    list-style: circle;
    font-size: small;
    opacity: 0.85;
}
.income-cell .sub-detail-list,
.income-cell .sub-detail-list li {
    color: #444 !important;
    list-style: circle;
    font-size: small;
    opacity: 0.85;
}

/* Kategori renkleri için örnek stiller */
.category-label {
    display: inline-block;
    padding: 0;
    border-radius: 0;
    font-weight: 600;
    color: inherit;
    font-size: 0.98em;
    margin-right: 4px;
    background: none;
}

/* Her kategoriye özel renkler (örnek) */
.category-color-0,
.category-color-1,
.category-color-2,
.category-color-3,
.category-color-4,
.category-color-5,
.category-color-6,
.category-color-7,
.category-color-8,
.category-color-9 {
    background: none !important;
    color: inherit !important;
}

.sub-detail-list {
    margin-left: 28px; /* Kategoriye göre hizalama */
    font-size: 13px;
    color: #444;
    padding-left: 18px;
}
.sub-detail-list li {
    display: list-item;
    list-style: circle;
    font-size: 12.5px;
    opacity: 0.85;
    color: inherit;
    margin-bottom: 1px;
    padding-left: 0;
}

td.grand-total {
    background: #fef9e7 !important;
    color: #9B177E !important;
    font-weight: bold !important;
    text-align: center !important;
}

.tooltip-popup {
    position: fixed;
    background: white;
    border: 1px solid #3498db;
    padding: 5px 5px;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(52, 98, 180, 0.13);
    font-size: 13px;
    color: #333;
    z-index: 9999;
    display: none;
    white-space: pre-line;
    max-width: 320px;
    overflow-wrap: break-word;
    pointer-events: none;
}

.manual-category {
    color: #444 !important;
    font-weight: bold;
}

td .manual-category,
.manual-category.category-label {
    color: #444 !important;
    font-weight: bold !important;
    background: none !important;
}