/* MTC LMS dashboard. */

.mtc-dash { padding: 30px 0 70px; }

/* ---------- header ---------- */
.mtc-dash-head {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--mtc-line);
}
.mtc-dash-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.mtc-avatar { border-radius: 50%; flex: 0 0 auto; }
.mtc-dash-id h1 { margin: 2px 0 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; color: var(--mtc-plum); }
.mtc-dash-number { margin: 4px 0 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--mtc-muted); }
.mtc-dash-actions { display: flex; align-items: center; gap: 12px; }

.mtc-bell {
  position: relative; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; color: var(--mtc-plum);
  background: var(--mtc-purple-soft); text-decoration: none; flex: 0 0 auto;
}
.mtc-bell:hover { background: var(--mtc-purple-line); color: var(--mtc-plum); }
.mtc-bell-count {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--mtc-crit, #9E3B3B); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--mtc-bg);
}

/* ---------- layout ---------- */
.mtc-dash-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 34px; align-items: start; }

.mtc-dash-nav { position: sticky; top: 100px; }
.mtc-dash-navtoggle { display: none; }
.mtc-dash-navgroup {
  margin: 20px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--mtc-muted);
}
.mtc-dash-navgroup:first-child { margin-top: 0; }
.mtc-dash-nav ul { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mtc-dash-nav a {
  display: block; padding: 9px 12px; border-radius: 9px;
  color: var(--mtc-ink); text-decoration: none; font-size: 14.5px; font-weight: 600;
}
.mtc-dash-nav a:hover { background: var(--mtc-purple-soft); color: var(--mtc-purple-600); }
.mtc-dash-nav a[aria-current="page"] { background: var(--mtc-plum); color: #fff; }

.mtc-dash-main { min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.mtc-dash-title { margin: 0; font-size: clamp(20px, 2.6vw, 26px); color: var(--mtc-plum); }

/* ---------- panels and tiles ---------- */
.mtc-panel {
  background: var(--mtc-surface); border: 1px solid var(--mtc-line);
  border-radius: var(--mtc-radius); padding: 22px; box-shadow: var(--mtc-shadow);
}
.mtc-panel-title {
  margin: 0 0 16px; font-size: 17px; color: var(--mtc-plum);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between;
}
.mtc-muted { color: var(--mtc-muted); }
.mtc-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
.mtc-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.mtc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 14px; }
.mtc-tile {
  background: var(--mtc-surface); border: 1px solid var(--mtc-line);
  border-radius: var(--mtc-radius); padding: 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.mtc-tile-n { font-size: 28px; font-weight: 700; color: var(--mtc-plum); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mtc-tile-l { font-size: 13px; color: var(--mtc-muted); }

.mtc-resume { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.mtc-resume h3 { margin: 6px 0 4px; font-size: 20px; color: var(--mtc-ink); }
/* ---------- pills ---------- */
.mtc-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  background: var(--mtc-purple-soft); color: var(--mtc-purple-600); white-space: nowrap;
}
.mtc-pill.is-pass { background: var(--mtc-ok-soft); color: var(--mtc-ok); }
.mtc-pill.is-fail { background: #FBEAEA; color: #9E3B3B; }
.mtc-pill.is-info { background: var(--mtc-gold-soft); color: var(--mtc-gold); }

.mtc-button--sm { padding: 7px 13px; font-size: 13.5px; }

/* ---------- key/value ---------- */
.mtc-kv { margin: 0; display: flex; flex-direction: column; gap: 0; }
.mtc-kv > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--mtc-line);
}
.mtc-kv > div:last-child { border-bottom: 0; }
.mtc-kv dt { color: var(--mtc-muted); font-size: 14px; }
.mtc-kv dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- course cards ---------- */
.mtc-dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.mtc-dash-course { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.mtc-dash-course-media { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--mtc-purple-soft); }
.mtc-dash-course-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mtc-dash-course-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mtc-dash-course-body h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.mtc-dash-course-body h3 a { color: var(--mtc-ink); text-decoration: none; }
.mtc-dash-course-body h3 a:hover { color: var(--mtc-purple); }
.mtc-dash-course-actions { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mtc-cert-card h3 { margin: 6px 0 14px; font-size: 19px; color: var(--mtc-ink); }

/* ---------- notifications ---------- */
.mtc-notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mtc-notif {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  background: var(--mtc-surface); border: 1px solid var(--mtc-line);
  border-radius: var(--mtc-radius); padding: 16px 18px;
}
.mtc-notif.is-unread { border-left: 3px solid var(--mtc-purple); background: var(--mtc-purple-soft); }
.mtc-notif-title { margin: 0 0 4px; font-weight: 700; }
.mtc-notif-body { margin: 0; color: var(--mtc-muted); font-size: 14.5px; }
.mtc-notif-date { margin: 6px 0 0; font-size: 12.5px; }

/* ---------- grading ---------- */
.mtc-grade-list { display: flex; flex-direction: column; gap: 16px; }
.mtc-grade-item.is-graded { opacity: .82; }
.mtc-grade-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.mtc-grade-head h3 { margin: 0 0 4px; font-size: 17px; }
.mtc-submission {
  background: var(--mtc-bg); border: 1px solid var(--mtc-line);
  border-radius: var(--mtc-radius-sm); padding: 14px 16px; margin-bottom: 14px;
  font-size: 14.5px; max-height: 260px; overflow-y: auto;
}
.mtc-grade-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.mtc-grade-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--mtc-muted); }
.mtc-grade-form label:first-child { flex: 0 0 150px; }
.mtc-grade-form label:nth-child(2) { flex: 1 1 260px; }
.mtc-grade-form input, .mtc-grade-form textarea {
  border: 1px solid var(--mtc-line); border-radius: var(--mtc-radius-sm);
  padding: 9px 11px; font-size: 14.5px; font-weight: 400; color: var(--mtc-ink); background: #fff; width: 100%;
}
.mtc-grade-msg { font-size: 13.5px; font-weight: 600; color: var(--mtc-ok); }
/* ---------- attendance roll ---------- */
.mtc-roll .mtc-roll-cell { text-align: center; }
.mtc-radio { display: inline-grid; place-items: center; cursor: pointer; }
.mtc-radio input { width: 18px; height: 18px; accent-color: var(--mtc-purple); cursor: pointer; }
.mtc-roll tbody tr.is-saving { opacity: .55; }
.mtc-roll-status { min-height: 22px; font-size: 13.5px; font-weight: 600; color: var(--mtc-ok); }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ---------- bar chart ---------- */
.mtc-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mtc-bars li { display: grid; grid-template-columns: minmax(120px, 1.4fr) 3fr auto; gap: 14px; align-items: center; }
.mtc-bar-label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtc-bar-track { height: 12px; background: var(--mtc-purple-soft); border-radius: 999px; overflow: hidden; }
.mtc-bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--mtc-purple), var(--mtc-plum)); }
.mtc-bar-value { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--mtc-plum); min-width: 28px; text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .mtc-dash-layout { grid-template-columns: 1fr; gap: 18px; }
  .mtc-dash-nav { position: static; }
  .mtc-dash-navtoggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--mtc-surface); border: 1px solid var(--mtc-line); border-radius: var(--mtc-radius);
    padding: 13px 16px; font-size: 15px; font-weight: 700; color: var(--mtc-plum); cursor: pointer;
  }
  .mtc-dash-navtoggle svg { transition: transform .2s ease; }
  .mtc-dash-navtoggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .mtc-dash-navlist {
    display: none; background: var(--mtc-surface); border: 1px solid var(--mtc-line);
    border-top: 0; border-radius: 0 0 var(--mtc-radius) var(--mtc-radius); padding: 8px 14px 14px;
  }
  .mtc-dash-navlist.is-open { display: block; }
  .mtc-dash-head { gap: 14px; }
  .mtc-grade-form label:first-child { flex: 1 1 120px; }
}

