/* =====================================================
   Canadian University of Nigeria (CUN)
   Neuro-Futuristic Design System — Dark Edition
   Inspired by modern AI platforms, student-friendly
   ===================================================== */

:root {
  /* Core Palette — Deep space + neon cyan/purple */
  --bg-deep: #050810;
  --bg-primary: #0a0e1a;
  --bg-card: rgba(15, 22, 40, 0.75);
  --bg-card-solid: #0f1628;
  --bg-elevated: #141c30;
  --primary: #0ea5e9;
  --primary-bright: #38bdf8;
  --primary-dim: #0284c7;
  --accent: #a855f7;
  --accent-bright: #c084fc;
  --accent-glow: rgba(168, 85, 247, 0.45);
  --cyan: #22d3ee;
  --teal: #2dd4bf;
  --gold: #fbbf24;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Borders & Glass */
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --glass: rgba(15, 22, 40, 0.65);
  --glass-border: rgba(56, 189, 248, 0.15);

  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
  --glow-primary: 0 0 30px rgba(14, 165, 233, 0.35);
  --glow-accent: 0 0 40px rgba(168, 85, 247, 0.4);
  --glow-cyan: 0 0 25px rgba(34, 211, 238, 0.3);

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-4xl: 6rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --header-height: 72px;
  --container: 1180px;
  --container-wide: 1320px;
}

/* Light theme override (toggle) */
[data-theme="light"] {
  --bg-deep: #f8fafc;
  --bg-primary: #ffffff;
  --bg-card: rgba(255,255,255,0.9);
  --bg-card-solid: #ffffff;
  --bg-elevated: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(15,23,42,0.08);
  --border-strong: rgba(15,23,42,0.14);
  --glass: rgba(255,255,255,0.85);
  --glass-border: rgba(14,165,233,0.2);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.1);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100vw;
  height: auto;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-deep);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  height: auto;
  position: relative;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-bright); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--cyan); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2.8vw, 1.65rem); }
h4 { font-size: 1.2rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-lg); }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--space-lg); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--primary); color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius-md);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ========== HEADER ========== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-height);
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}
[data-theme="light"] .site-header {
  background: rgba(255,255,255,0.9);
}
.site-header.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.35);
  border-bottom-color: var(--glass-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height); gap: 1rem;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-link img { height: 40px; width: auto; transition: transform var(--transition); }
.logo-link:hover img { transform: scale(1.04); }

.main-nav {
  display: flex; align-items: center; gap: 0.15rem;
}
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.55rem 0.9rem; border-radius: var(--radius-md);
  color: var(--text-secondary); font-weight: 500; font-size: 0.925rem;
  transition: all var(--transition);
}
.nav-link:hover, .nav-item:hover > .nav-link {
  color: var(--text-primary); background: rgba(14,165,233,0.08);
}
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all var(--transition);
  z-index: 100;
}
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: block; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.9rem;
  transition: all var(--transition);
}
.dropdown a:hover {
  background: rgba(14,165,233,0.12); color: var(--primary-bright);
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.search-toggle, .menu-toggle, .theme-toggle {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); background: transparent;
  transition: all var(--transition); font-size: 1.15rem;
}
.search-toggle:hover, .menu-toggle:hover, .theme-toggle:hover {
  background: rgba(14,165,233,0.12); color: var(--primary-bright);
}
.menu-toggle { display: none; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border-radius: var(--radius-full);
  font-weight: 600; font-size: 0.95rem; line-height: 1.2;
  transition: all var(--transition); white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary, .btn-accent {
  background: linear-gradient(135deg, #0ea5e9 0%, #a855f7 100%);
  color: #fff; box-shadow: 0 4px 20px rgba(14,165,233,0.35);
}
.btn-primary:hover, .btn-accent:hover {
  transform: translateY(-2px); box-shadow: 0 8px 28px rgba(168,85,247,0.45);
  color: #fff;
}
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(14,165,233,0.1); color: var(--primary-bright);
  border-color: var(--primary);
}
.btn-outline {
  background: transparent; color: var(--primary-bright);
  border: 1.5px solid rgba(14,165,233,0.5);
}
.btn-outline:hover {
  background: rgba(14,165,233,0.12); border-color: var(--primary-bright);
  box-shadow: var(--glow-primary);
}
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.05rem; }

