/* The dashboards (dashboard.js): the student's on the landing page, the
 * faculty and admin one on /internal/ and the front door. In the site's
 * tokens, so each side wears its own theme; nothing here names a colour of
 * its own.
 *
 * Panels stand in rows of one or two, and the panels of a row are always
 * the same height, however long each one's content: the row stretches
 * them, each panel is a column, and its closing note sits at its foot. */
.dash { --gap: 20px; --pad: 20px; --radius: 14px; max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; color: var(--text); font-family: var(--font-ui); }
.dash * { box-sizing: border-box; }
.dash a { color: var(--accent); text-underline-offset: 2px; }

/* ---- the greeting ---- */
.dash-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 24px; }
.dash-hello h1 { color: var(--text); text-transform: none; letter-spacing: -.02em; font: 700 clamp(1.7rem, 3.4vw, 2.3rem)/1.12 var(--font-display); margin: 0 0 6px; }
.dash-hello p { margin: 0; color: var(--muted); font-size: 1rem; }
.dash-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 600; text-decoration: none; }
.dash-pill.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---- the numbers ---- */
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 var(--gap); }
.dash-stat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.dash-stat:hover { border-color: var(--accent); transform: translateY(-1px); }
.dash-stat b { display: block; font: 700 1.9rem/1.05 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.dash-stat span { color: var(--muted); font-size: .86rem; line-height: 1.35; margin: 4px 0 12px; }
.dash-stat .bar { height: 6px; border-radius: 4px; background: var(--surface-2); margin-top: auto; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.dash-stat .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---- rows and panels ---- */
.dash-rows { display: flex; flex-direction: column; gap: var(--gap); }
.dash-row { display: grid; gap: var(--gap); align-items: stretch; }
.dash-row.one { grid-template-columns: minmax(0, 1fr); }
.dash-row.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-row.wide-narrow { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-row.narrow-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.dash-panel { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.dash-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px var(--pad) 14px; border-bottom: 1px solid var(--border); }
.dash-panel-head h2 { margin: 0; color: var(--text); text-transform: none; letter-spacing: normal; font: 700 1.04rem/1.3 var(--font-display); }
.dash-aside { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.dash-head-link { font-size: .84rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.dash-head-link:hover { text-decoration: underline; }
.dash-panel-body { display: flex; flex-direction: column; flex: 1; padding: 14px var(--pad) 18px; }
.dash-sub { color: var(--muted); font-size: .86rem; margin: 0 0 10px; }
.dash-note { color: var(--muted); font-size: .8rem; line-height: 1.5; margin: auto 0 0; padding-top: 14px; }
.dash-foot { color: var(--muted); font-size: .8rem; margin: 18px 4px 0; }

/* Two panels stacked in one column of a row: each takes its share of the height. */
.dash-stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.dash-stack > .dash-panel { flex: 1 1 auto; }

/* ---- lists ---- */
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; gap: 14px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--border); }
.dash-list li:first-child { border-top: 0; padding-top: 2px; }
.dash-list .main { flex: 1; min-width: 0; }
.dash-list .title { font-weight: 600; line-height: 1.35; }
.dash-list .title a { text-decoration: none; }
.dash-list .title a:hover { text-decoration: underline; }
.dash-list .meta { color: var(--muted); font-size: .84rem; margin-top: 3px; line-height: 1.4; }
.dash-list .side { color: var(--muted); font-size: .82rem; white-space: nowrap; text-align: right; line-height: 1.45; }
.dash-code { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); white-space: nowrap; margin-right: 2px; }
.dash-tag { display: inline-block; vertical-align: 1px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.dash-tag.ok { background: var(--moss-soft); color: var(--moss); }
.dash-tag.wait { background: var(--brass-soft); color: var(--brass); }
.dash-tag.no { background: var(--rust-soft); color: var(--rust); }
.dash-tag.info { background: var(--steel-soft); color: var(--steel); }

/* ---- progress ---- */
.dash-group { margin: 0 0 16px; }
.dash-group:last-of-type { margin-bottom: 0; }
.dash-group-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: .92rem; margin-bottom: 7px; }
.dash-group-head span { color: var(--muted); font-weight: 500; white-space: nowrap; }
.dash-progress { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.dash-progress i { display: block; height: 100%; }
.dash-progress .done { background: var(--accent); }
.dash-progress .now { background: var(--brass); }
.dash-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.dash-chip { font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-chip.done { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.dash-chip.now { background: var(--brass-soft); border-color: transparent; color: var(--brass); }

/* ---- links, people, tables ---- */
.dash-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dash-link { display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--text) !important; transition: border-color .15s, background .15s; }
.dash-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.dash-link b { font-size: .94rem; }
.dash-link span { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.dash-person { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.dash-person + .dash-person { border-top: 1px solid var(--border); }
.dash-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.dash-person .dash-sub { margin: 2px 0 0; }
.dash-scroll { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dash-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .76rem; letter-spacing: .02em; text-transform: uppercase; padding: 0 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dash-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table th.n, .dash-table td.n { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 10px; }
.dash-table .dash-sub { display: block; margin: 2px 0 0; font-size: .8rem; }

/* ---- empty, loading, view-as ---- */
.dash-empty { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: .9rem; padding: 18px 12px; margin: 0; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); }
.dash-loading { color: var(--muted); padding: 40px 0; }
.dash-viewas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; margin: 0 0 22px; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); font-size: .88rem; }
.dash-viewas select, .dash-viewas button { font: inherit; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.dash-viewas button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.dash-viewas .dash-sub { margin: 0; }

/* ---- narrow screens: one panel to a row ---- */
@media (max-width: 900px) {
  .dash-row.half, .dash-row.wide-narrow, .dash-row.narrow-wide { grid-template-columns: minmax(0, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .dash { --pad: 16px; padding: 22px 14px 44px; }
  .dash-stat b { font-size: 1.45rem; }
  .dash-list .side { white-space: normal; }
}
.dash-btn { font: inherit; font-size: 0.86rem; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.dash-btn:hover { border-color: var(--accent); color: var(--accent); }
.dash-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "Your teaching": the published term and a Draft view of each drafted term ahead. */
.dash-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.dash-tab { font: inherit; font-size: .85rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; }
.dash-tab:hover { color: var(--text); border-color: var(--accent); }
.dash-tab.on { color: var(--text); background: var(--surface-2); border-color: var(--accent); }
.dash-teach[hidden] { display: none; }
