:root {
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.645, .045, .355, 1);
  --side-w: 252px;
  --top-h: 60px;
}
body { background: var(--paper); font-size: 14px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.faint { color: var(--faint); width: 16px; height: 16px; }
.muted { color: var(--mute); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.fine { font-size: 12px; }
.mt { margin-top: 16px; }
.w3 { width: 36px; text-align: right; }
.empty { color: var(--mute); text-align: center; padding: 28px 0; margin: 0; }
.only-m { display: none !important; }
a, button { -webkit-tap-highlight-color: transparent; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border: 0; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
  color: var(--fg); background: var(--bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.18);
  transition: transform 160ms var(--ease-out), background-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }
.btn.ghost { --bg: var(--card); --fg: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.btn.light { --bg: #fff; --fg: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.btn.danger { --fg: var(--rose-ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.xs .ic { width: 14px; height: 14px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.full { width: 100%; height: 42px; }
.btn-group { display: flex; gap: 6px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); text-decoration: none; position: relative; transition: background-color 150ms ease, transform 160ms var(--ease-out); flex: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.xs .ic { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #262a33; }
  .btn.ghost:hover { background: #fcfbf9; box-shadow: 0 0 0 1px var(--faint), var(--shadow-sm); }
  .btn.light:hover { background: #f4f2ee; }
  .icon-btn:hover { background: rgba(18,20,26,.06); }
}

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 16px 12px; border-right: 1px solid var(--line); background: #fbfaf7; z-index: 40; }
.side-top { display: grid; gap: 14px; padding: 0 4px 12px; }
.side-brand { display: flex; justify-content: space-between; align-items: center; }
.side .logo .key { min-width: 36px; height: 30px; font-size: 12.5px; }
.campus { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); text-align: left; transition: box-shadow 150ms ease; }
.campus .kbd { margin-left: auto; }
.campus-badge { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; transition: background-color 300ms ease; }
.campus-txt { min-width: 0; }
.campus-txt b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campus-txt small { color: var(--mute); font-size: 12px; }
.side-nav { position: relative; flex: 1; overflow-y: auto; padding: 4px 0; scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
#sideNav { position: relative; }
.nav-g { display: grid; gap: 2px; margin-bottom: 12px; }
.nav-g small { padding: 6px 10px 4px; font-size: 11px; font-weight: 500; color: var(--faint); letter-spacing: .02em; }
.nav-ind { position: absolute; left: 0; right: 0; top: 4px; height: 36px; border-radius: 9px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: transform 280ms var(--ease-in-out), height 280ms var(--ease-in-out), opacity 150ms ease; pointer-events: none; }
.side-nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 14px; color: var(--ink-2); text-decoration: none; transition: color 150ms ease, background-color 150ms ease; }
.side-nav a.on { color: var(--ink); font-weight: 500; }
.side-nav a .ic { color: var(--mute); transition: color 150ms ease; }
.side-nav a.on .ic { color: var(--accent); }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .side-nav a:not(.on):hover { background: rgba(18,20,26,.04); color: var(--ink); }
  .campus:hover { box-shadow: 0 0 0 1px var(--faint), var(--shadow-sm); }
}
.side-foot { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.role-card { padding: 12px; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line); margin-bottom: 4px; }
.role-card small { display: block; font-size: 11.5px; color: var(--mute); margin-bottom: 8px; }
.role-seg { position: relative; padding: 3px; border-radius: 9px; background: var(--line-2); }
.role-seg #roleSeg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.role-seg button { position: relative; z-index: 1; height: 28px; border: 0; border-radius: 7px; background: transparent; font-size: 12.5px; font-weight: 500; color: var(--mute); transition: color 200ms ease; }
.role-seg button[aria-checked="true"] { color: var(--ink); }
.seg-ind { position: absolute; left: 0; top: 3px; bottom: 3px; width: 0; border-radius: 7px; background: var(--card); box-shadow: var(--shadow-sm); transition: transform 260ms var(--ease-in-out), width 260ms var(--ease-in-out), opacity 150ms ease; pointer-events: none; }
.role-seg .seg-ind { left: 3px; }
.no-ind-anim .nav-ind, .no-ind-anim .seg-ind { transition: none; }
.side-link { display: block; padding: 7px 10px; border: 0; background: none; text-align: left; font-size: 13px; color: var(--mute); text-decoration: none; border-radius: 8px; transition: color 150ms ease; }
.side-link:hover { color: var(--ink); }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 28px; background: rgba(248,247,243,.86); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; min-width: 0; }
.crumbs a { color: var(--mute); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .ic { width: 14px; height: 14px; color: var(--faint); }
.search { margin-left: auto; display: flex; align-items: center; gap: 10px; width: 340px; height: 36px; padding: 0 6px 0 12px; border: 0; border-radius: 10px; background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--faint); font-size: 13.5px; text-align: left; transition: box-shadow 150ms ease; }
.search:hover { box-shadow: 0 0 0 1px var(--faint); }
.search .ic { width: 16px; height: 16px; }
.search-txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot-n { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--paper); }
.me { display: flex; align-items: center; gap: 10px; padding: 3px 8px 3px 3px; border: 0; border-radius: 99px; background: transparent; text-align: left; transition: background-color 150ms ease; }
.me:hover { background: rgba(18,20,26,.05); }
.me-txt b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.me-txt small { font-size: 11.5px; color: var(--mute); }

.view { padding: 28px; max-width: 1400px; width: 100%; outline: none; }
.v-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.v-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.v-head p { margin: 4px 0 0; color: var(--mute); }
.v-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Entry motion ---------- */
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sx { from { transform: scaleX(0); } }
@keyframes sy { from { transform: scaleY(0); } }
.view.enter > * { animation: up 340ms var(--ease-out) both; animation-delay: calc(var(--n, 0) * 45ms); }
.view.enter .stg > * { animation: up 300ms var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 22ms); }
.ov.open .stg > * { animation: up 280ms var(--ease-out) both; animation-delay: calc(80ms + var(--i, 0) * 25ms); }

/* ---------- Cards & grid ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); padding: 18px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 26px; }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.card-sub { margin: -8px 0 10px; font-size: 13px; color: var(--mute); }
.card-sub a { color: var(--accent-ink); }
.card-foot { margin: 14px 0 0; font-size: 12.5px; }
.link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--mute); text-decoration: none; border: 0; background: none; padding: 0; transition: color 150ms ease; }
.link:hover { color: var(--ink); }
.link .ic { width: 14px; height: 14px; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid.top0 { margin-top: 0; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-gb { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { position: relative; background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); padding: 16px 18px; overflow: hidden; min-height: 104px; }
.kpi-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kpi small { font-size: 13px; color: var(--mute); }
.kpi strong { display: block; margin-top: 8px; font-size: 26px; font-weight: 600; letter-spacing: -.035em; white-space: nowrap; }
.delta { font-size: 12px; font-weight: 500; color: var(--mute); white-space: nowrap; }
.delta.up { color: var(--sage-ink); } .delta.down { color: var(--rose-ink); } .delta.warn { color: var(--butter-ink); }
.spark { position: absolute; right: 14px; bottom: 14px; width: 96px; height: 30px; }
.spark .line { fill: none; stroke: var(--ink-2); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark .fill { fill: rgba(18,20,26,.05); }
.spark.up .line { stroke: var(--sage-ink); } .spark.up .fill { fill: rgba(47,107,74,.1); }
.spark.down .line { stroke: var(--rose-ink); } .spark.down .fill { fill: rgba(163,58,40,.08); }
.enter .spark .line { stroke-dasharray: 260; animation: dash 900ms var(--ease-out) 200ms both; }
@keyframes dash { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }

/* ---------- Segmented / tabs ---------- */
.seg { position: relative; display: flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--line-2); flex: none; }
.seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font-size: 12.5px; font-weight: 500; color: var(--mute); transition: color 200ms ease; }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { color: var(--ink); }
.seg .ic { width: 16px; height: 16px; }
.tabs { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--line-2); margin: 18px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > button, .tabs > a { position: relative; z-index: 1; flex: 1 0 auto; display: grid; place-items: center; height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; color: var(--mute); text-decoration: none; transition: color 200ms ease; white-space: nowrap; }
.tabs [aria-selected="true"] { color: var(--ink); }
.tabs .seg-ind { border-radius: 8px; }
.ctabs { display: inline-flex; margin: 0 0 18px; max-width: 100%; }
.ctabs > a { flex: 0 0 auto; }

