/* =====================================================
   Statistics Module — Modern Chart Card
   ===================================================== */

.statistic-chart-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(31, 25, 40, 0.08);
    border: 1px solid rgba(120, 17, 62, 0.07);
    overflow: hidden;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ── Header ──────────────────────────────────────────── */
.statistic-chart-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(120, 17, 62, 0.06);
    width: 100%;
    box-sizing: border-box;
}

.statistic-chart-card__headline {
    flex: 1 1 auto;
    min-width: 0;
}

.statistic-chart-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d2536;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Controls Row ────────────────────────────────────── */
.statistic-chart-card__controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex: 0 0 auto;
}

/* ── Chart Type Toggle Buttons ───────────────────────── */
.statistic-chart-type-btns {
    display: flex;
    gap: 4px;
}

.statistic-chart-type-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1.5px solid rgba(120, 17, 62, 0.2);
    border-radius: 8px;
    background: transparent;
    color: #6f6278;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
}

.statistic-chart-type-btn:hover {
    background: rgba(120, 17, 62, 0.05);
    border-color: rgba(120, 17, 62, 0.35);
    color: #78113e;
}

.statistic-chart-type-btn.is-active {
    background: var(--red3, #78113e);
    border-color: var(--red3, #78113e);
    color: #ffffff;
}

/* ── Data Range Select ───────────────────────────────── */
.statistic-data-range-select {
    padding: 5px 10px;
    font-size: 12px;
    border: 1.5px solid rgba(120, 17, 62, 0.2);
    border-radius: 8px;
    background: #fff;
    color: #4f465d;
    cursor: pointer;
    outline: none;
    transition: border-color 0.18s;
    min-width: 110px;
}

.statistic-data-range-select:focus {
    border-color: rgba(120, 17, 62, 0.45);
}

/* ── Excel Button ────────────────────────────────────── */
.statistic-excel-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1.5px solid rgba(16, 130, 66, 0.35);
    border-radius: 8px;
    background: transparent;
    color: #108242;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.statistic-excel-btn:hover {
    background: #108242;
    color: #fff;
}

/* ── Chart Container ─────────────────────────────────── */
.statistic-chart-card__chart {
    width: 100%;
    min-height: 420px;
    padding: 8px 16px 16px;
    box-sizing: border-box;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .statistic-chart-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .statistic-chart-card__controls {
        width: 100%;
    }

    .statistic-chart-type-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    .statistic-data-range-select {
        width: 100%;
    }
}


/* =====================================================
   Statistics Module — Modern Table Card
   ===================================================== */

/* ── Table Card Wrapper ──────────────────────────────── */
.statistic-table-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(31, 25, 40, 0.08);
    border: 1px solid rgba(120, 17, 62, 0.07);
    overflow: hidden;
    width: 100%;
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
}

/* ── Table Card Header ───────────────────────────────── */
.statistic-table-card__header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid rgba(120, 17, 62, 0.06);
}

.statistic-table-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d2536;
    margin: 0;
    line-height: 1.4;
}

/* ── Toolbar (filters + controls) ───────────────────── */
.statistic-table-card__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(120, 17, 62, 0.02);
    border-bottom: 1px solid rgba(120, 17, 62, 0.05);
}

.statistic-table-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 auto;
}

/* Filter buttons — scoped override inside toolbar */
.statistic-table-card__toolbar .btn.bg-gray {
    font-size: 11.5px;
    padding: 4px 12px;
    border-radius: 8px;
    background-color: #f5f0f3 !important;
    border: 1.5px solid rgba(120, 17, 62, 0.15) !important;
    color: #6f6278 !important;
    transition: background 0.17s, color 0.17s, border-color 0.17s !important;
}

.statistic-table-card__toolbar .btn.bg-gray:hover {
    background-color: rgba(120, 17, 62, 0.08) !important;
    border-color: rgba(120, 17, 62, 0.3) !important;
    color: #78113e !important;
}

