
.drawer-sem-ctrl { display: flex; background: rgba(0,0,0,0.04); border-radius: 14px; padding: 4px; gap: 4px; }
[data-theme=dark] .drawer-sem-ctrl { background: #1e293b; }
.drawer-sem-btn {
  flex: 1; background: transparent; border: none; color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem; font-weight: 700; padding: 8px 0; border-radius: 10px; cursor: pointer; transition: all 0.2s ease; outline: none;
}
.drawer-sem-btn:hover { color: var(--text); }
.drawer-sem-btn.active { background: #fff; color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
[data-theme=dark] .drawer-sem-btn.active { background: var(--accent); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }

/* DASHBOARD SPECIFIC STYLES */
.hub-container {
  padding: 16px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  margin-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}

.greeting-wrap {
  margin: 0;
  padding: 4px 4px;
  flex-shrink: 0;
}

.dashboard-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-icon-btn {
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
}

.header-pill-btn {
  width: auto;
  padding: 0 11px;
  gap: 6px;
}

.header-btn-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.header-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}
.header-icon-btn:hover .header-btn-label {
  color: var(--accent);
}

.header-icon-btn:active {
  transform: scale(0.94);
}

[data-theme=dark] .header-icon-btn {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme=dark] .header-icon-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  border-color: #93c5fd;
}
[data-theme=dark] .header-icon-btn:hover .header-btn-label {
  color: #93c5fd;
}

