/* British Council – One Calendar concept
   Teaching Centre Performance (dashboard.html).

   Uses only the :root tokens already defined in css/styles.css, and only
   logical properties (inline-start / inline-end / margin-inline), so the whole
   page mirrors in Arabic without a single direction override — the rule the
   student space established and the one thing that keeps RTL cheap.

   The colour vocabulary is deliberately small and means something:
     green  = healthy / recorded
     orange = watch / modelled
     red    = a problem
     cyan   = teaching income and new students
     purple = exam income and returning students
   Nothing on this page is coloured for decoration. */

.dash-page { padding-block: 24px 64px; }

.dash-head { margin-block-end: 20px; }
.dash-head h1 { font-size: 30px; letter-spacing: -0.02em; }
.dash-head .lead { color: var(--grey-600); max-width: 78ch; margin-block-start: 8px; }
.dash-internal {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-block-end: 10px;
}

/* ===== filter bar ===== */

.dash-filters {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-block-end: 20px;
  box-shadow: var(--shadow);
}
.dash-filter { display: flex; flex-direction: column; gap: 4px; }
.dash-filter label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-600);
}
.dash-filter select {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 170px;
}
.dash-scope {
  margin-inline-start: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: end;
  font-size: 13px;
  color: var(--grey-600);
}
.dash-scope strong { font-size: 16px; color: var(--ink); }
.dash-scope-cmp { font-size: 12px; color: var(--grey-400); }

/* ===== provenance badges ===== */

