/* ---------- Next halaqa planner ---------- */
.planner-summary {
  display: grid;
  --grid-min: 160px;
  gap: .75rem;
  margin-bottom: 1rem;
}

.planner-summary__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 72px;
  padding: 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.planner-summary__item:hover {
  border-color: var(--success-border);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.planner-summary__item--alert:hover { border-color: var(--danger-border); }
/* The missing-assignment tile is the way into that queue, so it says so. */
.planner-summary__text { display: grid; gap: .25rem; }
.planner-summary__cta { display: inline-flex; align-items: center; gap: .25rem; color: var(--brand); font-size: var(--text-label); font-weight: 700; }
.planner-summary__cta .app-icon { width: 14px; height: 14px; }
.planner-summary__item[aria-current] { border-color: var(--brand-border); }
.planner-summary__label { color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.planner-summary__item strong { color: var(--ink); font-size: var(--text-title); line-height: 1; }

.planner-panel,
.planner-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.planner-panel { padding: 1rem; }
.planner-panel--missing {
  padding: 0;
  overflow: clip;
  border-color: var(--brand-border);
  background: linear-gradient(180deg, var(--surface-soft) 0, var(--surface) 150px);
}

.planner-panel__head,
.planner-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.planner-panel__head { margin-bottom: .75rem; }
.planner-panel--missing .planner-panel__head {
  margin: 0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--brand-light);
  background: color-mix(in srgb, var(--brand-light) 60%, transparent);
}
.planner-panel__heading,
.planner-panel__title-row {
  display: flex;
  align-items: center;
}
.planner-panel__heading { gap: .75rem; min-width: 0; }
.planner-panel__title-row { flex-wrap: wrap; gap: .5rem; }
.planner-panel__icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--brand-dark);
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
}
.planner-panel__icon .app-icon { width: 19px; height: 19px; }
.planner-panel__head h2 { margin: 0; font-size: var(--text-lead); font-weight: 800; }
.planner-panel__head p { margin: .25rem 0 0; color: var(--muted); font-size: var(--text-small); }
.planner-panel__dismiss {
  flex: 0 0 auto;
  padding: .5rem .75rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-small);
  font-weight: 700;
  text-decoration: none;
}
.planner-panel__dismiss:hover { color: var(--brand-dark); border-color: var(--brand-border); text-decoration: none; }
.planner-note { padding: .75rem 1rem; color: var(--ink); }

.missing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  padding: 1rem;
}

.missing-student {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.missing-student:hover { border-color: var(--brand-border); box-shadow: var(--shadow); transform: translateY(-1px); }
.missing-student__identity { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.missing-student__avatar {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--brand-dark);
  background: var(--brand-light);
  border-radius: 50%;
  font-size: var(--text-body);
  font-weight: 800;
}
.missing-student__details { min-width: 0; }

.missing-student__name {
  display: block;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.missing-student__name:hover { color: var(--brand); text-decoration: none; }
.missing-student__halaqah {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-top: .125rem;
  color: var(--muted);
  font-size: var(--text-label);
}
.missing-student__halaqah .app-icon { width: 12px; height: 12px; }
.missing-student__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.missing-student__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  min-width: 0;
  min-height: 36px;
  padding: .5rem .5rem;
  color: var(--brand-dark);
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  font-size: var(--text-small);
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.missing-student__action:hover { color: var(--brand-dark); background: var(--brand-light); border-color: var(--brand-border); text-decoration: none; }
.missing-student__action--primary { color: var(--on-brand); background: var(--brand); border-color: var(--brand); }
.missing-student__action--primary:hover { color: var(--on-brand); background: var(--brand-dark); border-color: var(--brand-dark); }
.missing-student__action .app-icon { flex: 0 0 auto; width: 15px; height: 15px; }

@media (max-width: 1100px) {
  .missing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.assignment-row--overdue td { background: var(--danger-bg); }
.assignment-row--today td { background: var(--warning-bg); }
.readonly-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-weight: 700;
}

/* ---------- Dashboard ---------- */
.stat-grid {
  display: grid;
  --grid-min: 180px;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 98%, transparent), color-mix(in srgb, var(--surface) 96%, transparent)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.stat-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--brand-light);
  display: grid; place-items: center; font-size: var(--text-subtitle); flex-shrink: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 8%, transparent);
}
.stat-card__icon .app-icon {
  width: 1.35rem;
  height: 1.35rem;
  stroke-width: 1.8;
}
.stat-card:nth-child(3n + 2) .stat-card__icon { background: var(--info-bg); }
.stat-card:nth-child(3n) .stat-card__icon { background: var(--accent-light); }
.stat-card__body { flex: 1; min-width: 0; }
.stat-card__label { color: var(--muted); font-size: var(--text-small); }
.stat-card__value {
  overflow-wrap: anywhere;
  font-size: var(--text-title);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.12;
  margin-top: .125rem;
}
.stat-card__subtitle {
  margin-top: .25rem;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.35;
}
/* Feature stat: the one headline figure on a page, lifted by a brand border
   and glow. Doubled class so it outranks the shared
   .stat-card surface in 12-surfaces.css. */