/* ========== HERO ========== */
.hero {
  position: relative; padding: 5rem 0 4rem;
  overflow: hidden; min-height: 78vh;
  display: flex; align-items: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(168,85,247,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 20% 70%, rgba(14,165,233,0.15) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 0%, rgba(34,211,238,0.08) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem; align-items: center; position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: var(--radius-full);
  background: rgba(14,165,233,0.12); border: 1px solid rgba(14,165,233,0.3);
  color: var(--cyan); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 1.25rem; animation: fadeInUp 0.6s ease both;
}
.hero-badge i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s ease infinite;
}
.hero h1 {
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.7s ease 0.1s both;
}
.hero .lead {
  font-size: 1.15rem; color: var(--text-secondary);
  max-width: 520px; margin-bottom: 2rem;
  animation: fadeInUp 0.7s ease 0.2s both;
}
.hero-ctas {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  margin-bottom: 1.75rem;
  animation: fadeInUp 0.7s ease 0.3s both;
}
.hero-trust {
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  font-size: 0.85rem; color: var(--text-muted);
  animation: fadeInUp 0.7s ease 0.4s both;
}
.hero-trust span { display: flex; align-items: center; gap: 0.4rem; }
.hero-trust svg { width: 16px; height: 16px; color: var(--success); }

.hero-visual {
  position: relative; display: flex; justify-content: center; align-items: center;
  animation: fadeIn 1s ease 0.3s both;
}
.hero-orb {
  width: min(420px, 90%); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(56,189,248,0.25), transparent 55%),
              radial-gradient(circle at 65% 65%, rgba(168,85,247,0.3), transparent 50%);
  position: relative;
  box-shadow: var(--glow-accent), inset 0 0 60px rgba(14,165,233,0.15);
  animation: float 8s ease-in-out infinite;
}
.hero-orb::before {
  content: ''; position: absolute; inset: 12%;
  border-radius: 50%; border: 1px solid rgba(56,189,248,0.25);
  animation: spin 40s linear infinite;
}
.hero-orb::after {
  content: ''; position: absolute; inset: 22%;
  border-radius: 50%; border: 1px dashed rgba(168,85,247,0.3);
  animation: spin 25s linear infinite reverse;
}
.hero-features {
  position: absolute; inset: 0;
  display: flex; flex-wrap: wrap; align-content: space-around;
  justify-content: space-between; padding: 8%;
  pointer-events: none;
}
.hero-chip {
  background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 0.55rem 0.9rem; border-radius: var(--radius-md);
  font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  animation: floatChip 5s ease-in-out infinite;
}
.hero-chip:nth-child(2) { animation-delay: 0.8s; }
.hero-chip:nth-child(3) { animation-delay: 1.6s; }
.hero-chip:nth-child(4) { animation-delay: 2.4s; }

/* ========== TRUSTED / LOGOS ========== */
.trusted-bar {
  padding: 2rem 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(10,14,26,0.6);
}
.trusted-label {
  text-align: center; font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.25rem;
}
.trusted-logos {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 2rem 2.5rem; opacity: 0.7;
}
.trusted-logos span {
  font-weight: 600; font-size: 0.95rem; color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* ========== SECTIONS ========== */
.section { padding: var(--space-3xl) 0; position: relative; }
.section-label {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 0.75rem;
}
.section-title { margin-bottom: 0.75rem; }
.section-sub {
  color: var(--text-secondary); max-width: 560px; margin-bottom: 2.5rem;
}

/* Feature cards grid */
.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.75rem 1.5rem;
  transition: all var(--transition-slow);
  position: relative; overflow: hidden;
  backdrop-filter: blur(8px);
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(14,165,233,0.35);
  box-shadow: var(--glow-primary), var(--shadow-md);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(168,85,247,0.2));
  color: var(--primary-bright); margin-bottom: 1.1rem;
  font-size: 1.35rem;
}
.feature-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; margin-bottom: 0; color: var(--text-muted); }

