/* The admin console's page layouts (D11, docs/mesosim-admin-console-plan.md): only inside .admin-shell, so customer pages
   are untouched. Colours are the theme's and meso.lib ChartStyle's custom properties, never literal values. */

.admin-shell .admin-split {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.admin-shell .admin-split > .admin-split__main {
    flex: 999 1 40rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-shell .admin-split > .admin-split__side {
    flex: 1 1 20rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-shell .admin-cols {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
}

.admin-shell .admin-cols-2 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(32rem, 100%), 1fr));
}

.admin-shell .admin-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-shell .admin-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.admin-shell .admin-tnum {
    font-variant-numeric: tabular-nums;
}

.admin-shell .admin-muted {
    color: var(--rz-text-secondary-color);
}

.admin-shell .admin-small {
    font-size: 0.8125rem;
}

.admin-shell .admin-strong {
    color: var(--rz-text-title-color);
    font-weight: 700;
}

/* The service strip's tiles. */
.admin-shell .admin-tiles {
    display: grid;
    gap: 0.875rem 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(12.5rem, 100%), 1fr));
}

.admin-shell .admin-tile {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    padding: 0.25rem;
    margin: -0.25rem;
}

.admin-shell a.admin-tile:hover {
    background: var(--rz-base-100);
    text-decoration: none;
    color: inherit;
}

.admin-shell .admin-tile__name {
    font-size: 0.8125rem;
    color: var(--rz-text-secondary-color);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.admin-shell .admin-tile__value {
    font-weight: 700;
    color: var(--rz-text-title-color);
}

.admin-shell .admin-tile__sub {
    font-size: 0.8125rem;
    color: var(--rz-text-secondary-color);
}

/* A status dot, in the status's colour, with its words beside it. */
.admin-shell .admin-dot {
    display: inline-block;
    width: 0.5625rem;
    height: 0.5625rem;
    border-radius: 50%;
    background: var(--chart-good);
    flex: 0 0 auto;
}

.admin-shell .admin-dot--warning { background: var(--chart-warning); }
.admin-shell .admin-dot--bad { background: var(--chart-bad); }
.admin-shell .admin-dot--quiet { background: var(--chart-rule); }
.admin-shell .admin-dot--running { background: var(--rz-primary); }
.admin-shell .admin-dot--credits { background: var(--chart-credits); }

/* Needs attention's rows. */
.admin-shell .admin-att {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.6875rem 0;
    border-bottom: 1px solid var(--chart-grid);
}

.admin-shell .admin-att:last-child {
    border-bottom: 0;
}

.admin-shell .admin-att__tag {
    flex: 0 0 5.5rem;
    margin-top: 0.125rem;
}

.admin-shell .admin-att__text {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-shell .admin-att__title {
    display: block;
    color: var(--rz-text-title-color);
    font-weight: 700;
}

.admin-shell .admin-att__detail {
    display: block;
    color: var(--rz-text-secondary-color);
    font-size: 0.875rem;
}

.admin-shell .admin-att__action {
    flex: 0 0 auto;
}

@media (max-width: 599.98px) {
    .admin-shell .admin-att {
        flex-wrap: wrap;
    }

    .admin-shell .admin-att__tag {
        flex-basis: auto;
    }

    .admin-shell .admin-att__text {
        flex-basis: 100%;
        order: 2;
    }

    .admin-shell .admin-att__action {
        order: 3;
    }
}

/* A timeline: time, then what happened. */
.admin-shell .admin-tl {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-shell .admin-tl > li {
    display: grid;
    grid-template-columns: 5.75rem 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--chart-grid);
    font-size: 0.875rem;
}

.admin-shell .admin-tl > li:last-child {
    border-bottom: 0;
}

.admin-shell .admin-tl__time {
    color: var(--rz-text-secondary-color);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

/* What happened, its account, then who did it and why, each on its own line. */
.admin-shell .admin-tl__what {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-shell .admin-tl__by {
    color: var(--rz-text-secondary-color);
    font-size: 0.8125rem;
}

@media (max-width: 767.98px) {
    .admin-shell .admin-tl > li {
        grid-template-columns: 1fr;
        gap: 0.125rem;
    }
}

/* Facts as a two-column list. */
.admin-shell .admin-kv {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.375rem 1rem;
    margin: 0;
    font-size: 0.875rem;
}

.admin-shell .admin-kv dt {
    color: var(--rz-text-secondary-color);
    font-weight: 400;
}

.admin-shell .admin-kv dd {
    margin: 0;
    color: var(--rz-text-title-color);
    overflow-wrap: anywhere;
}

/* A big figure with its unit, as the Usage page shows them. */
.admin-shell .admin-kpi {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--rz-text-title-color);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.admin-shell .admin-kpi small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--rz-text-secondary-color);
}

/* A meter: one or more segments on the measure's track. */
.admin-shell .admin-meter {
    height: 0.5rem;
    border-radius: 4px;
    background: var(--chart-measure-track);
    overflow: hidden;
    display: flex;
}

.admin-shell .admin-meter > span {
    display: block;
    height: 100%;
    background: var(--chart-measure);
}

.admin-shell .admin-meter > span.is-warning { background: var(--chart-warning); }
.admin-shell .admin-meter > span.is-bad { background: var(--chart-bad); }
.admin-shell .admin-meter > span.is-credits { background: var(--chart-credits); }

.admin-shell .admin-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--rz-text-secondary-color);
}

