/* ========================================================================= */
/* Reports Page Specific Styles */
/* ========================================================================= */

:root {
    /* Reports sayfası için yeni rapor renkleri */
    --liquid-subtotal-bg: rgba(46, 74, 106, 0.8); /* Koyu mavi, likit varlıklar */
    --card-subtotal-bg: rgba(106, 46, 46, 0.8); /* Koyu kırmızı, kredi kartı */
    --investment-subtotal-bg: rgba(46, 106, 65, 0.8); /* Koyu yeşil, yatırımlar */
    --subtotal-text-color: #e0f2f7; /* Subtotal metin rengi (açık ton) */
    --separator-border-color: rgba(255, 255, 255, 0.2);
}

/* Sayfa Ana Konteyneri (Ortalama ve Dikey Hizalama için) */
.reports-page-layout {
    display: flex;
    flex-direction: column;
    align-items: center; /* İçerikleri yatayda ortalar */
    gap: 30px; /* Filtreler, özet kartları ve grafikler arasına boşluk koyar */
    padding: 30px 20px; /* Sayfa kenarlarından boşluk */
    width: 100%;
    box-sizing: border-box;
}

/* Filters Panel */
.filters-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    background-color: var(--panel-bg);
    padding: 25px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(var(--panel-blur));
    border: 1px solid rgba(255, 255, 255, 0.18);
    max-width: 1000px;
    width: 100%;
    color: var(--text-light);
}

.filters-panel .filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.filters-panel label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.filters-panel select,
.filters-panel input[type="date"] {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
    font-size: 14px;
    color: var(--text-light);
    outline: none;
    backdrop-filter: blur(5px);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.filters-panel select:focus,
.filters-panel input[type="date"]:focus {
    border-color: var(--primary-blue);
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(0, 140, 255, 0.4);
}
.filters-panel select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 30px;
}
.filters-panel select option {
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--text-light);
}
.filters-panel select option:checked {
    background-color: var(--primary-blue);
}

.filters-panel .separator {
    font-size: 20px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    justify-content: center;
}
.summary-card {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(var(--panel-blur));
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.summary-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.summary-card span {
    display: block;
    margin-top: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-light);
}
.summary-card i {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
}

/* Renk temaları */
.summary-card.income { border-left: 5px solid var(--accent-green); }
.summary-card.income span { color: var(--text-light); }
.summary-card.expense {
  background-color: var(--error-red) !important;
  color: white !important;
  border-left: 5px solid white !important;
}
.summary-card.expense span {
  color: white !important;
}

.summary-card.net {
  background-color: var(--primary-blue) !important;
  color: white !important;
  border-left: 5px solid white !important;
}
.summary-card.net span {
  color: white !important;
}
.summary-card.net:hover {
  background-color: var(--primary-blue) !important;
  color: white !important;
}


/* Report Sections (Table and Chart) */
.report-section {
    width: 100vw;
    max-width: none;
    background-color: var(--panel-bg);
    padding: 5px;
    border-radius: 2px;
    box-shadow: none;
    backdrop-filter: blur(var(--panel-blur));
    border: none;
    color: var(--text-light);
    margin: var(--header-height) 0 50px 0;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.report-section .section-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.report-section .section-title i {
    width: 28px;
    height: 28px;
}

/* Table Wrapper */
.table-wrapper {
    overflow-x: auto;
    border: none;
    text-align: center;
}

/* Report Tables */
.report-table {
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 14px;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    table-layout: auto;
    margin-left: auto;
    margin-right: auto;
}

.report-table thead th {
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    padding: 12px 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--primary-blue), color-mix(in srgb, var(--primary-blue) 80%, white 20%));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.report-table th, .report-table td {
    padding: 4px;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}
.report-table td:first-child { text-align: left; font-weight: normal; }
.report-table thead th:first-child { border-top-left-radius: 15px; }
.report-table thead th:last-child { border-top-right-radius: 15px; }
.report-table tbody tr:last-child td { border-bottom: none; }