.dash-prov {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: help;
}
.prov-recorded { background: rgba(63, 174, 47, 0.14); color: #2b7a20; }
.prov-modelled { background: rgba(224, 115, 0, 0.14); color: #a35300; }
.prov-live { background: rgba(0, 184, 217, 0.16); color: #00707f; }

/* ===== KPI tiles ===== */

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-block-end: 20px;
}
@media (min-width: 900px) { .dash-kpis { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 620px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }

.dash-tile {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dash-tile-label { font-size: 12px; font-weight: 700; color: var(--grey-600); line-height: 1.3; }
.dash-tile-value { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.dash-tile-sub { font-size: 12px; color: var(--grey-600); }
.dash-tile-live {
  font-size: 11px;
  font-weight: 700;
  color: #00707f;
  background: rgba(0, 184, 217, 0.12);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  align-self: flex-start;
}

.dash-delta { font-size: 13px; font-weight: 700; margin-inline-start: 6px; }
.dash-delta.up { color: #2b7a20; }
.dash-delta.down { color: var(--red); }
.dash-delta.flat { color: var(--grey-400); }

/* ===== cards ===== */

.dash-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-block-end: 20px;
}
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 6px;
}
.dash-card h2 { font-size: 19px; letter-spacing: -0.01em; }
.dash-card h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-600);
  margin-block: 18px 10px;
}
.dash-sub { font-size: 14px; color: var(--grey-600); margin-block-end: 12px; }
.dash-note { font-size: 12.5px; line-height: 1.6; color: var(--grey-600); margin-block-start: 12px; max-width: 92ch; }
.dash-note-warn { color: #a35300; }
.dash-note-live { color: #00707f; }
.dash-empty { font-size: 14px; color: var(--grey-600); padding-block: 12px; }

.dash-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--grey-600); margin-block: 10px; }
.dash-legend .swatch {
  display: inline-block;
  inline-size: 10px;
  block-size: 10px;
  border-radius: 3px;
  margin-inline-end: 6px;
  background: var(--grey-400);
}
.dash-legend-rate { color: var(--ink); font-weight: 600; }
.swatch-new, .swatch-teaching { background: var(--cyan); }
.swatch-re, .swatch-exams { background: var(--purple); }
.swatch.fill-low { background: var(--red); }
.swatch.fill-healthy { background: var(--green); }
.swatch.fill-high { background: var(--orange); }
.swatch.band-overloaded { background: var(--red); }
.swatch.band-busy { background: var(--orange); }
.swatch.band-steady { background: var(--green); }
.swatch.band-light { background: var(--grey-400); }

/* ===== generic bars ===== */

.dash-bar {
  display: inline-block;
  inline-size: 74px;
  block-size: 8px;
  border-radius: 999px;
  background: var(--grey-100);
  overflow: hidden;
  vertical-align: middle;
  margin-inline-end: 6px;
}
.dash-bar-fill { display: block; block-size: 100%; background: var(--cyan); }
.dash-bar-fill.fill-low { background: var(--red); }
.dash-bar-fill.fill-healthy { background: var(--green); }
.dash-bar-fill.fill-high { background: var(--orange); }
.dash-bar-fill.band-overloaded { background: var(--red); }
.dash-bar-fill.band-busy { background: var(--orange); }
.dash-bar-fill.band-steady { background: var(--green); }
.dash-bar-fill.band-light { background: var(--grey-400); }
.dash-bar-fill.bar-exam { background: var(--purple); }

/* ===== funnel ===== */

.dash-funnel { display: flex; flex-direction: column; gap: 10px; margin-block-start: 12px; }
.dash-funnel-step {
  display: grid;
  grid-template-columns: 190px 1fr 120px;
  align-items: center;
  gap: 12px;
}
.dash-funnel-label { font-size: 13px; font-weight: 600; }
.dash-funnel-track {
  position: relative;
  block-size: 30px;
  background: var(--grey-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.dash-funnel-fill { position: absolute; inset-block: 0; inset-inline-start: 0; }
.dash-funnel-fill.step-1 { background: rgba(35, 8, 89, 0.85); }
.dash-funnel-fill.step-2 { background: var(--ink-3); }
.dash-funnel-fill.step-3 { background: var(--purple); }
.dash-funnel-fill.step-4 { background: var(--cyan); }
.dash-funnel-value {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  padding-inline-start: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.dash-funnel-value em { font-style: normal; opacity: 0.9; }
.dash-funnel-conv { font-size: 12px; color: var(--grey-600); }

@media (max-width: 720px) {
  .dash-funnel-step { grid-template-columns: 1fr; gap: 4px; }
  .dash-funnel-conv { margin-block-end: 6px; }
}

/* ===== split bars (new vs returning, exam types, income by centre) ===== */

.dash-split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .dash-split-grid { grid-template-columns: 1fr; } }

.dash-splits { display: flex; flex-direction: column; gap: 8px; }
.dash-split-row {
  display: grid;
  grid-template-columns: 170px 1fr 96px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.dash-split-label { color: var(--grey-800); overflow-wrap: anywhere; }
.dash-split-track {
  display: flex;
  block-size: 14px;
  background: var(--grey-100);
  border-radius: 999px;
  overflow: hidden;
}
.dash-split-new { background: var(--cyan); }
.dash-split-re { background: var(--purple); }
.dash-split-value { text-align: end; font-weight: 700; color: var(--ink); }
@media (max-width: 620px) {
  .dash-split-row { grid-template-columns: 1fr 70px; }
  .dash-split-track { grid-column: 1 / -1; }
}

/* ===== fill strip ===== */

.dash-strip {
  display: flex;
  block-size: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--grey-100);
}
.dash-strip-seg { display: block; }
.dash-strip-seg.fill-low { background: var(--red); }
.dash-strip-seg.fill-healthy { background: var(--green); }
.dash-strip-seg.fill-high { background: var(--orange); }

/* ===== tables ===== */

.dash-tablewrap { overflow-x: auto; margin-block-start: 12px; }
.dash-table { inline-size: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th, .dash-table td {
  text-align: start;
  padding: 8px 10px;
  border-block-end: 1px solid var(--grey-100);
  white-space: nowrap;
}
.dash-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-600);
  border-block-end: 1px solid var(--grey-200);
}
.dash-table td.num, .dash-table th.num { text-align: end; }
.dash-table td.wrap { white-space: normal; min-inline-size: 220px; }
.dash-table td.nowrap { white-space: nowrap; }
.dash-table tbody tr:hover { background: var(--grey-50); }
.dash-table .row-empty td { background: rgba(209, 0, 43, 0.04); }
.dash-table .muted { color: var(--grey-400); }
.dash-table .small { font-size: 11px; }
.dash-table .tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--grey-100);
  color: var(--grey-600);
  padding: 2px 6px;
  border-radius: 999px;
}
.dash-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ink-3);
  text-decoration: underline;
}
.dash-more {
  margin-block-start: 12px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* ===== income ===== */

.dash-income-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-block-start: 12px;
}
.dash-income-total strong { display: block; font-size: 32px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.dash-income-split { flex: 1 1 320px; min-inline-size: 240px; }
.dash-income-bar {
  display: flex;
  block-size: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--grey-100);
}
.dash-income-bar .seg-teaching { background: var(--cyan); }
.dash-income-bar .seg-exams { background: var(--purple); }

