/* ==========================================================================
   Public dashboard styles
   ========================================================================== */

/* ---- shell ---------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  padding: 24px 18px; border-right: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 70%, transparent), transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 24px;
  box-shadow: var(--glow);
}
.brand-mark svg { stroke-width: 2.2; }
.brand-text { display: grid; min-width: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: grid; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px;
  color: var(--muted); font-weight: 500; transition: color .2s, background .2s;
}
.nav a svg { font-size: 20px; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.nav a.active::before {
  content: ''; position: absolute; left: -18px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent);
}
.nav a.active svg { color: var(--accent-2); }

.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.sem-mini { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 10px; }
.sem-mini-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.sem-mini-top b { color: var(--text); font-family: var(--font-mono); }
.foot-actions { display: flex; gap: 8px; }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .i-sun { display: none; }
  :root:not([data-theme="dark"]) .i-moon { display: block; }
}

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.eyebrow { color: var(--accent-2); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.topbar h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.chip-week { height: 40px; padding: 0 14px; font-size: 13px; }
.chip-week b { color: var(--text); font-family: var(--font-mono); }
.clock {
  display: grid; justify-items: end; padding: 6px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.clock span { font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.clock small { color: var(--muted); font-size: 11.5px; }

.view { outline: none; animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

/* ---- dashboard grid --------------------------------------------------------- */
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

/* hero: current / next class */
.hero {
  --c: var(--accent);
  overflow: hidden; padding: 28px; min-height: 260px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) 30%, transparent) 0%, transparent 55%),
    radial-gradient(100% 120% at 100% 100%, color-mix(in srgb, var(--accent-2) 16%, transparent) 0%, transparent 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--c) 35%, var(--border));
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .06) 50%, transparent 60%);
  background-size: 250% 100%; animation: sheen 7s linear infinite;
}
@keyframes sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 60%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.hero-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 70%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.hero h2 { font-size: clamp(26px, 3.6vw, 44px); font-weight: 700; margin: 14px 0 4px; }
.hero .code { font-family: var(--font-mono); color: color-mix(in srgb, var(--c) 60%, var(--text)); font-size: 14px; font-weight: 700; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-meta .chip { height: 32px; padding: 0 12px; font-size: 13px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.hero-progress { margin-top: 22px; display: grid; gap: 8px; max-width: 520px; }
.hero-progress .bar { height: 8px; }
.hero-progress .bar i { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 40%, var(--accent-2))); box-shadow: 0 0 18px var(--c); }
.hero-progress-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.hero-progress-row b { color: var(--text); font-family: var(--font-mono); }