.statistic-table-card__toolbar .btn.bg-gray.active,
.statistic-table-card__toolbar .btn.active {
    background-color: var(--red3, #78113e) !important;
    border-color: var(--red3, #78113e) !important;
    color: #ffffff !important;
}

.statistic-table-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Sort select — scoped (override Bootstrap width: 100%) */
.statistic-table-controls .form-select {
    width: auto;
    min-width: 200px;
    max-width: 420px;
    font-size: 12px;
    padding: 5px 10px;
    border: 1.5px solid rgba(120, 17, 62, 0.2);
    border-radius: 8px;
    color: #4f465d;
}

.statistic-table-controls .form-select:focus {
    border-color: rgba(120, 17, 62, 0.45);
    box-shadow: none;
}

/* ── Table Container ─────────────────────────────────── */
.statistic-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 1040px;
    padding: 4px 20px 0;
}

/* ── Data Table ──────────────────────────────────────── */
.statistic-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #3d3548;
}

.statistic-data-table thead tr {
    background: linear-gradient(90deg, rgba(120,17,62,0.88) 0%, rgba(160,35,85,0.82) 100%);
}

.statistic-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 11px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.03em;
    border: none;
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
    background: linear-gradient(90deg, rgb(120,17,62) 0%, rgb(160,35,85) 100%);
}

.statistic-data-table tbody tr {
    border-bottom: 1px solid rgba(120, 17, 62, 0.06);
    transition: background 0.15s;
}

.statistic-data-table tbody tr:last-child {
    border-bottom: none;
}

.statistic-data-table tbody tr:nth-child(even) {
    background-color: rgba(120, 17, 62, 0.025);
}

.statistic-data-table tbody tr:hover {
    background-color: rgba(120, 17, 62, 0.055) !important;
}

.statistic-data-table td {
    padding: 9px 14px;
    border: none;
    vertical-align: middle;
    line-height: 1.45;
}

/* ── "Toplam" highlighted columns ───────────────────── */
.statistic-data-table .statisticDarkBg {
    background-color: rgba(120, 17, 62, 0.06) !important;
    font-weight: 600;
    color: #5a1030;
}

.statistic-data-table tbody tr:hover .statisticDarkBg {
    background-color: rgba(120, 17, 62, 0.1) !important;
}

/* ── Table Card Footer (kayıt sayısı) ────────────────── */
.statistic-table-card__footer {
    padding: 8px 20px 10px;
    font-size: 11.5px;
    color: #9b8fa0;
    border-top: 1px solid rgba(120, 17, 62, 0.05);
    text-align: right;
    background: rgba(120, 17, 62, 0.015);
    letter-spacing: 0.01em;
}

/* ── Totals Row (tfoot) ──────────────────────────────── */
.statistic-data-table tfoot tr {
    background: rgba(120, 17, 62, 0.05);
    border-top: 2px solid rgba(120, 17, 62, 0.18);
}

.statistic-data-table tfoot td {
    padding: 10px 14px;
    font-weight: 700;
    color: #3d3548;
    border: none;
    white-space: nowrap;
    background: rgba(245, 240, 243, 0.97);
}

.statistic-data-table tfoot .statisticDarkBg {
    background-color: rgba(120, 17, 62, 0.12) !important;
    color: #5a1030;
}

/* ── Excel button inside table card ─────────────────── */
.statistic-table-controls .btn-success {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1.5px solid rgba(16, 130, 66, 0.35) !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #108242 !important;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}

.statistic-table-controls .btn-success:hover {
    background: #108242 !important;
    color: #fff !important;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .statistic-table-card__toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .statistic-table-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .statistic-table-controls .form-select {
        min-width: 120px;
    }

    .statistic-data-table thead th,
    .statistic-data-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .statistic-table-container {
        max-height: 840px;
    }

    .statistic-table-card__footer {
        text-align: left;
    }
}
