/*
 * Dashboard cards (dash-*): one panel per section with vivid Material tiles, built on the list kit tones (lp-tone-*).
 *
 * Each tone maps to a Material colour pair (--dash-a, --dash-b) used for the tile gradient, the panel accent and
 * the banners. Only the dash-* rules read them, so the list kit tones keep their soft look elsewhere.
 */
.lp-tone-primary { --dash-a: #1976d2; --dash-b: #42a5f5; }   /* Blue 700 -> 400 */
.lp-tone-success { --dash-a: #388e3c; --dash-b: #66bb6a; }   /* Green 700 -> 400 */
.lp-tone-warning { --dash-a: #ef6c00; --dash-b: #ffa726; }   /* Orange 800 -> 400 */
.lp-tone-danger  { --dash-a: #d32f2f; --dash-b: #ef5350; }   /* Red 700 -> 400 */
.lp-tone-info    { --dash-a: #00796b; --dash-b: #26a69a; }   /* Teal 700 -> 400 */
.lp-tone-neutral { --dash-a: #3949ab; --dash-b: #7986cb; }   /* Indigo 600 -> 300 */

.dash-panel {
    background: var(--lp-surface); border: 1px solid var(--lp-line); border-top: 4px solid var(--dash-a, var(--lp-line));
    border-radius: 14px; box-shadow: var(--lp-shadow-1);
    padding: 14px; display: grid; gap: 10px; margin-bottom: 14px; color: var(--lp-fg);
}
.dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dash-title { margin: 0; font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--lp-fg); }
.dash-title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dash-b, var(--lp-tone)); flex: 0 0 auto; }
.dash-sub { font-size: .8rem; color: var(--lp-fg-3); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.dash-tile {
    display: grid; gap: 7px; align-content: start; padding: 10px 14px; border-radius: 14px; min-width: 0;
    background: linear-gradient(135deg, var(--dash-a), var(--dash-b)); color: #fff; border: 0;
    box-shadow: 0 1px 4px rgba(16, 24, 40, .12), 0 3px 10px color-mix(in srgb, var(--dash-a) 20%, transparent);
}
.dash-pill {
    justify-self: start; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .22); color: #fff;
}
.dash-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dash-ar { font-size: 1.1rem; font-weight: 700; line-height: 1.2; color: #fff; text-align: right; }
.dash-metrics { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.dash-metrics > div { min-width: 0; }
.dash-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255, 255, 255, .85); font-weight: 600; }
.dash-value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; color: #fff; }
.dash-value small { font-size: .78rem; color: rgba(255, 255, 255, .8); font-weight: 500; }
.dash-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.dash-bar b { display: block; height: 100%; background: #fff; border-radius: 99px; }
.dash-bar-label { margin-bottom: 4px; }
@media (max-width: 575px) { .dash-value { font-size: 1.2rem; } .dash-ar { font-size: 1rem; } }

/* Banners (school year, results available) */
.dash-banner {
    display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px;
    background: linear-gradient(135deg, var(--dash-a), var(--dash-b)); border: 0; color: #fff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .14); font-size: .9rem; font-weight: 600;
}
.dash-banner::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: 0 0 auto; }
.dash-banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dash-banner a:hover { color: #fff; opacity: .85; }
.dash-banner-label { font-weight: 500; color: rgba(255, 255, 255, .85); }
/* Light variant (school year): the tone's soft background with its dark text, no gradient. */
.dash-banner--soft {
    background: var(--lp-tone-soft); color: var(--lp-tone-fg); box-shadow: none;
    border: 1px solid color-mix(in srgb, var(--lp-tone) 20%, #fff);
}
.dash-banner--soft::before { background: var(--lp-tone); }
.dash-banner--soft .dash-banner-label { color: var(--lp-fg-2); }

/* Compact progress card (school information collection): title + count, segmented bar, legend. */
.dash-progress {
    display: grid; grid-template-columns: minmax(170px, auto) minmax(120px, 1fr) auto; align-items: center; gap: 4px 18px;
    margin: 0 0 14px; padding: 9px 14px; border-radius: 12px; color: var(--lp-fg); text-decoration: none;
    background: var(--lp-surface); border: 1px solid var(--lp-line); border-left: 4px solid var(--dash-a, var(--lp-line));
    box-shadow: var(--lp-shadow-1);
}
.dash-progress:hover { color: var(--lp-fg); text-decoration: none; border-color: var(--lp-line-strong); border-left-color: var(--dash-a, var(--lp-line-strong)); }
.dash-progress:focus-visible { outline: 2px solid var(--lp-primary); outline-offset: 2px; }
.dash-progress-head { display: grid; gap: 1px; min-width: 0; }
.dash-progress-title { font-size: .9rem; font-weight: 700; line-height: 1.25; }
.dash-progress-count { font-size: .75rem; color: var(--lp-fg-2); font-variant-numeric: tabular-nums; }
.dash-progress-count b { color: var(--lp-fg); }
.dash-progress-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #e6ebf2; }
.dash-progress-bar i { display: block; flex-basis: 0; }
.dash-progress-bar .is-done { background: #43a047; }
.dash-progress-bar .is-started { background: #ffb74d; }
.dash-progress-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .72rem; color: var(--lp-fg-2); font-variant-numeric: tabular-nums; }
.dash-progress-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #cbd3dd; }
.dash-progress-legend .is-done::before { background: #43a047; }
.dash-progress-legend .is-started::before { background: #ffb74d; }
@media (max-width: 767.98px) {
    .dash-progress { grid-template-columns: 1fr; gap: 6px; }
    .dash-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
}

/* Tables inside dashboard panels */
.dash-panel .table { margin: 0; font-size: .875rem; }
.dash-panel .table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--lp-fg-2); border-top: 0; }
.dash-empty { margin: 0; text-align: center; color: var(--lp-fg-3); font-size: .875rem; }
.dash-chart { position: relative; }

/* Centre documents list (one tinted panel per document type) */
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.cd-grid[hidden], .cd-panel[hidden], .cd-item[hidden], #noResultsMessage[hidden] { display: none; }
.cd-panel { margin-bottom: 0; }
.cd-list { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.cd-item { min-width: 0; }
.cd-split { display: flex; width: 100%; }
.cd-btn {
    display: block; min-width: 0; padding: 7px 12px; border-radius: 9px; text-align: left; font-size: .85rem; font-weight: 600; line-height: 1.3;
    background: var(--lp-tone-soft); border: 1px solid color-mix(in srgb, var(--lp-tone) 14%, #fff); color: var(--lp-tone-fg);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cd-btn:hover { color: var(--lp-tone-fg); text-decoration: none; background: color-mix(in srgb, var(--lp-tone) 16%, #fff); }
.cd-btn:focus-visible { outline: 2px solid var(--lp-tone); outline-offset: 1px; box-shadow: none; }
.cd-btn.disabled, .cd-btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
a.cd-btn { flex: 1 1 auto; }
.cd-split .cd-btn:first-child { border-radius: 9px 0 0 9px; }
.cd-toggle { flex: 0 0 34px; width: 34px; padding: 0; text-align: center; border-radius: 0 9px 9px 0; border-left-color: color-mix(in srgb, var(--lp-tone) 30%, #fff); }
.cd-toggle::after { margin: 0; vertical-align: middle; }
.cd-split .dropdown-menu { border-radius: 10px; border: 1px solid var(--lp-line); box-shadow: var(--lp-shadow-2); font-size: .85rem; max-height: 240px; overflow-y: auto; }
.cd-hint { margin: 0; font-size: .78rem; color: var(--lp-fg-3); }
.cd-hint-info { display: block; color: var(--lp-fg-2); }
