/* ==========================================================================
   M01 Dashboard (DSH-01) — module styles. Tokens only; classes prefixed .m01-
   Layout: context line → KPI grid (4×2 desktop, 2 columns ≤1023px) →
   .rv-grid-report cards (revenue + recent lists span both columns; one column
   on mobile, charts full width) → lists become cards on mobile (DataTable).
   ========================================================================== */

.m01-body { display: flex; flex-direction: column; gap: var(--rv-space-4); min-width: 0; }
.m01-alerts { display: flex; flex-direction: column; gap: var(--rv-space-2); min-width: 0; }

/* ---------- context line: period · comparison period · data as-of ---------- */
.m01-context {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--rv-space-1) var(--rv-space-4); min-width: 0;
  font-size: var(--rv-fs-small); line-height: var(--rv-lh-small); color: var(--rv-text-secondary);
}
.m01-context__item { display: inline-flex; align-items: center; gap: var(--rv-space-1); min-width: 0; }
.m01-context__item svg { color: var(--rv-text-muted); }
.m01-context strong { font-weight: 600; color: var(--rv-text-primary); }

/* ---------- KPI cards ---------- */
.m01-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.m01-kpis .rv-stat__delta { margin-top: auto; padding-top: var(--rv-space-1); }

/* ---------- chart / list cards ---------- */
.m01-card .rv-card__actions { flex-shrink: 0; max-width: 100%; }
.m01-seg { max-width: 100%; }
.m01-sum {
  margin: 0 0 var(--rv-space-2); font-size: var(--rv-fs-small); line-height: var(--rv-lh-small);
  color: var(--rv-text-secondary); font-variant-numeric: tabular-nums;
}
.m01-sum:empty { display: none; }
.m01-sum strong { font-weight: 600; color: var(--rv-text-primary); }
.m01-chart { min-width: 0; }
.m01-note { margin: var(--rv-space-2) 0 0; font-size: var(--rv-fs-small); line-height: var(--rv-lh-small); color: var(--rv-text-muted); }
.m01-list { min-width: 0; }

/* fixed short lists (≤10 rows): no pager, the card title carries the count */
.m01-mini .rv-dt__pager { display: none; }

/* pending work */
.m01-task { display: inline-flex; align-items: flex-start; gap: var(--rv-space-2); font-weight: 500; color: var(--rv-text-primary); }
.m01-task svg { flex-shrink: 0; margin-top: 2px; color: var(--rv-text-muted); }
.m01-refs { display: block; font-variant-numeric: tabular-nums; }

/* multi-course orders */
.m01-line + .m01-line { margin-top: 2px; }

/* recent learning activity */
.m01-act { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m01-act__label { display: inline-flex; align-items: center; gap: var(--rv-space-1); font-weight: 500; color: var(--rv-text-primary); }
.m01-act__label svg { flex-shrink: 0; color: var(--rv-primary-700); }
.m01-act__ref { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rv-space-1); color: var(--rv-text-secondary); overflow-wrap: anywhere; }

/* ---------- MetricDrawer ---------- */
.m01-metric .rv-kv__row.is-full dd { font-size: var(--rv-fs-small); line-height: var(--rv-lh-small); color: var(--rv-text-secondary); }
.m01-metric .rv-table tfoot th, .m01-metric .rv-table tfoot td { font-variant-numeric: tabular-nums; }

/* ---------- responsive (design system §9) ---------- */
@media (max-width: 1023px) {
  .m01-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .m01-context { gap: 2px var(--rv-space-3); }
  .m01-card .rv-card__actions { width: 100%; }
  .m01-seg { display: flex; width: 100%; }
  .m01-seg .rv-tab { flex: 1 1 0; justify-content: center; }
}