/* ONBOARDING */
#onboarding{position:fixed;inset:0;z-index:9999;display:none;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:var(--bg);transition:opacity .25s,background .25s,backdrop-filter .25s}
#onboarding.active{display:flex}
.ob-card{background:#fff;border-radius:22px;padding:28px 24px 22px;width:100%;max-width:340px;position:relative;z-index:1;box-shadow:0 32px 80px rgba(15,23,42,.3);transform:translateY(14px) scale(.97);transition:transform .3s cubic-bezier(.34,1.3,.64,1)}
#onboarding.active .ob-card{transform:translateY(0) scale(1)}
[data-theme=dark] .ob-card{background:#1e293b;box-shadow:0 32px 80px rgba(0,0,0,.4);border:none}
.ob-back{position:absolute;top:14px;left:16px;background:var(--bg);border:none;cursor:pointer;color:var(--muted);width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s;line-height:1}
.ob-back:hover{background:#fee2e2;color:var(--danger)}
[data-theme=dark] .ob-back:hover{background:rgba(220,38,38,.15);color:#f87171}
.ob-back.hide{opacity:0;pointer-events:none}
.ob-dots{display:flex;gap:6px;justify-content:center;margin-bottom:24px;margin-top:4px}
.ob-dot{width:6px;height:6px;border-radius:50%;background:var(--border);transition:all .3s}
.ob-dot.active{width:20px;border-radius:3px;background:var(--accent)}
.ob-dot.done{background:var(--accent);opacity:.4}
.ob-icon{width:48px;height:48px;border-radius:14px;margin:0 auto 14px;display:flex;align-items:center;justify-content:center}
.ob-step{display:none}.ob-step.active{display:block;animation:obFadeIn .2s ease}
@keyframes obFadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.ob-title{font-size:1.05rem;font-weight:800;color:var(--text);margin-bottom:4px;text-align:center;letter-spacing:-.3px;margin-top:4px}
.ob-hint{font-size:.77rem;color:var(--muted);text-align:center;margin-bottom:22px;line-height:1.5}
.ob-input{width:100%;height:48px;padding:0 16px;font-family:'DM Mono',monospace;font-size:.92rem;background:var(--bg);border:1.5px solid var(--border);border-radius:12px;color:var(--text);text-transform:uppercase;outline:none;transition:border-color .15s,box-shadow .15s;letter-spacing:.06em;text-align:center;margin-bottom:0}
.ob-input::placeholder{font-family:'DM Sans',sans-serif;text-transform:none;letter-spacing:0;font-size:.86rem;text-align:center;color:var(--muted);font-weight:400}
.ob-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
#ob-moodle-email{font-family:'DM Sans',sans-serif;text-transform:none;letter-spacing:normal;text-align:left}
#ob-moodle-pass{font-family:'DM Sans',sans-serif;text-transform:none;letter-spacing:normal;text-align:left}
#ob-moodle-email::placeholder { text-align: left; }
#ob-moodle-pass::placeholder { text-align: left; }
[data-theme=dark] .ob-input{background:#0f172a;color:var(--text)}
.ob-dropdown{position:relative;margin-bottom:10px;user-select:none}
.ob-dd-trigger{width:100%;height:48px;padding:0 14px;border:1.5px solid var(--border);border-radius:12px;background:var(--bg);color:var(--text);font-family:'DM Sans',sans-serif;font-size:.88rem;font-weight:600;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:border-color .15s,box-shadow .15s;gap:8px}
.ob-dd-trigger:hover,.ob-dropdown.open .ob-dd-trigger{border-color:var(--accent);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.ob-dd-trigger svg{flex-shrink:0;color:var(--muted);transition:transform .2s}
.ob-dropdown.open .ob-dd-trigger svg{transform:rotate(180deg)}
.ob-dd-menu{position:absolute;left:0;right:0;top:calc(100% + 6px);background:var(--surface);border:1.5px solid var(--border);border-radius:12px;overflow:hidden;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,.12);display:none}
[data-theme=dark] .ob-dd-menu{box-shadow:0 8px 24px rgba(0,0,0,.4);background:#1e293b}
[data-theme=dark] .ob-dd-trigger{background:#0f172a;color:var(--text)}
.ob-dropdown.open .ob-dd-menu{display:block}
.ob-dd-opt{padding:12px 14px;font-size:.86rem;font-weight:600;font-family:'DM Sans',sans-serif;cursor:pointer;transition:background .1s;color:var(--text);display:flex;align-items:center;justify-content:space-between}
.ob-dd-opt:hover{background:rgba(37,99,235,.05)}
[data-theme=dark] .ob-dd-opt:hover{background:rgba(255,255,255,.06)}
.ob-dd-opt.selected{color:var(--accent)}
.ob-dd-opt+.ob-dd-opt{border-top:1px solid var(--border)}
.ob-btn{display:block;width:100%;height:48px;background:var(--accent);color:#fff;font-family:'DM Sans',sans-serif;font-size:.92rem;font-weight:700;border:none;border-radius:12px;cursor:pointer;transition:background .15s,transform .1s;margin-top:22px;margin-bottom:0}
.ob-btn:hover{background:var(--accent-h)}.ob-btn:active{transform:scale(.98)}.ob-btn:disabled{opacity:.55;cursor:not-allowed}
#ob-3 .ob-btn{margin-top:18px;margin-bottom:4px}
.ob-spinner{display:inline-block;width:14px;height:14px;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:spin .6s linear infinite;vertical-align:-2px;margin-right:8px}
.ob-skip{width:100%;height:32px;background:none;color:var(--muted);font-family:'DM Sans',sans-serif;font-size:.82rem;font-weight:600;border:none;cursor:pointer;margin-top:0;margin-bottom:0;border-radius:10px;transition:color .15s}
.ob-skip:hover{color:var(--text)}
.ob-err{display:none;font-size:.76rem;color:var(--danger);min-height:16px;margin-bottom:8px;text-align:center;line-height:1.45;padding:0 4px}
.ob-email-row{display:flex;align-items:stretch;margin-bottom:10px}
.ob-email-row .ob-input{border-radius:12px 0 0 12px;border-right:none;margin-bottom:0;flex:1;min-width:0}
.ob-email-suffix{border:1.5px solid var(--border);border-left:none;border-radius:0 12px 12px 0;padding:0 10px;display:flex;align-items:center;font-size:.78rem;font-weight:600;color:var(--muted);white-space:nowrap;background:var(--bg)}
[data-theme=dark] .ob-email-suffix{background:#0f172a;color:var(--muted)}
.ob-lbl{font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:5px;display:block;text-align:left}

/* ACADEMIC CALENDAR STYLES */
.cal-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  margin-top: 0;
  container-type: inline-size;
  container-name: calsection;
}
.calendar-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0;
  border-radius: 18px;
  height: 100%;
  flex: 1;
  min-height: 0;
}
.calendar-carousel::-webkit-scrollbar { display: none; }
.cal-card {
  flex: 0 0 calc(100% - 24px);
  width: calc(100% - 24px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.cal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
  min-height: 38px;
}
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  box-sizing: border-box;
  background: var(--bg);
  border-radius: 12px;
  padding: 0 4px;
  border: 1.5px solid var(--border);
  flex: 1;
  min-width: 0;
}
.cal-month-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 1;
}
.cal-nav-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.cal-nav-btn svg { display: block; }
.cal-nav-btn:hover:not(:disabled) { background: rgba(37,99,235,0.08); }
[data-theme=dark] .cal-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.cal-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

#cal-sem-dropdown {
  width: 100px;
  margin-left: 8px;
}

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.cal-grid-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  flex: 1;
  min-height: 0;
  align-content: space-between;
}
.cal-day-cell {
  height: 100%;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}
.cal-day-cell.past {
  opacity: 0.45;
  background: rgba(0,0,0,0.03);
}
.cal-day-cell.other-month {
  opacity: 0.28;
  color: var(--muted);
  background: transparent;
  pointer-events: none;
}
[data-theme=dark] .cal-day-cell.past { background: rgba(255,255,255,0.03); }
.cal-day-cell.today {
  background: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}
.cal-day-cell.today .cal-day-dot { background: #ffffff !important; }
.cal-day-cell.has-event { background: rgba(37,99,235,0.12); color: var(--accent); }
.cal-day-cell.has-exam { background: rgba(239,68,68,0.18) !important; color: #ef4444 !important; font-weight: 800; }
.cal-day-cell.has-holiday { background: rgba(16,185,129,0.15); color: #10b981; }
.cal-day-cell.selected { box-shadow: 0 0 0 2px var(--accent); z-index: 2; }
@media (hover: hover) and (pointer: fine) {
  .cal-day-cell:hover { box-shadow: 0 0 0 2px var(--accent); z-index: 2; }
}
.cal-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 2px;
  background: currentColor;
}

.cal-popover {
  position: fixed;
  z-index: 99999;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(-90%) scale(0.95);
  width: 220px;
  box-sizing: border-box;
}
[data-theme=dark] .cal-popover { box-shadow: 0 16px 40px rgba(0,0,0,0.6); }
.cal-popover.show { opacity: 1; pointer-events: auto; transform: translateY(-100%) scale(1); }
.cal-popover-date {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 6px;
}
.cal-popover-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}
.cal-popover-item { font-size: 0.76rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.cal-popover-item.exam { color: #ef4444; font-weight: 700; }
.cal-popover-item.holiday { color: #10b981; font-weight: 700; }

@media (max-width: 767px) {
  .hub-container { padding: 12px 12px 14px; gap: 10px; }
  .greeting-wrap { margin: 0; padding: 2px 2px; }
  .dashboard-title { font-size: 1.35rem; }
  .header-actions { gap: 6px; }
  .header-pill-btn {
    width: 35px;
    height: 35px;
    padding: 0;
    justify-content: center;
  }
  .header-pill-btn .header-btn-label {
    display: none;
  }
  .header-pill-btn.header-pill-share {
    width: auto;
    padding: 0 9px;
    gap: 5px;
  }
  .header-pill-btn.header-pill-share .header-btn-label {
    display: inline-block;
    font-size: 0.78rem;
  }
  .cal-section { margin-top: 0; gap: 0; }
  .cal-card { padding: 14px 14px; border-radius: 18px; }
  .tt-card { padding: 14px 14px; border-radius: 18px; }
  .dash-inline-box { border-radius: 18px; }
  .dash-inline-head { padding: 12px 14px; }
  .cal-card-header { margin-bottom: 10px; min-height: 40px; height: 40px; }
  .cal-month-nav { height: 40px; padding: 0 8px; box-sizing: border-box; }
  .cal-month-label { font-size: 0.92rem; font-weight: 800; }
  .cal-nav-btn { width: 32px; height: 32px; padding: 0; }
  #cal-sem-dropdown { width: 100px; margin-left: 8px; }
  .cal-grid-header { font-size: 0.75rem; margin-bottom: 6px; }
  .cal-grid-body { flex: 1; min-height: 0; gap: 4px; }
  .cal-day-cell { min-height: 0; height: 100%; border-radius: 8px; font-size: 0.84rem; padding: 2px 0; }
  .cal-day-dot { width: 4px; height: 4px; margin-top: 1px; }
  .dash-action-bar { gap: 8px; }
  .dash-toggle-btn { padding: 9px 6px; font-size: 0.78rem; gap: 5px; border-radius: 12px; }
  .dash-toggle-btn svg { width: 14px; height: 14px; }
}

@media (max-width: 360px) {
  .dashboard-title { font-size: 1.18rem; }
  .header-actions { gap: 5px; }
  .header-pill-btn { width: 33px; height: 33px; border-radius: 10px; }
  .header-pill-btn.header-pill-share { width: auto; padding: 0 7px; gap: 4px; }
  .header-pill-btn.header-pill-share .header-btn-label { font-size: 0.72rem; }
  .dash-action-bar { gap: 6px; }
  .dash-toggle-btn { padding: 8px 3px; font-size: 0.72rem; gap: 4px; }
  .dash-toggle-btn svg { width: 12px; height: 12px; }
}

@media (min-width: 768px) {
  .hub-container {
    padding: 24px 28px 20px;
    gap: 16px;
  }
  .dash-action-bar {
    gap: 10px;
  }
  .dash-toggle-btn {
    padding: 11px 12px;
    font-size: 0.84rem;
  }
}

/* Academic Calendar: 3-column desktop layout only when space allows (>= 940px) */
@media (min-width: 940px) {
  .calendar-carousel:not(.force-mobile-cal) {
    display: grid !important;
    grid-template-columns: 1fr 1.25fr 1fr !important;
    gap: 16px !important;
    overflow-x: visible !important;
    scroll-snap-type: none !important;
  }
  .calendar-carousel:not(.force-mobile-cal) .cal-card {
    flex: none !important;
    width: 100% !important;
  }
  .calendar-carousel:not(.force-mobile-cal) #cal-card-2 { order: 1 !important; }
  .calendar-carousel:not(.force-mobile-cal) #cal-card-1 { order: 2 !important; }
  .calendar-carousel:not(.force-mobile-cal) #cal-card-3 { order: 3 !important; }
}

@container calsection (min-width: 940px) {
  .calendar-carousel:not(.force-mobile-cal) {
    display: grid !important;
    grid-template-columns: 1fr 1.25fr 1fr !important;
    gap: 16px !important;
    overflow-x: visible !important;
    scroll-snap-type: none !important;
  }
  .calendar-carousel:not(.force-mobile-cal) .cal-card {
    flex: none !important;
    width: 100% !important;
  }
  .calendar-carousel:not(.force-mobile-cal) #cal-card-2 { order: 1 !important; }
  .calendar-carousel:not(.force-mobile-cal) #cal-card-1 { order: 2 !important; }
  .calendar-carousel:not(.force-mobile-cal) #cal-card-3 { order: 3 !important; }
}

/* Force mobile-view styled calendar when 3 cards would exceed buttons width */
.calendar-carousel.force-mobile-cal {
  display: flex !important;
  gap: 12px !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  overscroll-behavior-x: contain !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  padding: 0 !important;
  border-radius: 18px !important;
  height: 100% !important;
  flex: 1 !important;
  min-height: 0 !important;
}

.calendar-carousel.force-mobile-cal::-webkit-scrollbar {
  display: none !important;
}

.calendar-carousel.force-mobile-cal .cal-card {
  flex: 0 0 calc(100% - 24px) !important;
  width: calc(100% - 24px) !important;
  scroll-snap-align: start !important;
  scroll-snap-stop: always !important;
  order: initial !important;
}
.cal-list-scroll { position: relative; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; min-height: 0; }
.cal-list-scroll::-webkit-scrollbar { width: 4px; }
.cal-list-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.cal-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; transition: all 0.15s ease;
}
.cal-item.past { opacity: 0.45; background: rgba(0,0,0,0.02); }
[data-theme=dark] .cal-item.past { background: rgba(255,255,255,0.02); }
.cal-item.is-exam { background: rgba(239, 68, 68, 0.1) !important; border: 1.5px solid rgba(239, 68, 68, 0.35) !important; color: #ef4444 !important; }
.cal-item.is-exam .cal-item-title, .cal-item.is-exam .cal-item-date-right { color: #ef4444 !important; font-weight: 700; }
.cal-item-title { font-size: 0.83rem; font-weight: 700; color: var(--text); line-height: 1.3; flex: 1; min-width: 0; }
.cal-item-date-right { font-size: 0.75rem; font-weight: 700; color: var(--muted); white-space: nowrap; flex-shrink: 0; text-align: right; }

.nm-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(239, 68, 68, 0.15); color: #ef4444; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

#consent-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 0.3s ease;
}
#consent-modal.active { display: flex; }
#consent-modal.show { opacity: 1; }
.cm-card {
  background: var(--surface); border-radius: 20px; padding: 28px 24px 24px;
  width: 100%; max-width: 600px; max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.3); transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
}
#consent-modal.show .cm-card { transform: translateY(0) scale(1); }
[data-theme=dark] .cm-card { box-shadow: 0 32px 80px rgba(0,0,0,0.6); border: 1px solid #334155; }
.cm-content { font-size: 0.88rem; color: var(--text); line-height: 1.5; opacity: 0.9; overflow-y: auto; padding-right: 8px; margin-right: -8px; }
.cm-content p { margin-bottom: 16px; }
.cm-point { margin-bottom: 16px; padding: 12px; background: rgba(37,99,235,0.05); border-radius: 12px; border: 1px solid rgba(37,99,235,0.1); flex-shrink: 0; }
[data-theme=dark] .cm-point { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.05); }
.cm-point > strong:first-child { display: block; color: var(--accent); margin-bottom: 6px; font-size: 0.92rem; }
.cm-point ul { margin: 8px 0 0 0; padding-left: 20px; }
.cm-point li { margin-bottom: 6px; }
.cm-point li:last-child { margin-bottom: 0; }
.cm-content::-webkit-scrollbar { width: 6px; }
.cm-content::-webkit-scrollbar-track { background: transparent; }
.cm-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
[data-theme=dark] .cm-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════════════════════ */
/* Dynamic Toggle Action Bar (Calendar, Notices, Syllabus)        */
/* ═══════════════════════════════════════════════════════════════ */
.dash-action-bar {
  display: flex;
  gap: 8px;
  margin: 0;
  flex-shrink: 0;
  width: 100%;
}

.dash-toggle-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: clamp(0.74rem, 2.7vw, 0.84rem);
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  user-select: none;
  white-space: nowrap;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

.dash-toggle-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.dash-toggle-btn:focus,
.dash-toggle-btn:focus-visible {
  outline: none !important;
  border-color: var(--border) !important;
}

@media (hover: hover) {
  .dash-toggle-btn:hover {
    border-color: var(--border);
    color: var(--text);
    background: rgba(37, 99, 235, 0.04);
  }
}

.dash-toggle-btn:active {
  transform: scale(0.97);
}

/* Active Shaded Button State */
.dash-toggle-btn.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.dash-toggle-btn.active:focus,
.dash-toggle-btn.active:focus-visible {
  border-color: var(--accent) !important;
}

.dash-toggle-btn.active svg {
  opacity: 1;
  stroke: #ffffff;
}

.dash-toggle-btn .btn-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Dynamic Panels Container & Paneling                             */
/* ═══════════════════════════════════════════════════════════════ */
.dash-panels-container {
  width: 100%;
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dash-panel {
  display: none;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
}

.dash-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  animation: dashPanelFade 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

#panel-calendar.dash-panel.active .cal-section {
  margin-top: 0;
  height: 100%;
  flex: 1;
  min-height: 0;
}

@keyframes dashPanelFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tt-body.active {
  animation: dashPanelFade 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Inline Box for Notices & Syllabus */
.dash-inline-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
  min-height: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.dash-inline-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

[data-theme=dark] .dash-inline-head {
  background: rgba(15, 23, 42, 0.4);
}

.dash-inline-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}

.dash-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Timetable Card & Timeline                                       */
/* ═══════════════════════════════════════════════════════════════ */
.tt-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}

.tt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tt-topbar-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tt-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.tt-subheading {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

.tt-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tt-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.tt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.tt-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tt-action-btn:active {
  transform: scale(0.96);
}

.tt-action-btn.tt-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
}

.tt-action-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

/* Slot Actions container (holds the batch dropdown on lab slots) */
.tt-slot-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}


/* Day Selector Nav */
.tt-day-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  padding: 3px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  box-sizing: border-box;
  width: 100%;
  height: 38px;
  flex-shrink: 0;
}

.tt-day-chip {
  flex: 1;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tt-day-chip:hover {
  color: var(--text);
}

.tt-day-chip.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme=dark] .tt-day-chip.active {
  background: #334155;
  color: #fff;
}

.tt-day-chip.is-today {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  font-weight: 800;
  border-color: rgba(37, 99, 235, 0.25);
}

.tt-day-chip.active.is-today {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

[data-theme=dark] .tt-day-chip.is-today {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.3);
}

[data-theme=dark] .tt-day-chip.active.is-today {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Timetable Slots Body */
.tt-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.tt-body::-webkit-scrollbar {
  display: none;
}

.tt-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  min-height: 200px;
  margin: auto 0;
  width: 100%;
  box-sizing: border-box;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Period Pair Container (Ensures identical slot heights across all days) */
.tt-period-pair {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 104px;
  width: 100%;
  box-sizing: border-box;
}

/* Slot Card (Flex spreads across full container height) */
.tt-slot {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
  flex: 1;
  min-height: 48px;
  box-sizing: border-box;
  width: 100%;
}

.tt-slot.is-2hr {
  flex: 1;
  height: 100%;
  min-height: 104px;
  box-sizing: border-box;
  width: 100%;
}

.tt-slot.is-now {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.16);
}

[data-theme=dark] .tt-slot.is-now {
  background: rgba(37, 99, 235, 0.16);
  border-color: #60a5fa;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}

.tt-slot-time {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 52px;
  min-width: 52px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tt-time-start {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  line-height: 1.2;
  text-align: center;
}

.tt-time-end {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  text-align: center;
}

.tt-slot-divider {
  width: 2px;
  align-self: stretch;
  background: var(--border);
  border-radius: 2px;
  margin: 3px 0;
  flex-shrink: 0;
  position: relative;
}

.tt-slot.is-now .tt-slot-divider {
  background: var(--accent);
}

.tt-now-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
  animation: ttPulse 1.8s infinite;
}

@keyframes ttPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.tt-slot-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

/* Slot Custom Batch Dropdown overrides */
.tt-slot-batch-dropdown {
  width: auto;
  min-width: 86px;
  margin-left: 0 !important;
}
.tt-slot-batch-dropdown .sem-trigger {
  height: 36px;
  padding: 0 26px 0 12px;
}
.tt-slot-batch-dropdown .sem-menu {
  min-width: 100%;
  width: max-content;
  max-width: 130px;
  right: 0;
  left: auto;
}
.tt-slot-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tt-slot-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tt-slot-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tt-slot.is-empty {
  flex: 1;
  min-height: 48px;
  opacity: 0.55;
  background: transparent;
  border: 1.5px dashed var(--border);
  box-shadow: none;
}

.tt-slot-empty-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  font-style: italic;
}

.tt-tag-elective {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.25);
}

[data-theme=dark] .tt-tag-elective {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.tt-tag-lab {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme=dark] .tt-tag-lab {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.tt-slot-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  flex-wrap: wrap;
}

.tt-code-pill {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.85;
}

.tt-fac, .tt-room {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Visible Break Divider Across Full Width */
.tt-break-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 6px;
  flex-shrink: 0;
  user-select: none;
}

.tt-break-line {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  border-radius: 2px;
  opacity: 0.85;
}

.tt-break-text {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

/* Empty Timetable State */
.tt-empty {
  text-align: center;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  min-height: 200px;
  margin: auto 0;
  width: 100%;
  box-sizing: border-box;
}

.tt-empty-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
  text-align: center;
}

.tt-empty-desc {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.5;
  text-align: center;
  margin: 0 auto;
}

.tt-empty-btn {
  margin-top: 6px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.tt-empty-btn:hover {
  opacity: 0.94;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.tt-empty-btn:active {
  transform: translateY(0) scale(0.97);
}

/* Dropzone for Upload Modal */
.tt-dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tt-dropzone:hover,
#tt-edit-file-row:hover {
  border-color: var(--accent) !important;
  background: rgba(37, 99, 235, 0.03) !important;
}

.nm-scroll-area {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.nm-scroll-area::-webkit-scrollbar { width: 6px; }
.nm-scroll-area::-webkit-scrollbar-track { background: transparent; }
.nm-scroll-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
[data-theme=dark] .nm-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

.nm-list {
  padding: 16px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 0 auto;
  min-height: 100%;
  box-sizing: border-box;
}
.notice-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 14px 16px;
  display: flex; gap: 14px; align-items: center; text-decoration: none; transition: 0.2s;
}
.notice-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.notice-icon {
  width: 44px; height: 44px; border-radius: 10px; background: transparent;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notice-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.notice-title { 
  font-size: 0.9rem; font-weight: 600; color: var(--text); line-height: 1.3; margin: 0; 
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notice-meta { display: flex; gap: 8px; align-items: center; font-size: 0.75rem; color: var(--muted); margin: 0; }

.nm-loader {
  display: none;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
}

.nm-loader.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  flex: 1;
  height: 100%;
  min-height: 200px;
  margin: auto 0;
}

.nm-loader span {
  text-align: center;
  display: block;
}

.nm-loader.show + .nm-list {
  display: none;
}

.nm-list:has(> div:only-child) {
  justify-content: center;
  align-items: center;
  height: 100%;
}

.nm-list > div:only-child {
  margin: auto 0;
  text-align: center;
  width: 100%;
}