/* Cash Flow Report Specific */
.cashflow-report .section-title i { color: var(--primary-blue); }
.cashflow-report thead th { background: linear-gradient(135deg, var(--primary-blue), color-mix(in srgb, var(--primary-blue) 80%, white 20%)); }
.cashflow-report tbody tr.income-row:nth-child(even) td { background-color: rgba(0, 221, 146, 0.1); }
.cashflow-report tbody tr.income-row:nth-child(odd) td { background-color: rgba(0, 221, 146, 0.05); }
.cashflow-report tbody tr.income-row td { color: var(--text-light); font-weight: normal; }
.cashflow-report tbody tr.income-row td:first-child { color: var(--accent-green); font-weight: 600; }
.cashflow-report tbody tr.expense-row:nth-child(even) td { background-color: rgba(255, 75, 92, 0.1); }
.cashflow-report tbody tr.expense-row:nth-child(odd) td { background-color: rgba(255, 75, 92, 0.05); }
.cashflow-report tbody tr.expense-row td { color: var(--text-light); font-weight: normal; }
.cashflow-report tbody tr.expense-row td:first-child { color: var(--error-red); font-weight: 600; }
.cashflow-report tbody tr.subtotal-row td {
    background-color: rgba(0, 140, 255, 0.2);
    font-weight: 700;
    text-align: right;
    color: var(--text-light);
    padding: 10px;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.cashflow-report tbody tr.subtotal-row td:first-child { text-align: left; }
.cashflow-report tfoot td {
    background-color: var(--primary-blue);
    color: var(--text-light);
    font-weight: 700;
    padding: 12px 10px;
    font-size: 15px;
}
.cashflow-report tfoot tr:last-child td:first-child { border-bottom-left-radius: 15px; }
.cashflow-report tfoot tr:last-child td:last-child { border-bottom-right-radius: 15px; }
.cashflow-report tbody tr.cash-card-section-header td {
    background-color: rgba(0, 140, 255, 0.25);
    color: var(--text-light);
    font-weight: 700;
    text-align: center !important;
    padding: 10px;
    font-size: 1.05em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cashflow-report tbody tr.info-row td {
    color: var(--text-light);
    font-weight: normal;
    padding: 8px 10px;
    font-size: 14px;
}
.cashflow-report tbody tr.info-row td:first-child {
    color: var(--primary-blue);
    font-weight: 600;
}
.cashflow-report tbody tr.sub-subtotal-row td {
    background-color: rgba(0, 140, 255, 0.3);
    color: var(--text-light);
    font-weight: 700;
    text-align: right !important;
    padding: 10px;
    font-size: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}
.cashflow-report tbody tr.sub-subtotal-row td:first-child { text-align: left !important; }
.cashflow-report tbody tr:hover td { background-color: rgba(255, 255, 255, 0.15); }
.cashflow-report tbody tr.subtotal-row:hover td { background-color: rgba(0, 140, 255, 0.4); }
.cashflow-report tbody tr.info-row:hover td { background-color: rgba(0, 140, 255, 0.2); }
.cashflow-report tbody tr.sub-subtotal-row:hover td { background-color: rgba(0, 140, 255, 0.45); }

/* Account Summary Report Specific */
.account-summary-report .section-title i { color: var(--accent-green); }
.account-summary-report thead th { background: linear-gradient(135deg, var(--accent-green), color-mix(in srgb, var(--accent-green) 80%, white 20%)); }
.account-summary-report tbody tr.account-row td {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
}
.account-summary-report tbody tr.account-row:hover td { background-color: rgba(255, 255, 255, 0.15); }

/* Yeni Alt Toplam Satırları için Renkler */
.report-table .subtotal-row.liquid-subtotal td {
    background-color: var(--liquid-subtotal-bg);
    color: var(--subtotal-text-color);
}
.report-table .subtotal-row.card-subtotal td {
    background-color: var(--card-subtotal-bg);
    color: var(--subtotal-text-color);
}
.report-table .subtotal-row.investment-subtotal td {
    background-color: var(--investment-subtotal-bg);
    color: var(--subtotal-text-color);
}
.report-table .subtotal-row.income-subtotal td {
    background-color: var(--accent-green);
    color: #ffffff;
    font-weight: bold;
}
.report-table .subtotal-row.expense-subtotal td {
    background-color: var(--error-red);
    color: #ffffff;
    font-weight: bold;
}
.report-table .net-cash-row td {
    background-color: #002147;
    color: white;
    font-weight: bold;
}
.report-table .credit-card-subtotal td {
    background-color: #007BFF;
    color: #ffffff;
    font-weight: bold;
}
.report-table .cash-bank-subtotal td {
    background-color: #007BFF;
    color: #ffffff;
    font-weight: bold;
}
.report-table .subtotal-row td {
    font-weight: bold;
    border-top: 1px solid var(--separator-border-color);
    border-bottom: 1px solid var(--separator-border-color);
    padding: 10px;
}
.report-table .subtotal-row td:first-child { text-align: left; }
.report-table .separator-row td {
    height: 15px;
    background-color: transparent;
    border: none;
}

/* TFOOT'taki Genel Özet Satırları */
.account-summary-report tfoot tr.total-row td,
.account-summary-report tfoot tr.stock-summary-row td {
    background-color: var(--primary-blue);
    color: var(--text-light);
    font-weight: bold;
    padding: 15px 20px;
    font-size: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}
.account-summary-report tfoot tr.credit-card-summary-row td {
    background-color: var(--error-red);
    color: var(--text-light);
    font-weight: bold;
    padding: 15px 20px;
    font-size: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}
.account-summary-report tfoot tr.net-worth-row td {
    background-color: color-mix(in srgb, var(--primary-blue) 80%, black 20%);
    color: var(--text-light);
    font-weight: bold;
    padding: 18px 20px;
    font-size: 18px;
    border-top: 3px double rgba(255, 255, 255, 0.4);
}

.account-summary-report tfoot tr:last-child td:first-child { border-bottom-left-radius: 15px; }
.account-summary-report tfoot tr:last-child td:last-child { border-bottom-right-radius: 15px; }


/* Chart Section Styles */
.chart-area-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    /* margin-top: 20px; Bu satır artık .reports-page-layout'taki gap ile yönetiliyor */
}
.chart-container {
    background-color: var(--panel-bg);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(var(--panel-blur));
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 450px;
}
.chart-container .chart-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
}
.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Responsive Ayarlar - Reports Page Specific */
@media (max-width: 992px) {
    .reports-page-layout {
        padding: 20px;
        gap: 20px;
    }
    .filters-panel {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    .filters-panel .filter-group {
        width: 100%;
        justify-content: center;
    }
    .summary-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    .summary-card {
        padding: 15px;
        font-size: 13px;
    }
    .summary-card span {
        font-size: 20px;
        margin-top: 5px;
    }
    .summary-card i {
        width: 28px;
        height: 28px;
    }

    .report-section {
        padding: 20px;
    }
    .report-section .section-title {
        font-size: 22px;
        margin-bottom: 20px;
        gap: 8px;
    }
    .report-section .section-title i {
        width: 24px;
        height: 24px;
    }
    .report-table th, .report-table td {
        padding: 8px;
        font-size: 13px;
    }
    .cashflow-report tbody tr.subtotal-row td,
    .cashflow-report tfoot td,
    .cashflow-report tbody tr.cash-card-section-header td,
    .cashflow-report tbody tr.sub-subtotal-row td {
        padding: 8px;
        font-size: 13px;
    }
    .account-summary-report tfoot tr.total-row td,
    .account-summary-report tfoot tr.stock-summary-row td,
    .account-summary-report tfoot tr.credit-card-summary-row td,
    .account-summary-report tfoot tr.net-worth-row td {
        font-size: 14px;
        padding: 10px 15px;
    }
    .chart-area-section {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    .chart-container {
        height: 400px;
        padding: 20px;
    }
    .chart-container .chart-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

@media (max-width: 600px) {
    .reports-page-layout {
        padding: 15px;
        gap: 15px;
    }
    .filters-panel {
        padding: 15px;
        gap: 10px;
    }
    .filters-panel .filter-group {
        gap: 8px;
        padding: 8px 10px;
    }
    .filters-panel label {
        font-size: 14px;
    }
    .filters-panel select,
    .filters-panel input[type="date"] {
        padding: 6px 10px;
        font-size: 13px;
    }
    .filters-panel .separator {
        font-size: 18px;
    }
    .summary-card {
        padding: 12px;
        font-size: 12px;
    }
    .summary-card span {
        font-size: 18px;
    }
    .summary-card i {
        width: 24px;
        height: 24px;
    }

    .report-section {
        padding: 15px;
    }
    .report-section .section-title {
        font-size: 20px;
        margin-bottom: 15px;
        gap: 8px;
    }
    .report-section .section-title i {
        width: 24px;
        height: 24px;
    }
    .report-table th, .report-table td {
        padding: 6px;
        font-size: 12px;
    }
    .cashflow-report tbody tr.subtotal-row td,
    .cashflow-report tfoot td,
    .cashflow-report tbody tr.cash-card-section-header td,
    .cashflow-report tbody tr.sub-subtotal-row td {
        padding: 6px;
        font-size: 12px;
    }
    .account-summary-report tfoot tr.total-row td,
    .account-summary-report tfoot tr.stock-summary-row td,
    .account-summary-report tfoot tr.credit-card-summary-row td,
    .account-summary-report tfoot tr.net-worth-row td {
        font-size: 13px;
        padding: 8px 10px;
    }
    .chart-container {
        height: 350px;
        padding: 15px;
    }
    .chart-container .chart-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
}