/* Administrator home page dashboard (Start.aspx, pnlContent).
   Everything is scoped under .dash so nothing leaks into other pages that
   share this theme. The flights-per-day chart is drawn by js/dashboard.js. */

.dash {
    --dash-plane: #f6f5f2;
    --dash-card: #ffffff;
    --dash-border: rgba(11, 11, 11, 0.08);
    --dash-ink: #1d1c1a;
    --dash-ink-2: #52514e;
    --dash-muted: #898781;
    --dash-grid: #e1e0d9;
    --dash-axis: #c3c2b7;
    --dash-brand: #6e1b1b;
    --dash-brand-soft: #f6eaea;
    --dash-series: #2a78d6;
    --dash-series-soft: rgba(42, 120, 214, 0.10);
    /* Each bar list gets its own hue (palette slots 1-3, in order), so the
       fuel, student and instructor lists read as different measures. */
    --dash-series-2: #eb6834;
    --dash-series-3: #1baf7a;
    --dash-track: #eeede8;
    --dash-good: #0ca30c;
    --dash-warning: #fab219;
    --dash-critical: #d03b3b;

    background: var(--dash-plane);
    color: var(--dash-ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.45;
    padding: 18px 18px 24px 18px;
    text-align: left;
    box-sizing: border-box;
}

.dash *, .dash *::before, .dash *::after {
    box-sizing: border-box;
}

/* ---- Greeting + quick links ---- */
.dash-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.dash-eyebrow {
    color: var(--dash-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dash-title {
    margin: 2px 0 0 0;
    color: var(--dash-ink);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.dash-sub {
    color: var(--dash-ink-2);
    margin-top: 2px;
}

/* ---- Headline figures ---- */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.dash-kpi {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    padding: 14px 16px;
}

.dash-kpi-label {
    color: var(--dash-ink-2);
    font-weight: 600;
}

.dash-kpi-value {
    margin: 4px 0 2px 0;
    color: var(--dash-ink);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
}

.dash-kpi-unit {
    margin-left: 4px;
    color: var(--dash-ink-2);
    font-size: 16px;
    font-weight: 600;
}

.dash-kpi-note {
    color: var(--dash-muted);
}

.dash-kpi-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 6px 0;
}

.dash-kpi-status .dash-status {
    font-size: 15px;
}

.dash-trend {
    display: block;
    color: var(--dash-ink-2);
}

/* ---- Status (always dot + label, never colour alone) ---- */
.dash-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--dash-ink);
    font-weight: 600;
}

.dash-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
    background: var(--dash-muted);
}

.dash-status-critical .dash-dot { background: var(--dash-critical); }
.dash-status-warning .dash-dot { background: var(--dash-warning); }

/* ---- Cards ---- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dash-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    padding: 14px 16px 16px 16px;
    min-width: 0;
}

.dash-span-2 {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
}

.dash-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 10px;
}

.dash-card-head h2 {
    margin: 0;
    color: var(--dash-ink);
    font-size: 15px;
    font-weight: 600;
}

.dash-card-sub {
    color: var(--dash-muted);
}

.dash a.dash-card-link {
    color: var(--dash-brand);
    font-weight: 600;
    text-decoration: none;
}

.dash a.dash-card-link:hover {
    text-decoration: underline;
}

.dash-card-subhead {
    margin: 16px 0 6px 0;
    padding-top: 12px;
    border-top: 1px solid var(--dash-grid);
    color: var(--dash-ink);
    font-size: 13px;
    font-weight: 600;
}

.dash-scroll {
    max-height: 330px;
    overflow-y: auto;
    padding-right: 10px;
}

.dash-empty {
    padding: 18px 0;
    color: var(--dash-muted);
    text-align: center;
}

/* ---- Tables ---- */
.dash-table-wrap {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    position: sticky;
    top: 0;
    background: var(--dash-card);
    padding: 6px 10px 6px 0;
    border-bottom: 1px solid var(--dash-axis);
    color: var(--dash-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: left;
    text-transform: uppercase;
}

.dash-table td {
    padding: 7px 10px 7px 0;
    border-bottom: 1px solid var(--dash-grid);
    color: var(--dash-ink);
    vertical-align: middle;
}

.dash-table tbody tr:last-child td {
    border-bottom: none;
}

.dash-table tbody tr:hover td {
    background: #faf9f6;
}

.dash .dash-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dash .dash-nowrap { white-space: nowrap; }
.dash .dash-strong { font-weight: 600; }
.dash .dash-muted { color: var(--dash-ink-2); }

.dash-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--dash-brand-soft);
    color: var(--dash-brand);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Horizontal bars (fuel, student and instructor hours) ---- */
.dash-bar-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.dash-bar-row-wide {
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 56px;
}

.dash-bar-label {
    overflow: hidden;
    color: var(--dash-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-bar {
    display: block;
    height: 10px;
    border-radius: 0 4px 4px 0;
    background: var(--dash-track);
}

.dash-bar-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--dash-series);
}

/* ---- Lollipops (top students by hours): a thin stem and a dot at the value ---- */
.dash-lolly {
    position: relative;
    display: block;
    height: 12px;
}

.dash-lolly::before {
    /* faint full-length guide */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 5px;
    height: 2px;
    background: var(--dash-track);
}

