/* ============ Attendance page (.pg-attendance) ============ */

.pg-attendance .att-stats { margin-bottom: 16px; }

/* percentage colour coding: green >=85, amber 80–85, red <80 */
.pg-attendance .att-c-ok   { color: var(--success); }
.pg-attendance .att-c-warn { color: var(--warning); }
.pg-attendance .att-c-low  { color: var(--danger); }
.pg-attendance .att-c-none { color: var(--muted); }

/* 80% rule note */
.pg-attendance .att-note {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--gold-50);
  border-left: 4px solid var(--gold);
  margin-bottom: 16px; font-size: 13px;
}
.pg-attendance .att-note svg { width: 22px; height: 22px; color: var(--gold-dark); flex: none; margin-top: 1px; }

/* status colours shared by mini-bar segments + legend dots */
.pg-attendance .b-present { background: var(--success); }
.pg-attendance .b-late    { background: var(--gold); }
.pg-attendance .b-absent  { background: var(--danger); }
.pg-attendance .b-excused { background: var(--n-300); }

/* ----- student course cards ----- */
.pg-attendance .att-course {
  border-left: 4px solid var(--cc, var(--indigo));
  cursor: pointer; transition: box-shadow .15s ease, transform .15s ease;
}
.pg-attendance .att-course:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.pg-attendance .att-course:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pg-attendance .att-course-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.pg-attendance .att-pct { font-size: 24px; font-weight: 800; line-height: 1.1; margin-bottom: 3px; }

.pg-attendance .att-bar {
  display: flex; height: 10px; border-radius: 99px; overflow: hidden;
  background: var(--line); margin-top: 14px;
}
.pg-attendance .att-bar span { display: block; height: 100%; }
.pg-attendance .att-legend {
  display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 10px; color: var(--muted);
}
.pg-attendance .att-legend .dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px;
}

/* ----- staff: date bar + class cards ----- */
.pg-attendance .att-datebar { padding: 14px 20px; margin-bottom: 16px; }
.pg-attendance .att-datebar .input { width: auto; }
.pg-attendance .att-class { border-left: 4px solid var(--cc, var(--indigo)); }

/* ----- staff: register roster ----- */
.pg-attendance .att-reg-tools { margin-bottom: 4px; }
.pg-attendance .att-row {
  display: flex; gap: 12px; align-items: center; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.pg-attendance .att-row:last-child { border-bottom: 0; }

/* .att-row is not a .list-row, so give the shared list classes the same
   look here (app.css only styles them under .list-row). Keeps names/rolls
   on the left and the P/L/A/E toggles flush right on every row. */
.pg-attendance .att-row .list-main { flex: 1; min-width: 0; }
.pg-attendance .att-row .list-title { font-weight: 700; font-size: 13.5px; }
.pg-attendance .att-row .list-sub { font-size: 12px; color: var(--muted); }

.pg-attendance .att-toggle { display: flex; gap: 6px; flex: none; }
.pg-attendance .att-toggle button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-weight: 800; font-size: 12px;
  cursor: pointer; font-family: inherit; transition: background .12s ease, color .12s ease;
}
.pg-attendance .att-toggle button:hover { border-color: var(--indigo-3); color: var(--text); }
.pg-attendance .att-toggle .t-present.active { background: var(--success); border-color: var(--success); color: #fff; }
.pg-attendance .att-toggle .t-late.active    { background: var(--gold);    border-color: var(--gold);    color: var(--indigo); }
.pg-attendance .att-toggle .t-absent.active  { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.pg-attendance .att-toggle .t-excused.active { background: var(--n-500);  border-color: var(--n-500);  color: #fff; }

/* ----- staff: summary table ----- */
.pg-attendance .att-sum tr.att-low td { background: rgba(194,38,79,.055); }

/* ----- mobile ----- */
@media (max-width: 540px) {
  .pg-attendance .att-row { flex-wrap: wrap; }
  .pg-attendance .att-row .att-toggle {
    width: 100%; margin-left: 48px; justify-content: flex-start;
  }
  .pg-attendance .att-pct { font-size: 21px; }
}

/* ---------- Denning records (totals by subject, not clickable) ---------- */
.pg-attendance .b-online { background: var(--p-300); }
.pg-attendance .b-leave  { background: var(--g-200); }
.pg-attendance .b-bunk   { background: color-mix(in srgb, var(--danger) 55%, var(--card)); }
.pg-attendance .att-rec { cursor: default; }
.pg-attendance .att-rec:hover { box-shadow: var(--shadow-xs); transform: none; }
.pg-attendance .att-notice { margin-bottom: 14px; color: var(--text-2); border-left: 3px solid var(--warning); }
