/* ═══════════════════════════════════════════════════
   CampusOrbit — Design System & Styles
   Premium dark-mode student platform
   ═══════════════════════════════════════════════════ */

.hidden { display: none !important; }

/* ═══════════ SW UPDATE BANNER (ITEM 10) ═══════════ */
/* Slim, glassmorphic, dismissable bar pinned to the very top of the viewport. */
.sw-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: rgba(20, 22, 45, 0.62);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: sw-banner-down 0.35s ease;
}
.sw-update-refresh {
  flex: 1;
  max-width: 420px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}
.sw-update-dismiss {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}
.sw-update-dismiss:hover { background: rgba(255, 255, 255, 0.2); }
@keyframes sw-banner-down {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sw-update-banner { animation: none; }
}

/* ── CSS Custom Properties ── */
:root {
  /* ═══ REDESIGN — premium dark palette ═══
     New design-system tokens live alongside legacy aliases. Every legacy var
     (--bg-card, --text-primary, --accent-indigo, …) now resolves to a new-palette
     value so existing components inherit the redesign automatically. */

  /* ── Surfaces ── */
  --bg-base: #09090f;
  --bg-layer: #0f0f1c;
  --bg-elevated: #14142a;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-hover: rgba(255, 255, 255, 0.09);
  /* legacy aliases */
  --bg-primary: var(--bg-base);
  --bg-secondary: var(--bg-layer);
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.09);
  --bg-glass: rgba(255, 255, 255, 0.05);

  /* ── Accents ── */
  --accent: #6c63ff;
  --accent-soft: #a78bfa;
  --accent-glow: rgba(108, 99, 255, 0.25);
  --accent-muted: rgba(108, 99, 255, 0.25);
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  /* legacy accent aliases (cyan family folded into the violet accent) */
  --accent-indigo: #6c63ff;
  --accent-indigo-light: #a78bfa;
  --accent-cyan: #818cf8;
  --accent-cyan-light: #a78bfa;
  --accent-purple: #a78bfa;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #f87171;
  --accent-pink: #f472b6;

  --gradient-primary: linear-gradient(135deg, #6c63ff, #a78bfa);
  --gradient-hero: linear-gradient(135deg, rgba(56, 130, 246, 0.18), rgba(34, 211, 238, 0.06));
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));

  /* ── Text ── */
  --text-1: #eeeeff;
  --text-2: rgba(238, 238, 255, 0.55);
  --text-3: rgba(238, 238, 255, 0.28);
  /* legacy aliases — secondary/muted kept a touch brighter than raw text-2/3
     to preserve WCAG AA on body-sized copy. */
  --text-primary: var(--text-1);
  --text-secondary: rgba(238, 238, 255, 0.72);
  --text-muted: rgba(238, 238, 255, 0.46);
  --text-accent: #a78bfa;

  /* ── Borders ── */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-card: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(108, 99, 255, 0.45);

  /* Spacing — 8-point system. --space-unit is the base for calc()-derived gaps. */
  --space-unit: 8px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radii */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-pill: 9999px;
  --radius-full: 9999px; /* legacy alias → pill */

  /* Shadows — glass-card standard */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-glow-indigo: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-glow);
  --shadow-glow-cyan: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-glow);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Transitions */
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --spring: 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 60px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #0d0b2e 30%, #1a0a3d 60%, #0f0620 100%);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input {
  font-family: inherit;
  color: inherit;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-glow);
}

/* ── Selection + focus polish ── */
::selection {
  background: var(--accent-glow);
  color: var(--text-1);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ═══════════ SPLASH SCREEN ═══════════ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Dark frosted veil over the whole shell. NOTE: #app (the dashboard) is never
     display:none and paints at z-index 1 — in FRONT of the fixed .mesh-bg
     (z-index -1) — so a transparent splash reveals the dashboard, not the blob
     aurora. We blur + dim the shell here so the onboarding card reads as the
     primary layer and the dashboard behind isn't legible through it. */
  background: rgba(9, 9, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}
.splash.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}
.splash-logo {
  text-align: center;
  animation: splashIn 0.8s var(--ease-spring);
}
.splash-icon {
  width: 100px;
  height: 100px;
  margin-bottom: var(--space-lg);
}
.splash-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.splash-title .brand-guide {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.splash-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
  letter-spacing: 2px;
  text-transform: uppercase;
  /* Base state is the final/visible state (safe fallback). The animation below
     uses `both` fill so during its 1.6s delay the element holds the `from`
     (opacity:0) state — this hides the subtitle's final text until the JS
     scramble kicks in, so there is no flash-of-final-state before it animates.
     Under prefers-reduced-motion the animation is disabled and this base
     opacity:1 keeps the subtitle visible. */
  opacity: 1;
  animation: splashSubReveal 0.5s ease 1.6s both;
}
@keyframes splashSubReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Splash branding intro (one-shot on load) ──
   "MUJ" blurs into focus; "guide" wipes in left→right (clip-path stands in for
   an SVG stroke reveal — the wordmark is a font glyph, not a path); the subtitle
   glyph-scramble runs in JS (animateSplashScramble). */
.splash-title .brand-muj {
  display: inline-block;
  animation: splashBlurIn 0.7s ease-out both;
}
.splash-title .brand-guide {
  display: inline-block;
  /* Delay = MUJ's blur-reveal duration (0.7s) so guide starts only once MUJ finishes. */
  animation: splashClipIn 0.9s var(--ease-smooth) 0.7s both;
}
@keyframes splashBlurIn {
  from { filter: blur(8px); opacity: 0; }
  to   { filter: blur(0);   opacity: 1; }
}
@keyframes splashClipIn {
  /* negative top/bottom insets keep the script font's overhangs unclipped */
  from { clip-path: inset(-25% 100% -25% 0); }
  to   { clip-path: inset(-25% -5% -25% 0); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-title .brand-muj,
  .splash-title .brand-guide,
  .splash-sub { animation: none; }
}

/* ── Intro screen actions (Continue as Student / Staff login) ── */
#splash-intro { animation: splashIn 0.5s var(--ease-spring); }
.splash-cta {
  width: 100%;
  font-size: 1rem;
  padding: 14px;
}
.splash-staff-btn {
  width: 100%;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  transition: color var(--duration-normal), border-color var(--duration-normal);
}
.splash-staff-btn:hover:not([disabled]) { color: var(--text-secondary); border-color: var(--border-glow); }
.splash-staff-btn[disabled] { opacity: 0.6; cursor: default; }

@keyframes splashIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══════════ ONBOARDING / LOGIN CARD ═══════════
   Glass card for the guest name step, the class picker, and the staff-login
   entry. SCOPED strictly to #splash-intro so the pill/input styling never
   leaks into the rest of the app (admin fields, .tt-select, etc. keep theirs).
   Tokens deliberately match the dashboard glass (.hero-banner): a rgba(0,0,0,.3)
   fill, blur(20px), and a 1px rgba(255,255,255,.1) hairline. */
#splash-intro {
  margin-top: 28px;
  display: none;                 /* JS flips to flex once the auth gate resolves */
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  width: min(360px, 86vw);
  padding: var(--space-xl);
  box-sizing: border-box;
  /* Opaque enough to obscure the dashboard behind (this card overlays busy
     content); frosted via backdrop-filter. Darker than .splash's veil so it
     reads as the primary panel. */
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: splashIn 0.5s var(--ease-spring);
}
#splash-intro .onb-section { display: flex; flex-direction: column; gap: 12px; }
/* Pill the primary CTA to match the inputs. ID scope beats the global .btn rule. */
#splash-intro .splash-cta { border-radius: 30px; }
#splash-intro .splash-staff-btn { border-radius: 30px; }
#splash-intro .onb-label { font-size: 0.95rem; color: var(--text-secondary); text-align: center; }
#splash-intro .onb-msg { font-size: 0.85rem; color: var(--text-secondary); text-align: center; margin: 0; }
/* Pill inputs/selects — structural pattern borrowed from the reference login
   template, recoloured with our glass tokens (not its light-gray palette). */
