/* ============================================================
   InnoTech Platform — กลุ่มงานส่งเสริม พัฒนาสื่อ นวัตกรรมและเทคโนโลยีทางการศึกษา
   Theme: น้ำเงิน-ทอง-เขียว (Blue-Gold-Green) · Futuristic Glassmorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --blue-900: #0a0f3a;
  --blue-800: #1a237e;
  --blue-700: #283593;
  --blue-600: #0d47a1;
  --blue-500: #1565c0;
  --blue-400: #1e88e5;
  --blue-300: #42a5f5;
  --gold-500: #ffc107;
  --gold-400: #ffca28;
  --gold-600: #ffb300;
  --gold-700: #ffa000;
  --green-700: #2e7d32;
  --green-600: #388e3c;
  --green-500: #43a047;
  --green-400: #66bb6a;
  --bg-dark: #0a0e27;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.08);
  --bg-glass-strong: rgba(255, 255, 255, 0.12);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.45);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(30, 136, 229, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 48px rgba(30, 136, 229, 0.25);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-th: 'Prompt', sans-serif;
  --font-en: 'Inter', sans-serif;
  --nav-height: 68px;
  --sidebar-width: 260px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-th);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(26, 35, 126, 0.45) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(46, 125, 50, 0.18) 0%, transparent 60%);
}
a { color: var(--blue-300); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-500); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; border: none; outline: none; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-400); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }
.font-en { font-family: var(--font-en); }
.text-gold { color: var(--gold-500); }
.text-green { color: var(--green-400); }
.text-blue { color: var(--blue-300); }
.text-muted { color: var(--text-muted); }

/* ---------- Navigation ---------- */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(10, 14, 39, 0.75);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
}
.navbar .logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.25rem; font-weight: 700;
}
.navbar .logo-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), var(--green-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; box-shadow: 0 0 20px rgba(30, 136, 229, 0.35);
}
.navbar .logo span { background: linear-gradient(90deg, var(--blue-300), var(--gold-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  padding: 8px 16px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-weight: 500; font-size: 0.92rem;
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary); background: var(--bg-glass);
}
.nav-links a.active { border-bottom: 2px solid var(--gold-500); }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--green-500));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.nav-user .user-name { font-size: 0.88rem; color: var(--text-secondary); }

/* ---------- Hero Section ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 5rem 2rem 4rem; text-align: center;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 30%, #0d2137 60%, var(--bg-dark) 100%);
  background-size: 300% 300%;
  animation: gradient-shift 12s ease infinite;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle 300px at 20% 40%, rgba(255, 193, 7, 0.1), transparent),
    radial-gradient(circle 400px at 80% 60%, rgba(46, 125, 50, 0.1), transparent);
  pointer-events: none;
}
.hero h1 { font-size: 2.8rem; margin-bottom: 1rem; position: relative; }
.hero h1 span { background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 640px; margin: 0 auto 2rem; position: relative; }
.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap;
  position: relative; margin-top: 2rem;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 2.2rem; font-weight: 800; font-family: var(--font-en); color: var(--gold-400); }
.hero-stat .label { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Container ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 2rem; }
.section-title { margin-bottom: 2rem; }
.section-title h2 { margin-bottom: 0.4rem; }
.section-title p { color: var(--text-secondary); font-size: 0.95rem; }

/* ---------- Glass Card ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-glow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header h3 { font-size: 1.15rem; }

/* ---------- Dashboard Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ---------- Stat Card ---------- */
.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1.2rem;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 0 4px 4px 0;
}
.stat-card.blue::before  { background: linear-gradient(180deg, var(--blue-400), var(--blue-600)); }
.stat-card.gold::before  { background: linear-gradient(180deg, var(--gold-400), var(--gold-700)); }
.stat-card.green::before { background: linear-gradient(180deg, var(--green-400), var(--green-700)); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.stat-card.blue .stat-icon  { background: rgba(30, 136, 229, 0.15); }
.stat-card.gold .stat-icon  { background: rgba(255, 193, 7, 0.15); }
.stat-card.green .stat-icon { background: rgba(67, 160, 71, 0.15); }
.stat-info .stat-value { font-size: 1.8rem; font-weight: 800; font-family: var(--font-en); line-height: 1; }
.stat-info .stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

/* ---------- Chart Container ---------- */
.chart-container {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 300px;
}
.chart-container canvas { width: 100% !important; }

/* ---------- Activity Cards ---------- */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.activity-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition);
  cursor: pointer;
  position: relative; overflow: hidden;
}
.activity-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.08), transparent 60%);
  opacity: 0; transition: opacity var(--transition);
}
.activity-card:hover { transform: translateY(-4px); border-color: var(--border-glow); }
.activity-card:hover::after { opacity: 1; }
.activity-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1rem; position: relative; z-index: 1;
}
.activity-card h4 { font-size: 1rem; margin-bottom: 0.5rem; position: relative; z-index: 1; }
.activity-card p { font-size: 0.85rem; color: var(--text-muted); position: relative; z-index: 1; }
.activity-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; position: relative; z-index: 1; }