/* Stats / dashboard strip */
.stats-strip {
  background: linear-gradient(180deg, rgba(15,22,40,0.9), rgba(10,14,26,0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
  margin-top: 2.5rem;
  box-shadow: var(--shadow-md);
}
.stat-item { text-align: center; padding: 0.5rem; }
.stat-value {
  font-size: 1.85rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary-bright), var(--accent-bright));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1.2;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-change { font-size: 0.75rem; color: var(--success); margin-top: 0.15rem; }

/* Quick actions */
.quick-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin: 2rem 0;
}
.quick-action {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.35rem 1.1rem;
  text-align: center; transition: all var(--transition);
  color: var(--text-primary);
}
.quick-action:hover {
  transform: translateY(-4px);
  border-color: rgba(14,165,233,0.4);
  box-shadow: var(--glow-primary);
  color: var(--text-primary);
}
.quick-action-icon {
  width: 44px; height: 44px; margin: 0 auto 0.85rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(168,85,247,0.15));
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-bright);
}
.quick-action h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.quick-action p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* Info cards / about */
.info-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.info-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.75rem;
  transition: all var(--transition);
}
.info-card:hover {
  border-color: rgba(168,85,247,0.35);
  box-shadow: var(--glow-accent);
}
.info-card h3 { margin-bottom: 0.6rem; font-size: 1.2rem; }
.info-card p { font-size: 0.95rem; margin-bottom: 0; }

/* Programme cards */
.programme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.programme-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  transition: all var(--transition-slow);
}
.programme-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--glow-primary);
  border-color: rgba(14,165,233,0.35);
}
.programme-card img {
  width: 100%; height: 160px; object-fit: cover;
  transition: transform 0.6s ease;
}
.programme-card:hover img { transform: scale(1.05); }
.programme-body { padding: 1.35rem; }
.programme-body h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.programme-body p { font-size: 0.9rem; margin-bottom: 0.85rem; }

/* News cards */
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.news-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  transition: all var(--transition);
}
.news-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-md);
  border-color: rgba(14,165,233,0.3);
}
.news-card img { width: 100%; height: 180px; object-fit: cover; }
.news-body { padding: 1.25rem; }
.news-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.news-body h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, #0c1222 0%, #1a0a2e 50%, #0a1628 100%);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  text-align: center; position: relative; overflow: hidden;
  box-shadow: var(--glow-accent);
}
.cta-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(14,165,233,0.15), transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(168,85,247,0.2), transparent 50%);
  pointer-events: none;
}
.cta-banner h2 {
  position: relative; margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #f1f5f9, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cta-banner p { position: relative; max-width: 480px; margin: 0 auto 1.75rem; }
.cta-banner .btn { position: relative; }

/* Footer */
.site-footer {
  background: #03050c; border-top: 1px solid var(--border);
  padding: 3.5rem 0 1.5rem; margin-top: 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand p { font-size: 0.9rem; color: var(--text-muted); max-width: 280px; }
.footer-col h4 {
  font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-primary); margin-bottom: 1rem;
}
.footer-col a {
  display: block; color: var(--text-muted); font-size: 0.9rem;
  padding: 0.3rem 0; transition: color var(--transition);
}
.footer-col a:hover { color: var(--primary-bright); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 1rem; font-size: 0.85rem; color: var(--text-muted);
}

/* Page header (inner pages) */
.page-header {
  padding: 3rem 0 2rem;
  background: linear-gradient(180deg, rgba(14,165,233,0.06), transparent);
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary-bright); }
.breadcrumb span { color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 0.4rem;
}
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: 0.75rem 1rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
}
textarea { min-height: 120px; resize: vertical; }

/* Login / Auth cards */
.auth-wrap {
  min-height: calc(100vh - var(--header-height));
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(14,165,233,0.12), transparent 55%);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.4rem; text-align: center; }
.auth-card .auth-sub { text-align: center; color: var(--text-muted); margin-bottom: 1.75rem; font-size: 0.95rem; }
.auth-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
  background: var(--bg-elevated); padding: 0.3rem; border-radius: var(--radius-md);
}
.auth-tab {
  flex: 1; padding: 0.6rem; text-align: center; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
  transition: all var(--transition);
}
.auth-tab.active {
  background: linear-gradient(135deg, rgba(14,165,233,0.25), rgba(168,85,247,0.2));
  color: var(--text-primary);
}
.auth-msg {
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  font-size: 0.9rem; margin-bottom: 1rem;
  background: rgba(14,165,233,0.1); border: 1px solid rgba(14,165,233,0.25);
  color: var(--primary-bright); display: none;
}
.auth-msg.show { display: block; }
.auth-msg.error { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); color: var(--danger); }

