/*
 * Admin UI refresh — statistics and reports (module Statistics).
 * Builds on the tokens and the global layer of admin-refresh.css.
 * Calm KPI page: filters as a card on top, tables and charts as cards below.
 */

/* ── Page frame ── */

body.admin-new-theme.Statistics-css
{
    background-color: var(--adm-page);
}

body.admin-new-theme.Statistics-css #content > .container-fluid
{
    padding-bottom: 32px;
}

body.admin-new-theme.Statistics-css #content .page-header
{
    margin: 4px 0 20px;
    padding: 0;
    border-bottom: 0;
}

body.admin-new-theme.Statistics-css #content h1
{
    margin: 4px 0 20px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--adm-text);
}

body.admin-new-theme.Statistics-css #content .page-header h1
{
    margin: 0;
}

body.admin-new-theme.Statistics-css #content > .container-fluid > hr,
body.admin-new-theme.Statistics-css #content > .container-fluid > br
{
    display: none;
}

/* ── Filter / period bar as a card ── */

body.admin-new-theme.Statistics-css #content > .container-fluid > form,
body.admin-new-theme.Statistics-css #content > .container-fluid > .container > form,
body.admin-new-theme.Statistics-css #content > .container-fluid > #range_selector,
body.admin-new-theme.Statistics-css #content > .container-fluid > .compare_form,
body.admin-new-theme.Statistics-css #content > .container-fluid > .comparing_products,
body.admin-new-theme.Statistics-css #content > .container-fluid > .return-rate-statistics-wrapper > form
{
    display: flow-root;
    margin: 0 0 20px;
    padding: 20px 20px 6px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
}

body.admin-new-theme.Statistics-css #content > .container-fluid > form.row
{
    margin-left: 0;
    margin-right: 0;
    padding-left: 5px;
    padding-right: 5px;
}

body.admin-new-theme.Statistics-css #content > .container-fluid > form .control-label,
body.admin-new-theme.Statistics-css #content > .container-fluid > form label
{
    font-size: 12px;
    font-weight: 600;
    color: var(--adm-muted);
}

body.admin-new-theme.Statistics-css #content > .container-fluid > form .checkbox label,
body.admin-new-theme.Statistics-css #content > .container-fluid > form label:has(> input[type="checkbox"]),
body.admin-new-theme.Statistics-css #content > .container-fluid > form label:has(> input[type="radio"])
{
    font-size: 13px;
    font-weight: 500;
    color: var(--adm-text-soft);
}

body.admin-new-theme.Statistics-css #content > .container-fluid > form > .btn,
body.admin-new-theme.Statistics-css #content > .container-fluid > form > input.btn
{
    margin-bottom: 14px;
}

/* ── Tables as cards ── */

body.admin-new-theme.Statistics-css #content div.table-responsive
{
    margin: 0 0 20px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
}

body.admin-new-theme.Statistics-css #content .dataTables_wrapper
{
    margin: 0 0 20px;
    padding: 14px 16px 10px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
}

body.admin-new-theme.Statistics-css #content .dataTables_wrapper
{
    float: none;
}

body.admin-new-theme.Statistics-css #content .dataTables_wrapper > .table,
body.admin-new-theme.Statistics-css #content .dataTables_wrapper .row > [class*="col-"] > .table
{
    width: 100% !important;
}