.admin-shell .admin-swatch {
    display: inline-block;
    width: 0.6875rem;
    height: 0.6875rem;
    border-radius: 2px;
    margin-right: 0.3125rem;
    vertical-align: -1px;
    background: var(--chart-measure);
}

.admin-shell .admin-swatch.is-track { background: var(--chart-measure-track); }
.admin-shell .admin-swatch.is-warning { background: var(--chart-warning); }
.admin-shell .admin-swatch.is-credits { background: var(--chart-credits); }

/* A plan, a feature or a symbol: a small grey chip. */
.admin-shell .admin-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rz-text-color);
    background: var(--rz-base-200);
    border-radius: 4px;
    padding: 0.0625rem 0.375rem;
    white-space: nowrap;
}

.admin-shell .admin-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* The console's tables: Radzen grids, compact, figures in columns, a row that needs attention tinted. */
.admin-shell .admin-grid {
    border: 0;
}

.admin-shell .admin-grid .rz-cell-data {
    font-variant-numeric: tabular-nums;
}

.admin-shell .admin-grid .admin-cell2 {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.admin-shell .admin-grid .admin-cell2 > span + span {
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
}

.admin-shell .admin-grid tr.admin-row--warning > td {
    background: var(--chart-warning-wash);
}

.admin-shell .admin-grid tr.admin-row--bad > td {
    background: var(--chart-bad-wash);
}

/* A segmented filter, as MesoSim's Backtests page has one, scrolling sideways on phones. */
.admin-shell .admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

.admin-shell .admin-toolbar .rz-selectbar {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.admin-shell .admin-toolbar .rz-selectbar .rz-button {
    white-space: nowrap;
}

.admin-shell .admin-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--rz-text-title-color);
}

.admin-shell .admin-banner--bad { background: var(--chart-bad-wash); }
.admin-shell .admin-banner--warning { background: var(--chart-warning-wash); }
.admin-shell .admin-banner--info { background: var(--chart-strategy-area); }

.admin-shell .admin-banner__text {
    flex: 1 1 18rem;
    min-width: 0;
}

/* The day strip of the Market data page: one cell per day, in its state's colour. */
.admin-shell .admin-strip {
    display: flex;
    gap: 2px;
    height: 1.125rem;
    min-width: 10rem;
}

.admin-shell .admin-strip > span {
    flex: 1 1 0;
    border-radius: 2px;
    background: var(--chart-good);
}

.admin-shell .admin-strip > span.is-late { background: var(--chart-warning); }
.admin-shell .admin-strip > span.is-unknown { background: var(--chart-rule); }
.admin-shell .admin-strip > span.is-none { background: var(--rz-base-200); }

/* The console's dialogs render outside its shell (Radzen's dialog host), hence names of their own. */
.admin-dialog-note {
    font-size: 0.8125rem;
    color: var(--rz-text-secondary-color);
}

.admin-dialog-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.admin-dialog-checks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-dialog-kv {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 0.25rem 1rem;
    margin: 0;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.admin-dialog-kv dt {
    font-weight: 400;
    color: var(--rz-text-secondary-color);
}

.admin-dialog-kv dd {
    margin: 0;
    text-align: right;
    color: var(--rz-text-title-color);
}