/* Portal layout */
.portal-layout {
  display: flex; min-height: 100vh; background: var(--bg-deep);
}
.portal-sidebar {
  width: 260px; background: var(--bg-card-solid); border-right: 1px solid var(--border);
  padding: 1.25rem 0; flex-shrink: 0;
  transition: transform var(--transition);
}
.portal-sidebar-header { padding: 0 1.25rem 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; }
.portal-nav a {
  display: block; padding: 0.7rem 1.25rem; color: var(--text-secondary);
  font-size: 0.925rem; transition: all var(--transition);
  border-left: 3px solid transparent;
}
.portal-nav a:hover, .portal-nav a.active {
  background: rgba(14,165,233,0.1); color: var(--primary-bright);
  border-left-color: var(--primary);
}
.portal-main { flex: 1; padding: 1.75rem; overflow-x: hidden; }
.portal-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.portal-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.35rem; margin-bottom: 1.25rem;
}

/* AI Assistant */
.ai-shell { max-width: 820px; margin: 0 auto; }
.ai-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.ai-panel-head {
  padding: 1.5rem; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(168,85,247,0.08));
}
.ai-headline-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.ai-kicker { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cyan); }
.ai-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--success); font-weight: 600;
}
.ai-status i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 8px var(--success); animation: pulse 2s infinite;
}
.ai-prompts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.ai-prompt {
  padding: 0.45rem 0.9rem; border-radius: var(--radius-full);
  background: rgba(14,165,233,0.1); border: 1px solid rgba(14,165,233,0.25);
  color: var(--primary-bright); font-size: 0.85rem;
  transition: all var(--transition);
}
.ai-prompt:hover { background: rgba(14,165,233,0.2); transform: translateY(-1px); }
.ai-messages {
  min-height: 320px; max-height: 420px; overflow-y: auto;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem;
}
.ai-msg {
  max-width: 85%; padding: 0.85rem 1.1rem; border-radius: var(--radius-lg);
  font-size: 0.95rem; line-height: 1.55;
}
.ai-msg.user {
  align-self: flex-end; background: linear-gradient(135deg, rgba(14,165,233,0.25), rgba(168,85,247,0.2));
  border: 1px solid rgba(14,165,233,0.3);
}
.ai-msg.bot {
  align-self: flex-start; background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.ai-input-row {
  display: flex; gap: 0.75rem; padding: 1rem 1.25rem;
  border-top: 1px solid var(--border); background: rgba(10,14,26,0.5);
}
.ai-input-row input {
  flex: 1; padding: 0.8rem 1.1rem; border-radius: var(--radius-full);
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary);
}
.ai-input-row input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu.open {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.mobile-menu-panel {
  position: absolute; top: 0; right: 0; width: min(320px, 88vw);
  height: 100%; background: var(--bg-card-solid);
  border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform var(--transition-slow);
  overflow-y: auto; padding: 1.25rem;
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.mobile-nav a {
  display: block; padding: 0.75rem 0; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); font-weight: 500;
}
.mobile-nav a:hover { color: var(--primary-bright); }

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
@keyframes floatChip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes spin {
  from { transform: rotate(0deg); } to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(14,165,233,0.3); }
  50% { box-shadow: 0 0 35px rgba(168,85,247,0.45); }
}