body.admin-new-theme.Statistics-css #content div.table-responsive .dataTables_wrapper
{
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

body.admin-new-theme.Statistics-css #content div.table-responsive > .table
{
    margin-bottom: 0;
}

body.admin-new-theme.Statistics-css #content .table
{
    background: var(--adm-surface);
    font-variant-numeric: tabular-nums;
}

body.admin-new-theme.Statistics-css #content .table > thead > tr > th
{
    font-size: 12px;
    font-weight: 600;
    color: var(--adm-text-soft);
    background-color: var(--adm-surface-head);
    vertical-align: bottom;
}

body.admin-new-theme.Statistics-css #content .table > thead > tr:first-child > th
{
    border-top: 0;
}

body.admin-new-theme.Statistics-css #content .table > tbody > tr > td,
body.admin-new-theme.Statistics-css #content .table > tfoot > tr > td,
body.admin-new-theme.Statistics-css #content .table > tfoot > tr > th
{
    vertical-align: middle;
}

body.admin-new-theme.Statistics-css #content .table > tfoot > tr > td,
body.admin-new-theme.Statistics-css #content .table > tfoot > tr > th
{
    font-weight: 600;
    background-color: var(--adm-surface-head);
    border-top: 1px solid var(--adm-border);
}

/* a report whose form wraps the table too: one card, the table flat inside */

body.admin-new-theme.Statistics-css #content > .container-fluid > form div.table-responsive,
body.admin-new-theme.Statistics-css #content > .container-fluid > form .dataTables_wrapper
{
    padding-left: 0;
    padding-right: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

body.admin-new-theme.Statistics-css #content > .container-fluid > form > hr
{
    margin: 4px 0 16px;
    border-top-color: var(--adm-border);
}

/* a table that sits straight in the page (no wrapper) gets the card itself */

body.admin-new-theme.Statistics-css #content > .container-fluid > .table,
body.admin-new-theme.Statistics-css #content > .container-fluid > form > .table
{
    border: 1px solid var(--adm-border);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
    overflow: hidden;
}

/* ── Charts as cards ── */

body.admin-new-theme.Statistics-css #content > .container-fluid > #container,
body.admin-new-theme.Statistics-css #content > .container-fluid > #visualization,
body.admin-new-theme.Statistics-css #content > .container-fluid > #orderTotalVisualization,
body.admin-new-theme.Statistics-css #content #chart-container
{
    margin: 0 0 20px;
    padding: 12px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
}

/* ── Info notes under a report ── */

body.admin-new-theme.Statistics-css #content .alert-info
{
    border-radius: var(--adm-radius);
}

/* ═════════════════════════════════════════
 *  Statistics:profitabilityByProducts
 * ═════════════════════════════════════════ */

body.admin-new-theme.Statistics-css #profitability-by-products-form .type-inputs
{
    display: flex;
    flex-wrap: wrap;
}

body.admin-new-theme.Statistics-css #profitability-by-products-form .type-inputs > div
{
    flex: 1 1 420px;
}

body.admin-new-theme.Statistics-css #profitability-by-products-form .type-inputs > div > .col-md-3
{
    width: 50%;
}

body.admin-new-theme.Statistics-css #profitability-by-products-form .select-inputs
{
    padding: 0;
    background: transparent;
}

body.admin-new-theme.Statistics-css #profitability-by-products-form .select-field-title
{
    font-size: 12px;
    font-weight: 600;
    color: var(--adm-muted);
}

body.admin-new-theme.Statistics-css #profitability-by-products-form #profitability_table > thead > tr > th:not(:first-child),
body.admin-new-theme.Statistics-css #profitability-by-products-form #profitability_table > tbody > tr > td:not(:first-child)
{
    text-align: right;
}

/* ── numeric columns right-aligned ── */

body.admin-new-theme.Statistics-css #bestsellers_table > thead > tr > th:nth-child(n+3),
body.admin-new-theme.Statistics-css #bestsellers_table > tbody > tr > td:nth-child(n+3),
body.admin-new-theme.Statistics-css #profitability #profitability_table > thead > tr > th:nth-child(n+4),
body.admin-new-theme.Statistics-css #profitability #profitability_table > tbody > tr > td:nth-child(n+4),
body.admin-new-theme.Statistics-css #profitability #profitability_table > tfoot > tr > td:nth-child(n+4),
body.admin-new-theme.Statistics-css #unsold-products > thead > tr > th:nth-child(n+4):nth-child(-n+6),
body.admin-new-theme.Statistics-css #unsold-products > tbody > tr > td:nth-child(n+4):nth-child(-n+6),
body.admin-new-theme.Statistics-css #unsold-products > thead > tr > th:nth-child(9),
body.admin-new-theme.Statistics-css #unsold-products > tbody > tr > td:nth-child(9)
{
    text-align: right;
}

/* ═════════════════════════════════════════
 *  Statistics:suppliersDeliveryTimes
 * ═════════════════════════════════════════ */

body.admin-new-theme.suppliersDeliveryTimes-css #content .table > thead > tr > th:nth-child(n+2),
body.admin-new-theme.suppliersDeliveryTimes-css #content .table > tbody > tr > td:nth-child(n+2)
{
    text-align: right;
}

/* ═════════════════════════════════════════
 *  Statistics:canceledReasons — two cards side by side
 * ═════════════════════════════════════════ */

body.admin-new-theme.canceledReasons-css .canceled-reasons-wrappper
{
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 4px 0 20px;
}

body.admin-new-theme.canceledReasons-css .canceled-reasons-wrappper::before,
body.admin-new-theme.canceledReasons-css .canceled-reasons-wrappper::after
{
    display: none;
}

body.admin-new-theme.canceledReasons-css .canceled-reasons-wrappper > .col-md-6
{
    flex: 1 1 420px;
    width: auto;
    padding: 0 0 8px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
    overflow: hidden;
}

body.admin-new-theme.canceledReasons-css #content .cancel-reason-title
{
    margin: 0;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

body.admin-new-theme.canceledReasons-css .cancel-reason-subtitle
{
    padding: 8px 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--adm-text-soft);
    background: var(--adm-surface-head);
    border-top: 1px solid var(--adm-border);
    border-bottom: 1px solid var(--adm-border);
}

body.admin-new-theme.canceledReasons-css .cancel-reason-subtitle p,
body.admin-new-theme.canceledReasons-css .cancel-reason-item p
{
    margin: 0;
}

body.admin-new-theme.canceledReasons-css .cancel-reason-item
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 5px;
    border-bottom: 1px solid var(--adm-border);
}

body.admin-new-theme.canceledReasons-css .cancel-reason-item:last-child
{
    border-bottom: 0;
}

body.admin-new-theme.canceledReasons-css .cancel-reason-item:hover
{
    background: var(--adm-row-hover);
}

body.admin-new-theme.canceledReasons-css .cancel-reason-description
{
    color: var(--adm-text);
}

body.admin-new-theme.canceledReasons-css .cancel-reason-count,
body.admin-new-theme.canceledReasons-css .cancel-reason-subtitle .col-md-4
{
    text-align: right;
    font-variant-numeric: tabular-nums;
}

body.admin-new-theme.canceledReasons-css .cancel-reason-count
{
    font-weight: 600;
}

body.admin-new-theme.canceledReasons-css .cancel-reason-item .btn-warning,
body.admin-new-theme.canceledReasons-css .cancel-reason-item .btn-danger
{
    padding: 4px 12px;
    font-size: 12.5px;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    color: var(--adm-text-soft);
    box-shadow: none;
}

body.admin-new-theme.canceledReasons-css .cancel-reason-item .btn-danger
{
    color: var(--adm-danger);
}

body.admin-new-theme.canceledReasons-css .cancel-reason-item .btn-warning:hover,
body.admin-new-theme.canceledReasons-css .cancel-reason-item .btn-warning:focus
{
    background: var(--adm-brand-tint);
    border-color: var(--adm-brand);
    color: var(--adm-brand);
}

body.admin-new-theme.canceledReasons-css .cancel-reason-item .btn-danger:hover,
body.admin-new-theme.canceledReasons-css .cancel-reason-item .btn-danger:focus
{
    background: var(--adm-danger-bg);
    border-color: var(--adm-danger);
    color: var(--adm-danger);
}

body.admin-new-theme.canceledReasons-css .cancel-reasons-form
{
    margin: 8px 0 4px;
}

body.admin-new-theme.canceledReasons-css .cancel-reasons-form textarea
{
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
}

body.admin-new-theme.canceledReasons-css .cancel-reasons-form textarea:focus
{
    border-color: var(--adm-brand-soft);
    box-shadow: var(--adm-focus);
    outline: 0;
}

/* calmer grid: horizontal rules only */

body.admin-new-theme.Statistics-css #content .table-bordered
{
    border-left: 0;
    border-right: 0;
}

body.admin-new-theme.Statistics-css #content .table-bordered > thead > tr > th,
body.admin-new-theme.Statistics-css #content .table-bordered > tbody > tr > td,
body.admin-new-theme.Statistics-css #content .table-bordered > tbody > tr > th,
body.admin-new-theme.Statistics-css #content .table-bordered > tfoot > tr > td
{
    border-left-color: transparent;
    border-right-color: transparent;
}

body.admin-new-theme.Statistics-css #content div.table-responsive > .table-bordered
{
    border: 0;
}

/* section titles between report blocks */

body.admin-new-theme.Statistics-css #content > .container-fluid > h3
{
    margin: 24px 0 10px;
    font-size: 15px;
    font-weight: 600;
}

/* ═════════════════════════════════════════
 *  Statistics:searchLogReport (SearchLog plugin) — KPI tiles
 * ═════════════════════════════════════════ */

body.admin-new-theme.searchLogReport-css #content .row:has(> [class*="col-"] > .panel)
{
    display: flex;
    flex-wrap: wrap;
}

body.admin-new-theme.searchLogReport-css #content .row:has(> [class*="col-"] > .panel)::before,
body.admin-new-theme.searchLogReport-css #content .row:has(> [class*="col-"] > .panel)::after
{
    display: none;
}

body.admin-new-theme.searchLogReport-css #content .row > [class*="col-"] > .panel
{
    height: calc(100% - 20px);
    margin-bottom: 20px;
    border-radius: var(--adm-radius-lg);
}

body.admin-new-theme.searchLogReport-css #content .row > [class*="col-"] > .panel > .panel-body
{
    padding: 16px 18px;
}

body.admin-new-theme.searchLogReport-css #content .row > [class*="col-"] > .panel .text-muted
{
    font-size: 12px;
    font-weight: 600;
    color: var(--adm-muted);
}

body.admin-new-theme.searchLogReport-css #content .row > [class*="col-"] > .panel h3
{
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

body.admin-new-theme.searchLogReport-css #content h3:not(.panel h3)
{
    margin: 24px 0 10px;
    font-size: 15px;
    font-weight: 600;
}

/* ═════════════════════════════════════════
 *  Statistics:categoryStatistics — category cards (Elasticsearch report)
 * ═════════════════════════════════════════ */

body.admin-new-theme.Statistics-css #new-chart-grpahic .progress-bar-card .card-header
{
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--adm-text);
    background-color: var(--adm-surface-head);
    border-color: var(--adm-border);
    border-radius: var(--adm-radius-lg) var(--adm-radius-lg) 0 0;
}

body.admin-new-theme.Statistics-css #new-chart-grpahic .progress-bar-card .card-body
{
    background: var(--adm-surface);
    border-color: var(--adm-border);
    border-radius: 0 0 var(--adm-radius-lg) var(--adm-radius-lg);
    box-shadow: var(--adm-shadow);
}

body.admin-new-theme.Statistics-css #new-chart-grpahic .progress
{
    background: var(--adm-surface-alt);
}

body.admin-new-theme.Statistics-css #new-chart-grpahic .progress .progress-value
{
    font-variant-numeric: tabular-nums;
}