/* ---------- Progress Bar ---------- */
.progress-bar {
  width: 100%; height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px; overflow: hidden;
  position: relative;
}
.progress-bar .fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--blue-400), var(--green-400));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.progress-bar .fill::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 30px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  animation: progress-shine 2s infinite;
}
.progress-label { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 4px; }
.progress-label span:last-child { color: var(--gold-400); font-weight: 600; font-family: var(--font-en); }

/* ---------- Badges / Tags ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px;
  border-radius: 20px; font-size: 0.78rem; font-weight: 500;
  gap: 4px;
}
.badge.blue   { background: rgba(30, 136, 229, 0.18); color: var(--blue-300); }
.badge.gold   { background: rgba(255, 193, 7, 0.18); color: var(--gold-400); }
.badge.green  { background: rgba(67, 160, 71, 0.18); color: var(--green-400); }
.badge.red    { background: rgba(229, 57, 53, 0.18); color: #ef5350; }
.badge.purple { background: rgba(156, 39, 176, 0.18); color: #ce93d8; }

/* ---------- Tables ---------- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }
table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card); backdrop-filter: blur(12px);
}
thead th {
  padding: 14px 16px; text-align: left; font-weight: 600; font-size: 0.88rem;
  background: rgba(26, 35, 126, 0.3);
  color: var(--text-secondary); border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px; font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
tbody tr:nth-child(even):hover { background: rgba(255, 255, 255, 0.06); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.88rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all var(--transition);
}
.form-control:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2);
  background: rgba(255, 255, 255, 0.09);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
textarea.form-control { resize: vertical; min-height: 100px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.92rem;
  cursor: pointer; transition: all var(--transition);
  border: none; position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.btn:hover::before { opacity: 1; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: white; box-shadow: 0 4px 16px rgba(30, 136, 229, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(30, 136, 229, 0.4); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-400));
  color: #1a1a2e; box-shadow: 0 4px 16px rgba(255, 193, 7, 0.25);
}
.btn-gold:hover { transform: translateY(-2px); }
.btn-green {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: white; box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
}
.btn-green:hover { transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}
.btn-outline:hover { background: var(--bg-glass); color: var(--text-primary); border-color: var(--blue-400); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  animation: fadeIn 0.25s ease;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #121630;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 580px; max-height: 85vh;
  overflow-y: auto; padding: 2rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-header h3 { font-size: 1.3rem; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); border: none;
  color: var(--text-secondary); font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(229, 57, 53, 0.2); color: #ef5350; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.5rem; }

/* ---------- Login Page ---------- */
.login-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark), var(--blue-900));
  padding: 2rem;
}
.login-card {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: slideUp 0.5s ease;
}
.login-card .logo-icon {
  width: 72px; height: 72px; border-radius: 18px;
  background: linear-gradient(135deg, var(--blue-600), var(--green-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1.5rem;
  box-shadow: 0 0 40px rgba(30, 136, 229, 0.3);
}
.login-card h2 { margin-bottom: 0.5rem; font-size: 1.6rem; }
.login-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.login-card .form-control { text-align: left; }
.login-card .btn { width: 100%; margin-top: 0.5rem; }

/* ---------- Sidebar (Admin) ---------- */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-height)); }
.sidebar {
  width: var(--sidebar-width); min-height: 100%;
  background: rgba(10, 14, 39, 0.9);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border-glass);
  padding: 1.5rem 0; flex-shrink: 0;
  position: sticky; top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}