.animate-in {
  animation: fadeInUp 0.7s ease both;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Ensure no horizontal overflow on any element */
.site-header, .hero, .section, .site-footer, main, .container, .container-wide {
  max-width: 100%;
}
img, video, iframe, embed, object {
  max-width: 100%;
}


/* ========== SMOOTH SCROLL + PERFORMANCE ========== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.page-home {
  overflow-x: hidden !important;
}
/* Momentum scrolling on iOS */
.mobile-menu-panel,
.ai-messages,
.portal-main {
  -webkit-overflow-scrolling: touch;
}
/* Reveal without jank */
.will-reveal {
  opacity: 0.01;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.will-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
/* Prefer GPU for common hover lifts */
.feature-card,
.quick-action,
.programme-card,
.news-card,
.info-card {
  backface-visibility: hidden;
}

/* ========== FLOATING CONTROLS ========== */
.cun-fab-stack {
  position: fixed;
  right: 1.1rem;
  bottom: 1.4rem;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-end;
  pointer-events: none;
}
.cun-fab-stack > * {
  pointer-events: auto;
}

.cun-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0,0,0,0.38);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transform: translate3d(0, 0, 0);
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1),
              box-shadow 0.35s ease,
              opacity 0.35s ease,
              filter 0.3s ease;
  animation: fabPopIn 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.cun-fab:nth-of-type(1) { animation-delay: 0.05s; }