.stat-card.stat-card--feature {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  background:
    radial-gradient(280px 120px at 100% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%),
    var(--surface);
  border-color: var(--brand-border);
}
[dir="rtl"] .stat-card.stat-card--feature {
  background:
    radial-gradient(280px 120px at 0% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%),
    var(--surface);
}
.stat-card__total { margin-inline-start: .125rem; font-size: var(--text-lead); font-weight: 600; opacity: .65; }

.progress-ring { width: 76px; height: 76px; flex: none; }
.progress-ring circle { fill: none; stroke-width: 7; }
.progress-ring__track { stroke: var(--brand-light); }
.progress-ring__value { stroke: var(--brand); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
[dir="rtl"] .progress-ring__value { transform: rotate(-90deg) scaleY(-1); }
/* Size comes from the SVG font-size attribute (user units of the 80x80 viewBox). */
.progress-ring__label { fill: var(--ink); font-family: var(--font-display); font-weight: 700; }

.stat-card__arrow { color: var(--brand); opacity: 0; transition: opacity var(--duration) var(--ease); }
.stat-card__arrow::before { content: "→"; }
[dir="rtl"] .stat-card__arrow::before { content: "←"; }
.stat-card--link { cursor: pointer; transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease); }
.stat-card--link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  border-color: var(--success-border);
  text-decoration: none;
}
.stat-card--link:hover .stat-card__arrow { opacity: 1; }

/* ---------- Dashboard analytics ---------- */
.analytics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.analytics:has(> .card:only-child) { grid-template-columns: 1fr; }
.analytics .card { margin: 0; display: flex; flex-direction: column; }
.analytics .card > .table__empty,
.analytics .card > .chart__empty { margin-block: auto; }
.analytics__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1rem;
  margin-bottom: 1rem;
}
/* The heading block yields first, so a short badge or link stays beside it
   and only a long companion (a date range) drops to its own line. */
.analytics__head > :first-child { flex: 1 1 12rem; min-width: 0; }
.analytics__title { margin: 0; font-size: var(--text-lead); font-weight: 800; }
.analytics__meta { color: var(--muted); font-size: var(--text-small); text-decoration: none; }
a.analytics__meta:hover { color: var(--brand); text-decoration: none; }
@media (max-width: 820px) { .analytics { grid-template-columns: 1fr; } }

.upcoming-halaqas {
  container-type: inline-size;
  margin-bottom: 1.25rem;
}

.upcoming-halaqas__list {
  display: grid;
  gap: .5rem;
}

/* A day with nothing scheduled is one short line, so the busy days stand out. */
.upcoming-halaqas--empty { padding-block: .75rem; }
.upcoming-halaqas--empty .analytics__head { margin-bottom: .25rem; }