/* countdown ring */
.ring { position: relative; width: 196px; height: 196px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--surface-2); }
.ring .prog { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 70%, transparent)); }
.ring-inner { display: grid; justify-items: center; gap: 2px; text-align: center; }
.ring-inner small { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.ring-inner .count { font-family: var(--font-mono); font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.ring-inner .count.long { font-size: 24px; }
.ring-inner .sub { color: var(--text-2); font-size: 12px; }

.hero-empty h2 { font-size: clamp(24px, 3vw, 36px); }
.hero-empty p { color: var(--text-2); margin-top: 8px; max-width: 46ch; }

/* stat tiles */
.stat { display: grid; gap: 6px; padding: 18px 20px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-size: 18px; background: color-mix(in srgb, var(--tint, var(--accent)) 16%, transparent); color: var(--tint, var(--accent)); }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.stat .bar { margin-top: 6px; }

/* next-up mini card (shown when a class is running) */
.next-mini { display: grid; gap: 10px; align-content: start; }
.next-mini .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.next-mini h3 { font-size: 20px; }
.next-mini .count { font-family: var(--font-mono); font-size: 34px; font-weight: 700; background: linear-gradient(90deg, var(--c, var(--accent)), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* timeline (today) */
.timeline { display: grid; gap: 10px; }
.tl-item {
  --c: var(--accent);
  position: relative; display: grid; grid-template-columns: 74px 4px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.tl-item:hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--c) 45%, var(--border)); }
.tl-time { display: grid; font-family: var(--font-mono); font-size: 13px; }
.tl-time b { font-size: 15px; }
.tl-time span { color: var(--muted); font-size: 12px; }
.tl-bar { align-self: stretch; border-radius: 4px; background: var(--c); box-shadow: 0 0 12px var(--c); }
.tl-body { min-width: 0; }
.tl-body h4 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-body p { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tl-status { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tl-item.done { opacity: .5; }
.tl-item.now { background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.tl-item.now .tl-status { background: var(--c); color: #fff; }
.tl-item.cancelled { opacity: .6; }
.tl-item.cancelled h4 { text-decoration: line-through; }
.tl-item.cancelled .tl-status { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.tl-item.exam .tl-status { color: var(--pink); background: color-mix(in srgb, var(--pink) 15%, transparent); }

/* upcoming list */
.up-list { display: grid; gap: 8px; }
.up-item { display: grid; grid-template-columns: 50px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; transition: background .2s; }
.up-item:hover { background: var(--surface); }
.up-date { display: grid; place-items: center; height: 50px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); line-height: 1; }
.up-date b { font-family: var(--font-display); font-size: 19px; }
.up-date small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.up-body { min-width: 0; }
.up-body h4 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-body p { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.tag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.tag-exam { background: color-mix(in srgb, var(--pink) 18%, transparent); color: var(--pink); }
.tag-deadline { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.tag-holiday { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.tag-cancel { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.tag-extra { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }

/* announcements */
.ann-list { display: grid; gap: 10px; }
.ann { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.ann.important { border-left-color: var(--amber); }
.ann.urgent { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.ann h4 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.ann h4 svg { color: var(--amber); }
.ann p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; white-space: pre-line; }
.ann time { display: block; color: var(--muted); font-size: 11.5px; margin-top: 8px; }

/* week glance strip on dashboard */
.glance { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 10px; }
.glance-day {
  display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 16px; min-height: 120px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: border-color .2s, transform .2s var(--ease);
}
.glance-day:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.glance-day.today { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: var(--glow); }
.glance-day.holiday { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 8px, color-mix(in srgb, var(--green) 8%, transparent) 8px, color-mix(in srgb, var(--green) 8%, transparent) 16px); }
.glance-head { display: flex; justify-content: space-between; align-items: baseline; }
.glance-head b { font-family: var(--font-display); font-size: 15px; }
.glance-head span { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
.glance-pill { --c: var(--accent); display: grid; gap: 1px; font-size: 12px; font-weight: 600; padding: 5px 8px; min-width: 0; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--text-2); white-space: nowrap; overflow: hidden; }
.glance-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glance-pill b { font-family: var(--font-mono); font-size: 11px; color: color-mix(in srgb, var(--c) 65%, var(--text)); }
.glance-pill.cancelled { text-decoration: line-through; opacity: .55; }
.glance-note { font-size: 12px; color: var(--green); font-weight: 600; }

/* ---- toolbar (week / semester nav) ----------------------------------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar h2 { font-size: 20px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.toolbar h2 small { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); }
.seg button { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }

/* ---- week grid -------------------------------------------------------------- */
.wk { --hour: 64px; padding: 0; overflow: hidden; }
.wk-scroll { overflow-x: auto; }
.wk-inner { min-width: 760px; }
.wk-head { display: grid; grid-template-columns: 78px repeat(var(--cols), 1fr); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--surface-solid) 85%, transparent); backdrop-filter: blur(10px); }
.wk-head div { padding: 14px 10px; text-align: center; display: grid; gap: 2px; }
.wk-head b { font-family: var(--font-display); font-size: 14px; }
.wk-head span { font-size: 12px; color: var(--muted); }
.wk-head .today b { color: var(--accent-2); }
.wk-head .today span { display: inline-block; justify-self: center; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: #fff; }
.wk-body { position: relative; display: grid; grid-template-columns: 78px repeat(var(--cols), 1fr); }
.wk-hours { position: relative; }
.wk-sesi { position: absolute; left: 0; right: 0; display: grid; align-content: start; justify-items: end; padding: 4px 10px 0 4px; border-top: 1px solid var(--border); }
.wk-sesi b { font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.wk-sesi small { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.wk-col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% var(--row, 66px); background-position: 0 12px; }
.wk-col.today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.wk-col.holiday { background-color: color-mix(in srgb, var(--green) 5%, transparent); }
.wk-holiday {
  position: absolute; inset: 6px; border-radius: 14px; display: grid; place-items: center; text-align: center; padding: 10px;
  border: 1px dashed color-mix(in srgb, var(--green) 50%, transparent); color: var(--green); font-weight: 600; font-size: 13px;
  background: repeating-linear-gradient(135deg, transparent, transparent 10px, color-mix(in srgb, var(--green) 7%, transparent) 10px, color-mix(in srgb, var(--green) 7%, transparent) 20px);
}
.wk-ev {
  --c: var(--accent);
  position: absolute; left: 5px; right: 5px; padding: 8px 10px; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 32%, var(--surface-solid)), color-mix(in srgb, var(--c) 14%, var(--surface-solid)));
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); border-left: 3px solid var(--c);
  transition: transform .2s var(--ease), box-shadow .2s; display: grid; align-content: start; gap: 2px;
}
.wk-ev:hover { transform: scale(1.02); z-index: 3; box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--c) 60%, transparent); }
.wk-ev b { font-family: var(--font-mono); font-size: 11px; color: color-mix(in srgb, var(--c) 55%, var(--text)); }
.wk-ev strong { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-ev span { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev.cancelled { opacity: .5; filter: grayscale(.6); }
.wk-ev.cancelled strong { text-decoration: line-through; }
.wk-ev.exam { border-style: solid; box-shadow: 0 0 0 1px var(--pink) inset; }
.wk-ev.half { left: 5px; right: 50%; }
.wk-ev.half2 { left: 50%; right: 5px; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; box-shadow: 0 0 10px var(--danger); pointer-events: none; }
.wk-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* agenda (mobile week) */
.agenda { display: grid; gap: 14px; }
.agenda-day h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text-2); }
.agenda-day h3 .chip { height: 22px; font-size: 11px; }
.agenda-day.today h3 { color: var(--accent-2); }

/* ---- semester calendar --------------------------------------------------------- */
.weeks-strip { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; margin-top: 12px; }
.weeks-strip i { height: 26px; border-radius: 6px; background: var(--surface-2); position: relative; display: grid; place-items: center; font-style: normal; font-size: 10px; font-family: var(--font-mono); color: var(--muted); }
.weeks-strip i.past { background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); color: var(--text-2); }
.weeks-strip i.cur { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--glow); }
.weeks-strip i.brk { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 4px, color-mix(in srgb, var(--green) 30%, transparent) 4px, color-mix(in srgb, var(--green) 30%, transparent) 8px); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

.cal { padding: 0; overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-head span { padding: 12px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 118px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: grid; align-content: start; gap: 4px; cursor: pointer; transition: background .2s; text-align: left; position: relative;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--surface); }
.cal-cell.out { opacity: .35; }
.cal-cell.off { background: repeating-linear-gradient(135deg, transparent, transparent 8px, var(--surface) 8px, var(--surface) 9px); }
.cal-cell.holiday { background: color-mix(in srgb, var(--green) 7%, transparent); }
.cal-num { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.cal-num small { font-family: var(--font-body); font-weight: 500; font-size: 10.5px; color: var(--muted); }
.cal-cell.today .cal-num b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--glow); }
.cal-pill { --c: var(--accent); display: flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 60%, var(--text)); white-space: nowrap; overflow: hidden; font-weight: 600; }
.cal-pill.cancelled { text-decoration: line-through; opacity: .5; }
.cal-pill.exam { background: color-mix(in srgb, var(--pink) 22%, transparent); color: var(--pink); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-hol { font-size: 11px; color: var(--green); font-weight: 600; line-height: 1.25; }
.cal-dl { font-size: 11px; color: var(--amber); font-weight: 600; display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

/* ---- courses + lecturers ------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.course {
  --c: var(--accent);
  display: grid; gap: 14px; align-content: start; overflow: hidden; transition: transform .25s var(--ease), border-color .25s;
}
.course::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 120px; pointer-events: none;
  background: radial-gradient(80% 100% at 0% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%);
}
.course:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 45%, var(--border)); }
.course-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; }
.course-code { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--c) 60%, var(--text)); }
.course h3 { font-size: 20px; margin-top: 4px; }
.course-desc { color: var(--text-2); font-size: 13.5px; position: relative; }
.course-lect { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); position: relative; }
.course-lect b { font-size: 14px; display: block; }
.course-lect small { color: var(--muted); font-size: 12px; }
.slot-list { display: grid; gap: 6px; position: relative; }
.slot-row { display: grid; grid-template-columns: 44px 98px 1fr; gap: 8px; font-size: 13px; align-items: center; }
.slot-row b { font-weight: 600; }
.slot-row .mono { color: var(--text-2); font-size: 12.5px; }
.slot-row span:last-child { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-prog { display: grid; gap: 6px; position: relative; }
.course-prog .bar i { background: var(--c); box-shadow: 0 0 12px var(--c); }
.course-prog div:first-child { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.avatar {
  --c: var(--accent);
  width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 40%, var(--accent-2)));
}
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 22px; box-shadow: 0 12px 30px -10px var(--c); }
.lect { display: grid; gap: 14px; align-content: start; transition: transform .25s var(--ease); }
.lect:hover { transform: translateY(-4px); }
.lect-top { display: flex; gap: 14px; align-items: center; }
.lect-top small { color: var(--muted); font-size: 12.5px; }
.lect-top h3 { font-size: 18px; }
.lect-info { display: grid; gap: 8px; font-size: 13.5px; }
.lect-info div { display: flex; gap: 10px; align-items: center; color: var(--text-2); min-width: 0; }
.lect-info div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lect-info svg { color: var(--muted); font-size: 16px; }
.lect-info a:hover { color: var(--accent-2); text-decoration: underline; }
.lect-bio { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- detail modal --------------------------------------------------------------- */
.detail { --c: var(--accent); display: grid; gap: 18px; }
.detail-head { padding-right: 40px; }
.detail-head .course-code { font-size: 13px; }
.detail-head h2 { font-size: 26px; margin-top: 6px; }
.detail-band { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--c), transparent); }
.detail-rows { display: grid; gap: 4px; }
.detail-row { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.detail-row:last-child { border-bottom: 0; }
.detail-row .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--c) 15%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--text)); font-size: 17px; }
.detail-row small { display: block; color: var(--muted); font-size: 11.5px; }
.detail-row b { font-weight: 600; font-size: 14.5px; }
.day-list { display: grid; gap: 10px; margin-top: 6px; }

