/* =============================
   КАРТКА ФІЛЬТРІВ / ХЕДЕР
================================ */

.cabinet-stats-card {
    position: relative;
}

.cabinet-stats-title {
    font-size: 16px;
    font-weight: 600;
}

.cabinet-stats-subtitle {
    font-size: 12px;
    color: #6b7280;
}

.cabinet-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

/* форма фільтра */

.cabinet-stats-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 16px;
    margin-top: 10px;
}

.cabinet-stats-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.cabinet-stats-filter-group label {
    font-size: 13px;
    color: #4b5563;
}

.cabinet-stats-filter-group .form-control {
    font-size: 13px;
    height: calc(1.9rem + 2px);
}

/* блок з кнопками */

.cabinet-stats-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cabinet-stats-reset {
    font-size: 12px;
    padding-left: 4px;
    padding-right: 0;
}

/* =============================
   SUMMARY-ЧІПИ
================================ */

.cabinet-stats-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cabinet-stats-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 4px 10px;
    background: #f3f4ff; /* легкий фіолетовий відтінок */
    border: 1px solid #e0e7ff;
    font-size: 11px;
    color: #4b5563;
}

.cabinet-stats-chip-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    color: #9ca3af;
}

.cabinet-stats-chip-value {
    font-weight: 500;
    color: #111827;
}

/* =============================
   ТАБЛИЦЯ (DESKTOP / TABLET)
================================ */

.cabinet-stats-table-card {
    overflow: hidden;
}

/* верх таблиці: заголовок + підказка */

.cabinet-stats-table-header {
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.cabinet-stats-table-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.cabinet-stats-table-hint {
    font-size: 11px;
    color: #9ca3af;
}

/* контейнер таблиці */

.cabinet-stats-table-wrapper {
    max-height: 70vh;
    overflow-y: auto;
}

/* сама таблиця */

.cabinet-stats-table {
    border-collapse: separate;
    border-spacing: 0;
}

/* head */

.cabinet-stats-table thead tr {
    background: #f8fafc;
}

.cabinet-stats-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* body */

.cabinet-stats-table tbody td {
    font-size: 13px;
    vertical-align: middle;
    border-top: 1px solid #e5e7eb;
}

/* зебра по рядках */

.cabinet-stats-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.cabinet-stats-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

/* hover */

.cabinet-stats-table tbody tr:hover {
    background-color: #e5f3ff;
}

/* цифри -- моноширинні */

.cabinet-stats-table td.text-right {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* pagination */

.cabinet-stats-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* =============================
   MOBILE CARDS
================================ */

.cabinet-stats-mobile-list {
    display: none; /* показуємо тільки на мобілці */
    margin-top: 10px;
}

.cabinet-stats-mobile-card {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: radial-gradient(circle at top left, #eef2ff 0, #ffffff 55%, #f9fafb 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    margin-bottom: 8px;
}

.cabinet-stats-mobile-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.cabinet-stats-mobile-head-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cabinet-stats-mobile-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cabinet-stats-mobile-date {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}

.cabinet-stats-mobile-cab {
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
}

.cabinet-stats-mobile-body {
    border-top: 1px dashed #e5e7eb;
    padding-top: 6px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cabinet-stats-mobile-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.cabinet-stats-mobile-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    min-width: 76px;
}

.cabinet-stats-mobile-value {
    font-size: 12px;
    color: #111827;
}

.cabinet-stats-mobile-pagination {
    justify-content: center;
}

/* =============================
   ADAPTIVE
================================ */

/* Планшети: форма стає колоною, таблиця без обмеження по висоті */
@media (max-width: 991.98px) {
    .cabinet-stats-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .cabinet-stats-filter-group {
        width: 100%;
    }

    .cabinet-stats-filter-actions {
        justify-content: flex-start;
    }

    .cabinet-stats-table-wrapper {
        max-height: none;
    }
}

/* Мобілка: компактна картка, фільтр по одному стовпчику, таблиця ховається, показуємо картки */
@media (max-width: 767.98px) {
    .cabinet-stats-card {
        padding: 10px 12px !important;
    }

    .cabinet-stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .cabinet-stats-title {
        font-size: 15px;
    }

    .cabinet-stats-subtitle {
        font-size: 11px;
    }

    .cabinet-stats-filter {
        gap: 8px;
    }

    .cabinet-stats-filter-group label {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .cabinet-stats-filter-group .form-control {
        font-size: 12px;
        height: 34px;
        padding: 4px 8px;
    }

    .cabinet-stats-filter-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-top: 2px;
    }

    .cabinet-stats-filter-actions .btn {
        width: 100%;
    }

    .cabinet-stats-reset {
        padding-left: 0;
        text-align: center;
    }

    .cabinet-stats-summary {
        margin-top: 10px;
        gap: 4px;
    }

    .cabinet-stats-chip {
        width: 100%;
        justify-content: space-between;
    }

    /* Таблицю ховаємо, залишаємо тільки мобільні картки */
    .cabinet-stats-table-card {
        display: none;
    }

    .cabinet-stats-mobile-list {
        display: block;
    }

    .cabinet-stats-pagination {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Дуже маленькі екрани */
@media (max-width: 575.98px) {
    .cabinet-stats-mobile-label {
        min-width: 70px;
    }

    .cabinet-stats-mobile-card {
        padding: 8px 9px;
    }
}