.upcoming-halaqah {
  display: grid;
  grid-template-columns: minmax(150px, .55fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.upcoming-halaqah__time,
.upcoming-halaqah__body {
  display: grid;
  gap: .125rem;
}

.upcoming-halaqah__time strong,
.upcoming-halaqah__name {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.upcoming-halaqah__name:hover {
  color: var(--brand);
  text-decoration: none;
}

.upcoming-halaqah__time span,
.upcoming-halaqah__meta {
  color: var(--muted);
  font-size: var(--text-small);
}

.upcoming-halaqah__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem .75rem;
}

.upcoming-halaqah__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

/* Narrow, the time stays beside the name and the actions take the row below. */
@container (max-width: 640px) {
  .upcoming-halaqah { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .upcoming-halaqah__actions { grid-column: 1 / -1; justify-content: stretch; }
  .upcoming-halaqah__actions .btn { flex: 1 1 0; }
}

.top-students { list-style: none; margin: 0; padding: 0; }
.top-students li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem 0;
  border-bottom: 1px solid var(--border);
}
.top-students li:last-child { border-bottom: none; }
.top-students__rank { display: grid; place-items: center; width: 1.75rem; }
.top-students__name { min-width: 0; font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.top-students__name:hover { color: var(--brand); text-decoration: none; }
.top-students__halaqah { color: var(--muted); font-size: var(--text-small); flex: 1; }
.top-students__points { color: var(--brand); font-weight: 700; font-size: var(--text-body); }

.config-list { list-style: none; margin: 0; padding: 0; }
.config-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .375rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-body);
}
.config-list li:last-child { border-bottom: none; }
.marketplace-inbox .analytics > .card { min-inline-size: 0; }
.marketplace-inbox .config-list li { align-items: flex-start; column-gap: 1rem; }
.marketplace-inbox .config-list li > span { min-inline-size: 0; max-inline-size: 100%; overflow-wrap: anywhere; }
.marketplace-inbox .config-list li > span:first-child { flex-shrink: 0; }

/* Only groups that hold centers render, side by side while they fit. */
.dashboard-follow-ups:has(.super-admin-alerts) { border-inline-start: 4px solid var(--warning); }
.dashboard-follow-ups:has(.empty-action) { padding-block: .75rem; }
.dashboard-follow-ups:has(.empty-action) .analytics__head { margin-block-end: .25rem; }
.dashboard-follow-ups .config-list li { gap: .75rem; align-items: baseline; }
.dashboard-follow-ups .config-list a { min-inline-size: 0; overflow-wrap: anywhere; }
.super-admin-alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1rem 2rem;
}
.super-admin-alert {
  display: grid;
  align-content: start;
  gap: .5rem;
  min-width: 0;
}
.super-admin-alert__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.super-admin-alert__head h3 { margin: 0; font-size: var(--text-body); font-weight: 700; }
.config-list__time { flex-shrink: 0; white-space: nowrap; }
.super-admin-alert__hint { margin: 0; }
.super-admin-alert__hint,
.super-admin-alert .config-list li :is(span, time) {
  color: var(--muted);
  font-size: var(--text-small);
}
.setup-checklist {
  margin-bottom: 1rem;
  padding: 1rem 1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-light), var(--surface));
  box-shadow: var(--shadow-sm);
}
.setup-checklist__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.setup-checklist__head h2 { margin: 0; font-size: var(--text-lead); }
.setup-checklist__head p { margin: .25rem 0 0; color: var(--muted); font-size: var(--text-small); }
.setup-checklist__head > strong { color: var(--brand); font-size: var(--text-small); white-space: nowrap; }
.setup-checklist__progress { height: 6px; margin: .75rem 0; overflow: clip; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.setup-checklist__progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width var(--duration) var(--ease); }
.setup-checklist__steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.setup-checklist__steps li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.setup-checklist__steps li .btn { grid-column: 1 / -1; justify-content: center; margin-top: .125rem; }
.setup-checklist__check { display: grid; place-items: center; width: 23px; height: 23px; color: var(--brand); font-size: var(--text-label); font-weight: 800; border-radius: 50%; background: var(--brand-light); }
.setup-checklist__steps strong,
.setup-checklist__steps small { display: block; }
.setup-checklist__steps strong { font-size: var(--text-label); line-height: 1.3; }
.setup-checklist__steps small { margin-top: .125rem; color: var(--muted); font-size: var(--text-micro); line-height: 1.35; }
.setup-checklist__step--complete { opacity: .68; }
/* A finished step needs only its name; the hint was for doing it. */
.setup-checklist__steps .setup-checklist__step--complete { align-items: center; padding-block: .5rem; }
.setup-checklist__step--complete small { display: none; }
.setup-checklist__step--complete .setup-checklist__check { color: var(--on-brand); background: var(--success); }
.setup-checklist__step--current { border-color: color-mix(in srgb, var(--brand) 45%, transparent) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 8%, transparent); }
.setup-checklist__later { grid-column: 1 / -1; padding-inline-start: 1.75rem; }
.activation-summary { margin-bottom: 1rem; }
.activation-summary__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.activation-summary__head p { margin: .25rem 0 0; }
.activation-summary__head > strong { color: var(--brand); font-size: var(--text-small); }
.activation-summary__steps { margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; }
.activation-summary__steps li { padding: .375rem .75rem; display: flex; align-items: center; gap: .375rem; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--muted); font-size: var(--text-label); }
.activation-summary__steps li.is-complete { color: var(--brand-dark); border-color: var(--brand-border); background: var(--brand-light); }

