/**
 * Order KPIs: statistics tabs, order KPI tab and dashboard order tiles.
 * Bootstrap 4.1 has no spinner/skeleton utilities, hence the custom ones below.
 */

/* Statistics tabs: CoreUI frames .tab-content, but the panes already consist of cards. */
.statistics-tabs > .nav-tabs {
    margin: 0 25px 1rem;
}

.statistics-tabs > .tab-content {
    margin-top: 0;
    border: 0;
    background: transparent;
}

.statistics-tabs > .tab-content > .tab-pane {
    padding: 0;
}

/* Order KPI tiles */
.merchant-dashboard .md-kpi .card-body {
    padding: 1.25rem;
}

/* Fixed head height keeps icons and values on the same line in every tile. */
.merchant-dashboard .md-kpi-head {
    min-height: 2.5rem;
}

.merchant-dashboard .md-kpi-label {
    overflow: hidden;
    margin-right: .75rem;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    color: #5c6873;
}

.merchant-dashboard .md-kpi-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.1rem;
}

.merchant-dashboard .md-kpi-icon--primary {
    background: rgba(32, 168, 216, .12);
    color: #20a8d8;
}

.merchant-dashboard .md-kpi-icon--info {
    background: rgba(99, 194, 222, .15);
    color: #2f9fbf;
}

.merchant-dashboard .md-kpi-icon--warning {
    background: rgba(255, 193, 7, .15);
    color: #c69500;
}

.merchant-dashboard .md-kpi-icon--success {
    background: rgba(77, 189, 116, .15);
    color: #3a9d5d;
}

.merchant-dashboard .md-kpi-icon--danger {
    background: rgba(248, 108, 107, .15);
    color: #e55353;
}

.merchant-dashboard .md-kpi-icon--secondary {
    background: rgba(115, 129, 143, .15);
    color: #5c6873;
}

.merchant-dashboard .md-kpi-value {
    margin-top: .75rem;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.merchant-dashboard .md-kpi-sub {
    margin-top: .25rem;
    min-height: 1.2em;
    font-size: .8rem;
    color: #73818f;
}

.merchant-dashboard .md-kpi-delta {
    margin-top: .5rem;
    min-height: 1.1em;
    font-size: .75rem;
    font-weight: 600;
    color: #73818f;
}

.merchant-dashboard .md-kpi-delta--positive {
    color: #3a9d5d;
}

.merchant-dashboard .md-kpi-delta--negative {
    color: #e55353;
}

.merchant-dashboard .md-delta-change,
.merchant-dashboard .md-delta-previous {
    white-space: nowrap;
}

.merchant-dashboard .md-delta-previous {
    font-weight: 400;
    color: #73818f;
}

.merchant-dashboard.md-is-loading .md-kpi-delta {
    visibility: hidden;
}

/* Clickable tiles and table filter chip */
.merchant-dashboard .md-kpi--clickable {
    cursor: pointer;
    border-top: 3px solid transparent;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.merchant-dashboard .md-kpi--clickable:hover,
.merchant-dashboard .md-kpi--clickable:focus {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12) !important;
    outline: none;
}

.merchant-dashboard .md-kpi--active {
    border-top-color: #20a8d8;
}

.merchant-dashboard .md-filter-chip {
    padding: .25rem .25rem .25rem .6rem;
    font-size: .75rem;
    font-weight: 600;
    background: rgba(32, 168, 216, .12);
    color: #1b8eb7;
}

.merchant-dashboard .md-filter-chip button {
    margin-left: .25rem;
    padding: 0 .3rem;
    border: 0;
    background: none;
    font-size: .9rem;
    line-height: 1;
    color: inherit;
    cursor: pointer;
}

.merchant-dashboard .md-link {
    padding: 0;
    border: 0;
    background: none;
    font-size: .8rem;
    color: #20a8d8;
    cursor: pointer;
}

.merchant-dashboard .md-link:hover,
.merchant-dashboard .md-link:focus {
    text-decoration: underline;
}

.merchant-dashboard .md-info {
    color: #73818f;
    cursor: help;
}

/* Skeleton loading */
.merchant-dashboard.md-is-loading .md-kpi-value,
.merchant-dashboard.md-is-loading .md-kpi-sub {
    color: transparent !important;
    border-radius: .25rem;
    background: linear-gradient(90deg, #eef1f4 25%, #f8f9fa 50%, #eef1f4 75%);
    background-size: 200% 100%;
    animation: md-shimmer 1.2s ease-in-out infinite;
}

.merchant-dashboard.md-is-loading .md-kpi-value {
    width: 60%;
}

.merchant-dashboard.md-is-loading .md-kpi-sub {
    width: 85%;
}

.merchant-dashboard.md-is-loading .md-kpi-sub * {
    visibility: hidden;
}

/* Spinner, table message and trend chart */
.merchant-dashboard .md-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: .15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -.15em;
    animation: md-spin .75s linear infinite;
}

.merchant-dashboard .md-spinner--lg {
    width: 2rem;
    height: 2rem;
    border-width: .2em;
    color: #20a8d8;
}

.merchant-dashboard .md-table-message td {
    padding: 2rem;
    text-align: center;
    color: #73818f;
}

.merchant-dashboard .md-pager .btn {
    min-width: 6.5rem;
}

/* Order view of the position table */
.merchant-dashboard .md-order-row td {
    border-top: 2px solid #c8ced3;
    background: #f0f3f5;
    font-weight: 600;
    cursor: pointer;
}

.merchant-dashboard .md-order-toggle {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.merchant-dashboard .md-order-toggle .fa {
    width: .75rem;
    color: #20a8d8;
    transition: transform .15s ease;
}

.merchant-dashboard .md-order-toggle[aria-expanded="true"] .fa {
    transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
    .merchant-dashboard .md-order-toggle .fa {
        transition: none;
    }
}

.merchant-dashboard .md-order-row small {
    font-weight: 400;
}

.merchant-dashboard .md-order-row .badge + .badge {
    margin-left: .25rem;
}

.merchant-dashboard .md-order-position--match td {
    background: rgba(32, 168, 216, .08);
}

.merchant-dashboard .md-order-position--match td:first-child {
    box-shadow: inset 3px 0 0 #20a8d8;
}

.merchant-dashboard .md-trend-chart {
    position: relative;
    height: 300px;
}

.merchant-dashboard .md-trend-message {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .85);
    color: #73818f;
}

@keyframes md-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes md-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .merchant-dashboard .md-spinner,
    .merchant-dashboard.md-is-loading .md-kpi-value,
    .merchant-dashboard.md-is-loading .md-kpi-sub {
        animation: none;
    }
}

/* Dashboard order tiles and chart */
.dashboard-order-kpis .dash-kpi {
    color: inherit;
    text-decoration: none;
    transition: box-shadow .15s ease;
}

.dashboard-order-kpis .dash-kpi:hover,
.dashboard-order-kpis .dash-kpi:focus {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12) !important;
    outline: none;
}

.dashboard-order-kpis .dash-kpi-sub {
    min-height: 1.2em;
    font-size: .8rem;
    color: #73818f;
}

.dashboard-order-kpis .dash-kpi-delta {
    min-height: 1.1em;
    font-size: .75rem;
    font-weight: 600;
    color: #73818f;
}

.dashboard-order-kpis .dash-kpi-delta--positive {
    color: #3a9d5d;
}

.dashboard-order-kpis .dash-kpi-delta--negative {
    color: #e55353;
}

.dash-order-chart {
    position: relative;
    height: 330px;
}

.dash-order-chart-message {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #73818f;
}
