.module-page-container {
    min-height: 100vh;
    padding-top: calc(var(--navbar-height-desktop) + clamp(1rem, 0.5rem + 1.5vw, 1.75rem));
    padding-bottom: clamp(1.25rem, 0.75rem + 2vw, 2rem);
}

.module-header { margin-bottom: 1.25rem; }
.module-summary-row { margin-bottom: 1rem; }

.module-stat-card,
.module-panel {
    background: var(--card-bg);
    border-radius: 0.875rem;
    box-shadow: var(--shadow-soft);
}

.module-stat-card {
    display: flex;
    min-height: 6rem;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.15rem;
}

.module-stat-card span {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.module-stat-card strong {
    margin-top: 0.35rem;
    color: var(--text-strong);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: clamp(1.15rem, 0.95rem + 0.6vw, 1.65rem);
}

.module-panel {
    min-height: 0;
    padding: clamp(1rem, 0.75rem + 1vw, 1.5rem);
}

.module-panel h2,
.module-panel-heading h2 {
    margin: 0 0 1rem;
    color: #343a40;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: clamp(1.05rem, 0.9rem + 0.45vw, 1.35rem);
    font-weight: 700;
}

.module-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.module-panel-heading h2 { margin-bottom: 0; }
.module-panel-subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}
.module-table { margin-bottom: 0; }

.record-filter-form {
    display: grid;
    grid-template-columns: minmax(8.5rem, 0.8fr) minmax(9rem, 1fr) minmax(12rem, 1.25fr) auto;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid #eef0f2;
    border-radius: 0.75rem;
    background: #f8fafc;
}

.record-filter-form .form-label {
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.record-filter-actions {
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
}

.module-table thead th {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.record-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    white-space: nowrap;
}

.record-actions form {
    margin: 0;
}

.credit-card-preview {
    min-height: 13rem;
    position: relative;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #20c997);
    overflow: hidden;
}

.credit-card-topline {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 2.6rem;
    margin-bottom: 1.35rem;
}

.credit-card-preview .credit-card-spend-button {
    min-height: 2.35rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(10px);
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.14);
    white-space: nowrap;
}

.credit-card-preview .credit-card-spend-button span[aria-hidden="true"] {
    display: inline-grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #0d6efd;
    font-size: 1rem;
    font-weight: 800;
}

.credit-card-preview .credit-card-spend-button:hover,
.credit-card-preview .credit-card-spend-button:focus {
    background: #fff;
    color: #0d6efd;
}

.credit-card-preview .credit-card-spend-button:hover span[aria-hidden="true"],
.credit-card-preview .credit-card-spend-button:focus span[aria-hidden="true"] {
    background: #0d6efd;
    color: #fff;
}

.credit-card-preview.secondary-card {
    background: linear-gradient(135deg, #6f42c1, #0dcaf0);
}

.credit-card-preview p {
    position: relative;
    z-index: 1;
    margin: 1.9rem 0 0.4rem;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}

.credit-card-preview strong {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    letter-spacing: 0.06em;
}

.card-chip {
    display: block;
    width: 2.4rem;
    height: 1.7rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.85);
}

.credit-card-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
}

.credit-card-preview > .text-white-50,
.credit-card-preview > .d-flex {
    position: relative;
    z-index: 1;
}

.reports-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.reports-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.reports-filter-form {
    width: 8.5rem;
}

.reports-period-pill {
    padding: 0.45rem 0.75rem;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #fff;
    color: var(--text-soft);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
}

.reports-overview-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: clamp(1.1rem, 0.8rem + 1.3vw, 1.75rem);
    border-radius: 0.875rem;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.reports-overview-copy h2 {
    max-width: 46rem;
    margin: 0.55rem 0 0.6rem;
    color: var(--text-strong);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: clamp(1.35rem, 1rem + 1vw, 2rem);
    font-weight: 800;
}