.cun-fab:nth-of-type(2) { animation-delay: 0.15s; }
.cun-fab:hover {
  transform: translate3d(0, -4px, 0) scale(1.07);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.cun-fab:active {
  transform: scale(0.92);
  transition-duration: 0.1s;
}
.cun-fab-icon {
  pointer-events: none;
  line-height: 1;
}

.cun-fab-theme {
  background: linear-gradient(145deg, #1e293b, #475569);
}
[data-theme="light"] .cun-fab-theme {
  background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
  color: #0f172a;
}
[data-theme="gray"] .cun-fab-theme {
  background: linear-gradient(145deg, #3f4654, #555e70);
}

.cun-fab-ai {
  background: linear-gradient(145deg, #0ea5e9, #6366f1 50%, #a855f7);
}
.cun-fab-ai::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(56,189,248,0.35);
  animation: fabSoftPulse 2.8s ease-out infinite;
  pointer-events: none;
}

.cun-fab.hidden-fab {
  opacity: 0;
  transform: scale(0.4) translate3d(0, 24px, 0);
  pointer-events: none;
}

/* Panel sits left of the stack, aligned toward Theme (top) button */
.cun-settings-panel {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 60px; /* aligns with Theme button above AI */
  width: 220px;
  background: var(--bg-elevated, #141c30);
  border: 1px solid var(--border, rgba(148,163,184,0.18));
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: 0 16px 44px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(10px, 0, 0) scale(0.94);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34, 1.25, 0.64, 1), visibility 0.28s;
  z-index: 20;
  pointer-events: none;
  transform-origin: right center;
}
.cun-settings-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}
.cun-settings-panel h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #64748b);
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.cun-settings-panel .opt-group { margin-bottom: 0.75rem; }
.cun-settings-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cun-settings-btn {
  flex: 1 1 auto;
  min-width: 54px;
  padding: 0.5rem 0.4rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  background: rgba(148,163,184,0.1);
  border: 1px solid transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.cun-settings-btn:hover {
  background: rgba(14,165,233,0.15);
  color: var(--primary-bright, #38bdf8);
}
.cun-settings-btn:active { transform: scale(0.96); }
.cun-settings-btn.active {
  background: linear-gradient(135deg, rgba(14,165,233,0.3), rgba(168,85,247,0.25));
  border-color: rgba(14,165,233,0.4);
  color: #fff;
}
[data-theme="light"] .cun-settings-btn.active { color: #0f172a; }
.cun-settings-divider {
  height: 1px;
  background: var(--border, rgba(148,163,184,0.12));
  margin: 0.45rem 0;
}
.cun-settings-action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s ease, color 0.2s ease;
}
.cun-settings-action:hover {
  background: rgba(14,165,233,0.12);
  color: var(--primary-bright, #38bdf8);
}
.cun-settings-action.danger:hover {
  background: rgba(248,113,113,0.12);
  color: #f87171;
}

.cun-fab-menu {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 0;
  background: var(--bg-elevated, #141c30);
  border: 1px solid var(--border, rgba(148,163,184,0.15));
  border-radius: 12px;
  padding: 0.35rem;
  min-width: 130px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(10px, 0, 0) scale(0.94);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.25, 0.64, 1), visibility 0.25s;
  z-index: 15;
  pointer-events: none;
}
.cun-fab-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}
.cun-fab-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary, #f1f5f9);
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}
.cun-fab-menu button:hover {
  background: rgba(14,165,233,0.14);
  color: var(--primary-bright, #38bdf8);
}

[data-theme="gray"] {
  --bg-deep: #1a1d23;
  --bg-primary: #22262e;
  --bg-card: rgba(36, 40, 50, 0.85);
  --bg-card-solid: #2a2e38;
  --bg-elevated: #323742;
  --text-primary: #e8eaed;
  --text-secondary: #b0b5be;
  --text-muted: #8a909a;
  --border: rgba(176, 181, 190, 0.14);
  --border-strong: rgba(176, 181, 190, 0.22);
  --glass: rgba(36, 40, 50, 0.8);
  --glass-border: rgba(148, 163, 184, 0.2);
}
html.cun-text-sm { font-size: 14.5px; }
html.cun-text-sm body { line-height: 1.55; }

@keyframes fabPopIn {
  from { opacity: 0; transform: scale(0.45) translate3d(0, 22px, 0); }
  to { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
}
@keyframes fabSoftPulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  70% { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

@media (max-width: 768px) {
  .cun-fab-stack { right: 0.85rem; bottom: 1.1rem; gap: 0.7rem; }
  .cun-fab { width: 48px; height: 48px; font-size: 1.25rem; }
  .cun-settings-panel { width: 200px; bottom: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cun-fab, .cun-settings-panel, .cun-fab-menu, .will-reveal, .cun-fab-ai::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   MOBILE SCROLL FIX (iOS / Android)
   overflow-x:hidden on BOTH html+body breaks vertical scroll
   on many mobile browsers. Use clip on body only.
   ============================================================ */
html {
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  height: auto !important;
  position: static !important;
}
body {
  overflow-x: clip !important;
  overflow-y: visible !important;
  height: auto !important;
  min-height: 100% !important;
  position: static !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}
body.page-home {
  overflow-x: clip !important;
  overflow-y: visible !important;
  touch-action: pan-y !important;
}
/* Never lock body from CSS while menu is closed */
body:not(.menu-open) {
  overflow-y: visible !important;
}
/* Hero must not trap scroll */
.hero {
  overflow-x: hidden;
  overflow-y: visible !important;
  min-height: 0 !important;
}
@media (max-width: 768px) {
  .hero {
    min-height: 0 !important;
    overflow: visible !important;
  }
  html, body {
    overflow-y: scroll !important;
    height: auto !important;
    max-height: none !important;
  }
  main, #main {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
}

/* Only lock scroll when mobile menu is open */
body.menu-open {
  overflow: hidden !important;
  touch-action: none !important;
}

/* ============================================================
   INNER PAGES + PORTALS + FORMS + TABLES
   Human-readable, smooth, mobile table swipe enabled
   ============================================================ */

/* Page header (about, apply, etc.) */
.page-header {
  padding: 2.75rem 0 2rem;
  background: linear-gradient(180deg, rgba(14,165,233,0.07), transparent);
  border-bottom: 1px solid var(--border);
}
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { max-width: 640px; color: var(--text-secondary); margin-bottom: 0; }
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.85rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary-bright); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.card:hover {
  border-color: rgba(14,165,233,0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card-body { padding: 1.25rem 1.35rem; }
.card-body h4 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.card-body p { margin-bottom: 0; font-size: 0.9rem; color: var(--text-muted); }
.text-muted { color: var(--text-muted) !important; }
.muted { color: var(--text-muted); font-size: 0.92rem; }

/* Grids */
.grid { display: grid; gap: 1.15rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Forms — clear, large enough for thumbs */
.form-label, label.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.form-label .required, .required { color: var(--danger); }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-group { margin-bottom: 1.15rem; }
.form-control,
input.form-control,
select.form-control,
textarea.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus,
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.85; }
.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.3rem;
  min-height: 1.1em;
}
.form-step h3 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Tables — swipe horizontally on mobile when needed */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  margin-bottom: 0.5rem;
  /* allow left-right swipe for wide tables */
  overscroll-behavior-x: contain;
}
.table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table-wrap th,
.table-wrap td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-wrap th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(14,165,233,0.06);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tbody tr {
  transition: background 0.2s ease;
}
.table-wrap tbody tr:hover {
  background: rgba(14,165,233,0.06);
}
.table-wrap td { color: var(--text-secondary); }

/* Status pills */
.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(14,165,233,0.15);
  color: var(--primary-bright);
}
.status-pill.success, .badge-success { background: rgba(52,211,153,0.15); color: var(--success); }
.status-pill.warning, .badge-warning { background: rgba(251,191,36,0.15); color: var(--warning); }
.status-pill.danger, .badge-danger { background: rgba(248,113,113,0.15); color: var(--danger); }

/* ========== PORTAL LAYOUT ========== */
.portal-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-deep);
  width: 100%;
}
.portal-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-card-solid);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.portal-sidebar-header {
  padding: 0 1.25rem 1.15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.85rem;
}
.portal-nav a {
  display: block;
  padding: 0.75rem 1.35rem;
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.portal-nav a:hover {
  background: rgba(14,165,233,0.08);
  color: var(--primary-bright);
}
.portal-nav a.active {
  background: rgba(14,165,233,0.12);
  color: var(--primary-bright);
  border-left-color: var(--primary);
}
.portal-main {
  flex: 1;
  min-width: 0; /* critical: allows flex child to shrink + table swipe */
  padding: 1.5rem 1.75rem 2.5rem;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.portal-topbar strong {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.portal-topbar span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.portal-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(14,165,233,0.12);
  border: 1px solid rgba(14,165,233,0.25);
  color: var(--primary-bright);
  font-size: 1.25rem;
}
.portal-content h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.85rem;
  letter-spacing: -0.02em;
}
.portal-content h2:first-child { margin-top: 0; }
.portal-section {
  animation: portalFadeIn 0.45s ease both;
}
@keyframes portalFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard cards */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.15rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  animation: portalFadeIn 0.5s ease both;
}
.dash-card:nth-child(1) { animation-delay: 0.05s; }
.dash-card:nth-child(2) { animation-delay: 0.1s; }
.dash-card:nth-child(3) { animation-delay: 0.15s; }
.dash-card:nth-child(4) { animation-delay: 0.2s; }
.dash-card:hover {
  transform: translateY(-4px);
  border-color: rgba(14,165,233,0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.dash-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  font-weight: 600;
}
.dash-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  word-break: break-word;
}
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-bottom: 1.15rem;
  animation: portalFadeIn 0.5s ease both;
}
.panel-card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Notification list */
#notif-list .notif-item,
.notif-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.65rem;
  transition: border-color 0.25s ease;
}
.notif-item:hover { border-color: rgba(14,165,233,0.3); }

/* Portal mobile */
@media (max-width: 900px) {
  .portal-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-105%);
    box-shadow: 0 0 40px rgba(0,0,0,0.4);
  }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
  .portal-main { padding: 1.15rem 1rem 2rem; }
}
@media (max-width: 480px) {
  .dash-cards { grid-template-columns: 1fr; }
  .dash-card-value { font-size: 1.25rem; }
}

/* Utility spacing used by portals */
.mt-2 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.flex { display: flex; }

/* AI Concierge compatibility */
.ai-message.user, .ai-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(14,165,233,0.25), rgba(168,85,247,0.2));
  border: 1px solid rgba(14,165,233,0.3);
  max-width: 88%;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.55;
}
.ai-message.assistant, .ai-msg.bot, .ai-message.bot {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  max-width: 92%;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-primary);
}
.ai-composer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border);
  background: rgba(10,14,26,0.45);
  align-items: flex-end;
}
.ai-composer .form-control,
.ai-composer textarea {
  flex: 1;
  min-height: 48px;
  resize: vertical;
  max-height: 140px;
}
.ai-composer .btn { flex-shrink: 0; }
.info-strip {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}

/* AI typing dots + source chip */
.ai-typing {
  padding: 0.9rem 1.15rem !important;
  min-width: 64px;
}
.ai-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 1em;
}
.ai-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-bright, #38bdf8);
  opacity: 0.35;
  animation: aiDot 1.2s ease-in-out infinite;
}
.ai-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.ai-msg-source {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border, rgba(148,163,184,0.12));
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}
.ai-src-icon {
  font-size: 0.7rem;
  opacity: 0.85;
}