#splash-intro .onb-input,
#splash-intro .onb-select {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s var(--ease-smooth),
              box-shadow 0.2s var(--ease-smooth),
              background 0.2s var(--ease-smooth);
}
#splash-intro .onb-input { text-align: center; }
#splash-intro .onb-input::placeholder { color: var(--text-muted); }
#splash-intro .onb-input:focus,
#splash-intro .onb-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.25);
  background: rgba(255, 255, 255, 0.09);
}
#splash-intro .onb-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
#splash-intro .onb-select:disabled { opacity: 0.5; cursor: default; }
#splash-intro .onb-select option { background: var(--bg-elevated, #14142a); color: var(--text-primary); }

/* ❄️ Snowfall Canvas ❄️ */
#snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none; /* Let clicks pass through to the app */
  z-index: 5; /* Above blurred feature cards (0), but strictly BELOW bottom-nav (10) and sidebar (20) */
  opacity: 0;
  transition: opacity 1.5s ease;
}
#snow-canvas.snow-active {
  opacity: 1;
}

/* 📱 APP SHELL 📱 */
.app {
  display: flex;
  height: 100vh;
  /* Dynamic viewport height so the absolutely-positioned bottom nav sits at the
     real bottom of the visible area, not behind the mobile browser's toolbar. */
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  /* Horizontal safe-area: inset from the notch/rounded corners in landscape. */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  overflow: hidden;
  position: relative;
  z-index: 1; /* Guarantees all UI content sits strictly above the z-index: 0 snow */
}
.app.hidden {
  display: none;
}

/* ═══════════ SIDEBAR (removed in redesign — unified floating pill nav on all sizes) ═══════════ */
.sidebar {
  display: none !important;
  width: var(--sidebar-width);
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-subtle);
  flex-direction: column;
  z-index: 20;
  box-shadow: 10px 0 30px rgba(0,0,0,0.5);
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-xl);
}
.brand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.brand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: -0.3px;
}
.brand-text strong {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ITEM 11: cursive "guide" in the MUJguide wordmark (Dancing Script) */
.brand-guide {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: 1.15em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-left: 1px;
}

/* Logo glow — subtle blue/purple on desktop hover and mobile tap (:active).
   drop-shadow lights up the SVG shape itself (no box background). */
.brand-icon,
.header-logo {
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.3s ease;
}
.brand-icon:hover,
.brand-icon:active,
.header-logo:hover,
.header-logo:active {
  filter: drop-shadow(0 0 6px rgba(129, 140, 248, 0.9))
          drop-shadow(0 0 14px rgba(79, 70, 229, 0.55));
  transform: scale(1.06);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
}
.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo-light);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-rose);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.nav-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-sm) var(--space-md);
}

.sidebar-footer {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-lg);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.user-avatar.small {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.user-branch {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══════════ MAIN AREA ═══════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  /* Transparent so the fixed aurora mesh-bg shows through behind the content. */
  background: transparent;
}

/* ── App Header (centered wordmark — shown on all sizes now) ── */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: center;   /* ITEM 11: centered logo/wordmark */
  padding: var(--space-md) var(--space-lg);
  /* Safe-area: keep the wordmark clear of the notch / status bar. min-height
     (not height) so the header can grow by the inset instead of clipping. */
  padding-top: calc(var(--space-md) + env(safe-area-inset-top, 0px));
  min-height: var(--header-height);
  background: rgba(9, 9, 15, 0.7);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
  flex-shrink: 0;
}
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.header-logo {
  width: 30px;
  height: 30px;
}
.header-title {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
}
.header-title strong {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-profile {
  padding: 2px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-card);
}

/* ═══════════ VIEWS ═══════════ */
.view {
  display: none;
  flex: 1;
  overflow: hidden;
  position: absolute;
  inset: 0;
  opacity: 0;
}
/* Instant open with a quick fade + subtle scale-in — no horizontal slide, no
   lingering outgoing view (navigateTo swaps the active class immediately). */
.view.active {
  display: flex;
  flex-direction: column;
  position: relative;
  opacity: 1;
  animation: viewEnter 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes viewEnter {
  from { opacity: 0; transform: scale(1.015); }
  to   { opacity: 1; transform: scale(1); }
}
.view.exit-left { opacity: 0; }   /* retained for safety; no longer applied */

@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
}

.view-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-xl) var(--space-xl) calc(var(--space-2xl) + 20px);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ── View Title Bar ── */
.view-title-bar {
  margin-bottom: var(--space-xl);
}
.tt-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.tt-add-btn {
  flex: none;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  white-space: nowrap;
}
.tt-title-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.tt-publish-btn {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  white-space: nowrap;
}
.view-title-bar h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}
.view-title-bar p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ═══════════ HERO BANNER ═══════════ */
.hero-banner {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-xl);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero-greeting {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}
.hero-name {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: var(--space-xs) 0 var(--space-sm);
  /* Subtle shimmer sweep across the gradient name (3s loop). */
  background: linear-gradient(100deg,
    var(--accent-soft) 0%, var(--accent-soft) 38%,
    #f3f0ff 50%,
    var(--accent) 62%, var(--accent) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-shimmer 3s linear infinite;
}
@keyframes hero-shimmer {
  0%   { background-position: 180% center; }
  100% { background-position: -180% center; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-name { animation: none; background-position: center; }
}
.hero-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hero-glow {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 60%);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ═══════════ STATS ROW ═══════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
/* Dashboard stat cards are tappable buttons (ITEM 9). They are id-scoped so the
   focus-mode's runtime-injected .stat-card/.stat-value/.stat-label styles (which
   load after this file) don't bleed into the dashboard. */
.dash-stat {
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
#dashboard-stats .dash-stat {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
#dashboard-stats .stat-value {
  color: var(--text-primary);
  font-size: 1.4rem;
}
#dashboard-stats .stat-label {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0;
  font-size: 0.8rem;
}
.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-smooth),
              border-color var(--duration-normal) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity var(--duration-normal);
  pointer-events: none;
}
.stat-card:hover, .stat-card.touch-active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-glow-indigo);
  border-color: var(--border-glow);
}
.stat-card:hover::after, .stat-card.touch-active::after {
  opacity: 1;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px -4px var(--accent-glow);
  position: relative;   /* anchor for the notification badge */
}
/* Gmail-style notification count badge — top-right corner, bright red, with a
   ring so it reads as a floating app badge. */