.sidebar-section { padding: 0 1rem; margin-bottom: 1.5rem; }
.sidebar-section-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); font-weight: 600; padding: 0 0.75rem; margin-bottom: 0.6rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0.75rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.9rem;
  transition: all var(--transition); cursor: pointer;
}
.sidebar-link:hover { background: var(--bg-glass); color: var(--text-primary); }
.sidebar-link.active {
  background: rgba(30, 136, 229, 0.15); color: var(--blue-300);
  border-left: 3px solid var(--blue-400);
}
.sidebar-link .icon { font-size: 1.1rem; width: 24px; text-align: center; }
.admin-content { flex: 1; padding: 2rem; overflow-y: auto; }

/* ---------- Footer ---------- */
.footer {
  background: rgba(10, 14, 39, 0.9);
  border-top: 1px solid var(--border-glass);
  padding: 2.5rem 2rem 1.5rem; margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; max-width: 1280px; margin: 0 auto; }
.footer h4 { color: var(--gold-400); margin-bottom: 1rem; font-size: 1rem; }
.footer p, .footer a { color: var(--text-muted); font-size: 0.88rem; }
.footer a:hover { color: var(--gold-400); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom {
  text-align: center; padding-top: 1.5rem; margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem; color: var(--text-muted);
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed; top: calc(var(--nav-height) + 16px); right: 20px;
  z-index: 3000; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: #1a1f3d; border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; min-width: 300px;
  animation: slideIn 0.35s ease;
}
.toast.success { border-left: 4px solid var(--green-500); }
.toast.error   { border-left: 4px solid #e53935; }
.toast.info    { border-left: 4px solid var(--blue-400); }
.toast.warning { border-left: 4px solid var(--gold-500); }

/* ---------- Loading Spinner ---------- */
.spinner-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(10, 14, 39, 0.85); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem;
}
.spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--blue-400);
  border-right-color: var(--gold-400);
  animation: spin 0.8s linear infinite;
}
.spinner-text { color: var(--text-secondary); font-size: 0.9rem; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.95rem; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-glass); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 10px 20px; background: none; border: none;
  color: var(--text-muted); font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--gold-400); border-bottom-color: var(--gold-400); }