.reports-overview-copy p {
    max-width: 52rem;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.reports-status {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.reports-status.is-positive {
    color: #0f6848;
    background: #dff7ea;
}

.reports-status.is-negative {
    color: #a51d2d;
    background: #fde2e6;
}

.reports-overview-metrics {
    display: grid;
    gap: 0.75rem;
}

.reports-overview-metrics div {
    display: flex;
    min-height: 5.75rem;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    border: 1px solid #eef0f2;
    border-radius: 0.75rem;
    background: #f8fafc;
}

.reports-overview-metrics span,
.report-kpi-card small {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.reports-overview-metrics strong {
    margin-top: 0.35rem;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: clamp(1.1rem, 0.9rem + 0.6vw, 1.5rem);
}

.report-kpi-card small {
    margin-top: 0.25rem;
}

.reports-panel-heading {
    align-items: flex-start;
}

.reports-panel-heading p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.report-chart-panel {
    min-height: 25rem;
}

.report-chart-frame {
    position: relative;
    width: 100%;
    height: 20rem;
    min-height: 20rem;
    max-height: 20rem;
    overflow: hidden;
}

.report-chart-frame-large {
    height: 22rem;
    min-height: 22rem;
    max-height: 22rem;
}

.report-chart-frame canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.report-select { width: 9rem; }

.report-side-panel {
    height: 100%;
}

.report-category-list,
.report-category-bars,
.report-month-list {
    display: grid;
    gap: 0.75rem;
}

.report-category-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eef0f2;
}

.report-category-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.report-category-row,
.report-month-row {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid #eef0f2;
}

.report-category-row:first-child,
.report-month-row:first-child {
    padding-top: 0;
}

.report-category-row:last-child,
.report-month-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.report-category-row-top,
.report-month-title,
.report-month-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.report-category-row-top span,
.report-month-title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-category-row-top strong,
.report-month-title span {
    flex-shrink: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.report-progress-track {
    width: 100%;
    height: 0.45rem;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.report-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--expense);
}

.report-progress-track.is-positive span {
    background: var(--income);
}

.report-progress-track.is-negative span {
    background: var(--expense);
}

.report-month-values {
    flex-wrap: wrap;
    justify-content: flex-start;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.report-month-values span {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #f8fafc;
}

@media (min-width: 992px) {
    .module-panel {
        height: auto;
    }
}

@media (max-width: 991.98px) {
    .reports-overview-panel {
        grid-template-columns: 1fr;
    }

    .reports-overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .module-page-container {
        padding-top: calc(var(--navbar-height-mobile) + 1rem);
        padding-bottom: 2rem;
    }

    .module-page-container > .row {
        row-gap: 1rem;
    }

    .module-page-container .col-lg-5,
    .module-page-container .col-lg-7,
    .module-page-container .col-lg-8,
    .module-page-container .col-lg-4 {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .module-panel {
        width: 100%;
        height: auto;
        margin-bottom: 0 !important;
        overflow: visible;
    }

    .module-panel-heading,
    .reports-header,
    .report-month-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .record-filter-form {
        grid-template-columns: 1fr;
    }

    .record-filter-actions,
    .record-filter-actions .btn {
        width: 100%;
    }

    .record-filter-actions {
        flex-direction: column;
    }

    .reports-actions,
    .reports-filter-form {
        width: 100%;
    }

    .reports-actions .btn,
    .reports-actions .form-select,
    .reports-period-pill {
        width: 100%;
    }

    .reports-overview-metrics {
        grid-template-columns: 1fr;
    }

    .reports-overview-metrics div {
        min-height: 5rem;
    }

    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
    }

    .module-table {
        min-width: 42rem;
    }

    .module-page-container:has(.credit-card-preview) .table-responsive {
        overflow: visible;
    }

    .module-page-container:has(.credit-card-preview) .module-table {
        min-width: 0;
    }

    .module-page-container:has(.credit-card-preview) .module-table thead {
        display: none;
    }

    .module-page-container:has(.credit-card-preview) .module-table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .module-page-container:has(.credit-card-preview) .module-table tr {
        display: grid;
        gap: 0.45rem;
        padding: 0.85rem;
        border: 1px solid #eef0f2;
        border-radius: 0.75rem;
        background: #fff;
        box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.04);
    }

    .module-page-container:has(.credit-card-preview) .module-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        width: 100%;
        min-width: 0;
        padding: 0.18rem 0;
        border: 0;
        text-align: right !important;
        white-space: normal;
    }

    .module-page-container:has(.credit-card-preview) .module-table td::before {
        flex: 0 0 auto;
        color: var(--text-muted);
        font-size: 0.76rem;
        font-weight: 800;
        line-height: 1.45;
        text-align: left;
        text-transform: uppercase;
    }

    .module-page-container:has(.credit-card-preview) .module-table td > * {
        max-width: 100%;
    }

    .module-page-container:has(.credit-card-preview) .module-table form {
        margin-left: auto;
    }

    .module-page-container:has(.credit-card-preview) .module-table tr:has(td[colspan]) {
        padding: 0.65rem 0.85rem;
        border-style: dashed;
        background: #f8fafc;
        box-shadow: none;
    }

    .module-page-container:has(.credit-card-preview) .module-table td[colspan] {
        display: block;
        padding: 0;
        background: transparent !important;
        text-align: left !important;
    }

    .module-page-container:has(.credit-card-preview) .module-table td[colspan]::before {
        display: block;
        margin-bottom: 0.45rem;
        content: "Kayıtlar";
    }

    .module-page-container:has(.credit-card-preview) .module-table tr:only-child td[colspan]::before {
        display: none;
    }

    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(1)::before { content: "Kart"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(2)::before { content: "Dönem"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(3)::before { content: "Son Ödeme"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(4)::before { content: "Ekstre"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(5)::before { content: "Asgari"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(6)::before { content: "Ödenen"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(7)::before { content: "Kalan"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(8)::before { content: "Durum"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(9)) tr:not(:has(td[colspan])) td:nth-child(9)::before { content: "İşlem"; }

    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(1)::before { content: "Kart"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(2)::before { content: "Geçerlilik"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(3)::before { content: "Faiz"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(4)::before { content: "KKDF"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(5)::before { content: "BSMV"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(6)::before { content: "Asgari Oran"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(7)::before { content: "Mutlak Asgari"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(8)):not(:has(th:nth-child(9))) td:nth-child(8)::before { content: "İşlem"; }

    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(5)):not(:has(th:nth-child(6))) td:nth-child(1)::before { content: "Kart"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(5)):not(:has(th:nth-child(6))) td:nth-child(2)::before { content: "Açıklama"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(5)):not(:has(th:nth-child(6))) td:nth-child(3)::before { content: "Tarih"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(5)):not(:has(th:nth-child(6))) td:nth-child(4)::before { content: "Tutar"; }
    .module-page-container:has(.credit-card-preview) .module-table:has(th:nth-child(5)):not(:has(th:nth-child(6))) td:nth-child(5)::before { content: "İşlem"; }

    .report-select { width: 100%; }
    .report-chart-frame,
    .report-chart-frame-large { height: 17rem; min-height: 17rem; max-height: 17rem; }
}