.stat-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  letter-spacing: -0.2px;
  box-shadow: 0 0 0 2px var(--bg-card-solid, #14142a), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.stat-icon svg {
  width: 22px;
  height: 22px;
}
.stat-icon.blue {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo-light);
}
.stat-icon.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan-light);
}
.stat-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}
/* Transparent-glass icon chips for the dashboard stat cards — frosted glass
   holding the logo. Scoped to #dashboard-stats (focus-mode stat icons keep
   theirs); the id selector outranks the flat colour tints above. */
#dashboard-stats .stat-icon {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.12),
    0 2px 10px rgba(0, 0, 0, 0.25);
}
#dashboard-stats .stat-icon.blue   { color: var(--accent-indigo-light); }
#dashboard-stats .stat-icon.cyan   { color: var(--accent-cyan-light); }
#dashboard-stats .stat-icon.purple { color: var(--accent-purple); }

/* Attendance ring — the ring itself is the visual, so no glass chip behind it. */
#dashboard-stats .stat-icon.att-icon {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.att-ring { display: block; width: 42px; height: 42px; }

/* Schedule card — today's class list (taller than the plain stat cards). */
#dashboard-stats .sched-card { gap: 12px; }
.sched-head { display: flex; align-items: center; gap: 10px; }
.sched-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.sched-list { display: flex; flex-direction: column; gap: 7px; }
.sched-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.82rem; }
.sched-time { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-subj { color: var(--text-primary); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row.sched-done { opacity: 0.45; }
.sched-more { font-size: 0.75rem; color: var(--text-muted); }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ═══════════ SECTION HEADER ═══════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.section-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}
.link-btn {
  font-size: 0.85rem;
  color: var(--accent-indigo-light);
  font-weight: 500;
  transition: color var(--duration-fast);
}
.link-btn:hover {
  color: var(--accent-cyan);
}

/* ═══════════ SCHEDULE CARDS (Dashboard) ═══════════ */
.schedule-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.schedule-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  transition: transform var(--duration-normal) var(--ease-spring),
              border-color var(--duration-normal);
  position: relative;
  overflow: hidden;
}
.schedule-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
.schedule-card.color-indigo::before { background: var(--accent-indigo); }
.schedule-card.color-cyan::before { background: var(--accent-cyan); }
.schedule-card.color-purple::before { background: var(--accent-purple); }
.schedule-card.color-emerald::before { background: var(--accent-emerald); }
.schedule-card.color-amber::before { background: var(--accent-amber); }
.schedule-card.color-rose::before { background: var(--accent-rose); }

.schedule-card:hover, .schedule-card.touch-active {
  transform: translateX(4px);
  border-color: var(--border-glow);
}

.schedule-time {
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}
.schedule-time .time {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-soft);
}
.schedule-time .period {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.schedule-divider {
  width: 1px;
  height: 40px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.schedule-details {
  flex: 1;
  min-width: 0;
}
.schedule-details .subject {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-details .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.schedule-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.schedule-status.ongoing {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  animation: status-pulse 2s ease-in-out infinite;
}
.schedule-status.upcoming {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo-light);
}
.schedule-status.done {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ═══════════ QUICK GRID ═══════════ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal),
              border-color var(--duration-normal);
}
.quick-card:hover, .quick-card.touch-active {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-glow-indigo);
  border-color: var(--border-glow);
}
.quick-card:active {
  transform: scale(0.97);
}
.quick-icon {
  font-size: 1.8rem;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-icon.notes { background: rgba(99, 102, 241, 0.12); }
.quick-icon.pyq { background: rgba(6, 182, 212, 0.12); }
.quick-icon.food { background: rgba(245, 158, 11, 0.12); }
.quick-icon.calc { background: rgba(168, 85, 247, 0.12); }
.quick-icon.hostel { background: rgba(16, 185, 129, 0.12); }
.quick-icon.events { background: rgba(236, 72, 153, 0.12); }

.quick-card span:last-child {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ═══════════ UPDATES PREVIEW (Dashboard) ═══════════ */
.updates-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.update-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  padding-left: calc(var(--space-lg) + 5px);
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-spring),
              border-color var(--duration-normal),
              background var(--duration-normal);
}
/* Left accent bar coloured by update type. */
.update-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--accent);
}
.update-card.upd-type-hostel::before { background: var(--accent-soft); }
.update-card.upd-type-class::before  { background: var(--green); }
.update-card.upd-type-event::before  { background: var(--accent-pink); }
.update-card.upd-type-exam::before   { background: var(--yellow); }
.update-card:hover, .update-card.touch-active {
  transform: translateX(4px);
  border-color: var(--border-glow);
  background: var(--glass-hover);
}

.update-emoji {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.update-emoji.event { background: rgba(236, 72, 153, 0.12); }
.update-emoji.exam { background: rgba(245, 158, 11, 0.12); }
.update-emoji.announcement { background: rgba(99, 102, 241, 0.12); }

.update-body {
  flex: 1;
  min-width: 0;
}
.update-body .update-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.update-body .update-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.update-body .update-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.update-tag {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  letter-spacing: 0.5px;
}
.update-tag.event { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }
.update-tag.exam { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.update-tag.announcement { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo-light); }

/* ═══════════ TIMETABLE ═══════════ */
.day-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Keep horizontal swipes inside the week row — never bubble to page/view nav */
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  transition: all var(--duration-normal) var(--ease-spring);
  flex-shrink: 0;
}
.day-tab:hover {
  border-color: var(--border-glow);
}
.day-tab.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow-indigo);
}

.timetable-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  /* Vertical scroll native; horizontal day-swipe handled by JS */
  touch-action: pan-y;
}

.tt-slot {
  display: flex;
  gap: var(--space-md);
  align-items: stretch;
}