.error-box { padding: 20px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--text-2); }

/* ---- responsive ------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .span-8, .span-7, .span-5 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
  .span-3 { grid-column: span 6; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 50; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 82%, transparent);
  }
  .brand, .sidebar-foot .sem-mini { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; flex: 1; gap: 2px; }
  .nav a { flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 10.5px; }
  .nav a.active::before { left: 30%; right: 30%; top: -9px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 4px 4px; }
  .sidebar-foot { margin: 0; }
  .foot-actions { flex-direction: column; gap: 4px; }
  .foot-actions .icon-btn { width: 34px; height: 26px; border-radius: 8px; font-size: 15px; }
  .main { padding-bottom: 110px; }
  .hero { grid-template-columns: 1fr; }
  .ring { width: 170px; height: 170px; justify-self: center; }
}
@media (max-width: 640px) {
  .main { padding-top: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .span-4, .span-3 { grid-column: span 12; }
  .dash { gap: 14px; }
  .hero { padding: 22px; min-height: 0; }
  .glance { grid-template-columns: 1fr 1fr; }
  .cal-cell { min-height: 64px; padding: 6px 4px; }
  .cal-pill, .cal-more, .cal-hol, .cal-dl { display: none; }
  .cal-dots { display: flex; }
  .cal-num small { display: none; }
  .tl-item { grid-template-columns: 60px 4px 1fr; }
  .tl-status { display: none; }
  .search .input { min-width: 0; width: 100%; }
  .toolbar .search { flex: 1; }
  .cards { grid-template-columns: 1fr; }
}

/* ---- additions: sesi labels, notes, semester picker ---------------------------- */
.stat-sub { font-size: 12px; margin-top: 4px; }
.tl-item { grid-template-columns: 84px 4px 1fr auto; }
.tl-time em { font-style: normal; font-family: var(--font-body); font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--c) 65%, var(--text)); letter-spacing: .02em; }
.tl-note { color: color-mix(in srgb, var(--c) 55%, var(--text-2)) !important; font-style: italic; }
.tl-item.extra .tl-status { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 15%, transparent); }
.up-note { font-size: 12px; color: var(--text-2); margin-top: 3px; font-style: italic; }
.wk-ev.extra { border-left-style: dashed; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-2) 60%, transparent) inset; }
.slot-row { grid-template-columns: 58px 92px 1fr; align-items: start; }
.slot-row small { display: block; font-size: 11px; color: var(--muted); font-family: var(--font-body); }
.weeks-strip i.part { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--green) 70%, transparent); }
.sem-select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.sem-select .input { width: auto; min-width: 260px; }
.toolbar-actions .input { height: 40px; }
@media (max-width: 640px) {
  .tl-item { grid-template-columns: 70px 4px 1fr; }
  .sem-select .input { min-width: 0; }
  .toolbar-actions { flex-wrap: wrap; width: 100%; }
}

