.show-ranking {
    font-size: 11px;
}

.dashboard-page {
    display: grid;
    gap: 1rem;
}

.dashboard-command-surface {
    display: grid;
    gap: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--form-border);
    border-radius: var(--surface-radius);
    background: var(--surface-color);
    padding: 1rem;
}

.dashboard-command-surface__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-command-surface__title {
    margin: 0;
    color: var(--header-color);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
}

.dashboard-command-surface__meta {
    margin: 0.25rem 0 0;
    color: var(--sub-title-color);
    font-size: 0.88rem;
}

.dashboard-filter-shell {
    display: grid;
    gap: 0.85rem;
}

.dashboard-filter-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-filter-mode__label {
    color: var(--header-color);
    font-weight: 700;
}

.dashboard-comparison-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.2rem;
    border: 1px solid var(--form-border);
    border-radius: var(--form-border-radius);
    background: var(--surface-muted-color);
}

.dashboard-filter-form {
    margin-bottom: 0 !important;
}

.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter {
    gap: 0.75rem;
}

.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter .form-control,
.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter .form-select,
.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter .checkbox-select-toggle {
    border-color: var(--form-border);
    background-color: var(--form-field-bg);
    color: var(--form-text-color);
}

.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter .form-control:focus,
.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter .form-select:focus,
.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter .checkbox-select-toggle:focus,
.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter .checkbox-select-toggle.show {
    border-color: var(--primary-link-color);
    background-color: var(--form-field-bg);
}

.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter > .col-auto {
    min-width: 13rem;
}

.dashboard-filter-shell .form-layout-horizontal.form-purpose-filter > .col-auto:empty {
    display: none;
}

.dashboard-filter-submit {
    min-width: 0 !important;
}

.dashboard-builder-section {
    overflow: hidden;
}

.dashboard-builder-section .dashboard-builder-section__header {
    margin-bottom: 0;
    position: relative;
}

.dashboard-builder-section .dashboard-builder-section__body {
    align-items: stretch;
}

.dashboard-builder-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-builder-panel__action {
    flex: 0 0 auto;
}

.dashboard-builder-panel {
    min-height: 240px;
}

.dashboard-builder-widget {
    --dashboard-builder-chart-height: clamp(16rem, 23vw, 20rem);
    min-height: 180px;
}

.dashboard-builder-widget > .row {
    margin-left: 0;
    margin-right: 0;
}

.dashboard-builder-widget canvas {
    display: block;
    max-width: 100%;
}

.dashboard-builder-widget > canvas[data-widget-type] {
    width: 100% !important;
    height: var(--dashboard-builder-chart-height) !important;
    max-height: var(--dashboard-builder-chart-height);
    min-height: 0 !important;
}

.dashboard-pie-chart {
    display: flex;
    position: relative;
    width: 100%;
    height: var(--dashboard-builder-chart-height);
    max-height: var(--dashboard-builder-chart-height);
    min-height: 0;
    align-items: center;
    justify-content: center;
}

.dashboard-pie-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.dashboard-builder__info {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--form-border);
    border-radius: 50%;
    background: var(--surface-muted-color);
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.dashboard-builder__info:hover,
.dashboard-builder__info:focus,
.dashboard-builder__info[aria-expanded="true"] {
    border-color: rgba(81, 39, 155, 0.18);
    background: var(--control-active-bg);
    color: var(--primary-link-hover);
}

.dashboard-builder__legend {
    position: absolute;
    top: 3.25rem;
    right: 0.5rem;
    z-index: 10;
    width: min(18rem, calc(100vw - 3rem));
    border: 1px solid var(--form-border);
    border-radius: var(--surface-radius-sm);
    background: var(--surface-color);
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.12);
    padding: 0.85rem;
}

.dashboard-builder__legend-title {
    margin-bottom: 0.6rem;
    color: var(--header-color);
    font-size: 0.85rem;
    font-weight: 700;
}

.dashboard-builder__legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--form-text-color);
    font-size: 0.8rem;
    line-height: 1.35;
}

.dashboard-builder__legend-row + .dashboard-builder__legend-row {
    margin-top: 0.45rem;
}

.dashboard-builder__legend-swatch {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 0.2rem;
}

.dashboard-builder__legend-swatch--hit {
    border: 1px solid var(--valid-color);
    background: var(--valid-background);
}

.dashboard-builder__legend-swatch--miss {
    border: 1px solid var(--invalid-color);
    background: var(--invalid-background);
}

.dashboard-builder__legend-note {
    margin-top: 0.65rem;
    color: var(--sub-title-color);
    font-size: 0.75rem;
    line-height: 1.4;
}

.ranking-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--form-border);
    background: var(--surface-muted-color);
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.2;
    padding: 0.35rem 0.6rem;
    text-decoration: none;
}

.ranking-widget {
    --ranking-widget-metric-height: 8.5rem;
    position: relative;
}

.ranking-widget-main {
    min-height: 0;
}