/* ---------- Search Bar ---------- */
.search-bar {
  position: relative; max-width: 400px;
}
.search-bar input {
  width: 100%; padding: 10px 16px 10px 42px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 24px; color: var(--text-primary);
  transition: all var(--transition);
}
.search-bar input:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15); }
.search-bar .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem;
}

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 1.5rem; }
.page-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { background: rgba(30, 136, 229, 0.15); color: var(--text-primary); }
.page-btn.active { background: var(--blue-600); color: white; border-color: var(--blue-400); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ---------- Keyframe Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes progress-shine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideUp 0.5s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { width: 220px; }
  :root { --sidebar-width: 220px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat .num { font-size: 1.6rem; }
  .container { padding: 1rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .activities-grid { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: relative; top: 0;
    display: flex; overflow-x: auto; padding: 0.75rem;
    border-right: none; border-bottom: 1px solid var(--border-glass);
  }
  .sidebar-section { display: flex; gap: 4px; margin-bottom: 0; padding: 0; }
  .sidebar-section-title { display: none; }
  .sidebar-link { white-space: nowrap; padding: 8px 14px; font-size: 0.82rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .modal { width: 95%; padding: 1.5rem; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .login-card { padding: 2rem 1.5rem; }
  .stat-card { padding: 1rem; }
  .btn { padding: 8px 18px; font-size: 0.85rem; }
}

/* ---------- Print ---------- */
@media print {
  .navbar, .sidebar, .footer, .btn, .modal-overlay, .toast-container { display: none !important; }
  body { background: white; color: black; }
  .card, .stat-card, .activity-card { border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; background: white; }
}

/* ============================================================
   Styles for the class names used in index.html / app.js
   (added to align markup, script and stylesheet)
   ============================================================ */

/* ---------- Navbar layout ---------- */
.nav-container {
  max-width: 1280px; margin: 0 auto; padding: 0 2rem;
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text-primary); flex-shrink: 0; }
.nav-logo:hover { color: var(--text-primary); }
.logo-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), var(--green-500));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; box-shadow: 0 0 20px rgba(30, 136, 229, 0.35);
}
.logo-text { font-size: 1.15rem; font-weight: 700; line-height: 1.1; display: flex; flex-direction: column; }
.logo-text small { font-size: 0.72rem; font-weight: 400; color: var(--gold-400); }
.nav-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#user-nav-area { display: flex; align-items: center; }
.nav-search-btn, .nav-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-glass); color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.nav-search-btn:hover, .nav-toggle:hover { color: var(--gold-400); background: var(--bg-glass-strong); }
.nav-toggle { display: none; }
.nav-login-btn { white-space: nowrap; }
.user-menu { align-items: center; gap: 10px; }
.user-name { font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.user-name i { color: var(--gold-400); }
.nav-search-bar {
  display: none;
  border-top: 1px solid var(--border-glass);
  background: rgba(10, 14, 39, 0.95);
}
.nav-search-bar.active { display: block; }
.nav-search-bar .nav-container { height: auto; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.nav-search-bar .form-input { flex: 1; }
.nav-search-bar .btn { background: var(--bg-glass); color: var(--text-secondary); }

/* ---------- Page sections ---------- */
.page-section { animation: fadeIn 0.35s ease; }
.section { padding-top: 1rem; padding-bottom: 1rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-header .section-title { margin-bottom: 0; font-size: 1.6rem; display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--gold-400); }
.page-hero { padding: 3rem 0 1.5rem; position: relative; }
.page-hero .container { padding-top: 0; padding-bottom: 0; }
.page-hero h1 { font-size: 2.2rem; display: flex; align-items: center; gap: 12px; margin-bottom: 0.4rem; }
.page-hero p { color: var(--text-secondary); }
.page-hero-blue  { background: linear-gradient(135deg, rgba(26, 35, 126, 0.55), transparent 70%); }
.page-hero-gold  { background: linear-gradient(135deg, rgba(255, 160, 0, 0.22), transparent 70%); }
.page-hero-green { background: linear-gradient(135deg, rgba(46, 125, 50, 0.32), transparent 70%); }
.page-hero-blue h1 i  { color: var(--blue-300); }
.page-hero-gold h1 i  { color: var(--gold-400); }
.page-hero-green h1 i { color: var(--green-400); }

/* ---------- Home hero ---------- */
.hero-content { position: relative; max-width: 900px; margin: 0 auto; }
.hero-badge {
  display: inline-block; padding: 6px 18px; border-radius: 20px; margin-bottom: 1.25rem;
  background: rgba(255, 193, 7, 0.15); color: var(--gold-400);
  border: 1px solid rgba(255, 193, 7, 0.35); font-size: 0.9rem; font-weight: 500;
}
.hero-title { font-size: 2.8rem; margin-bottom: 1rem; }
.hero .hero-subtitle { font-size: 1.05rem; color: var(--text-secondary); max-width: 720px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-supervisor {
  display: inline-flex; align-items: center; gap: 14px; text-align: left;
  padding: 12px 20px; border-radius: var(--radius-md);
  background: var(--bg-glass); border: 1px solid var(--border-glass);
}
.hero-supervisor small { color: var(--text-muted); }
.hero-avatar { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold-500); flex-shrink: 0; }

/* ---------- Stat cards ---------- */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
  margin: 0 0 1.5rem;
}
.stats-row .stat-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 1rem; row-gap: 2px; align-items: center;
}
.stats-row .stat-card .stat-icon { grid-row: 1 / span 2; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; font-family: var(--font-en); line-height: 1.1; align-self: end; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-secondary); align-self: start; }
.stat-card .stat-icon { background: rgba(30, 136, 229, 0.15); color: var(--blue-300); }
.stat-card.stat-blue::before  { background: linear-gradient(180deg, var(--blue-400), var(--blue-600)); }
.stat-card.stat-gold::before  { background: linear-gradient(180deg, var(--gold-400), var(--gold-700)); }
.stat-card.stat-green::before { background: linear-gradient(180deg, var(--green-400), var(--green-700)); }
.stat-card.stat-gold .stat-icon  { background: rgba(255, 193, 7, 0.15); color: var(--gold-400); }
.stat-card.stat-green .stat-icon { background: rgba(67, 160, 71, 0.15); color: var(--green-400); }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid + .grid { margin-top: 1.5rem; }
.modal .grid { gap: 0 1rem; }
.modal .grid + .grid { margin-top: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-title { font-size: 1.1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--gold-400); }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 320px; }
.chart-box canvas { width: 100% !important; }