.tt-time {
  width: 70px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--space-md);
  position: relative;
}
.tt-time .t-start {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.tt-time .t-end {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.tt-time::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50px;
  bottom: -16px;
  width: 1px;
  background: var(--border-subtle);
}

.tt-card {
  flex: 1;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-spring),
              border-color var(--duration-normal);
}
.tt-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.tt-card.c-indigo::before { background: var(--accent-indigo); }
.tt-card.c-cyan::before { background: var(--accent-cyan); }
.tt-card.c-purple::before { background: var(--accent-purple); }
.tt-card.c-emerald::before { background: var(--accent-emerald); }
.tt-card.c-amber::before { background: var(--accent-amber); }
.tt-card.c-rose::before { background: var(--accent-rose); }

.tt-card:hover, .tt-card.touch-active {
  transform: scale(1.01);
  border-color: var(--border-glow);
}

.tt-card .tt-subject {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.tt-card .tt-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tt-card .tt-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tt-type.lecture { background: rgba(99, 102, 241, 0.12); color: var(--accent-indigo-light); }
.tt-type.lab { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.tt-type.tutorial { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple); }

/* Delete button on timetable cards */
.tt-delete-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(225, 29, 72, 0.15);
  color: var(--accent-rose);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-fast);
  z-index: 1;
}
.tt-card:hover .tt-delete-btn,
.tt-card.touch-active .tt-delete-btn {
  opacity: 1;
}
.tt-delete-btn:hover {
  background: rgba(225, 29, 72, 0.3);
}

/* ═══════════ TT-MODAL (Post Update + admin forms) ═══════════ */
/* Bottom sheet on mobile, centered dialog on desktop. Toggled via .active. */
.tt-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;            /* mobile & desktop: floats in the middle */
  justify-content: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tt-modal.active { display: flex; }

.tt-modal-content {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-elevated);
  animation: modalPopIn 0.3s var(--ease-spring);
}
.tt-modal-content::-webkit-scrollbar { display: none; }

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.tt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.tt-modal-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}
.tt-modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.tt-modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* Stacked label-over-input form used by the modal + admin glass-card forms */
.tt-modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.tt-modal-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.tt-modal-form input,
.tt-modal-form textarea {
  width: 100%;
  padding: var(--space-md);
  background: rgba(15, 23, 50, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-normal);
}
.tt-modal-form textarea { resize: vertical; min-height: 60px; }
.tt-modal-form input:focus,
.tt-modal-form textarea:focus { border-color: var(--accent-indigo); }
.tt-modal-form input::placeholder,
.tt-modal-form textarea::placeholder { color: var(--text-muted); }

/* Desktop: float the dialog in the centre instead of a bottom sheet */
@media (min-width: 640px) {
  .tt-modal { align-items: center; padding: var(--space-lg); }
  .tt-modal-content {
    border-radius: var(--radius-xl);
    animation: modalIn 0.3s var(--ease-spring);
  }
}

/* Select inputs in modal forms */
.tt-select {
  width: 100%;
  padding: var(--space-md);
  background: rgba(15, 23, 50, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  padding-right: calc(var(--space-md) * 2.5);
  transition: border-color var(--duration-normal);
  cursor: pointer;
}
.tt-select:focus { border-color: var(--accent-indigo); }

.tt-optional {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ═══════════ ATTENDANCE ═══════════ */
.attendance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.att-summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
}
.att-summary-card .att-circle {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-md);
  position: relative;
}
.att-summary-card .att-circle svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}
.att-summary-card .att-circle .bg-ring {
  fill: none;
  stroke: rgba(99, 102, 241, 0.1);
  stroke-width: 6;
}
.att-summary-card .att-circle .fg-ring {
  fill: none;
  stroke: url(#attendGrad);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease-smooth);
}
.att-summary-card .att-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.att-summary-card .att-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.subjects-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.subject-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--duration-normal) var(--ease-spring),
              border-color var(--duration-normal);
}
.subject-card:hover, .subject-card.touch-active {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.subject-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.subject-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.subject-pct {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.subject-pct.safe { color: var(--accent-emerald); }
.subject-pct.warning { color: var(--accent-amber); }
.subject-pct.danger { color: var(--accent-rose); }

.subject-bar {
  height: 6px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-md);
}
.subject-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width 0.8s var(--ease-smooth);
}
.subject-bar-fill.warning { background: linear-gradient(135deg, var(--accent-amber), #fbbf24); }
.subject-bar-fill.danger { background: linear-gradient(135deg, var(--accent-rose), #fb7185); }

.subject-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.subject-actions {
  display: flex;
  gap: var(--space-sm);
}
.subject-actions button {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--duration-fast) var(--ease-spring);
}
.subject-actions .btn-present {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.subject-actions .btn-present:hover { background: rgba(16, 185, 129, 0.2); }
.subject-actions .btn-present:active { transform: scale(0.95); }
.subject-actions .btn-absent {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.subject-actions .btn-absent:hover { background: rgba(244, 63, 94, 0.2); }
.subject-actions .btn-absent:active { transform: scale(0.95); }
.subject-actions .btn-delete {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
  flex: 0;
  padding: var(--space-sm) var(--space-sm);
}
.subject-actions .btn-delete:hover { background: rgba(100, 116, 139, 0.2); color: var(--accent-rose); }

.subject-bunk-info {
  font-size: 0.78rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  font-weight: 500;
}
.subject-bunk-info.can-bunk {
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-emerald);
}
.subject-bunk-info.must-attend {
  background: rgba(244, 63, 94, 0.08);
  color: var(--accent-rose);
}

.add-btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-normal);
}
.add-btn:hover {
  box-shadow: var(--shadow-glow-indigo);
}
.add-btn:active {
  transform: scale(0.95);
}

/* ═══════════ RESOURCES ═══════════ */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  transition: border-color var(--duration-normal);
}
.search-bar:focus-within {
  border-color: var(--accent-indigo);
}
.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.search-bar input::placeholder {
  color: var(--text-muted);
}

.filter-chips {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-spring);
  flex-shrink: 0;
}
.chip:hover {
  border-color: var(--border-glow);
}
.chip.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo-light);
}

/* ITEM 6: Updates segmented tabs (Campus / Hostel / Class) */
.updates-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  padding: var(--space-xs);
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
}
.upd-tab {
  flex: 1;
  white-space: nowrap;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-spring);
}
.upd-tab.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-indigo);
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.resource-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--duration-normal) var(--ease-spring),
              border-color var(--duration-normal),
              box-shadow var(--duration-normal);
  cursor: pointer;
}
.resource-card:hover, .resource-card.touch-active {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-indigo);
}

.resource-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}
.resource-card h3 {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
}
.resource-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}
.resource-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.resource-tag.notes { background: rgba(99, 102, 241, 0.12); color: var(--accent-indigo-light); }
.resource-tag.pyq { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.resource-tag.guide { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }

/* ── OUTLETS DIRECTORY ── */
/* .outlet-grid lives in features.css (base + responsive columns) — do not
   redefine it here: duplicate definitions made the winner depend on <link>
   order, which silently broke two visual passes before (5 July 2026 audit). */

/* ═══════════ CAMPUS DIRECTORY ═══════════ */
.campus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.campus-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--duration-normal) var(--ease-spring),
              border-color var(--duration-normal);
}
.campus-card:hover, .campus-card.touch-active {
  transform: translateY(-3px);
  border-color: var(--border-glow);
}