.ranking-widget-chart {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-widget-chart canvas {
    width: 100% !important;
    height: var(--dashboard-builder-chart-height) !important;
    max-height: var(--dashboard-builder-chart-height);
}

.ranking-widget--with-table .ranking-widget-chart canvas {
    height: var(--ranking-widget-metric-height) !important;
    max-height: var(--ranking-widget-metric-height);
}

.ranking-widget-summary {
    display: flex;
    min-height: 12rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 0.25rem;
}

.ranking-widget--with-table .ranking-widget-summary {
    min-height: var(--ranking-widget-metric-height);
    padding-top: 0.25rem;
}

.ranking-widget-title {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.ranking-widget-value {
    margin: 0;
    color: var(--sub-title-color);
    font-size: 1.2rem;
    line-height: 1.25;
}

.ranking-widget-delta {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.35rem;
    font-size: 11px;
}

.ranking-widget-absolute-delta {
    display: block;
    font-weight: 700;
}

.ranking-toggle:hover,
.ranking-toggle:focus {
    border-color: rgba(81, 39, 155, 0.18);
    background: rgba(81, 39, 155, 0.1);
    color: var(--primary-link-hover);
    text-decoration: none;
}

.chart-indication {
    font-size: 0.78rem;
    font-weight: 500;
}

.preset-plugin-container > button {
    background-color: var(--secondary-link-color);
    color: var(--primary-link-color);
}

.preset-plugin-container {
    background-color: var(--surface-color);
}

.preset-plugin-container > button:hover {
    background-color: var(--secondary-link-hover);
    color: var(--primary-link-color);
    border: 1px solid var(--secondary-link-hover);
}

.calendar > .days-grid > .day:hover {
    border: 1px solid var(--secondary-link-hover);
    color: var(--primary-link-color);
}

.container.range-plugin .calendar > .days-grid > .day.in-range {
    background-color: var(--secondary-link-color);
}

.container.range-plugin .calendar > .days-grid > .day.end,
.container.range-plugin .calendar > .days-grid > .day.start {
    background-color: var(--secondary-link-hover);
    color: var(--primary-link-color);
}

.container.range-plugin .calendar > .days-grid > .day.start:after {
    border-left: 8px solid var(--secondary-link-hover);
}

.container.range-plugin .calendar > .days-grid > .day.end:after {
    border-right: 8px solid var(--secondary-link-hover);
}

.calendar > .days-grid > .day.today {
    color: var(--primary-link-color);
    font-weight: 700;
    background-color: var(--secondary-link-color);
    border-radius: 50%;
}

.container.preset-plugin main.preset-left .preset-plugin-container,
.container.preset-plugin main.preset-right .preset-plugin-container {
    margin-top: 50px;
}

.tooltip-container {
    position: relative;
    display: inline-block;
}

.question-mark {
    background-color: var(--primary-link-color);
    border-radius: 50%;
    display: inline-block;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    cursor: pointer;
    color: #ffffff;
    font-size: 12px;
    vertical-align: middle;
}

.question-mark:hover {
    background-color: var(--primary-link-hover);
}

.tooltip-content {
    display: none;
    width: 175px;
    background-color: var(--surface-muted-color);
    border: 1px solid var(--form-border);
    padding: 5px;
    position: absolute;
    z-index: 1;
    left: 10%;
    transform: translateX(-50%);
    border-radius: 0.25rem;
}

/*
.tooltip-container:hover .tooltip-content {
    display: block;
}*/

i.pos {
    transform: rotate(45deg);
}

i.neg {
    transform: rotate(-45deg);
}

.sales-ranking {
    display: none;
}

#chartContainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.horizontal-line {
    display: block;
    height: 1px
}

.ranking {
    display: none;
    min-width: 0;
    overflow: hidden;
}

.ranking:not([hidden]) {
    display: block;
    margin-top: 0.25rem;
}

.ranking-table {
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0 0.45rem;
    font-size: 0.8rem;
    table-layout: auto;
    width: 100%;
}

.ranking-table > tbody > tr > td {
    background: #fff !important;
    border-bottom: 1px solid #e8ebf1;
    border-top: 1px solid #e8ebf1;
    color: var(--control-text);
    overflow: hidden;
    padding: 0.6rem 0.5rem;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.ranking-table-col-label {
    width: auto;
}

.ranking-table-col-value {
    width: 1%;
}

.ranking-table-col-difference {
    width: 1%;
}

.ranking-table-col-delta {
    width: 1%;
}

.ranking-table > tbody > tr:hover > td {
    background: #f8f5ff !important;
}

.ranking-table > tbody > tr > td:first-child {
    border-left: 3px solid rgba(111, 66, 193, 0.38);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.ranking-table > tbody > tr > td:last-child {
    border-right: 1px solid #e8ebf1;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.ranking-table-label {
    font-weight: 600;
    max-width: 0;
    text-align: left;
}

.ranking-table-value,
.ranking-table-difference,
.ranking-table-delta {
    font-variant-numeric: tabular-nums;
    text-align: right;
    width: 1%;
}

.ranking-table-difference {
    font-weight: 700;
}

.ranking-table-delta {
    font-weight: 700;
}

.ranking-table-label-text,
.ranking-table-number {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-table-empty {
    color: var(--sub-title-color) !important;
    font-style: italic;
    text-align: center;
}

.text-small {
    font-size: 11px;
}

.db-height {
    width: 100% !important;
    height: var(--dashboard-builder-chart-height) !important;
    max-height: var(--dashboard-builder-chart-height);
    min-height: 0 !important;
}

.chart-title {
    color: var(--header-color) !important;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .dashboard-command-surface {
        padding: 0.85rem;
    }

    .dashboard-command-surface__title {
        font-size: 1.25rem;
    }

    .dashboard-filter-shell .form-layout-horizontal.form-purpose-filter > .col-auto {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 991.98px) {
    .dashboard-builder-panel.dashboard-panel--bordered::before {
        display: none;
    }

    .dashboard-builder-panel {
        border-top: 1px solid var(--form-border);
        min-height: 0;
    }

    .ranking-widget-main,
    .ranking-widget-chart,
    .ranking-widget-summary {
        min-height: 0;
    }

    .dashboard-builder-panel:first-child {
        border-top: 0;
    }
}
