/* LMS UCI — app layer on top of uci-ds tokens + components */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--pattern-grid-light); background-color: var(--uci-cream-soft); }
.login-card { width: 100%; max-width: 400px; display: grid; gap: 6px; }
.login-logo { height: 34px; width: auto; margin-bottom: 10px; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 60px); }
.topbar-in { max-width: none; }
.role-switch { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.role-switch .select { height: 34px; width: auto; font-weight: 600; font-size: var(--fs-sm); }
.who { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--uci-navy); color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.side { background: #fff; border-right: 1px solid var(--uci-divider); padding: 14px 10px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); text-decoration: none; font-weight: 600; color: var(--uci-navy); font-size: var(--fs-base); }
.side a:hover { background: var(--uci-surface-muted); }
.side a[aria-current="page"] { background: var(--uci-red-subtle); color: var(--uci-red); }
.side .grp { font-size: var(--fs-xs); font-weight: 700; color: var(--uci-muted); padding: 14px 10px 4px; }
.side .cnt { margin-left: auto; background: var(--uci-red); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.ico { width: 18px; height: 18px; flex: none; }
main.content { padding: 20px 24px 60px; min-width: 0; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; }
.crumb { font-size: var(--fs-sm); color: var(--uci-muted); margin-bottom: 4px; }
.crumb a { text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--uci-red); }

/* grid helpers */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.card.tight { padding: 14px 16px; }
.card h3.h3 { margin-bottom: 8px; }
.kpi .stat { margin-top: 6px; }
.kpi .small { margin-top: 4px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--uci-divider); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--uci-muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: var(--fs-base); }
.tabs a:hover { color: var(--uci-navy); }
.tabs a[aria-current="page"] { color: var(--uci-red); border-bottom-color: var(--uci-red); }
.tabs .cnt { background: var(--uci-surface-muted); color: var(--uci-navy); border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

/* chain (traceability) */
.chain { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.chain > div { background: #fff; border: 1px solid var(--uci-divider); border-radius: var(--r-lg); padding: 10px 12px; position: relative; }
.chain > div b { display: block; font-family: var(--font-serif); font-size: 15px; }
.chain > div span { font-size: var(--fs-xs); color: var(--uci-muted); }
.chain > div:not(:last-child)::after { content: "→"; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); color: var(--uci-muted); font-weight: 700; background: var(--uci-cream-soft); line-height: 1; }
.tree { display: grid; gap: 8px; }
.node { border: 1px solid var(--uci-divider); border-radius: var(--r-lg); background: #fff; }
.node > .nh { display: flex; gap: 10px; align-items: center; padding: 10px 14px; flex-wrap: wrap; }
.node .code { font-weight: 800; font-size: var(--fs-sm); color: var(--uci-blue); min-width: 64px; }
.node .kids { border-top: 1px solid var(--uci-divider); padding: 8px 14px 10px 34px; display: grid; gap: 6px; background: var(--uci-panel-muted); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.lock { font-size: var(--fs-xs); color: var(--uci-muted); display: inline-flex; gap: 4px; align-items: center; }

/* status chips for competency */
.st { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.st-EX { background: #e3effe; color: #044695; }
.st-CO { background: var(--uci-green-subtle); color: var(--uci-green); }
.st-DV { background: var(--uci-yellow-subtle); color: #8a5a00; }
.st-NC { background: var(--uci-red-subtle); color: #b42318; }
.st-BD { background: var(--uci-surface-muted); color: var(--uci-muted); border-color: var(--uci-border); border-style: dashed; }
.st-none { background: #fff; color: var(--uci-muted); border: 1px dashed var(--uci-border); }
.fn { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.fn-DIA { background: #eef2f7; color: #3b4c66; }
.fn-FOR { background: var(--uci-yellow-subtle); color: #8a5a00; }
.fn-PEN { background: var(--uci-red-subtle); color: #b42318; }

/* UP timeline */
.ups { display: grid; gap: 10px; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.up { border: 1px solid var(--uci-divider); border-radius: var(--r-lg); background: #fff; padding: 12px; display: grid; gap: 8px; align-content: start; }
.up-h { display: flex; justify-content: space-between; align-items: baseline; }
.up-h b { font-family: var(--font-serif); font-size: 16px; }
.wbar { height: 8px; border-radius: 999px; background: var(--uci-surface-muted); overflow: hidden; }
.wbar > i { display: block; height: 100%; background: var(--uci-red); }
.item { border: 1px solid var(--uci-divider); border-radius: var(--r-md); padding: 8px 10px; background: var(--uci-near-white); font-size: var(--fs-sm); display: grid; gap: 4px; }
.item:hover { border-color: var(--uci-panel-border); background: #fff; }
.item .t { font-weight: 700; color: var(--uci-navy); }
button.item { text-align: left; cursor: pointer; width: 100%; }
.distbar { display: flex; height: 26px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--uci-divider); }
.distbar > div { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }

/* checks / gates */
.checks { display: grid; gap: 6px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); }
.chk i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; margin-top: 1px; }
.chk.ok i { background: var(--uci-green-subtle); color: var(--uci-green); }
.chk.no i { background: var(--uci-red-subtle); color: #b42318; }
.chk.warn i { background: var(--uci-yellow-subtle); color: #8a5a00; }
.note-warn { border: 1px solid #f0d58c; background: var(--uci-yellow-subtle); border-radius: var(--r-md); padding: 10px 14px; font-size: var(--fs-sm); }
.note-ok { border: 1px solid #b9dcc4; background: var(--uci-green-subtle); border-radius: var(--r-md); padding: 10px 14px; font-size: var(--fs-sm); }
.note-info { border: 1px solid var(--uci-panel-border); background: #f3f7fd; border-radius: var(--r-md); padding: 10px 14px; font-size: var(--fs-sm); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: var(--uci-overlay); display: grid; place-items: center; z-index: 40; padding: 16px; animation: fade .15s ease-out; }
.modal { background: #fff; border-radius: var(--r-xl); width: 100%; max-width: 720px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-pop); animation: up .2s var(--ease-out); }
.modal.wide { max-width: 980px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--uci-divider); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-b { padding: 16px 20px; display: grid; gap: 14px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--uci-divider); display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(12px); } }

.seg { display: inline-flex; border: 1px solid var(--uci-border); border-radius: var(--r-md); overflow: hidden; }
.seg label { padding: 7px 12px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border-right: 1px solid var(--uci-border); background: #fff; }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--uci-navy); color: #fff; }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpick label { border: 1px solid var(--uci-border); border-radius: 999px; padding: 4px 10px; font-size: var(--fs-sm); cursor: pointer; background: #fff; }
.tagpick input { display: none; }
.tagpick label:has(input:checked) { background: var(--uci-navy); color: #fff; border-color: var(--uci-navy); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.switch input { width: 34px; height: 20px; appearance: none; background: var(--uci-border); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--uci-green); }
.switch input:checked::after { transform: translateX(14px); }

/* rubric */
.rubric { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.rubric th, .rubric td { border: 1px solid var(--uci-divider); padding: 8px 10px; vertical-align: top; }
.rubric th { background: var(--uci-panel-muted); text-align: left; font-size: var(--fs-xs); }
.rubric td.pick { cursor: pointer; }
.rubric td.pick:hover { background: var(--uci-surface-hover); }
.rubric td.sel { outline: 2px solid var(--uci-blue-bright); outline-offset: -2px; background: #f3f7fd; }

/* matrix (gradebook) */
.matrix td, .matrix th { padding: 7px 10px; }
.matrix td.c { text-align: center; }
.matrix select.stsel { height: 26px; border-radius: 6px; border: 1px solid var(--uci-border); font-size: 12px; font-weight: 700; padding: 0 4px; background: #fff; }

/* student */
.hello { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.radar text { font-size: 10.5px; fill: var(--uci-muted); font-family: var(--font-sans); }
.prog { height: 6px; background: var(--uci-surface-muted); border-radius: 999px; overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--uci-green); }
.badge-card { display: flex; gap: 12px; align-items: center; }
.quiz-wrap { user-select: none; -webkit-user-select: none; }
.btn-xl { height: 52px; padding: 0 32px; font-size: 16px; border-radius: 10px; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border: 1px solid var(--uci-divider); border-radius: var(--r-lg); }
.qr img, .qr svg { width: 220px; height: 220px; image-rendering: pixelated; }
.code-big { font: 700 34px/1 var(--font-serif); letter-spacing: .08em; color: var(--uci-navy); }
.post { border-top: 1px solid var(--uci-divider); padding: 10px 0; display: grid; gap: 4px; }
.post:first-child { border-top: 0; }
.inbox-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--uci-divider); align-items: start; }
.inbox-item.unread { background: #fffaf0; }
.inbox-item:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--uci-red); margin-top: 6px; }
.dot.read { background: transparent; }
.preview-bar { background: var(--uci-yellow); color: var(--uci-navy); font-weight: 700; padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; font-size: var(--fs-sm); position: sticky; top: 60px; z-index: 15; }
.ref { font-size: 11px; font-weight: 700; color: var(--uci-blue); background: #eef3fb; border-radius: 4px; padding: 1px 6px; white-space: nowrap; text-decoration: none; }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; background: var(--uci-surface-muted); padding: 1px 6px; border-radius: 4px; }
.hide-m { }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); } .chain > div:nth-child(3)::after { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--uci-divider); padding: 8px; }
  .side .grp { display: none; }
  .side a { white-space: nowrap; }
  main.content { padding: 16px 14px 60px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .ups { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .who .nm { display: none; }
  .hello { grid-template-columns: 1fr; }
}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.matrix td { white-space: nowrap; }
.matrix td:first-child { white-space: normal; min-width: 150px; }
.matrix td.wrap { white-space: normal; min-width: 150px; max-width: 220px; }
.matrix select.stsel { width: auto; max-width: 150px; }
.radar { max-width: 360px; margin: 0 auto; }