.campus-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.campus-emoji {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.campus-emoji.food { background: rgba(245, 158, 11, 0.12); }
.campus-emoji.services { background: rgba(99, 102, 241, 0.12); }
.campus-emoji.facilities { background: rgba(16, 185, 129, 0.12); }

.campus-card h3 {
  font-weight: 600;
  font-size: 0.95rem;
}
.campus-card .campus-type {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.campus-card .campus-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}
.campus-card .campus-hours {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.campus-status {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.campus-status.open { background: var(--accent-emerald); box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.campus-status.closed { background: var(--accent-rose); }

/* ═══════════ UPDATES LIST ═══════════ */
.updates-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ═══════════ MODAL ═══════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.modal.hidden {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  animation: modalIn 0.3s var(--ease-spring);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.glass-card {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(190%) brightness(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(190%) brightness(1.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

/* Crystal-clear glass everywhere: let the vibrant aurora saturate through the cards
   so panels feel like real glass, not flat dark tiles. */
.stat-card, .quick-card, .schedule-card, .update-card,
#dashboard-stats .dash-stat, .outlet-card {
  backdrop-filter: blur(22px) saturate(190%) brightness(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(190%) brightness(1.08);
}

/* Interactive cards brighten toward the elevated glass on hover/press. */
.stat-card:hover, .stat-card.touch-active,
.quick-card:hover, .quick-card.touch-active,
.schedule-card:hover, .schedule-card.touch-active,
#dashboard-stats .dash-stat:hover, #dashboard-stats .dash-stat.touch-active {
  background: var(--glass-hover);
}

.modal-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-md);
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}
.form-group input {
  width: 100%;
  padding: var(--space-md);
  background: rgba(15, 23, 50, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-normal);
}
.form-group input:focus {
  border-color: var(--accent-indigo);
}
.form-group input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.btn {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--duration-fast) var(--ease-spring);
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  flex: 1;
}
.btn-primary:hover { box-shadow: var(--shadow-glow-indigo); }
.btn-ghost {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}
.btn-ghost:hover { background: rgba(100, 116, 139, 0.2); }

/* ═══════════ FLOATING PILL NAV (unified — mobile + desktop) ═══════════ */
/* Single floating glass pill, horizontally centred, with a spring-sliding
   indicator behind the active tab. The indicator's x/width are driven by JS
   via the --indicator-x / --indicator-w custom properties. */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 420px;
  height: auto;
  padding: 7px;
  gap: 0;
  justify-content: space-around;
  align-items: center;
  border-radius: var(--radius-pill);
  background: rgba(14, 14, 26, 0.72);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--border-strong);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 1000;
  flex-shrink: 0;
  transition:
    transform var(--transition),
    opacity var(--transition);
}
/* Desktop: a touch wider, still a floating pill (no sidebar). */
@media (min-width: 901px) {
  .bottom-nav { width: 520px; max-width: 600px; }
}
/* Slide the pill down off-screen (and fade) when auto-hidden on scroll. */
.bottom-nav.nav-hidden {
  transform: translateX(-50%) translateY(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}

/* Sliding active indicator — a single pill behind the active tab. */
.bnav-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  height: calc(100% - 12px);
  width: var(--indicator-w, 48px);
  transform: translate(var(--indicator-x, 0px), -50%);
  border-radius: var(--radius-pill);
  background: var(--accent-glow);
  border: 1px solid rgba(108, 99, 255, 0.4);
  box-shadow: 0 2px 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: transform var(--spring), width var(--spring), opacity var(--transition);
}
.bnav-indicator.show { opacity: 1; }

/* Each tab: flex cell, icon + (active-only) label. Label is absolutely positioned
   so toggling it never reflows the pill. */
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: 50px;
  padding: 0;
  color: rgba(238, 238, 255, 0.42);
  transition: color var(--transition);
  position: relative;
  z-index: 1;
  border-radius: var(--radius-pill);
}
.bnav-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform var(--spring);
}
/* Active-only label, absolutely positioned at the bottom of the cell. */
.bnav-item span {
  display: block;
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
  color: var(--accent-soft);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
}
.bnav-item.active {
  color: var(--accent-soft);
}
.bnav-item.active svg {
  transform: scale(1.06) translateY(-6px);
}
.bnav-item.active span {
  opacity: 1;
  transform: translateY(0);
}
.bnav-item:active svg {
  transform: scale(0.84);
}
.bnav-item:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: -4px;
  border-radius: var(--radius-pill);
}

.bnav-badge {
  position: absolute;
  top: 5px;
  right: 7px;
  background: var(--accent-rose);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .bottom-nav { transition: none; }
}

/* ═══════════ DOCK MODE (reactbits-style magnify, vanilla) ═══════════
   Layered over .bottom-nav so all nav wiring (.bnav-item data-view →
   navigateTo, active state, feature toggles, More handler) is untouched.
   Glass tokens match .hero-banner / the onboarding card. */
.bottom-nav.dock-nav {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  height: 60px;                 /* panelHeight ~60 */
  padding: 0 12px;
  gap: 0;
  justify-content: space-evenly;   /* even spacing across the full pill */
  align-items: flex-end;        /* items magnify upward from the dock floor */
  overflow: visible;            /* let magnified icons + labels spill out */
}
.dock-nav .bnav-indicator { display: none; }   /* dock uses magnify, not a sliding pill */
/* When the vanilla Glass Surface (SVG refraction) is active, JS sets an inline
   backdrop-filter (url(#dock-glass)…) that replaces the flat blur. Lighten the
   panel + brighten the hairline so the refraction/chroma reads. */
/* reactbits GlassSurface --svg edge treatment: no border, just soft inset edge
   glows — toned way down so the glass rim reads but isn't bright. */
.bottom-nav.dock-nav.glass-surface-live {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  box-shadow:
    inset 0 0 2px 1px rgba(255, 255, 255, 0.1),    /* inner edge (reactbits ~0.35 → 0.10) */
    inset 0 0 10px 4px rgba(255, 255, 255, 0.03),  /* soft inner glow */
    0 10px 30px rgba(0, 0, 0, 0.45);               /* lift */
}

/* Transparent glass on the app's segmented pill bars — consistent with the
   dock (SVG refraction stays dock-only for performance). Only bg/blur/edge are
   touched; each bar keeps its own radius/padding/layout. */