/* ---------- Chart ---------- */
.chart { position: relative; }
.chart svg.bars { width: 100%; height: auto; overflow: visible; }
.chart .gl { stroke: var(--line-2); }
.chart .ax { font-size: 10.5px; fill: var(--faint); font-family: var(--sans); }
.chart .ax.mid { text-anchor: middle; }
.chart .b { fill: #e9e6df; transform-box: fill-box; transform-origin: bottom; animation: sy 600ms var(--ease-out) both; animation-delay: calc(var(--i) * 30ms); transition: fill 150ms ease; }
.chart .bar.cur .b { fill: var(--accent); }
.chart .bar.hov .b { fill: var(--ink-2); }
.chart .bar.cur.hov .b { fill: var(--accent-ink); }
.chart .hit { fill: transparent; }
.chart .ln { fill: none; stroke: var(--lilac-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1200ms var(--ease-out) 250ms forwards; }
.chart .lp { fill: var(--card); stroke: var(--lilac-ink); stroke-width: 1.6; animation: fade 300ms ease both; animation-delay: calc(400ms + var(--i) * 50ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--mute); margin-top: 6px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg-b { width: 10px; height: 10px; border-radius: 3px; background: #e9e6df; }
.lg-l { width: 14px; height: 2px; border-radius: 2px; background: var(--lilac-ink); }
.lg { width: 10px; height: 10px; border-radius: 3px; }
.tip { position: absolute; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }

/* ---------- Lists ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border: 0; border-radius: 10px; background: transparent; text-align: left; text-decoration: none; color: inherit; transition: background-color 150ms ease; width: calc(100% + 16px); }
@media (hover: hover) and (pointer: fine) { .li:not(.static):hover { background: #f7f5f1; } }
.li + .li { box-shadow: 0 -1px 0 var(--line-2); }
.li-b { flex: 1; min-width: 0; }
.li-b b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-b small { color: var(--mute); font-size: 12.5px; }
.cv { flex: none; width: 34px; height: 34px; border-radius: 9px; }
.date-chip { flex: none; width: 40px; height: 42px; border-radius: 10px; display: grid; place-content: center; text-align: center; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font-size: 10.5px; color: var(--mute); line-height: 1.1; }
.date-chip b { font-size: 16px; color: var(--ink); }
.mini-prog { display: block; width: 72px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; flex: none; }
.mini-prog.wide { width: auto; flex: 1; }
.mini-prog.sc { width: auto; flex: 1; min-width: 40px; height: 4px; }
.mini-prog > span { display: block; height: 100%; border-radius: 99px; background: var(--ink); transform: scaleX(var(--p)); transform-origin: left; transition: transform 500ms var(--ease-out); }
.mini-prog.sc > span { background: var(--sage-ink); }
.enter .mini-prog > span, .ov.open .mini-prog > span { animation: sx 700ms var(--ease-out) 150ms both; }
.bar-cell { display: flex; align-items: center; gap: 10px; }

.agenda { display: grid; gap: 4px; }
.ag-row { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border: 0; border-radius: 10px; background: transparent; text-align: left; transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .ag-row:hover { background: #f7f5f1; } }
.ag-t { width: 42px; font-size: 13px; font-weight: 500; display: grid; flex: none; }
.ag-t small { font-size: 11.5px; color: var(--faint); font-weight: 400; }
.ag-bar { width: 3px; align-self: stretch; border-radius: 3px; flex: none; }
.ag-b { flex: 1; min-width: 0; }
.ag-b b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-b small { display: flex; align-items: center; gap: 4px; color: var(--mute); font-size: 12.5px; }
.ag-b small .ic { width: 13px; height: 13px; }
.p-sky.ag-bar, .lg.p-sky { background: var(--sky-ink); }
.p-accent.ag-bar, .lg.p-accent { background: var(--accent); }
.p-sage.ag-bar, .lg.p-sage { background: var(--sage-ink); }
.p-butter.ag-bar, .lg.p-butter { background: var(--butter-ink); }
.p-lilac.ag-bar, .lg.p-lilac { background: var(--lilac-ink); }
.p-grey.ag-bar, .lg.p-grey { background: var(--faint); }
.pill.live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.tasks li { display: flex; align-items: center; gap: 6px; }
.tasks li .chk { flex: 1; }
.t-del { opacity: 0; transition: opacity 150ms ease, background-color 150ms ease; }
.tasks li:hover .t-del, .t-del:focus-visible { opacity: 1; }
@media (hover: none) { .t-del { opacity: .6; } }
.chk { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; cursor: pointer; }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.box { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 6px; display: grid; place-items: center; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color 150ms ease, box-shadow 150ms ease; }
.box .ic { width: 13px; height: 13px; stroke-width: 2.4; color: #fff; opacity: 0; transform: scale(.6); transition: opacity 150ms ease, transform 200ms var(--ease-out); }
.chk input:checked + .box { background: var(--ink); box-shadow: none; }
.chk input:checked + .box .ic { opacity: 1; transform: none; }
.chk input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.chk input:checked ~ .tt { color: var(--faint); text-decoration: line-through; }
.chk.solo { padding: 0; }
.chk.solo .box { margin: 0; }
.tt { transition: color 200ms ease; }
.toggle-chk { padding: 0 4px; align-items: center; font-size: 13px; color: var(--ink-2); }
.toggle-chk .box { margin: 0; }
.task-add input { width: 100%; height: 36px; margin-top: 8px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); }
.task-add input:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff; }

.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feed li { display: flex; gap: 12px; align-items: flex-start; }
.feed p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); min-width: 0; }
.feed p b { font-weight: 500; color: var(--ink); }
.feed small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.fi { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.fi .ic { width: 15px; height: 15px; }

/* ---------- Covers ---------- */
.g1 { background: linear-gradient(135deg, #ff5a2c, #ff9a6b 55%, #f6d4a8); }
.g2 { background: linear-gradient(135deg, #5a4bb0, #8f7ff0 60%, #d9d2ff); }
.g3 { background: linear-gradient(135deg, #12141a, #3b3550 55%, #ff5a2c); }
.g4 { background: linear-gradient(135deg, #2a5f91, #5fa2d8 60%, #cfe6f7); }
.g5 { background: linear-gradient(135deg, #2f6b4a, #6fb08a 60%, #e0ebe3); }
.g6 { background: linear-gradient(135deg, #8a6a12, #d8b04a 60%, #f6edcc); }
.g7 { background: linear-gradient(135deg, #12141a, #2a5f91 70%, #5fa2d8); }
.g8 { background: linear-gradient(135deg, #a33a28, #e07a63 60%, #f8e1dc); }
.g9 { background: linear-gradient(135deg, #1d3557, #457b9d 60%, #a8dadc); }
.g10 { background: linear-gradient(135deg, #264d3b, #3f8a6a 55%, #c6e5d4); }
.g11 { background: linear-gradient(135deg, #5b3a29, #a0674a 60%, #edd5c5); }
.g12 { background: linear-gradient(135deg, #b8336a, #e46f9a 60%, #f7d6e3); }
.g13 { background: linear-gradient(135deg, #2b2b2b, #6b6b6b 60%, #e0ddd6); }
.g14 { background: linear-gradient(135deg, #3a2fd1, #7a5af8 50%, #ff8a5c); }

/* ---------- Toolbar & inputs ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar.mt { margin-top: 20px; }
.field-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border-radius: 10px; background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--faint); min-width: 240px; flex: 0 1 340px; transition: box-shadow 150ms ease; }
.field-search:focus-within { box-shadow: 0 0 0 1.5px var(--ink); }
.field-search .ic { width: 16px; height: 16px; }
.field-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; color: var(--ink); }
.field-search input::-webkit-search-cancel-button { display: none; }
.fs-x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: var(--line-2); color: var(--mute); flex: none; }
.fs-x .ic { width: 13px; height: 13px; }
.select { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.select select { height: 38px; padding: 0 34px 0 12px; border: 0; border-radius: 10px; background: var(--card); box-shadow: 0 0 0 1px var(--line); appearance: none; -webkit-appearance: none; max-width: 100%; text-overflow: ellipsis; cursor: pointer; }
.select select:focus { outline: 0; box-shadow: 0 0 0 1.5px var(--ink); }
.select .ic { position: absolute; right: 10px; width: 15px; height: 15px; color: var(--mute); pointer-events: none; }
.hint { margin-left: auto; font-size: 12.5px; color: var(--faint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 13px; color: var(--ink-2); transition: background-color 180ms ease, color 180ms ease, box-shadow 150ms ease, transform 160ms var(--ease-out); white-space: nowrap; }
.chip:active { transform: scale(.96); }
.chip .num { color: var(--faint); margin-left: 2px; }
.chip.on { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip.on .num { color: rgba(255,255,255,.55); }
@media (hover: hover) and (pointer: fine) { .chip:not(.on):hover { box-shadow: 0 0 0 1px var(--faint); } }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--mute); padding: 10px 16px; background: #fbfaf8; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-act] { cursor: pointer; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .table tr[data-act]:hover { background: #faf9f6; } }
.table tr.sel { background: var(--accent-soft) !important; }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table th.ck, .table td.ck { width: 44px; padding-right: 0; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; }
.th-sort.on { color: var(--ink); }
.th-sort .ic { width: 13px; height: 13px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { font-weight: 500; }
.who small { display: block; color: var(--mute); font-size: 12px; }
.av.sm { width: 26px; height: 26px; font-size: 10px; }
.av.lg { width: 52px; height: 52px; font-size: 16px; }
.g { font-weight: 500; }
.g.bad { color: var(--rose-ink); }
.g.top { color: var(--sage-ink); }
.warn-t { color: var(--rose-ink); }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; }
.table.mini { font-size: 13px; }
.table.mini th, .table.mini td { padding: 8px 6px; }
.table.mini th { background: transparent; }
.table.plain th { background: transparent; padding: 8px 12px; }
.table.plain td { padding: 10px 12px; }
.pager-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 13px; }

/* ---------- Bulk bar ---------- */
.bulk { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none; transition: transform 260ms var(--ease-out), opacity 200ms ease; max-width: calc(100vw - 24px); }
.bulk.open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bulk > span { font-size: 13.5px; margin-right: 6px; white-space: nowrap; }
.bulk .icon-btn { color: rgba(255,255,255,.7); }
.bulk .icon-btn:hover { background: rgba(255,255,255,.1); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: #f0eee8; border-radius: var(--r); padding: 10px; min-height: 420px; transition: background-color 150ms ease, box-shadow 150ms ease; }
.kcol.over { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.kcol header { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; }
.kcol h3 { margin: 0; font-size: 13.5px; font-weight: 600; flex: 1; }
.kval { padding: 0 4px 10px 20px; font-size: 12px; color: var(--mute); }
.kdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.k-nou { background: var(--faint); } .k-contactat { background: var(--sky-ink); } .k-entrevista { background: var(--butter-ink); } .k-admes { background: var(--lilac-ink); } .k-matriculat { background: var(--sage-ink); }
.kdrop { display: grid; gap: 8px; }
.kcard { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); cursor: grab; transition: box-shadow 200ms ease, opacity 150ms ease; }
@media (hover: hover) and (pointer: fine) { .kcard:hover { box-shadow: 0 0 0 1px var(--faint), var(--shadow); } }
.kcard.dragging { opacity: .4; }
.kcard.landed { animation: land 900ms var(--ease-out); }
@keyframes land { 0% { box-shadow: 0 0 0 2px var(--accent), var(--shadow); } 100% { box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); } }
.kc-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.kc-top > div { min-width: 0; }
.kc-top b { display: block; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-top small { color: var(--mute); font-size: 12px; }
.kc-bot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.kc-bot .muted { font-size: 12px; }
.kc-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--butter); color: var(--butter-ink); font-size: 12.5px; line-height: 1.4; }
.kempty { margin: 0; padding: 24px 8px; border: 1.5px dashed var(--line); border-radius: 12px; text-align: center; color: var(--faint); font-size: 12.5px; }
.stage-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dr-head .stage-chip { padding: 3px 10px; border-radius: 99px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font-size: 12px; }

/* ---------- Courses ---------- */
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.course { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); text-decoration: none; color: inherit; overflow: hidden; transition: transform 300ms var(--ease-out), box-shadow 300ms ease; }
@media (hover: hover) and (pointer: fine) { .course:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line), var(--shadow); } }
.course:active { transform: scale(.99); }
.cover { position: relative; height: 128px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; overflow: hidden; }
.cover::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); box-shadow: 0 0 0 24px rgba(255,255,255,.06), 0 0 0 48px rgba(255,255,255,.04); transition: transform 600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .course:hover .cover::after { transform: scale(1.08) translate(-6px, -4px); } }
.cv-prog { align-self: flex-start; font: 500 11px var(--mono); letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.18); }
.cv-title { position: relative; z-index: 1; font: 400 26px/1.05 var(--serif); font-style: italic; letter-spacing: -.01em; max-width: 90%; }
.course-b { padding: 14px 16px 16px; display: grid; gap: 14px; }
.course-meta { display: flex; gap: 10px; align-items: center; }
.course-meta b { display: block; font-weight: 500; font-size: 13.5px; }
.course-meta small { color: var(--mute); font-size: 12px; }
.course-foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.course-st { display: flex; align-items: center; font-size: 12.5px; }
.course-st .av { margin-right: -6px; }
.course-st .muted { margin-left: 14px; }

.course-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 28px; border-radius: var(--r-lg); color: #fff; overflow: hidden; margin-bottom: 16px; }
.course-head::after { content: ""; position: absolute; right: 10%; top: -80px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); box-shadow: 0 0 0 36px rgba(255,255,255,.05), 0 0 0 72px rgba(255,255,255,.035); pointer-events: none; }
.course-head > * { position: relative; z-index: 1; }
.course-head h1 { margin: 14px 0 0; font: 400 44px/1 var(--serif); font-style: italic; letter-spacing: -.01em; }
.course-head p { margin: 10px 0 0; max-width: 560px; color: rgba(255,255,255,.88); font-size: 14.5px; line-height: 1.5; }
.ch-meta { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 99px; background: rgba(0,0,0,.18); flex: none; }
.ch-meta b { display: block; font-size: 13px; }
.ch-meta small { font-size: 11.5px; opacity: .85; }
.ch-meta .av { box-shadow: none; }

.player-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(135deg, #1d2029, #12141a); display: grid; place-items: center; color: #fff; }
.player::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 70% at 75% 25%, rgba(255,90,44,.45), transparent 60%), radial-gradient(45% 60% at 15% 85%, rgba(90,75,176,.5), transparent 60%); }
.player.playing::before { animation: drift 8s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.15) translate(-4%, 3%); } }
.player.playing .pl-track span { animation: play 30s linear forwards; }
@keyframes play { to { transform: scaleX(1); } }
.player.lectura, .player.tasca, .player.test { background: linear-gradient(135deg, #f1efe9, #e7e4dd); color: var(--ink); }
.player.lectura::before, .player.tasca::before, .player.test::before { background: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; }
.play-big { position: relative; width: 76px; height: 76px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.95); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.3); transition: transform 200ms var(--ease-out); }
.play-big:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .play-big:hover { transform: scale(1.05); } }
.play-big .ic { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.pl-bar { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; align-items: center; gap: 12px; font-size: 12px; }
.pl-track { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.pl-track span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.pl-doc { position: relative; display: grid; justify-items: center; gap: 6px; }
.pl-doc .ic { width: 40px; height: 40px; stroke-width: 1.2; color: var(--accent); }
.pl-doc b { font-size: 18px; }
.pl-doc small { color: var(--mute); }
.live-tag { position: absolute; top: 14px; left: 14px; }
.lesson-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 20px 0 6px; flex-wrap: wrap; }
.lesson-h h2 { margin: 4px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.lesson-body p { font-size: 15px; line-height: 1.65; color: var(--ink-2); max-width: 720px; }
.res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.res-i { display: flex; gap: 10px; align-items: center; padding: 12px; border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line); text-decoration: none; color: inherit; text-align: left; transition: box-shadow 150ms ease, transform 160ms var(--ease-out); }
.res-i:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .res-i:hover { box-shadow: 0 0 0 1px var(--faint), var(--shadow-sm); } }
.res-i .ic { color: var(--accent); }
.res-i b { display: block; font-weight: 500; font-size: 13px; }
.res-i small { color: var(--mute); font-size: 12px; }
.pager { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.outline { position: sticky; top: calc(var(--top-h) + 20px); background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); padding: 14px 8px; max-height: calc(100vh - 100px); overflow-y: auto; }
.ol-h { display: flex; justify-content: space-between; padding: 0 8px 10px; }
.ol-prog { height: 4px; margin: 0 8px 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.ol-prog span { display: block; height: 100%; background: var(--sage-ink); transform: scaleX(var(--p)); transform-origin: left; transition: transform 500ms var(--ease-out); }
.ol-m summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 10px 8px; font-weight: 500; cursor: pointer; border-radius: 8px; transition: background-color 150ms ease; }
.ol-m summary > span:nth-child(2) { flex: 1; }
.ol-m summary::-webkit-details-marker { display: none; }
.ol-ch { width: 15px; height: 15px; color: var(--faint); transition: transform 220ms var(--ease-in-out); }
.ol-m[open] .ol-ch { transform: rotate(180deg); }
.ol-m[open] .ol-ls { animation: up 240ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ol-m summary:hover, .ol-l:hover { background: #f7f5f1; } }
.ol-l { display: flex; gap: 10px; align-items: flex-start; padding: 8px 8px 8px 12px; margin-left: 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 13px; transition: background-color 150ms ease; }
.ol-l.on { background: var(--accent-soft) !important; color: var(--ink); font-weight: 500; }
.ol-l small { display: block; font-size: 11.5px; color: var(--mute); font-weight: 400; margin-top: 1px; }
.ol-ck { flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center; transition: background-color 200ms ease, box-shadow 200ms ease; }
.ol-l.on .ol-ck { box-shadow: inset 0 0 0 4.5px var(--accent); }
.ol-l.done .ol-ck { background: var(--sage-ink); box-shadow: none; color: #fff; }
.ol-ck .ic { width: 11px; height: 11px; stroke-width: 2.6; }

.ann-wrap { display: grid; gap: 14px; max-width: 760px; }
.ann-form { display: grid; gap: 10px; }
.ann-form .card-h { margin-bottom: 4px; }
.ann-form input, .ann-form textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); resize: vertical; }
.ann-form input:focus, .ann-form textarea:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff; }
.ann-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-foot .chk { font-size: 13px; color: var(--ink-2); }
.ann-list { display: grid; gap: 12px; }
.ann-h { display: flex; gap: 12px; align-items: center; }
.ann-h > div { flex: 1; min-width: 0; }
.ann-h b { display: block; font-weight: 600; }
.ann-h small { font-size: 12.5px; }
.ann p { margin: 12px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

.resume { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 28px; border-radius: var(--r-lg); color: #fff; text-decoration: none; overflow: hidden; min-height: 220px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .resume:hover { transform: translateY(-2px); } }
.resume::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); box-shadow: 0 0 0 30px rgba(255,255,255,.05); }
.resume-in { position: relative; z-index: 1; min-width: 0; }
.resume small { font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.resume h2 { margin: 10px 0 0; font: 400 34px/1.05 var(--serif); font-style: italic; }
.resume p { margin: 8px 0 18px; opacity: .88; }
.resume .btn .ic { fill: currentColor; }
.resume-ring { --p: 50; position: relative; z-index: 1; flex: none; width: 116px; height: 116px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.25) 0); }
.resume-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: rgba(18,20,26,.35); }
.resume-ring span, .resume-ring small { position: relative; }
.resume-ring span { font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.resume-ring small { font-size: 11px; text-transform: none; letter-spacing: 0; font-family: var(--sans); }

/* ---------- Calendar ---------- */
.cal-scroll { overflow: auto; max-height: calc(100vh - 240px); }
.cal { min-width: 720px; }
.cal.one { min-width: 0; }
.cal-hd { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); background: #fbfaf8; border-bottom: 1px solid var(--line); }
.cal-hd div { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line-2); }
.cal-hd small { color: var(--mute); text-transform: capitalize; }
.cal-hd b { font-size: 18px; font-weight: 600; }
.cal-hd .today b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; }
.cal-body { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); }
.cal-times span { display: block; height: var(--px); padding: 0 8px; text-align: right; font-size: 11px; color: var(--faint); transform: translateY(-7px); }
.cal-times span:first-child { visibility: hidden; }
.cal-day { position: relative; height: calc(var(--rows) * var(--px)); border-left: 1px solid var(--line-2); background-image: linear-gradient(var(--line-2) 1px, transparent 1px); background-size: 100% var(--px); cursor: copy; }
.cal-day.today { background-color: #fffaf7; }
.ev { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 0; border-radius: 8px; text-align: left; overflow: hidden; font-size: 12px; border-left: 3px solid; cursor: pointer; transition: box-shadow 150ms ease, transform 160ms var(--ease-out); }
.enter .ev { animation: up 300ms var(--ease-out) both; animation-delay: calc(150ms + var(--i, 0) * 30ms); }
.ev:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .ev:hover { box-shadow: var(--shadow); z-index: 2; } }
.ev b { font-weight: 600; font-size: 12.5px; line-height: 1.25; }
.ev small { opacity: .85; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.p-sky { border-color: var(--sky-ink); } .ev.p-accent { border-color: var(--accent); } .ev.p-sage { border-color: var(--sage-ink); } .ev.p-butter { border-color: var(--butter-ink); } .ev.p-lilac { border-color: var(--lilac-ink); } .ev.p-grey { border-color: var(--faint); }
.now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--accent); z-index: 2; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.cal-legend { margin-top: 12px; }
.day-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.day-chips button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0; border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line); transition: background-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out); }
.day-chips button:active { transform: scale(.96); }
.day-chips small { font-size: 11px; color: var(--mute); text-transform: capitalize; }
.day-chips b { font-size: 17px; }
.day-chips i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.day-chips .today b { color: var(--accent); }
.day-chips .on { background: var(--ink); color: var(--paper); box-shadow: none; }
.day-chips .on small { color: rgba(255,255,255,.6); }
.day-chips .on.today b { color: #fff; }

/* ---------- Gradebook ---------- */
.gb th small { display: block; font-size: 11px; color: var(--faint); font-weight: 400; }
.gin { width: 64px; height: 32px; text-align: center; border: 0; border-radius: 8px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 500; transition: box-shadow 150ms ease, background-color 300ms ease; }
.gin:hover { box-shadow: inset 0 0 0 1px var(--line); }
.gin:focus { outline: 0; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.gin.bad { color: var(--rose-ink); }
.gin.err { box-shadow: inset 0 0 0 1.5px var(--rose-ink); background: var(--rose); }
.gin.saved { box-shadow: inset 0 0 0 1.5px var(--sage-ink); background: var(--sage); }
.gin::placeholder { color: var(--faint); }
.fin { font-size: 15px; }
.gb-side { display: grid; gap: 16px; position: sticky; top: calc(var(--top-h) + 20px); }
.big { display: block; font-size: 40px; font-weight: 600; letter-spacing: -.04em; margin: 4px 0; }
.histo { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; align-items: end; height: 120px; }
.histo div { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; }
.histo span { align-self: end; height: 100%; border-radius: 4px 4px 2px 2px; background: var(--ink); transform: scaleY(var(--h)); transform-origin: bottom; transition: transform 400ms var(--ease-out); }
.histo span.f { background: var(--rose-ink); }
.enter .histo span { animation: sy 600ms var(--ease-out) both; animation-delay: calc(200ms + var(--i) * 30ms); }
.histo small { font-size: 10.5px; color: var(--faint); text-align: center; }

.grade-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.gc-t { display: flex; gap: 12px; align-items: center; min-width: 0; }
.gc-t small { font-size: 12.5px; }
.gc-final { text-align: right; flex: none; }
.gc-final small { display: block; font-size: 11.5px; color: var(--mute); }
.gc-final b { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.gc-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gc-items > div { padding: 10px; border-radius: 10px; background: var(--paper); }
.gc-items small { display: block; font-size: 11.5px; color: var(--mute); }
.gc-items b { display: block; margin: 4px 0 8px; font-size: 17px; font-weight: 600; }
.gc-items .pend b { font-size: 13px; color: var(--faint); font-weight: 500; margin: 7px 0 11px; }
.gbar { display: block; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.gbar span { display: block; height: 100%; background: var(--ink); transform: scaleX(var(--p)); transform-origin: left; }
.enter .gbar span { animation: sx 700ms var(--ease-out) 200ms both; }

/* ---------- Finances ---------- */
.mbars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; height: 200px; }
.mbars > div { display: grid; grid-template-rows: auto 1fr auto; height: 100%; gap: 6px; text-align: center; }
.mbars b { font-size: 12px; font-weight: 500; color: var(--mute); }
.mbars span { align-self: end; height: 100%; border-radius: 8px 8px 3px 3px; background: #e9e6df; transform: scaleY(var(--h)); transform-origin: bottom; }
.mbars .cur span { background: var(--accent); }
.mbars .cur b { color: var(--ink); }
.enter .mbars span { animation: sy 650ms var(--ease-out) both; animation-delay: calc(150ms + var(--i) * 40ms); }
.mbars small { font-size: 12px; color: var(--faint); }
.pay-sum strong { display: block; margin-top: 6px; font-size: 34px; font-weight: 600; letter-spacing: -.035em; }
.pay-bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 16px 0 20px; }
.pay-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sage-ink), #5aa57c); transform: scaleX(var(--p)); transform-origin: left; transition: transform 600ms var(--ease-out); }
.enter .pay-bar span, .ov.open .pay-bar span { animation: sx 800ms var(--ease-out) 200ms both; }
.pay-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.pay-mini b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.next-pay { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); flex-wrap: wrap; }
.next-pay small { display: block; font-size: 12px; }
.next-pay b { display: block; font-weight: 600; margin: 2px 0; }
.timeline { display: grid; }
.tl { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.tl + .tl::before { content: ""; position: absolute; left: 10px; top: -12px; height: 24px; width: 2px; background: var(--line); }
.tl.pagada + .tl::before { background: var(--sage-ink); }
.tl-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line); background: var(--card); z-index: 1; }
.tl.pagada .tl-dot { background: var(--sage-ink); box-shadow: none; color: #fff; }
.tl.pagada + .tl:not(.pagada) .tl-dot { box-shadow: inset 0 0 0 6px var(--accent); }
.tl-dot .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.tl-b { flex: 1; min-width: 0; }
.tl-b b { display: block; font-weight: 500; }
.tl-b small { color: var(--mute); font-size: 12.5px; }

/* ---------- Analytics ---------- */
.afun { display: grid; gap: 10px; }
.af-row { display: grid; grid-template-columns: 96px 1fr 44px; gap: 12px; align-items: center; font-size: 13px; }
.af-bar { position: relative; height: 34px; border-radius: 8px; background: var(--paper); overflow: hidden; display: flex; align-items: center; }
.af-bar > span { position: absolute; inset: 0; border-radius: 8px; background: #e9e6df; transform: scaleX(var(--w)); transform-origin: left; }
.af-bar > span.hi { background: var(--accent); }
.af-bar > b { position: relative; padding-left: 12px; font-weight: 600; }
.enter .af-bar > span { animation: sx 700ms var(--ease-out) both; animation-delay: calc(150ms + var(--i) * 60ms); }
.af-p { text-align: right; }
.donut { position: relative; width: 160px; margin: 0 auto 14px; }
.donut svg circle { animation: fade 400ms ease both; animation-delay: calc(150ms + var(--i) * 70ms); }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c b { font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.donut-c small { font-size: 12px; color: var(--mute); }
.dl { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; }
.dl li { display: flex; align-items: center; gap: 8px; }
.dl i { width: 10px; height: 10px; border-radius: 3px; }
.dl b { margin-left: auto; font-weight: 500; }
.hbar { display: block; width: 120px; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hbar span { display: block; height: 100%; background: var(--ink); border-radius: 99px; transform: scaleX(var(--p)); transform-origin: left; }
.enter .hbar span { animation: sx 700ms var(--ease-out) 200ms both; }
.heat { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 12.5px; }
.heat th { font-weight: 500; color: var(--mute); text-align: left; white-space: nowrap; padding-right: 6px; }
.heat thead th { text-align: center; font-size: 11.5px; }
.heat td { height: 38px; min-width: 44px; border-radius: 8px; text-align: center; background: rgba(47, 107, 74, var(--a)); color: var(--sage-ink); font-weight: 500; }
.enter .heat td { animation: fade 400ms ease both; animation-delay: calc(200ms + var(--i, 0) * 30ms); }
.heat td.lt { color: #fff; }
.heat td:empty { background: repeating-linear-gradient(135deg, var(--line-2) 0 4px, transparent 4px 8px); }
.risk { width: 64px; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; flex: none; }
.risk span { display: block; height: 100%; background: var(--butter-ink); transform: scaleX(var(--p)); transform-origin: left; }
.risk.hi span { background: var(--rose-ink); }

/* ---------- Inbox ---------- */
.v-missatges { padding: 0; max-width: none; }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); }
.threads { border-right: 1px solid var(--line); overflow-y: auto; background: #fcfbf8; }
.th-h { display: flex; justify-content: space-between; align-items: center; padding: 20px 16px 10px 20px; }
.th-h h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.th-search { padding: 0 16px 12px 20px; }
.th-search .field-search { min-width: 0; width: 100%; }
.thread { position: relative; display: flex; gap: 12px; padding: 12px 16px 12px 20px; text-decoration: none; color: inherit; border-top: 1px solid var(--line-2); transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .thread:hover { background: #f5f3ee; } }
.thread.on { background: var(--card); box-shadow: inset 3px 0 0 var(--accent); }
.thread.is-unread .th-s { color: var(--ink); font-weight: 500; }
.th-b { flex: 1; min-width: 0; display: grid; gap: 1px; }
.th-r { display: flex; justify-content: space-between; gap: 8px; }
.th-r b { font-weight: 600; font-size: 13.5px; }
.th-r small { font-size: 12px; flex: none; }
.th-s { font-size: 13px; color: var(--ink-2); }
.th-p { font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { position: absolute; right: 16px; bottom: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.av.grp { background: var(--ink); color: #fff; }
.av.grp .ic { width: 15px; height: 15px; }
.conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.empty-conv { display: grid; place-items: center; }
.conv-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 24px; border-bottom: 1px solid var(--line); background: var(--card); }
.conv-who { flex: 1; min-width: 0; }
.conv-h b { display: block; font-weight: 600; }
.conv-h small { font-size: 12.5px; }
.msgs { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.msg-day { align-self: center; font-size: 12px; color: var(--mute); padding: 4px 12px; border-radius: 99px; background: var(--line-2); margin-bottom: 6px; }
.msg { max-width: min(560px, 82%); display: grid; gap: 4px; }
.msg:last-child { animation: up 260ms var(--ease-out); }
.msg p { margin: 0; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; justify-items: end; }
.msg.me p { border-radius: 16px 16px 4px 16px; background: var(--ink); color: var(--paper); box-shadow: none; }
.msg small { font-size: 11.5px; padding: 0 4px; }
.who-s { color: var(--accent-ink); font-weight: 500; }
.typing p { display: flex; gap: 4px; padding: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; transform: translateY(-2px); } }
.quick { display: flex; gap: 6px; padding: 0 24px 8px; overflow-x: auto; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { height: 28px; font-size: 12.5px; }
.composer { display: flex; gap: 8px; padding: 6px 24px 18px; background: var(--paper); }
.composer input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.composer input:focus { outline: 0; box-shadow: 0 0 0 1.5px var(--ink); }
.composer .btn { height: 44px; width: 44px; border-radius: 12px; }

/* ---------- Documents & settings ---------- */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.doc-tpl { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; }
.doc-tpl b { display: block; font-weight: 600; }
.doc-tpl small { font-size: 12.5px; }
.doc-acts { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.doc-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--paper); color: var(--accent); flex: none; }
.doc-list { display: grid; }
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.doc:last-child { border: 0; }
.doc-b { flex: 1; min-width: 0; }
.doc-b b { display: block; font-weight: 500; }
.doc-b small { font-size: 12.5px; }
.doc.pending .doc-ic { color: var(--butter-ink); background: var(--butter); }
.doc-paper { margin-top: 16px; padding: 28px; border-radius: 6px; background: #fffdf8; box-shadow: 0 0 0 1px var(--line), var(--shadow); text-align: center; }
.doc-paper small { display: block; margin-top: 12px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.doc-paper h3 { margin: 8px 0 14px; font: 400 30px/1.1 var(--serif); }
.doc-paper p { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.doc-paper .key { margin: 0 auto; }
.doc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.seal { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.settings { display: grid; gap: 16px; max-width: 900px; }
.set { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.set-l h3 { margin: 0; font-size: 15px; font-weight: 600; }
.set-l p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.set-r { display: grid; gap: 16px; align-content: start; }
.lbl { display: grid; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.inp { height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 400; }
.inp:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff; }
.swatches { display: flex; gap: 10px; }
.sw { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 0 var(--card), 0 0 0 0 var(--c); transition: box-shadow 200ms var(--ease-out), transform 160ms var(--ease-out); }
.sw:active { transform: scale(.92); }
.sw.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input { flex: 1; accent-color: var(--accent); }
.range-row b { font-size: 18px; width: 48px; text-align: right; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px 0; cursor: pointer; }
.switch-row b { display: block; font-weight: 500; }
.switch-row small { font-size: 12.5px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background-color 200ms ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 220ms var(--ease-in-out); }
.switch:checked { background: var(--sage-ink); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-r.integ { grid-template-columns: 1fr 1fr; gap: 10px; }
.int-i { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--paper); }
.int-i b { font-weight: 500; font-size: 13px; }
.sc-list { display: grid; margin-top: 12px; }
.sc-list > div { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.sc-list > div:last-child { border: 0; }

/* ---------- Quiz, submission, roll ---------- */
.quiz { margin: 18px 0; padding: 20px; border-radius: var(--r); background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); display: grid; gap: 18px; justify-items: start; }
.quiz-h { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.quiz-h b { display: block; font-size: 15px; }
.quiz-h small { font-size: 12.5px; }
.qq { border: 0; padding: 0; margin: 0; width: 100%; display: grid; gap: 6px; min-width: 0; }
.qq legend { font-weight: 500; font-size: 14.5px; margin-bottom: 8px; padding: 0; }
.qq legend .num { color: var(--mute); }
.qo { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; font-size: 14px; transition: box-shadow 150ms ease, background-color 150ms ease; }
.qo input { position: absolute; opacity: 0; }
.qr { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); transition: box-shadow 180ms var(--ease-out); }
.qo input:checked + .qr { box-shadow: inset 0 0 0 5px var(--ink); }
.qo:has(input:checked) { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.qo input:focus-visible + .qr { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz .qo.right { background: var(--sage); box-shadow: inset 0 0 0 1.5px var(--sage-ink); color: var(--sage-ink); }
.quiz .qo.right .qr { box-shadow: inset 0 0 0 5px var(--sage-ink); }
.quiz .qo.wrong { background: var(--rose); box-shadow: inset 0 0 0 1.5px var(--rose-ink); color: var(--rose-ink); }
.quiz .qo.wrong .qr { box-shadow: inset 0 0 0 5px var(--rose-ink); }
.qo:has(input:disabled) { cursor: default; }
@media (hover: hover) and (pointer: fine) { .qo:hover { box-shadow: inset 0 0 0 1px var(--faint); } }
.sub { display: flex; align-items: center; gap: 14px; margin: 18px 0; padding: 18px; border-radius: var(--r); background: var(--card); box-shadow: 0 0 0 1px var(--line); flex-wrap: wrap; }
.sub.drop { border: 1.5px dashed var(--line); box-shadow: none; background: #fcfbf9; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease; }
.sub.drop:hover, .sub.drop.over { background: var(--accent-soft); border-color: var(--accent); }
.sub-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--paper); color: var(--accent); flex: none; }
.sub-b { flex: 1; min-width: 180px; }
.sub-b b { display: block; font-weight: 600; }
.sub-b small { font-size: 12.5px; }
.sub.done { animation: up 300ms var(--ease-out); }
.sub.done .sub-ic { background: var(--sage); color: var(--sage-ink); }
.roll-cta { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 18px; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: box-shadow 150ms ease; }
.roll-cta:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.roll-cta > span { flex: 1; }
.roll-cta b { display: block; font-weight: 600; }
.roll-cta small { font-size: 12.5px; }
.roll-cta > .ic:first-child { color: var(--accent); }
.roll-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.rs { padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }
.rs b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.rs.k-p { background: var(--sage); color: var(--sage-ink); }
.rs.k-r { background: var(--butter); color: var(--butter-ink); }
.rs.k-a { background: var(--rose); color: var(--rose-ink); }
.roll { display: grid; max-height: 46vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.roll-r { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.roll-r b { flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg3 { display: flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--line-2); flex: none; }
.seg3 button { height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; font-size: 12px; color: var(--mute); transition: background-color 180ms ease, color 180ms ease; }
.seg3 .k-p[aria-checked="true"] { background: var(--sage-ink); color: #fff; }
.seg3 .k-r[aria-checked="true"] { background: var(--butter-ink); color: #fff; }
.seg3 .k-a[aria-checked="true"] { background: var(--rose-ink); color: #fff; }

/* ---------- Layers ---------- */
.ov { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(18,20,26,.32); opacity: 0; transition: opacity 220ms var(--ease-out); }
.ov.open { opacity: 1; }
.ov.closing { opacity: 0; transition-duration: 160ms; pointer-events: none; }
.modal-box { width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--card); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg); outline: none; transform: translateY(8px) scale(.97); transition: transform 220ms var(--ease-out); }
.ov.wide .modal-box { max-width: 580px; }
.ov.open .modal-box, .ov.open .pal-box, .ov.open .np-box { transform: none; }
.ov.closing .modal-box, .ov.closing .pal-box, .ov.closing .np-box { transform: scale(.98); transition-duration: 160ms; }
.modal-box h2 { margin: 12px 0 4px; font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.m-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.m-head h2 { margin: 0; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 16px 0 0; font-size: 13.5px; }
.kv dt { color: var(--mute); display: flex; align-items: center; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stage-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-pick.col { flex-direction: column; margin-top: 14px; }
.stage-pick button { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font-size: 13px; transition: background-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out); }
.stage-pick.col button { height: 44px; border-radius: 12px; font-size: 14px; }
.stage-pick.col .ic { color: var(--accent); }
.stage-pick button:active { transform: scale(.97); }
.stage-pick button.on { background: var(--ink); color: #fff; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .stage-pick button:not(.on):hover { box-shadow: 0 0 0 1px var(--faint); } }

.form { display: grid; gap: 14px; margin-top: 16px; }
.form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); min-width: 0; }
.form input, .form textarea, .form select { width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-weight: 400; font-size: 14px; }
.form select { appearance: none; -webkit-appearance: none; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6.5l3.5 3.5 3.5-3.5' fill='none' stroke='%236b7180' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center/14px no-repeat; padding-right: 32px; }
.form textarea { height: auto; padding: 10px 12px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--ink); background-color: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.form .m-foot { margin-top: 6px; }

.checkout-amt { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--paper); }
.checkout-amt small { display: block; font-size: 12px; }
.checkout-amt strong { font-size: 32px; font-weight: 600; letter-spacing: -.035em; }
.pay-methods { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; }
.pay-methods button { height: 36px; font-size: 13.5px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: rot .7s linear infinite; flex: none; }
.spin.dark { border-color: var(--line); border-top-color: var(--ink-2); }
@keyframes rot { to { transform: rotate(360deg); } }
.paid-ok { text-align: center; padding: 20px 0 6px; }
.paid-ok p { margin: 6px 0 20px; }
.big-check { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--sage); color: var(--sage-ink); animation: pop 420ms var(--ease-out); }
.big-check .ic { width: 30px; height: 30px; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.welcome { text-align: center; padding: 10px 4px 0; }
.welcome .key { margin: 0 auto; min-width: 48px; height: 40px; font-size: 15px; }
.welcome h2 { margin: 20px 0 8px; font-size: 24px; letter-spacing: -.035em; }
.welcome > p { margin: 0 auto; max-width: 380px; color: var(--ink-2); line-height: 1.55; }
.roles { display: grid; gap: 8px; margin: 22px 0 14px; }
.roles button { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: box-shadow 150ms ease, transform 160ms var(--ease-out), background-color 150ms ease; }
.roles button:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .roles button:hover { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); } .roles button:hover .rl-go { transform: translateX(3px); color: var(--ink); } }
.rl-ic { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.rl-ic .ic { width: 22px; height: 22px; }
.rl-go { grid-row: 1 / span 2; grid-column: 3; transition: transform 200ms var(--ease-out), color 150ms ease; }
.roles b { font-size: 15px; font-weight: 600; align-self: end; }
.roles small { color: var(--mute); font-size: 12.5px; align-self: start; }
.ov:has(.welcome) .modal-box { max-width: 440px; padding: 28px; }

.ov-drawer { place-items: stretch end; padding: 0; }
.drawer-box { position: relative; width: min(520px, 100vw); height: 100%; overflow-y: auto; background: var(--card); padding: 28px; box-shadow: var(--shadow-lg); outline: none; transform: translateX(100%); transition: transform 320ms var(--ease-out); }
.ov.open .drawer-box { transform: none; }
.ov.closing .drawer-box { transform: translateX(100%); transition-duration: 200ms; }
.dr-x { position: absolute; top: 16px; right: 16px; }
.dr-head { display: flex; gap: 16px; align-items: center; padding-right: 32px; }
.dr-head > div { min-width: 0; }
.dr-head h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.dr-head p { margin: 2px 0 8px; color: var(--mute); font-size: 13.5px; }
.dr-actions { display: flex; gap: 8px; margin: 20px 0 4px; flex-wrap: wrap; }
.dr-body { animation: fade 200ms ease; }
.dr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dr-stats div { padding: 12px; border-radius: 12px; background: var(--paper); }
.dr-stats small { display: block; color: var(--mute); font-size: 12px; }
.dr-stats b { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.dr-sec { margin-top: 24px; }
.dr-sec h4 { margin: 0 0 10px; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); font-family: var(--mono); }
.dr-sec .kv { margin-top: 0; }
.note-form { display: grid; gap: 8px; justify-items: end; }
.note-form textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); resize: vertical; }
.note-form textarea:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff; }
.timeline-v { list-style: none; padding: 0; margin: 0; display: grid; }
.timeline-v li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.timeline-v li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 1.5px; background: var(--line); }
.tv-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); color: var(--mute); }
.tv-ic .ic { width: 14px; height: 14px; }
.timeline-v p { margin: 4px 0 0; font-size: 13.5px; }
.timeline-v small { font-size: 12px; }

.ov-pal { place-items: start center; padding-top: 12vh; }
.pal-box { width: 100%; max-width: 600px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); overflow: hidden; outline: none; transform: translateY(-6px) scale(.98); transition: transform 200ms var(--ease-out); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--mute); }
.pal-in input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.pal-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.pal-g { padding: 10px 10px 4px; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.pal-i { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14px; }
.pal-i span:first-of-type { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-i .ic { color: var(--mute); }
.pal-i.on { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.pal-i.on .ic { color: var(--accent); }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: #fbfaf8; font-size: 12px; color: var(--mute); }
.pal-foot > span { display: flex; align-items: center; gap: 4px; }

.ov-np { place-items: start end; padding: calc(var(--top-h) + 4px) 20px; background: transparent; }
.np-box { width: min(380px, 100%); background: var(--card); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), var(--shadow-lg); overflow: hidden; outline: none; transform: translateY(-6px) scale(.98); transform-origin: top right; transition: transform 200ms var(--ease-out); }
.np-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.np-list { padding: 6px; display: grid; }
.np-i { position: relative; display: flex; gap: 12px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; transition: background-color 120ms ease; }
.np-i:hover { background: var(--paper); }
.np-i b { color: var(--ink); font-weight: 500; }
.np-i small { display: block; font-size: 12px; margin-top: 2px; }
.np-i.new::after { content: ""; position: absolute; right: 12px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.np-i.new .np-t { padding-right: 16px; display: block; }

.toasts { position: fixed; bottom: 20px; left: 50%; z-index: 200; display: grid; gap: 8px; justify-items: center; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; min-height: 44px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 13.5px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px) scale(.96); transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); pointer-events: auto; }
.toast > span { padding-right: 6px; }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(6px) scale(.98); transition-duration: 160ms; }
.toast .ic { color: var(--accent); width: 16px; height: 16px; }
.toast-a { flex: none; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; font-size: 12.5px; font-weight: 500; transition: background-color 150ms ease; }
.toast-a:hover { background: rgba(255,255,255,.2); }

.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-wrap { grid-template-columns: minmax(0, 1fr) 300px; }
  .search { width: 260px; }
  .g-gb { grid-template-columns: minmax(0, 1fr) 220px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; z-index: 90; transform: translateX(-100%); transition: transform 300ms var(--ease-out); box-shadow: var(--shadow-lg); }
  .side-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(18,20,26,.3); opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease-out); }
  .side-open .scrim { opacity: 1; pointer-events: auto; }
  .only-m { display: grid !important; }
  .top { padding: 0 16px; }
  .me-txt { display: none; }
  .search { width: auto; flex: 0 1 260px; }
  .g-2-1, .g-1-2, .g-2, .g-gb { grid-template-columns: minmax(0, 1fr); }
  .gb-side { position: static; grid-template-columns: 1fr 1fr; }
  .player-wrap { grid-template-columns: minmax(0, 1fr); }
  .outline { position: static; max-height: none; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-t .threads { display: none; }
  .inbox:not(.has-t) .conv { display: none; }
  .set { grid-template-columns: 1fr; gap: 14px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.92); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; border-radius: 10px; background: transparent; color: var(--mute); text-decoration: none; font-size: 10.5px; font-weight: 500; transition: color 150ms ease, transform 160ms var(--ease-out); }
  .tabbar a:active, .tabbar button:active { transform: scale(.94); }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on .ic { color: var(--accent); }
  .tb-dot { position: absolute; top: 4px; left: calc(50% + 8px); width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bulk { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .inbox { height: calc(100dvh - var(--top-h) - 64px - env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .view { padding: 18px 16px 28px; }
  .v-head { margin-bottom: 16px; align-items: flex-start; }
  .v-head h1 { font-size: 23px; }
  .v-actions { width: 100%; }
  .v-actions > .btn { flex: 1; }
  .v-actions .btn-group { flex: none; }
  .search-txt, .search .kbd { display: none; }
  .search { flex: none; width: 36px; padding: 0; justify-content: center; margin-left: auto; }
  .crumbs { font-size: 15px; font-weight: 600; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; min-height: 90px; }
  .kpi strong { font-size: 21px; }
  .kpi-top { flex-direction: column; align-items: flex-start; gap: 2px; }
  .spark { display: none; }
  .g-3 { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 12px; margin-top: 12px; }
  .field-search { min-width: 0; flex: 1 1 100%; }
  .toolbar .select { flex: 1 1 auto; }
  .toolbar .select select { width: 100%; }
  .hint, .hide-m { display: none !important; }
  .kanban { grid-template-columns: repeat(5, 84vw); scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 16px; }
  .kcol { scroll-snap-align: start; min-height: 300px; }
  .course-head { flex-direction: column; align-items: flex-start; padding: 22px; }
  .course-head h1 { font-size: 34px; }
  .ctabs { display: flex; }
  .res { grid-template-columns: minmax(0, 1fr); }
  .resume { flex-direction: column; align-items: flex-start; min-height: 0; padding: 22px; }
  .resume-ring { position: absolute; right: 18px; top: 18px; width: 70px; height: 70px; }
  .resume-ring span { font-size: 17px; }
  .resume-ring small { display: none; }
  .resume h2 { font-size: 27px; padding-right: 76px; }
  .gc-items { grid-template-columns: 1fr 1fr; }
  .grade-cards { grid-template-columns: minmax(0, 1fr); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .msgs { padding: 16px; }
  .quick { padding: 0 16px 8px; }
  .composer { padding: 6px 16px 12px; }
  .conv-h { padding: 10px 12px; }
  .seg3 button { padding: 0 6px; font-size: 11.5px; }
  .roll-r .av { display: none; }
  .af-row { grid-template-columns: 76px 1fr 36px; }
  .cal-scroll { max-height: none; }
  .mbars { height: 160px; gap: 8px; }
  .gb-side { grid-template-columns: 1fr; }
  .set-r.integ { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); }
  .doc { padding: 12px 14px; }
  .doc .btn span { display: none; }
  .pager-bar { padding: 10px 14px; }

  /* Tables become cards */
  .table.resp thead { display: none; }
  .table.resp, .table.resp tbody { display: block; }
  .table.resp tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); position: relative; }
  .table.resp tbody tr:last-child { border-bottom: 0; }
  .table.resp td { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; border: 0; white-space: normal; min-width: 0; text-align: left; }
  .table.resp td[data-l]::before { content: attr(data-l); font-size: 11px; color: var(--faint); font-weight: 500; }
  .table.resp td.who-td, .table.resp td.acts-td { grid-column: 1 / -1; }
  .table.resp td.ck { position: absolute; top: 18px; right: 16px; width: auto; }
  .table.resp td.ck:empty { display: none; }
  .table.resp.sel-table td.who-td { padding-right: 32px; }
  .table.resp td.r { text-align: left; }
  .table.resp td.acts-td .row-acts { width: 100%; }
  .table.resp td.acts-td .row-acts .btn { flex: 1; height: 34px; }
  .table.resp .bar-cell { width: 100%; }
  .table.resp .bar-cell .mini-prog { width: 56px; flex: 1; }

  /* Sheets on mobile */
  .ov-modal { place-items: end stretch; padding: 0; }
  .modal-box { max-width: none !important; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; transform: translateY(100%); transition: transform 320ms var(--ease-out); }
  .modal-box::before { content: ""; display: block; width: 36px; height: 4px; margin: -8px auto 12px; border-radius: 99px; background: var(--line); }
  .ov.closing .modal-box { transform: translateY(100%); transition-duration: 200ms; }
  .ov-drawer { place-items: end stretch; }
  .drawer-box { width: 100%; height: auto; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(100%); }
  .drawer-box::before { content: ""; display: block; width: 36px; height: 4px; margin: -10px auto 14px; border-radius: 99px; background: var(--line); }
  .ov.closing .drawer-box { transform: translateY(100%); }
  .ov-pal { padding: 10px; place-items: start stretch; }
  .pal-list { max-height: 55dvh; }
  .pal-foot { display: none; }
  .ov-np { padding: calc(var(--top-h) + 4px) 10px; place-items: start stretch; }
  .np-box { width: 100%; }
  .bulk { left: 12px; right: 12px; transform: translateY(calc(100% + 120px)); justify-content: space-between; }
  .bulk.open { transform: none; }
  .bulk .btn span { display: none; }
  .toast { font-size: 13px; }
}