/* ---- staffsite: lecturer photos, position, interests ----------------------------- */
.avatar.photo { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.avatar.lg { width: 76px; height: 76px; border-radius: 22px; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.lect-pos { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--c, var(--accent)) 65%, var(--text)); margin: 3px 0 2px; }
.lect-pos svg { font-size: 14px; }
.lect-interest { display: grid; gap: 6px; }
.lect-interest small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lect-interest .chip { height: 26px; font-size: 12px; }
.lect-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent-2); justify-self: start; }
.lect-link:hover { text-decoration: underline; }
.chip-photo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; margin-left: -4px; }
.lect-top > div { min-width: 0; }
.lect-top h3 { overflow-wrap: anywhere; }
.lect .chip { white-space: normal; height: auto; min-height: 28px; padding: 4px 10px; line-height: 1.35; }

/* ---- course detail + RPS ------------------------------------------------------------ */
.course { cursor: pointer; }
.course-more { position: relative; font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--c) 60%, var(--accent-2)); display: inline-flex; align-items: center; gap: 4px; }
.back-chip { margin-bottom: 14px; }
.course-hero {
  --c: var(--accent); display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 26px; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 55%), var(--surface);
  border-color: color-mix(in srgb, var(--c) 35%, var(--border));
}
.course-hero h2 { font-size: clamp(24px, 3vw, 36px); margin-top: 6px; }
.ch-side { display: grid; gap: 14px; align-content: start; }
.next-topic { margin-top: 18px; display: grid; gap: 3px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); max-width: 640px; }
.next-topic small { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 60%, var(--text)); }
.next-topic b { font-size: 16px; }
.next-topic .muted { font-size: 13px; }
.course-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.meet-list { display: grid; gap: 6px; max-height: 720px; overflow: auto; padding-right: 4px; }
.meet { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.meet-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font: 700 14px var(--font-mono); background: var(--surface-2); color: var(--text-2); }
.meet-body { min-width: 0; display: grid; gap: 2px; }
.meet-body b { font-size: 14px; font-weight: 600; }
.meet-body small { font-size: 12px; color: var(--muted); }
.meet-st { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.meet.done { opacity: .55; }
.meet.next, .meet.now { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.meet.next .meet-n, .meet.now .meet-n { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.meet.next .meet-st, .meet.now .meet-st { background: var(--accent); color: #fff; }
.meet.cancelled { opacity: .6; }
.meet.cancelled b { text-decoration: line-through; color: var(--danger); }
.meet.exam .meet-n { color: var(--pink); }
.meet.extra .meet-st { color: var(--accent-2); }
.about { display: grid; gap: 14px; }
.about small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.about p { font-size: 14px; color: var(--text-2); white-space: pre-line; margin-top: 3px; }
.sub-h { font-size: 15px; margin: 22px 0 10px; }
.week-plan { display: grid; gap: 6px; }
.wp-row { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.wp-row b { font-family: var(--font-mono); color: var(--accent-2); }
.wp-row p { font-size: 13.5px; }
.wp-row small { display: block; font-size: 12px; color: var(--muted); white-space: pre-line; margin-top: 2px; }
.wp-row.cur { outline: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.pdf-card { margin-top: 18px; }
.pdf-frame { width: 100%; height: 80vh; min-height: 520px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.hero-topic { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; color: var(--text-2); }
.hero-topic svg { color: var(--accent-2); flex: none; }
.detail-link { justify-self: start; }
@media (max-width: 1100px) {
  .course-hero, .course-grid { grid-template-columns: 1fr; }
}