.updates-tabs,
.acad-tabs,
.semester-tabs,
.admin-tabs {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.08);
}
.dock-nav .bnav-item {
  flex: 0 0 auto;
  width: 48px;                  /* baseItemSize ~48 */
  height: 48px;
  margin-bottom: 6px;
  border-radius: 14px;
  /* No per-icon glass tile — icons sit directly on the pill's glass surface. */
  background: transparent;
  border: none;
  color: rgba(238, 238, 255, 0.62);
  transform: scale(var(--dock-scale, 1));
  transform-origin: center bottom;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
  will-change: transform;
}
.dock-nav .bnav-item:hover { background: rgba(255, 255, 255, 0.06); }
.dock-nav .bnav-item.active { background: transparent; color: var(--accent-soft); }
.dock-nav .bnav-item svg { width: 24px; height: 24px; transform: none; }
.dock-nav .bnav-item.active svg { transform: none; }   /* cancel the pill-nav active lift */
/* Small active dot under the icon (replaces the sliding indicator). */
.dock-nav .bnav-item.active::after {
  content: "";
  position: absolute;
  bottom: 3px; left: 50%;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}
/* DockLabel — the existing <span> repurposed as a glass tooltip above the item. */
.dock-nav .bnav-item span {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  right: auto;
  width: auto;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth);
  pointer-events: none;
}
.dock-nav .bnav-item:hover span,
.dock-nav .bnav-item:focus-visible span,
.dock-nav .bnav-item.dock-show-label span { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .dock-nav .bnav-item { transition: background 0.2s, color 0.2s; }
}

/* ═══════════ RIPPLE EFFECT ═══════════ */
.ripple-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.25);
  transform: scale(0);
  animation: ripple-anim 0.6s linear;
  pointer-events: none;
}
@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ═══════════ EMPTY STATE ═══════════ */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
  grid-column: 1 / -1;   /* span all columns when dropped inside a grid (e.g. outlets) */
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}
/* SVG variant: stroke inherits the muted text colour, centred like the emoji icon. */
.empty-state .empty-icon--svg {
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state .empty-icon--svg svg {
  width: 46px;
  height: 46px;
}
.empty-state p {
  font-size: 0.9rem;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }
  /* Pill height (~56px) + 16px gap + safe-area = clearance beneath content. */
  .main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .view-scroll {
    padding: var(--space-md) var(--space-md) calc(80px + env(safe-area-inset-bottom, 0px) + var(--space-xl));
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);   /* ITEM 9: 2×2 dashboard cards on mobile */
  }
  .quick-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero-name { font-size: 1.6rem; }
  .resources-grid { grid-template-columns: 1fr; }
  .attendance-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 500px) {
  .quick-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }
  .quick-card {
    padding: var(--space-md) var(--space-sm);
  }
  .quick-icon {
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }
  .stat-card { padding: var(--space-md); }
  .stat-value { font-size: 1.2rem; }
  .hero-banner { padding: var(--space-lg); }
}

@media (min-width: 901px) {
  /* No sidebar — main is full-width, content column centred at 900px,
     editorial top spacing, bottom padding clears the floating pill. */
  .view-scroll {
    padding-left: max(var(--space-xl), calc((100% - 900px) / 2));
    padding-right: max(var(--space-xl), calc((100% - 900px) / 2));
    padding-top: var(--space-2xl);
    padding-bottom: 110px;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);   /* ITEM 9: keep 2×2 on desktop too */
  }
}

/* ═══════════ LOGIN SCREEN ═══════════ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: var(--space-lg);
}
.login-screen.hidden {
  display: none;
}

.login-container {
  text-align: center;
  max-width: 400px;
  width: 100%;
  animation: splashIn 0.6s var(--ease-spring);
}

.login-icon {
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-xl);
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}
.login-title span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  padding: 14px var(--space-lg);
  background: white;
  color: #1f1f1f;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-spring);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.google-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.google-login-btn:active {
  transform: scale(0.97);
}

.skip-login-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-md);
  padding: 12px;
  background: none;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal);
}
.skip-login-btn:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.login-footer {
  margin-top: var(--space-xl);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══════════ LOGOUT BUTTON ═══════════ */
.logout-btn {
  width: 100%;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-md);
  color: var(--accent-rose);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.logout-btn:hover {
  background: rgba(244, 63, 94, 0.2);
}
.logout-btn.hidden {
  display: none;
}

/* User avatar image */
.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
}
/* -- Premium Mesh Background -- */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Deep ocean-navy base with fresh blue / cyan / teal washes — vibrant and alive,
     but cool and clean (not purple). A faint indigo bridges to the accent. */
  background: var(--bg-primary);
}
.mesh-blob {
  position: absolute;
  border-radius: 50%;
  /* Soft radial fills already feather their own edges, so we only need a light
     blur — keeps the aurora vivid without the GPU cost of huge blur + blend. */
  filter: blur(46px);
  opacity: 0.95;
  animation: float-blob 24s infinite alternate ease-in-out;
  will-change: transform, opacity;
}
.blob-1 {
  width: 58vw;
  height: 58vw;
  background: rgba(79, 70, 229, 0.4);
  top: -20%;
  left: -12%;
  animation-duration: 24s;
}
.blob-2 {
  width: 64vw;
  height: 64vw;
  background: rgba(6, 182, 212, 0.3);
  bottom: -26%;
  right: -20%;
  animation-duration: 28s;
  animation-delay: -6s;
}
.blob-3 {
  width: 48vw;
  height: 48vw;
  background: rgba(147, 51, 234, 0.3);
  top: 34%;
  left: 38%;
  animation-duration: 32s;
  animation-delay: -12s;
}
.blob-4 {
  width: 44vw;
  height: 44vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.42), rgba(99, 102, 241, 0) 68%);
  top: -12%;
  right: -8%;
  animation-duration: 30s;
  animation-delay: -16s;
}
@media (prefers-reduced-motion: reduce) {
  .mesh-blob { animation: none; }
}

/* Drift + a gentle opacity "breathe" so the aurora feels alive, not static. */
@keyframes float-blob {
  0%   { transform: translate(0, 0) scale(1);          opacity: 0.78; }
  33%  { transform: translate(6%, 10%) scale(1.12);    opacity: 1; }
  66%  { transform: translate(-5%, 6%) scale(0.92);    opacity: 0.84; }
  100% { transform: translate(10%, -6%) scale(1.07);   opacity: 0.95; }
}

/* --- More Menu Drawer --- */
.more-menu-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-spring);
}
.more-menu-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.more-menu {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 85vh;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glow);
  border-radius: 24px 24px 0 0;
  z-index: 1000;
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 20px));
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-spring);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.more-menu.visible {
  transform: translateY(0);
}

.more-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.more-menu-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}
.close-menu-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
}