/* ---------- Activity cards ---------- */
.activity-card { display: flex; flex-direction: column; gap: 0.6rem; }
.activity-card .activity-icon { margin-bottom: 0.25rem; }
.activity-card .badge { align-self: flex-start; position: relative; z-index: 1; }
.activity-title { font-size: 1.1rem; position: relative; z-index: 1; }
.activity-name { font-size: 0.85rem; color: var(--text-muted); flex: 1; }
.progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--blue-400), var(--green-400));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.activity-card .progress-label { font-size: 0.85rem; color: var(--gold-400); font-weight: 600; margin: 0; position: relative; z-index: 1; }

/* ---------- Badges ---------- */
.badge-blue    { background: rgba(30, 136, 229, 0.18); color: var(--blue-300); }
.badge-gold    { background: rgba(255, 193, 7, 0.18); color: var(--gold-400); }
.badge-green   { background: rgba(67, 160, 71, 0.18); color: var(--green-400); }
.badge-gray    { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }
.badge-purple  { background: rgba(156, 39, 176, 0.18); color: #ce93d8; }
.badge-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-glass); }

/* ---------- Media cards ---------- */
.media-card { cursor: pointer; display: flex; flex-direction: column; gap: 0.75rem; }
.media-card-header { display: flex; gap: 6px; flex-wrap: wrap; }
.media-title { font-size: 1.1rem; flex: 1; }
.media-meta { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--text-muted); }
.media-meta i { width: 16px; color: var(--blue-300); }
.media-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 0.75rem; border-top: 1px solid var(--border-glass); }
.media-downloads { font-size: 0.85rem; color: var(--text-secondary); }
.media-downloads i { color: var(--gold-400); }