@media (max-width: 640px) {
  .mtc-dash { padding: 20px 0 50px; }
  .mtc-dash-cards { grid-template-columns: 1fr; }
  .mtc-resume { flex-direction: column; align-items: stretch; }
  .mtc-bars li { grid-template-columns: 1fr auto; }
  .mtc-bar-track { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .mtc-dash-navtoggle svg { transition: none; }
}
/* ---------- certificate requirements ---------- */
.mtc-req { border-top: 1px solid var(--mtc-line); padding-top: 12px; }
.mtc-req summary {
  cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--mtc-purple);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  list-style: none;
}
.mtc-req summary::-webkit-details-marker { display: none; }
.mtc-req summary:focus-visible { outline: 2px solid var(--mtc-purple); outline-offset: 2px; border-radius: 4px; }
.mtc-req-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.mtc-req-list li {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--mtc-line);
  font-size: 13.5px; color: var(--mtc-muted);
}
.mtc-req-list li:last-child { border-bottom: 0; }
.mtc-req-list li strong { color: var(--mtc-ink); font-variant-numeric: tabular-nums; }
.mtc-req-list li::before {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--mtc-line); order: -1;
}
.mtc-req-list li.is-ok::before { background: var(--mtc-ok); }
.mtc-req-list li span { flex: 1; }