.more-menu-list {
  display: grid;
  /* Adapts column count to the drawer width: 2 on phones, more on wider screens.
     minmax keeps every column an equal fraction so tiles stay uniform. */
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-auto-rows: 1fr;      /* every row shares a height → uniform tiles */
  gap: var(--space-sm);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.more-menu-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* center content so "Soon"-badge tiles match plain ones */
  gap: var(--space-xs);
  min-height: 96px;          /* even block height whether or not a badge is present */
  text-align: center;
}
.menu-badge-soon {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
  margin-top: -2px;
}
/* SLCM summary-bar caption (was an orphaned ".slider" rule — restored to its
   intended selector so the Focus ambience toggle can own ".slider"). */
.slcm-summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.slcm-sub-name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}
.slcm-sub-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}
.pct-green { color: var(--accent-emerald); }
.pct-amber { color: var(--accent-amber); }
.pct-red { color: var(--accent-rose); }

.fill-green { background: var(--accent-emerald); }
.fill-amber { background: var(--accent-amber); }
.fill-red { background: var(--accent-rose); }

.slcm-card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-bottom: 4px;
}
.slcm-bunk-info {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  display: inline-block;
}
.slcm-bunk-info.bunk-safe {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}
.slcm-bunk-info.bunk-warn {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

/* ═══════════ ACADEMICS VIEW ═══════════ */

/* Loading + spinner */
.acad-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-secondary);
}
.acad-spinner {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 3px solid var(--border-card);
  border-top-color: var(--accent-indigo-light);
  animation: acad-spin 0.8s linear infinite;
}
@keyframes acad-spin {
  to { transform: rotate(360deg); }
}

/* Tabs bar */
.acad-tabs-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.acad-tabs {
  display: flex;
  gap: var(--space-xs);
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: var(--space-xs);
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
}
.acad-tabs::-webkit-scrollbar { display: none; }
.acad-tab {
  flex: 1;
  white-space: nowrap;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-spring);
}
.acad-tab.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-indigo);
}
.acad-refresh-btn { flex-shrink: 0; }

/* Small circular icon button — refresh affordances in SLCM headers, summary bars */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--duration-normal), background var(--duration-normal), transform var(--duration-normal);
}
.icon-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.08); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spinning svg { animation: acad-spin 0.8s linear infinite; }

/* Panels */
.acad-panel { display: none; }
.acad-panel.active {
  display: block;
  animation: acad-fade-in var(--duration-slow) var(--ease-smooth);
}
@keyframes acad-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Marks table */
.acad-table-card { padding: var(--space-md); }
.acad-table-wrap { overflow-x: auto; }
.acad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.acad-table th {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-sm);
  border-bottom: 1px solid var(--border-card);
}
.acad-table th:first-child { text-align: left; }
.acad-table td {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.acad-table tbody tr:last-child td { border-bottom: none; }
.acad-table .acad-course {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}
.acad-table .acad-total {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--accent-indigo-light);
}

/* Grades list */
.acad-grades-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.acad-grade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
}
.acad-grade-course {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.acad-grade-pill {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 48px;
  text-align: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.acad-grade-pill.grade-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}
.acad-grade-pill.grade-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}
.acad-grade-pill.grade-red {
  background: rgba(225, 29, 72, 0.15);
  color: var(--accent-rose);
}
.acad-grade-pill.grade-neutral {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}

/* CGPA tab */
.acad-cgpa-card {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.acad-cgpa-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}
.acad-cgpa-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.acad-cgpa-big {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 4rem;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.acad-cgpa-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border-card);
}
.acad-cgpa-tkey {
  padding: var(--space-sm) var(--space-sm) var(--space-sm) 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: 55%;
  vertical-align: middle;
  text-align: left;
}
.acad-cgpa-tval {
  padding: var(--space-sm) 0 var(--space-sm) var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  vertical-align: middle;
}
.acad-cgpa-divider td {
  padding: 0;
  height: 1px;
  background: var(--border-subtle);
}

/* Transcript tab */
.acad-tr-card {
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.acad-tr-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-indigo-light);
  margin-bottom: var(--space-md);
}
.acad-tr-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.acad-tr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}
.acad-tr-row:last-child { border-bottom: none; padding-bottom: 0; }
.acad-tr-key {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.acad-tr-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}
.acad-tr-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   REDESIGN POLISH — inputs · buttons · card-enter · skeleton
   (transform/opacity-only animations; reduced-motion respected)
   ═══════════════════════════════════════════════════ */

/* ── Inputs: glass fill + accent focus ring ── */
.form-group input,
.form-group select,
.form-group textarea,
.tt-modal-form input,
.tt-modal-form textarea,
.tt-select,
.slcm-input {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
/* Username field with a constant @muj.manipal.edu suffix (SLCM-style). Same full
   bar length; the suffix is a display adornment — the typed value is submitted
   unchanged so the SLCM login isn't altered. */
.slcm-suffix-wrapper { position: relative; display: block; }
.slcm-suffix-wrapper .slcm-input { width: 100%; padding-right: 138px; }
.slcm-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  font-size: 0.92rem;
  white-space: nowrap;
  pointer-events: none;
}
/* Password show/hide toggle — a clear "Show"/"Hide" text control docked at the
   right of the field (replaces the ambiguous eye emoji). */
.slcm-password-wrapper { position: relative; display: block; }
.slcm-password-wrapper .slcm-input { width: 100%; padding-right: 64px; }
.slcm-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent-soft);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.slcm-pwd-toggle:hover { color: var(--accent); background: rgba(255, 255, 255, 0.06); }
/* Header actions (semester switcher + refresh) in the SLCM view title bars. */
.slcm-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.tt-modal-form input:focus,
.tt-modal-form textarea:focus,
.tt-select:focus,
.slcm-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-color: rgba(255, 255, 255, 0.06);
  outline: none;
}
.form-group input::placeholder,
.tt-modal-form input::placeholder,
.tt-modal-form textarea::placeholder,
.slcm-input::placeholder { color: var(--text-3); }
/* Search pill glows on focus-within */
.outlet-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Selects: themed field + dropdown (kills the flat dark-grey native look) ── */
.form-group select,
.tt-select,
select.slcm-input {
  /* color-scheme:dark themes the native popup; a soft violet-tinted fill makes the
     field read as part of the glass UI rather than a grey OS control. */
  color-scheme: dark;
  background-color: rgba(108, 99, 255, 0.10);
  color: var(--text-1);
  cursor: pointer;
}
.form-group select:hover,
.tt-select:hover,
select.slcm-input:hover {
  background-color: rgba(108, 99, 255, 0.16);
  border-color: var(--border-strong);
}
/* The dropdown option list — dark violet panel, light text (honoured by Chromium/Edge). */
.form-group select option,
.tt-select option,
select.slcm-input option {
  background-color: #14142a;
  color: var(--text-1);
}
.form-group select option:checked,
.tt-select option:checked,
select.slcm-input option:checked {
  background-color: var(--accent);
  color: #fff;
}