/* ---------- Search & filter bar ---------- */
.search-filter-bar { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.search-filter-bar .search-bar { flex: 1; min-width: 220px; max-width: none; }
.search-bar > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-filter-bar .form-select { width: auto; min-width: 170px; }

/* ---------- Forms (class names used in markup) ---------- */
.form-label { display: block; font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-label i { color: var(--gold-400); margin-right: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2);
  background-color: rgba(255, 255, 255, 0.09);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled { opacity: 0.75; cursor: default; }
.form-select {
  cursor: pointer; appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form-select option { background: #121630; color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 90px; }
input[type="date"].form-input { color-scheme: dark; }
.search-bar .form-input { border-radius: 24px; padding-left: 42px; }

/* ---------- Buttons ---------- */
.btn-block { width: 100%; }
.btn-danger {
  background: linear-gradient(135deg, #c62828, #e53935);
  color: white; box-shadow: 0 4px 16px rgba(229, 57, 53, 0.3);
}
.btn-danger:hover { transform: translateY(-2px); color: white; }
.btn-primary:hover { color: white; }
.btn-gold:hover { color: #1a1a2e; }

/* ---------- Tabs ---------- */
.tabs { flex-wrap: wrap; }
.tab {
  padding: 10px 20px; background: none;
  color: var(--text-muted); font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition);
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--gold-400); border-bottom-color: var(--gold-400); }

/* ---------- Table ---------- */
.table-container { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-glass); }
.table td .btn-sm { padding: 6px 10px; }

/* ---------- Network cards ---------- */
.network-card { display: flex; flex-direction: column; gap: 0.75rem; }
.network-card h3 { font-size: 1.1rem; }
.network-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.network-meta { font-size: 0.88rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.network-meta i { width: 18px; color: var(--gold-400); }
.network-card .badge { align-self: flex-start; }

/* ---------- Announcements ---------- */
.announcement-item { margin-bottom: 1rem; }
.announcement-item:hover { transform: none; }
.announcement-item.pinned { border-left: 4px solid var(--gold-500); }
.announcement-item h3 { font-size: 1.15rem; margin: 0.6rem 0 0.4rem; }
.announcement-item p { color: var(--text-secondary); font-size: 0.92rem; }
.announcement-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.announcement-item > .badge { margin-right: 6px; }
.announcement-date { font-size: 0.82rem; color: var(--text-muted); }

/* ---------- Login ---------- */
.login-wrapper { min-height: calc(100vh - var(--nav-height)); background: none; }
.login-logo { margin-bottom: 0.5rem; }
.logo-icon-lg {
  width: 72px; height: 72px; border-radius: 18px;
  background: linear-gradient(135deg, var(--blue-600), var(--green-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1.25rem;
  box-shadow: 0 0 40px rgba(30, 136, 229, 0.3);
}
.login-card form { text-align: left; }
.login-hint { margin-top: 1.25rem; color: var(--text-muted); }

/* ---------- Modal ---------- */
.modal-overlay.active { display: flex; }
.modal-body p { margin-bottom: 0.5rem; color: var(--text-secondary); }
.modal-body p strong { color: var(--text-primary); }
.modal-footer { flex-wrap: wrap; }

/* ---------- Toasts (class names used by app.js) ---------- */
.toast-success { border-left: 4px solid var(--green-500); }
.toast-success > i { color: var(--green-400); }
.toast-error   { border-left: 4px solid #e53935; }
.toast-error > i { color: #ef5350; }
.toast-info    { border-left: 4px solid var(--blue-400); }
.toast-info > i { color: var(--blue-300); }
.toast-warning { border-left: 4px solid var(--gold-500); }
.toast-warning > i { color: var(--gold-400); }
.toast span { flex: 1; }
.toast-close { background: none; color: var(--text-muted); cursor: pointer; padding: 2px 4px; }
.toast-close:hover { color: var(--text-primary); }

/* ---------- Loading overlay ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(10, 14, 39, 0.55); backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
}

/* ---------- Empty state ---------- */
.empty-state { grid-column: 1 / -1; }
.empty-state > i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

/* ---------- Footer ---------- */
.footer-logo { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; margin-bottom: 0.75rem; }
.footer-logo .logo-icon { width: 34px; height: 34px; font-size: 1rem; }
.footer-title { color: var(--gold-400); margin-bottom: 1rem; font-size: 1rem; }
.footer-col p { margin-bottom: 0.35rem; }
.footer-col i { width: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-container { padding: 0 1rem; }
  .nav-links a { padding: 8px 10px; font-size: 0.85rem; }
  .user-name { display: none; }
}
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 0.75rem 1rem 1rem;
    background: rgba(10, 14, 39, 0.97);
    border-bottom: 1px solid var(--border-glass);
  }
  .nav-links.active { display: flex; }
  .nav-links a { display: flex; padding: 12px 14px; font-size: 0.95rem; }
  .nav-links a.active { border-bottom: none; border-left: 3px solid var(--gold-500); }
  .nav-container { position: relative; }
  .nav-logo { margin-right: auto; }
}
@media (max-width: 768px) {
  .hero-title { font-size: 1.8rem; }
  .page-hero { padding: 2rem 0 1rem; }
  .page-hero h1 { font-size: 1.6rem; }
  .section-header .section-title { font-size: 1.3rem; }
  .search-filter-bar .form-select { flex: 1; }
  .chart-box { height: 280px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .stats-row .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .logo-text small { display: none; }
  .nav-login-btn { padding: 6px 10px; }
}
