/* [statistics_group]: the statistics filed under one menu item, with CSV downloads. */
.cbk-stats-group {
    --cbk-sg-blue: #194c9f;
    --cbk-sg-blue-dark: #123a7a;
    --cbk-sg-gold: #c9a227;
    --cbk-sg-line: #dfe4ec;
    --cbk-sg-soft: #f4f7fb;
    margin: 8px 0 48px;
    font-size: 16px;
}

.cbk-stats-group [hidden] {
    display: none !important;
}

.cbk-stats-group__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.cbk-stats-group__search {
    position: relative;
    flex: 0 1 380px;
    margin: 0;
}

.cbk-stats-group__search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7686;
    font-size: 14px;
    pointer-events: none;
}

.cbk-stats-group__search input[type="search"] {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--cbk-sg-line);
    border-radius: 0;
    background: #fff;
    font-size: 15px;
    color: #1d2633;
    box-shadow: none;
}

.cbk-stats-group__search input[type="search"]:focus {
    outline: 2px solid var(--cbk-sg-blue);
    outline-offset: -1px;
    border-color: var(--cbk-sg-blue);
}

.cbk-stats-group__count {
    color: #5b6575;
    font-size: 14px;
}

.cbk-stats-group__table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--cbk-sg-line);
    background: #fff;
    margin: 0;
}

.cbk-stats-group__table thead th {
    background: var(--cbk-sg-blue);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    text-align: left;
    padding: 13px 20px;
    border: 0;
}

.cbk-stats-group__table tbody td {
    padding: 14px 20px;
    border: 0;
    border-top: 1px solid var(--cbk-sg-line);
    vertical-align: middle;
    background: transparent;
}

.cbk-stats-group__table tbody tr:nth-child(even) td {
    background: var(--cbk-sg-soft);
}

.cbk-stats-group__table tbody tr:hover td {
    background: #eaf0f9;
}

.cbk-stats-group__title a {
    color: var(--cbk-sg-blue);
    font-weight: 500;
    text-decoration: none;
}

.cbk-stats-group__title a:hover,
.cbk-stats-group__title a:focus-visible {
    color: var(--cbk-sg-blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cbk-stats-group__latest {
    color: #444f5e;
    white-space: nowrap;
    width: 1%;
    padding-right: 32px !important;
}

.cbk-stats-group__actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.cbk-stats-group__csv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--cbk-sg-blue);
    color: var(--cbk-sg-blue);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.cbk-stats-group__csv:hover,
.cbk-stats-group__csv:focus-visible {
    background: var(--cbk-sg-blue);
    color: #fff;
    text-decoration: none;
}

.cbk-stats-group__csv:focus-visible,
.cbk-stats-group__title a:focus-visible {
    outline: 2px solid var(--cbk-sg-gold);
    outline-offset: 2px;
}

.cbk-stats-group__csv i {
    font-size: 15px;
}

.cbk-stats-group__none,
.cbk-stats-group__empty {
    margin: 16px 0 0;
    color: #5b6575;
}

/* Phones: each statistic becomes a card. */
@media (max-width: 680px) {
    .cbk-stats-group__search {
        flex-basis: 100%;
    }

    .cbk-stats-group__table,
    .cbk-stats-group__table tbody,
    .cbk-stats-group__table tr,
    .cbk-stats-group__table td {
        display: block;
        width: auto;
    }

    .cbk-stats-group__table {
        border: 0;
        background: transparent;
    }

    .cbk-stats-group__table thead {
        display: none;
    }

    .cbk-stats-group__table tbody tr {
        border: 1px solid var(--cbk-sg-line);
        border-left: 4px solid var(--cbk-sg-blue);
        background: #fff;
        margin-bottom: 12px;
        padding: 14px 16px;
    }

    .cbk-stats-group__table tbody tr td,
    .cbk-stats-group__table tbody tr:nth-child(even) td,
    .cbk-stats-group__table tbody tr:hover td {
        border: 0;
        padding: 0 !important;
        background: transparent;
        text-align: left;
        white-space: normal;
    }

    .cbk-stats-group__latest {
        margin-top: 6px;
        font-size: 14px;
    }

    .cbk-stats-group__latest::before {
        content: attr(data-label) ": ";
        color: #6b7686;
    }

    .cbk-stats-group__actions {
        margin-top: 12px;
    }
}