.dash-cols {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  block-size: 190px;
  padding-block-start: 8px;
}
.dash-col { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; block-size: 100%; }
.dash-col-value { font-size: 12px; font-weight: 700; color: var(--ink); margin-block-end: 4px; }
.dash-col-stack {
  inline-size: 100%;
  max-inline-size: 90px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
  background: var(--grey-100);
  min-block-size: 4px;
}
.dash-col-stack .seg-teaching { background: var(--cyan); }
.dash-col-stack .seg-exams { background: var(--purple); }
.dash-col-label { font-size: 11.5px; color: var(--grey-600); margin-block-start: 8px; text-align: center; }
.dash-col.current .dash-col-label { color: var(--ink); font-weight: 700; }
.dash-col.current .dash-col-stack { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ===== recommendations ===== */

.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px 16px; }
.dash-chip {
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--grey-800);
}
.dash-chip span { color: var(--grey-400); font-weight: 700; margin-inline-start: 4px; }
.dash-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.dash-chip.active span { color: rgba(255, 255, 255, 0.7); }

.dash-rec {
  border: 1px solid var(--grey-200);
  border-inline-start: 4px solid var(--grey-400);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-block-end: 10px;
  background: var(--grey-50);
}
.dash-rec.rec-close { border-inline-start-color: var(--red); }
.dash-rec.rec-open { border-inline-start-color: var(--green); }
.dash-rec.rec-staff { border-inline-start-color: var(--orange); }
.dash-rec.rec-exam { border-inline-start-color: var(--purple); }
.dash-rec.rec-funnel { border-inline-start-color: var(--cyan); }
.dash-rec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.dash-rec-kind {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--grey-600);
}
.dash-rec-impact { font-size: 14px; font-weight: 800; }
.dash-rec-impact.saving { color: #a35300; }
.dash-rec-impact.gain { color: #2b7a20; }
.dash-rec-impact em { font-style: normal; font-weight: 600; font-size: 11px; color: var(--grey-600); }
.dash-rec h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  margin-block: 6px 4px;
}
.dash-rec p { font-size: 13.5px; line-height: 1.6; color: var(--grey-800); }

/* ===== methodology ===== */

.dash-method { background: var(--ink); color: rgba(255, 255, 255, 0.85); border-color: var(--ink); }
.dash-method h2, .dash-method h3 { color: #fff; }
.dash-method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-block-start: 12px; }
@media (max-width: 820px) { .dash-method-grid { grid-template-columns: 1fr; } }
.dash-method-item h3 { margin-block: 0 6px; letter-spacing: 0.06em; }
.dash-method-item p { font-size: 13px; line-height: 1.65; }
.dash-method .dash-note { color: rgba(255, 255, 255, 0.7); }
.dash-method .dash-note-warn { color: var(--cyan-bright); }

/* The unit the money on this card is stated in. A management view that reports
   in one currency has to say which one, at the point where the figures are. */
.dash-unit {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--grey-600);
  background: var(--grey-100);
  border-radius: 999px;
  padding: 3px 8px;
  vertical-align: middle;
  margin-inline-start: 6px;
}
