/* lms-people – screens of this area (see lms.css for shared pieces): learners, profile, import, enrolments, gradebook, attendance, progress report */

/* ---------- shared bits */
.lp-pass { color: var(--green-fg); font-weight: 600; }
.lp-note { padding: 4px 12px 8px; margin: 0; }
.lp-inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.lp-inline .field.grow { flex: 1 1 220px; min-width: 0; }
.lp-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- learners list */
.lp-bulk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--blue-bg); color: var(--blue-fg); position: sticky; top: 0; z-index: 3; }
.lp-bulk strong { margin-inline-end: auto; }
.lp-school { display: inline-flex; vertical-align: middle; margin-inline-start: 6px; color: var(--primary); }

/* ---------- learner profile */
.lp-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1000px) { .lp-split { grid-template-columns: minmax(0, 1fr); } }
.lp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lp-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--row-line); border-radius: var(--radius-sm); min-width: 0; }
.lp-stats strong { display: inline-flex; align-items: center; gap: 4px; }
.lp-login { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-login .btn { margin-inline-start: auto; }
.lp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 16px; margin: 0; }
.lp-facts > div { min-width: 0; }
.lp-facts dt { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.lp-facts dd { margin: 0; overflow-wrap: anywhere; }
.lp-days { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.lp-day { min-width: 26px; justify-content: center; padding: 3px 6px; font-family: var(--mono); }
.lp-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lp-points li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--row-line); }
.lp-points li:last-child { border-bottom: 0; }
.lp-point-icon { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-bg); color: var(--blue-fg); }
.lp-point-text { display: flex; flex-direction: column; min-width: 0; }
.lp-point-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
    .lp-stats { grid-template-columns: minmax(0, 1fr); }
    .lp-points li { grid-template-columns: auto minmax(0, 1fr) auto; }
    .lp-points li > .small:last-child { grid-column: 2 / -1; }
}

/* ---------- CSV import */
.lp-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.lp-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.lp-steps li.current { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.lp-steps li.done { color: var(--green-fg); }
.lp-step-num { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-family: var(--mono);
    background: var(--gray-bg); color: var(--gray-fg); }
.lp-steps li.current .lp-step-num { background: var(--primary); color: var(--surface); }
.lp-steps li.done .lp-step-num { background: var(--green-bg); color: var(--green-fg); }
.lp-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; text-align: center; cursor: pointer;
    border: 2px dashed var(--border); border-radius: var(--radius); color: var(--text); }
.lp-drop:hover, .lp-drop:focus-within { border-color: var(--primary); }
.lp-drop:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.lp-drop .icon { color: var(--primary); }
.lp-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.lp-errors { margin: 6px 0 0; padding-inline-start: 18px; color: var(--red-fg); font-size: 12px; }

/* ---------- gradebook */
.lp-legend { flex-wrap: wrap; gap: 6px 16px; }
.lp-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.lp-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: var(--radius-sm); font-weight: 700; }
.lp-mark.green, .lp-cell.green { background: var(--green-bg); color: var(--green-fg); }
.lp-mark.red, .lp-cell.red { background: var(--red-bg); color: var(--red-fg); }
.lp-mark.blue, .lp-cell.blue { background: var(--blue-bg); color: var(--blue-fg); }
.lp-mark.gray, .lp-cell.gray { background: var(--gray-bg); color: var(--gray-fg); }
.lp-mark.amber, .lp-cell.amber { background: var(--amber-bg); color: var(--amber-fg); }
.lp-gb-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--row-line); border-radius: var(--radius-sm); }
.lp-gb-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lp-gradebook { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.lp-gradebook thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); vertical-align: bottom; }
.lp-gradebook .lp-sticky { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); min-width: 180px; max-width: 240px;
    text-align: start; font-weight: 400; box-shadow: inset -1px 0 0 var(--border); }
[dir="rtl"] .lp-gradebook .lp-sticky { box-shadow: inset 1px 0 0 var(--border); }
.lp-gradebook thead .lp-sticky { z-index: 3; font-weight: 600; }
.lp-gradebook tbody .lp-sticky a { font-weight: 600; }
.lp-gb-col { text-transform: none; letter-spacing: 0; min-width: 84px; max-width: 120px; white-space: normal; text-align: center; }
.lp-gb-col .lms-kind { display: block; margin-bottom: 2px; }
.lp-gb-title { display: block; line-height: 1.25; overflow-wrap: anywhere; color: var(--text); }
.lp-gb-max { display: block; font-family: var(--mono); font-weight: 400; }
.lp-gb-cell { text-align: center; padding: 6px; }
.lp-cell { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 64px; min-height: 30px; padding: 2px 8px; border-radius: var(--radius-sm);
    font-family: var(--mono); font-size: 13px; white-space: nowrap; border: 0; }
button.lp-cell { cursor: pointer; font-weight: 600; font-family: inherit; box-shadow: inset 0 0 0 1px var(--amber-fg); }
button.lp-cell:hover, button.lp-cell:focus-visible { outline: 2px solid var(--amber-fg); outline-offset: 1px; }
.lp-answer { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--gray-bg); color: var(--text); line-height: 1.6; }
.lp-attach { align-self: flex-start; }
.lp-score-input { max-width: 140px; font-family: var(--mono); }
.lp-score-pct { font-size: 18px; font-weight: 600; padding-bottom: 8px; }
@media print {
    .lp-gb-scroll { overflow: visible; max-height: none; border: 0; }
    .lp-gradebook thead th, .lp-gradebook .lp-sticky { position: static; box-shadow: none; }
}

/* ---------- attendance (tablet friendly) */
.lp-roster { gap: 14px; }
.lp-roster-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.lp-roster-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.lp-roster-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lp-roster-row { display: grid; grid-template-columns: minmax(160px, 1fr) auto minmax(140px, 220px); align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--row-line); }
.lp-roster-row:last-child { border-bottom: 0; }
.lp-roster-who { display: flex; flex-direction: column; min-width: 0; }
.lp-roster-who strong { overflow-wrap: anywhere; }
.lp-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.lp-seg-btn { min-height: 44px; min-width: 84px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 0;
    border-inline-start: 1px solid var(--border); background: var(--surface); color: var(--muted); touch-action: manipulation; }
.lp-seg-btn:first-child { border-inline-start: 0; }
.lp-seg-btn:hover:not(:disabled) { color: var(--text); background: var(--gray-bg); }
.lp-seg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; position: relative; }
.lp-seg-btn:disabled { cursor: default; }
.lp-seg-btn.on.green { background: var(--green-bg); color: var(--green-fg); }
.lp-seg-btn.on.amber { background: var(--amber-bg); color: var(--amber-fg); }
.lp-seg-btn.on.red { background: var(--red-bg); color: var(--red-fg); }
.lp-seg-btn.on.blue { background: var(--blue-bg); color: var(--blue-fg); }
.lp-seg-btn.on.gray { background: var(--gray-bg); color: var(--gray-fg); }
.lp-seg-btn.on { box-shadow: inset 0 -3px 0 currentColor; }
.lp-roster-note { min-height: 44px; width: 100%; min-width: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.lp-roster-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0 4px; background: var(--surface); border-top: 1px solid var(--border); }
.lp-roster-foot .btn { min-height: 44px; padding-inline: 22px; }
@media (max-width: 900px) {
    .lp-roster-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .lp-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lp-seg-btn { min-width: 0; padding: 0 4px; }
}
@media (max-width: 400px) { .lp-seg-btn { font-size: 12px; } }