/* ── Buttons: pill shape, glass secondary, danger tint ── */
.btn { border-radius: var(--radius-pill); }
.btn-primary { box-shadow: 0 2px 18px -4px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 6px 28px -4px var(--accent-glow); filter: brightness(1.05); }
.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}
.btn-danger {
  background: var(--glass);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--red);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.6); }

/* ── Card enter: staggered fade-up (fill backwards so hover transforms still work) ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stats-row > *,
#dashboard-stats > *,
.quick-grid > *,
.schedule-cards > *,
.updates-list > *,
.updates-preview > *,
.outlet-grid > *,
.rsrc-branch-grid > *,
.rsrc-subject-grid > * {
  animation: fadeUp 0.42s var(--ease-smooth) backwards;
}
.stats-row > *:nth-child(2), #dashboard-stats > *:nth-child(2), .quick-grid > *:nth-child(2), .schedule-cards > *:nth-child(2), .updates-list > *:nth-child(2), .updates-preview > *:nth-child(2), .outlet-grid > *:nth-child(2), .rsrc-branch-grid > *:nth-child(2), .rsrc-subject-grid > *:nth-child(2) { animation-delay: 0.05s; }
.stats-row > *:nth-child(3), #dashboard-stats > *:nth-child(3), .quick-grid > *:nth-child(3), .schedule-cards > *:nth-child(3), .updates-list > *:nth-child(3), .updates-preview > *:nth-child(3), .outlet-grid > *:nth-child(3), .rsrc-branch-grid > *:nth-child(3), .rsrc-subject-grid > *:nth-child(3) { animation-delay: 0.10s; }
.stats-row > *:nth-child(4), #dashboard-stats > *:nth-child(4), .quick-grid > *:nth-child(4), .schedule-cards > *:nth-child(4), .updates-list > *:nth-child(4), .updates-preview > *:nth-child(4), .outlet-grid > *:nth-child(4), .rsrc-branch-grid > *:nth-child(4), .rsrc-subject-grid > *:nth-child(4) { animation-delay: 0.15s; }
.quick-grid > *:nth-child(5), .schedule-cards > *:nth-child(5), .updates-list > *:nth-child(5), .outlet-grid > *:nth-child(5), .rsrc-branch-grid > *:nth-child(5), .rsrc-subject-grid > *:nth-child(5) { animation-delay: 0.20s; }
.quick-grid > *:nth-child(6), .schedule-cards > *:nth-child(6), .updates-list > *:nth-child(6), .outlet-grid > *:nth-child(6), .rsrc-branch-grid > *:nth-child(6), .rsrc-subject-grid > *:nth-child(6) { animation-delay: 0.25s; }
.outlet-grid > *:nth-child(n+7), .rsrc-branch-grid > *:nth-child(n+7), .rsrc-subject-grid > *:nth-child(n+7), .updates-list > *:nth-child(n+7) { animation-delay: 0.30s; }

/* ── Skeleton loader (pulsing glass with shimmer sweep) ── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--glass);
  border-radius: var(--radius-md);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: skeletonSweep 1.4s ease-in-out infinite;
}
@keyframes skeletonSweep {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .stats-row > *, #dashboard-stats > *, .quick-grid > *, .schedule-cards > *,
  .updates-list > *, .updates-preview > *, .outlet-grid > *,
  .rsrc-branch-grid > *, .rsrc-subject-grid > * { animation: none; }
  .skeleton::after { animation: none; }
}

/* ── Skeleton pulse loaders ── */
@keyframes muj-skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

.skeleton {
  background: rgba(255, 255, 255, 0.07);
  animation: muj-skeleton-pulse 1.6s ease-in-out infinite;
  pointer-events: none;
}

.skeleton-line        { height: 14px; margin-bottom: 10px; border-radius: 6px; }
.skeleton-line.wide   { width: 85%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.short  { width: 35%; }
.skeleton-card        { height: 80px; border-radius: 12px; margin-bottom: 12px; }
.skeleton-stat        { height: 64px; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ── View skeleton cards (outlets / updates / community) ──
   .skel-card is the card chrome; the shimmering blocks reuse .skeleton. */
.skel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.skel-row { display: flex; align-items: center; gap: var(--space-sm); }
.skel-grow { flex: 1; min-width: 0; }
.skel-avatar { width: 46px; height: 46px; border-radius: var(--radius-md); flex-shrink: 0; }
.skel-line { height: 12px; border-radius: 6px; }
.skel-line.lg { height: 16px; }
.skel-pill { height: 36px; flex: 1; border-radius: var(--radius-md); }
.skel-tag { width: 50px; height: 20px; border-radius: var(--radius-pill); flex-shrink: 0; }
.skel-w30 { width: 30%; }
.skel-w40 { width: 40%; }
.skel-w50 { width: 50%; }
.skel-w70 { width: 70%; }
.skel-w90 { width: 90%; }
/* In the outlet grid the skeletons live as grid cells; reset the card margin. */
.outlet-grid .skel-card { margin-bottom: 0; }

/* ── Resources empty-state SVG icon variant ── */
.rsrc-empty-icon--svg {
  display: flex;
  align-items: center;
  justify-content: center;
}
.rsrc-empty-icon--svg svg { width: 44px; height: 44px; }

/* ── Offline banner (slim bar below header) ── */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 7px var(--space-md);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-card);
  z-index: 9;
}
.offline-banner svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Pull-to-refresh indicator (outlets / updates / community) ── */
.ptr-indicator {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast), transform var(--duration-fast);
}
.ptr-indicator.visible { opacity: 1; transform: translateX(-50%) scale(1); }
.ptr-indicator.ready { border-color: var(--border-glow); }
.ptr-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
}
.ptr-indicator.refreshing .ptr-spinner { animation: ptrSpin 0.7s linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* ── Card entrance for outlets / updates / community (≤300ms, 60ms stagger) ──
   Defined after the global fadeUp block so it wins for containers carrying
   .cards-animate (equal specificity, later source order). */
@keyframes cardRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cards-animate > * { animation: cardRise 280ms var(--ease-smooth) backwards; }
.cards-animate > *:nth-child(1) { animation-delay: 0ms; }
.cards-animate > *:nth-child(2) { animation-delay: 60ms; }
.cards-animate > *:nth-child(3) { animation-delay: 120ms; }
.cards-animate > *:nth-child(4) { animation-delay: 180ms; }
.cards-animate > *:nth-child(5) { animation-delay: 240ms; }
.cards-animate > *:nth-child(6) { animation-delay: 300ms; }
.cards-animate > *:nth-child(n+7) { animation-delay: 340ms; }

@media (prefers-reduced-motion: reduce) {
  .cards-animate > * { animation: none; }
  .ptr-indicator.refreshing .ptr-spinner { animation-duration: 1.4s; }
}

