/* Page-level layout patterns shared by screens (dashboards, lists, documents).
   Tokens only: no colour literals. Loaded after components.css. */

/* ---------- dashboards ---------- */
.greet { display: flex; align-items: center; justify-content: space-between; gap: var(--s-6); flex-wrap: wrap; }
.greet-actions { gap: var(--s-3); }
@media (max-width: 767px) { .greet-actions { width: 100%; } .greet-actions .btn { flex: 1 1 100%; } }

.lessons > li { gap: var(--s-4); align-items: center; }
.lesson-time { display: flex; flex-direction: column; width: 56px; flex-shrink: 0; }
.lesson-actions { gap: var(--s-3); flex-shrink: 0; }
@media (max-width: 767px) {
  .lessons > li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s-2) var(--s-3); align-items: start; }
  .lesson-time { width: auto; }
  .lesson-actions { grid-column: 2; justify-content: space-between; }
}

.comp-list > li { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-3) 0; }
.comp-name { font-weight: 500; }
.comp-bar { display: flex; height: 12px; border-radius: var(--r-full); overflow: hidden; background: var(--field); gap: 2px; }
.comp-bar > span { display: block; height: 100%; }
.comp-counts { display: flex; gap: var(--s-2); font-size: 13px; color: var(--ink-600); white-space: nowrap; }
.comp-counts span { display: inline-flex; align-items: center; gap: 4px; }
.comp-counts .lvl { min-width: 28px; height: 20px; font-size: 11px; }
@media (max-width: 1180px) and (min-width: 768px) { .comp-list > li { grid-template-columns: 180px minmax(0, 1fr); } .comp-counts { grid-column: 2; } }
@media (max-width: 767px) { .comp-list > li { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); } }

.doc-row { align-items: flex-start !important; }
.doc-title { font-weight: 600; color: var(--ink-900); display: block; }
.doc-comment { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 13px; color: var(--crimson-700); }
.doc-comment .ic { margin-top: 3px; }

.evidence { list-style: none; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.ev-item { display: flex; flex-direction: column; gap: 2px; color: var(--ink-900); text-decoration: none !important; }
.ev-thumb { aspect-ratio: 4 / 3; margin-bottom: var(--s-2); }
.ev-item:hover .ev-thumb { border-color: var(--primary); }
.ev-name { font-weight: 600; }
.ev-cap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- teacher dashboard v2 (design round r1) ---------- */
.greet-title { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.01em; }
.greet-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }
.doc-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.doc-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 20px; }
.comp-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: 13px; color: var(--ink-600); }
.comp-legend li { display: inline-flex; align-items: center; gap: 6px; }
.comp-legend b { color: var(--ink-900); }
.comp-list > li { grid-template-columns: 210px minmax(0, 1fr) 150px; }
.comp-bar { height: 10px; }
.comp-counts { justify-content: flex-end; gap: var(--s-3); font-variant-numeric: tabular-nums; }
.comp-counts b { font-weight: 600; color: var(--ink-400); font-size: 11px; margin-right: 2px; }
.ev-list > li { gap: var(--s-3); align-items: center; }
.ev-thumb-sm { width: 44px; height: 44px; border-radius: var(--r-btn); background: var(--field); border: 1px dashed var(--line-strong); color: var(--ink-400); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ev-text { display: flex; flex-direction: column; min-width: 0; color: var(--ink-900) !important; text-decoration: none !important; }
.ev-text:hover .ev-name { text-decoration: underline; }
.ev-text .ev-cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .comp-list > li { grid-template-columns: 180px minmax(0, 1fr); }
  .comp-counts { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 767px) {
  .greet-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: var(--s-2); }
  .greet-actions .btn-primary { grid-column: 1 / -1; }
  .greet-actions .btn-soft { font-size: 13px; padding: 0 var(--s-2); }
  .comp-list > li { grid-template-columns: minmax(0, 1fr); }
  .comp-counts { grid-column: 1; }
}
/* teacher dashboard, design round r2: greeting is the page title, one snapshot figure per row */
.ph-right .greet-actions { justify-content: flex-end; }
.comp-figure { font-size: 13px; color: var(--ink-600); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.comp-figure b { font-size: 15px; font-weight: 700; color: var(--ink-900); margin-right: 2px; }
.dash-comp .card-body { gap: var(--s-2); }
.dash-comp .comp-legend { white-space: nowrap; }
@media (max-width: 1180px) {
  .comp-list > li { grid-template-columns: 180px minmax(0, 1fr) 140px; }
}
@media (max-width: 767px) {
  .ph-right:has(.greet-actions) { width: 100%; }
  .ph-right .greet-actions { justify-content: stretch; }
  .comp-list > li { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2) var(--s-3); }
  .comp-list .comp-bar { grid-column: 1 / -1; grid-row: 2; }
  .comp-figure { grid-column: 2; grid-row: 1; }
  .dash-comp .comp-legend { display: grid; grid-template-columns: repeat(2, max-content); gap: var(--s-2) var(--s-6); }
  :is(.dash-today, .dash-comp, .dash-evidence) .card-head { flex-wrap: nowrap; align-items: flex-start; }
  :is(.dash-today, .dash-comp, .dash-evidence) .card-head > .btn-ghost { flex-shrink: 0; margin-right: calc(-1 * var(--s-3)); margin-top: -6px; }
}

/* teacher dashboard, design round r3: phone evidence rows stay thumbnail | name + caption | date,
   left aligned with a one-line caption (two ids outrank the shared standalone-link rule) */
@media (max-width: 767px) {
  #app #main .ev-text { display: flex; flex: 1 1 0; align-items: stretch; justify-content: center; min-width: 0; text-align: left; }
  #app #main .ev-text > span { max-width: 100%; }
  .ev-list > li > .nowrap { flex-shrink: 0; }
}
