/* The Dashboard (static/pages/dashboard.js); shares tables, meters, tiles and blocks with servers.css. */

/* ---------- Shared ---------- */
.dash-view .sub {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.dash-view .mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.dash-heading {
    margin: 0 0 1rem;
}
.dash-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}
.dash-panel h3 {
    margin: 0;
    font-size: 0.95rem;
}
.dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.dash-panel-head a {
    color: var(--accent-text);
    font-size: 0.85rem;
    text-decoration: none;
}
.dash-panel-head a:hover {
    text-decoration: underline;
}
.dash-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    gap: 1rem;
    align-items: start;
}
.dash-attention {
    margin-bottom: 1rem;
    border-color: color-mix(in srgb, var(--state-busy) 45%, var(--border-color));
}
.dash-attention ul {
    display: grid;
    gap: 0.35rem;
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
}
.dash-attention li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}
.dash-attention li .icon {
    color: var(--state-busy);
}
.dash-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-primary);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.dash-link:hover {
    color: var(--accent-text);
}
.dash-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.dash-panel .srv-table-wrap {
    border: 0;
    border-radius: 0;
    background: none;
}
.dash-table {
    min-width: 0;
}
.dash-table .mono,
.dash-table .server-status {
    white-space: nowrap;
}
.dash-table .srv-meter + .mono {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}
.dash-table th:first-child,
.dash-table td:first-child {
    padding-left: 0;
}

/* ---------- Control room: KPI strip ---------- */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}
.dash-kpi {
    display: grid;
    gap: 0.15rem;
    margin: 0 -1px -1px 0;              /* the right and bottom rules of the outer cells fall under the frame */
    padding: 0.9rem 1rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.dash-kpi-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.dash-kpi-value {
    color: var(--text-heading);
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.dash-kpi-value small {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.dash-kpi-sub {
    color: var(--text-muted);
    font-size: 0.78rem;
}
:root[data-design="control-room"] .dash-heading {
    font-size: 1.15rem;
}

/* ---------- Workbench: greeting, cards and lists ---------- */
.dash-hello h2 {
    margin: 0;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}
.dash-hello p {
    margin: 0.25rem 0 1.25rem;
    color: var(--text-secondary);
}
.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.dash-card {
    display: grid;
    gap: 0.2rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}
.dash-card-label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}
.dash-card-value {
    color: var(--text-heading);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.dash-card-sub {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.dash-rows {
    display: grid;
}
.dash-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--border-color);
}
.dash-row:first-child {
    border-top: 0;
}
.dash-row-name {
    display: grid;
    min-width: 0;
}
.dash-row-name .name {
    color: var(--text-heading);
    font-weight: 600;
}
.dash-node {
    grid-template-columns: minmax(0, 1fr) auto 90px;
}
.dash-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--bg-hover);
}
.dash-bar i {
    display: block;
    height: 100%;
    background: var(--accent);
}

/* ---------- Block & biome: stat frames and tiles ---------- */
:root[data-design="biome"] .dash-heading,
.dash-subheading {
    font-family: var(--font-display);
    font-weight: 500;
}
.dash-subheading {
    margin: 1.25rem 0 0.6rem;
    font-size: 1.1rem;
}
.dash-frames {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.dash-frame {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 3px solid #1a1d1a;
    background: var(--bg-card);
    box-shadow: inset 0 0 0 3px var(--border-color), inset 0 -7px 0 rgba(0, 0, 0, 0.25);
}
.dash-frame .icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
}
.dash-frame-value {
    color: var(--text-heading);
    font-size: 1.7rem;
    font-weight: 800;               /* not the pixel font: its 5 reads as S and 2 as 8 */
    font-variant-numeric: tabular-nums;
}
.dash-frame-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.dash-minis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0.6rem;
}
.dash-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.dash-mini .srv-block {
    flex: none;
    width: 42px;
    height: 42px;
}
.dash-mini-body {
    display: grid;
    flex: 1;
    gap: 0.15rem;
    min-width: 0;
}
.dash-mini-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}
.dash-mini-top .dash-link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-mini-top .srv-state {
    flex: none;
    font-size: 0.72rem;
}
.dash-mini-kind {
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.dash-mini-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.group-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.05rem 0.4rem;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.group-tag i {
    flex: none;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.dash-node-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 0.6rem;
}
.dash-node-tile {
    display: grid;
    gap: 0.5rem;
    padding: 0.85rem;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.dash-node-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.dash-node-top h4 {
    margin: 0;
    font-weight: 700;
}
:root[data-design="biome"] .dash-panel {
    border-width: 2px;
    border-radius: 0;
}