.dash-lolly-stem {
    position: absolute;
    left: 0;
    top: 5px;
    height: 2px;
    background: var(--dash-series-2);
}

.dash-lolly-stem::after {
    content: "";
    position: absolute;
    right: -6px;
    top: -5px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--dash-card);
    border-radius: 50%;
    background: var(--dash-series-2);
    box-sizing: border-box;
}

/* ---- Donut (fuel by aircraft) ---- */
.dash-donut {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
}

.dash-donut-plot {
    position: relative;
    flex: none;
    width: 176px;
    height: 176px;
}

.dash-donut-plot svg {
    display: block;
}

.dash-donut .dc-seg {
    stroke: var(--dash-card);
    stroke-width: 2;
    transition: opacity 0.12s;
}

.dash-donut .dc-donut-total {
    fill: var(--dash-ink);
    font-size: 22px;
    font-weight: 600;
}

.dash-donut .dc-donut-unit {
    fill: var(--dash-muted);
    font-size: 12px;
}

.dash-legend {
    flex: 1 1 160px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-legend li {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto 40px;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: default;
    outline: none;
}

.dash-legend li.is-active,
.dash-legend li:focus {
    background: #f4f3ef;
}

.dash-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.dash-legend-label {
    overflow: hidden;
    color: var(--dash-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-legend-value {
    color: var(--dash-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.dash-legend-pct {
    color: var(--dash-muted);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ---- Columns (instructor activity) ---- */
.dash-columns {
    position: relative;
    height: 290px;
    outline: none;
}

.dash-columns svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.dash-columns .dc-col {
    fill: var(--dash-series-3);
    transition: opacity 0.12s;
}

.dash-columns .dc-grid { stroke: var(--dash-grid); stroke-width: 1; }
.dash-columns .dc-base { stroke: var(--dash-axis); stroke-width: 1; }
.dash-columns .dc-tick { fill: var(--dash-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dash-columns .dc-col-label { fill: var(--dash-ink-2); }
.dash-columns .dc-end { fill: var(--dash-ink); font-size: 12px; font-weight: 600; }

.dash-bar-value {
    color: var(--dash-ink-2);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* ---- Instructor 28-day hours meters ---- */
.dash-meter-row {
    padding: 6px 0 7px 0;
    border-bottom: 1px solid var(--dash-grid);
}

.dash-meter-row:last-child {
    border-bottom: none;
}

.dash-meter-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.dash-meter-name {
    overflow: hidden;
    color: var(--dash-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-meter-value {
    color: var(--dash-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dash-meter {
    position: relative;
    display: block;
    height: 8px;
    border-radius: 4px;
    background: var(--dash-track);
}

.dash-meter-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
}

.dash-fill-good { background: var(--dash-good); }
.dash-fill-warning { background: var(--dash-warning); }
.dash-fill-critical { background: var(--dash-critical); }

/* The limit: a tick across the track. */
.dash-meter-limit {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    border-radius: 1px;
    background: var(--dash-ink-2);
}

.dash-meter-row .dash-status {
    margin-top: 5px;
    font-size: 12px;
}

/* ---- Month navigation (top students / instructor activity) ---- */
.dash-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dash-month {
    min-width: 64px;
    color: var(--dash-ink-2);
    font-weight: 600;
    text-align: center;
}

.dash a.dash-month-btn {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 1px solid var(--dash-border);
    border-radius: 6px;
    color: var(--dash-ink);
    font-size: 16px;
    line-height: 21px;
    text-align: center;
    text-decoration: none;
}

.dash a.dash-month-btn:hover {
    border-color: var(--dash-brand);
    color: var(--dash-brand);
}

/* ---- Latest refuelling list ---- */
.dash-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-list li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--dash-grid);
}

.dash-list li:last-child {
    border-bottom: none;
}

.dash-list-meta {
    flex: 1 1 100%;
    font-size: 12px;
}

/* ---- Flights per day line chart (js/dashboard.js) ---- */
.dash-linechart {
    position: relative;
    flex: 1 1 auto;
    min-height: 260px;
}

.dash-linechart svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.dash-linechart .dc-grid { stroke: var(--dash-grid); stroke-width: 1; }
.dash-linechart .dc-base { stroke: var(--dash-axis); stroke-width: 1; }
.dash-linechart .dc-tick { fill: var(--dash-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dash-linechart .dc-area { fill: var(--dash-series-soft); }
.dash-linechart .dc-line { fill: none; stroke: var(--dash-series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dash-linechart .dc-cross { stroke: var(--dash-axis); stroke-width: 1; }
.dash-linechart .dc-dot { fill: var(--dash-series); stroke: var(--dash-card); stroke-width: 2; }
.dash-linechart .dc-end { fill: var(--dash-ink); font-size: 12px; font-weight: 600; }

.dash-tip {
    position: absolute;
    top: 0;
    z-index: 5;
    padding: 6px 9px;
    border: 1px solid var(--dash-border);
    border-radius: 8px;
    background: var(--dash-card);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    color: var(--dash-ink);
    pointer-events: none;
    white-space: nowrap;
}

.dash-tip b {
    display: block;
    font-size: 15px;
}

.dash-tip span {
    color: var(--dash-ink-2);
    font-size: 12px;
}

.dash-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Narrower windows ---- */
@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .dash { padding: 12px; }
    .dash-kpis, .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .dash-span-2 { grid-column: auto; }
}