@media (max-width: 1050px) {
  .setup-checklist__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .setup-checklist__head { flex-direction: column; gap: .375rem; }
  .setup-checklist__steps { grid-template-columns: 1fr; }
}
.attendance-meter-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.attendance-meter-row:last-child { margin-bottom: 0; }
.attendance-meter-row__label { flex: 0 0 70px; }
.attendance-meter-row__bar { flex: 1; min-width: 0; }
.attendance-meter-row__count { flex: 0 0 32px; text-align: end; font-weight: 700; }

/* auto-fill keeps a single child's card at a readable width instead of
   stretching it across the whole page. */
.ward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  align-items: start;
  gap: 1rem;
}
.ward-card {
  display: grid;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: inherit;
  box-shadow: var(--shadow-sm);
}
.ward-card__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-inline-size: 0;
  min-block-size: 44px;
  color: var(--ink);
}
.ward-card__header:hover { text-decoration: none; }
.ward-card__header:hover .ward-card__name { color: var(--brand); text-decoration: underline; }
.ward-card__identity { min-inline-size: 0; overflow-wrap: anywhere; }
.ward-card__name {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 800;
}
.ward-card__meta,
.ward-card__empty,
.ward-card__subline {
  color: var(--muted);
  font-size: var(--text-small);
}
.ward-card__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin-block: .5rem;
}
.ward-card__metrics div {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.ward-card__metrics dt {
  color: var(--muted);
  font-size: var(--text-label);
  margin: 0 0 .125rem;
}
.ward-card__metrics dd {
  color: var(--ink);
  font-size: var(--text-lead);
  font-weight: 800;
  margin: 0;
}
.ward-card__section {
  border-block-start: 1px solid var(--border);
  padding-block-start: .75rem;
  min-inline-size: 0;
}
.ward-card__label {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 700;
  margin: 0;
}
.ward-card__practice {
  min-inline-size: 0;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  background: var(--brand-light);
  padding: .75rem;
}
.ward-card__practice .ward-card__label,
.ward-card__practice .ward-card__subline {
  color: var(--brand-dark);
}
.ward-card__assignment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-block-size: 44px;
  color: var(--brand-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ward-card__assignment span { min-inline-size: 0; }
.ward-card__portion {
  margin: .25rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ward-card__subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .125rem .5rem;
  margin: .25rem 0 0;
}
.ward-card__details { border-block-start: 1px solid var(--border); }
.ward-card__details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-block-size: 44px;
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 600;
  list-style: none;
}
.ward-card__details > summary:hover { text-decoration: underline; }
.ward-card__details > summary::-webkit-details-marker { display: none; }
.ward-card__details[open] > summary .app-icon { transform: rotate(180deg); }
.ward-card__attendance { margin-block-start: .75rem; }
.ward-card__outcome { margin-block: .5rem; font-weight: 700; }
.ward-card__footer .btn { min-block-size: 44px; white-space: normal; }


.assignment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.assignment-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.assignment-list li > div {
  min-width: 0;
}
.assignment-list li:last-child { border-bottom: none; }
.assignment-list__name {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.assignment-list__name:hover { color: var(--brand); }
.assignment-list__meta {
  color: var(--muted);
  font-size: var(--text-small);
  margin-inline-start: .375rem;
}
.assignment-list__content {
  color: var(--ink);
  font-size: var(--text-small);
  margin-top: .25rem;
}

.attention-card { container-type: inline-size; margin-bottom: 1rem; border-inline-start: 4px solid var(--warning); }
.attention-card__hint { margin: .25rem 0 0; color: var(--muted); font-size: var(--text-small); }
.attention-list { display: grid; margin-top: .75rem; }
.attention-item { display: grid; grid-template-columns: minmax(150px, .65fr) minmax(240px, 1.35fr) auto; gap: .75rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.attention-item:last-child { border-bottom: 0; }
.attention-item__student { min-width: 0; }
.attention-item__name { display: block; color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.attention-item__student > span { color: var(--muted); font-size: var(--text-small); }
.attention-item__signals { display: flex; flex-wrap: wrap; gap: .375rem; }
.attention-item--two-column { grid-template-columns: minmax(0, 1fr) auto; }
.attention-item--two-column > .btn { justify-self: end; }
@container (max-width: 640px) {
  .attention-item { grid-template-columns: 1fr; align-items: stretch; }
  .attention-item__actions { justify-content: flex-start; }
  .attention-item__actions > .btn { flex: 1 1 auto; width: auto; }
}
@media (max-width: 720px) {
  .attention-item { grid-template-columns: 1fr; align-items: stretch; }
  .attention-item__actions { justify-content: flex-start; }
  .attention-item__actions > .btn { flex: 1 1 auto; width: auto; }
  /* A name with one compact action keeps them side by side, so a long list
     of students is not a column of full-width buttons. */
  .attention-item--two-column { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .attention-item--two-column > .btn { width: auto; justify-self: end; }
}

.assignment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.assignment-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.assignment-card__title {
  margin: 0;
  font-size: var(--text-lead);
  font-weight: 800;
}
.assignment-card__meta {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}
.assignment-card__portions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.assignment-portion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  color: var(--ink);
  font-size: var(--text-body);
}
.assignment-card__notes {
  margin: .75rem 0 0;
  color: var(--ink);
  white-space: pre-line;
}
.assignment-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.detail-grid {
  display: grid;
  --grid-min: 180px;
  gap: .75rem;
}
.detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  min-width: 0;
}
.detail-grid__label {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 700;
}

.section-head {
  display: flex;
  flex-wrap: wrap; /* actions drop under a heading that would otherwise squeeze */
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.section-head h2 {
  margin: 0;
  font-size: var(--text-lead);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline__item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
}
.timeline__marker {
  width: 10px;
  height: 10px;
  margin-top: .5rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.timeline__item--attendance .timeline__marker { background: var(--info); box-shadow: 0 0 0 4px var(--info-bg); }
.timeline__item--assignment .timeline__marker { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-bg); }
.timeline__item--certificate .timeline__marker { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); }
.timeline__body {
  min-width: 0;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.timeline__item:last-child .timeline__body { border-bottom: 0; padding-bottom: 0; }
.timeline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: var(--muted);
  font-size: var(--text-small);
}
.timeline__kind {
  font-weight: 800;
  color: var(--brand-dark);
}
.timeline__title {
  display: block;
  margin-top: .125rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.timeline__title:hover { color: var(--brand); text-decoration: none; }
.timeline__meta {
  margin: .125rem 0 0;
  color: var(--muted);
  font-size: var(--text-small);
}

/* Reports: the quick ranges head the period card on their own row, and the
   center totals line stays slim. */
/* Its own full row in the flex and the phone grid layouts alike, so the
   quick ranges are never clipped beside the date fields. */
.report-period .timeline-filters { flex-basis: 100%; grid-column: 1 / -1; }
.report-totals.summary-line { margin-block-end: 0; padding-block: .25rem; }
/* Four totals read as two pairs on a phone instead of three and one. */
@media (max-width: 640px) {
  .report-totals.summary-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; row-gap: 0; }
}
