/* ============================================
   JobLounge Design System v2.0
   Modern, professional, accessible
   ============================================ */

/* ===== CSS RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand colors — matched to JobLounge logo (blue #304878 + green #78c030) */
  --brand: #304878;
  --brand-light: #4868a0;
  --brand-dark: #1e3060;
  --brand-darker: #15234a;
  --brand-50: #eef2f8;
  --brand-100: #d4e0ee;
  --accent: #5fa830;
  --accent-light: #78c030;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  /* Neutrals */
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  /* Gradients — logo-inspired blue→green */
  --grad-brand: linear-gradient(135deg, #304878 0%, #5fa830 100%);
  --grad-dark: linear-gradient(135deg, #0f1a30 0%, #1e3060 100%);
  --grad-hero: linear-gradient(135deg, #1e3060 0%, #304878 45%, #5fa830 100%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --shadow-brand: 0 4px 14px rgba(79,70,229,0.3);

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Layout */
  --max-w: 1280px;
  --nav-h: 68px;
  --sidebar-w: 280px;

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4,0,0.2,1);
  --t-base: 250ms cubic-bezier(0.4,0,0.2,1);
  --t-slow: 400ms cubic-bezier(0.4,0,0.2,1);

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --border-dark: #475569;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --brand-50: #0f1a30;
  --brand-100: #1e3060;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.4);
  --success-bg: #064e3b;
  --warning-bg: #78350f;
  --danger-bg: #7f1d1d;
  --info-bg: #1e3a5f;
}

/* ===== GLOBAL ===== */
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

::selection { background: var(--brand); color: white; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LAYOUT ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; width: 100%; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
[data-theme="dark"] .navbar { background: rgba(30,41,59,0.85); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 20px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; color: var(--text); letter-spacing: -0.5px; flex-shrink: 0; }
.nav-brand:hover { color: var(--text); }
.nav-brand .logo-icon {
  width: 38px; height: 38px;
  background: var(--grad-brand);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.3rem;
  box-shadow: var(--shadow-brand);
}
.nav-brand img.nav-logo { height: 42px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  color: var(--text-secondary); font-weight: 500; font-size: 0.92rem;
  padding: 8px 14px; border-radius: var(--r-md); transition: all var(--t-fast);
}
.nav-links a:hover, .nav-links a.active { color: var(--brand); background: var(--brand-50); }
[data-theme="dark"] .nav-links a:hover, [data-theme="dark"] .nav-links a.active { background: var(--brand-100); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--text); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; font-size: 0.92rem; font-weight: 600;
  border-radius: var(--r-md); border: 2px solid transparent;
  cursor: pointer; transition: all var(--t-fast);
  white-space: nowrap; text-decoration: none; line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: var(--shadow-brand); transform: translateY(-1px); color: white; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-dark); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn-white { background: white; color: var(--brand); }
.btn-white:hover { background: var(--brand-50); transform: translateY(-1px); }
.btn-outline-white { background: transparent; color: white; border-color: rgba(255,255,255,0.4); }
.btn-outline-white:hover { background: rgba(255,255,255,0.1); border-color: white; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-xl { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; }

/* ===== FORM CONTROLS ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; font-size: 0.87rem; margin-bottom: 6px; color: var(--text); }
.form-label .req { color: var(--danger); }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-control {
  width: 100%; padding: 11px 14px; font-size: 0.95rem;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md);
  color: var(--text); transition: all var(--t-fast); outline: none;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.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' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }

/* Checkbox/Radio */
.checkbox-group, .radio-group { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-group input, .radio-group input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }

/* ===== CARDS ===== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: all var(--t-base);
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--brand-light); }
.card-body { padding: 24px; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 1.1rem; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); }

/* Blog card image (top of card when featured_image is set) */
.blog-card { overflow: hidden; }
.blog-card-img { width: 100%; aspect-ratio: 1200/630; overflow: hidden; background: var(--surface-2, #f5f5f7); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t-base); }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }

/* ===== BADGES & PILLS ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; font-size: 0.75rem; font-weight: 600;
  border-radius: var(--r-full); line-height: 1.6;
}
.badge-brand { background: var(--brand-50); color: var(--brand); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg-alt); color: var(--text-secondary); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-full); font-size: 0.85rem; font-weight: 500;
  background: var(--bg-alt); color: var(--text-secondary); border: 1px solid var(--border);
}
.pill.active { background: var(--brand); color: white; border-color: var(--brand); }

/* ===== JOB CARDS ===== */
.job-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; transition: all var(--t-base); cursor: pointer; position: relative;
}
.job-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--brand-light); }
.job-card .job-top { display: flex; align-items: flex-start; gap: 14px; }
.job-card .company-logo {
  width: 52px; height: 52px; border-radius: var(--r-md);
  background: var(--grad-brand); color: white; display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; flex-shrink: 0;
}
.job-card .job-info { flex: 1; min-width: 0; }
.job-card .job-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.job-card .job-company { font-size: 0.87rem; color: var(--text-secondary); margin-bottom: 8px; }
.job-card .job-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--text-muted); }
.job-card .job-meta span { display: inline-flex; align-items: center; gap: 4px; }
.job-card .job-salary { color: var(--success); font-weight: 600; }
.job-card .save-btn {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer; padding: 6px; color: var(--text-muted);
  border-radius: var(--r-full); transition: all var(--t-fast);
}
.job-card .save-btn:hover { color: var(--brand); background: var(--brand-50); }
.job-card .save-btn.saved { color: var(--brand); }

/* ===== HERO ===== */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero);
  padding: 80px 0 60px;
  color: white;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1), transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(6,182,212,0.2), transparent 50%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -1.5px; line-height: 1.15; margin-bottom: 20px; }
.hero p { font-size: clamp(1rem, 2vw, 1.25rem); opacity: 0.9; max-width: 600px; margin-bottom: 36px; }
.hero-search {
  background: white; border-radius: var(--r-lg); padding: 8px;
  display: flex; flex-wrap: wrap; gap: 8px; max-width: 720px; box-shadow: var(--shadow-xl);
}
[data-theme="dark"] .hero-search { background: var(--surface); }
.hero-search input, .hero-search select {
  border: none; background: transparent; padding: 12px 16px;
  font-size: 0.95rem; outline: none; color: var(--text); flex: 1; min-width: 120px;
}
.hero-search .divider { width: 1px; background: var(--border); margin: 8px 0; }
.hero-search .btn { flex-shrink: 0; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; }
.hero-stat .num { font-size: 2rem; font-weight: 800; }
.hero-stat .label { font-size: 0.9rem; opacity: 0.8; }

/* ===== GRID ===== */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

/* ===== DASHBOARD LAYOUT ===== */
.dash-layout { display: flex; gap: 0; min-height: calc(100vh - var(--nav-h)); }
.dash-sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 0; flex-shrink: 0; position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.dash-sidebar .sidebar-header { padding: 0 24px 20px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.dash-sidebar .sidebar-header h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; }
.dash-sidebar .sidebar-header .user-name { font-weight: 700; font-size: 1rem; }
.dash-sidebar .sidebar-header .user-email { font-size: 0.82rem; color: var(--text-muted); }
.dash-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 24px;
  color: var(--text-secondary); font-weight: 500; font-size: 0.9rem;
  cursor: pointer; transition: all var(--t-fast); border-left: 3px solid transparent;
}
.dash-nav-item:hover { background: var(--bg-alt); color: var(--text); }
.dash-nav-item.active { background: var(--brand-50); color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
[data-theme="dark"] .dash-nav-item.active { background: var(--brand-100); }
.dash-nav-item .icon { width: 20px; text-align: center; }
.dash-content { flex: 1; padding: 32px; max-width: 100%; overflow-x: hidden; }
.dash-section { display: none; }
.dash-section.active { display: block; }

/* ===== STAT CARDS ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: var(--r-md); display: flex;
  align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 16px;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data-table th { text-align: left; padding: 14px 16px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
table.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.data-table tbody tr:hover { background: var(--surface-hover); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--t-base);
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--r-xl); max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-xl);
  transform: scale(0.95); transition: transform var(--t-base);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.25rem; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast {
  background: var(--surface); border-radius: var(--r-md); padding: 14px 18px;
  box-shadow: var(--shadow-lg); border-left: 4px solid var(--brand);
  display: flex; align-items: flex-start; gap: 10px;
  animation: toastIn var(--t-base); font-size: 0.9rem;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.removing { animation: toastOut var(--t-base) forwards; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* ===== ALERT ===== */
.alert { padding: 14px 18px; border-radius: var(--r-md); font-size: 0.9rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: #92400e; }
.alert-danger { background: var(--danger-bg); color: var(--danger); }

/* ===== AVATAR ===== */
.avatar {
  width: 44px; height: 44px; border-radius: var(--r-full);
  background: var(--grad-brand); color: white; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }

/* ===== PROGRESS BAR ===== */
.progress { height: 8px; background: var(--bg-alt); border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--grad-brand); border-radius: var(--r-full); transition: width var(--t-slow); }

/* ===== LOADING ===== */
.spinner { width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 60px; }
.skeleton { background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border) 50%, var(--bg-alt) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 20px; }

/* ===== FOOTER ===== */
.footer { background: #0f172a; color: #cbd5e1; padding: 60px 0 24px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer-brand .logo-icon { width: 38px; height: 38px; background: var(--grad-brand); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.3rem; }
.footer-brand img.footer-logo-img { height: 44px; width: auto; display: block; margin-bottom: 8px; }
.footer-brand span { font-size: 1.3rem; font-weight: 800; color: white; }
.footer h4 { color: white; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { color: #94a3b8; font-size: 0.9rem; transition: color var(--t-fast); }
.footer ul li a:hover { color: white; }
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a { width: 40px; height: 40px; border-radius: var(--r-md); background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: all var(--t-fast); }
.footer-social a:hover { background: var(--brand); transform: translateY(-2px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: #64748b; }

/* ===== UTILITY ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.text-sm { font-size: 0.87rem; } .text-xs { font-size: 0.78rem; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded-full { border-radius: var(--r-full); }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-date { font-size: 0.78rem; color: var(--text-muted); }
.timeline-title { font-weight: 600; font-size: 0.92rem; }
.timeline-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab { padding: 10px 20px; cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--t-fast); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ===== DROPDOWN ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 100; display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: 0.9rem; color: var(--text); transition: background var(--t-fast); }
.dropdown-item:hover { background: var(--bg-alt); }

/* ===== SECTION HEADER ===== */
.section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-header h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.section-header p { font-size: 1.05rem; color: var(--text-secondary); }

/* ===== CATEGORY GRID ===== */
.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px; text-align: center; cursor: pointer; transition: all var(--t-base);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-light); }
.cat-card .cat-icon { margin-bottom: 12px; color: var(--brand); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.cat-card .cat-icon svg { width: 32px; height: 32px; }
.cat-card:hover .cat-icon { color: var(--brand-light); }
.cat-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.cat-card .cat-count { font-size: 0.82rem; color: var(--text-muted); }

/* ===== PAGE HEADER ===== */
.page-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 32px 0; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.5px; }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }

/* ===== FILTER SIDEBAR ===== */
.filter-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; position: sticky; top: calc(var(--nav-h) + 20px); }
.filter-group { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filter-group h4 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 0.9rem; }
.filter-option input { accent-color: var(--brand); }
.filter-option .count { margin-left: auto; font-size: 0.78rem; color: var(--text-muted); }

/* ===== CHAT MESSAGES ===== */
.chat-msg { display: flex; gap: 12px; margin-bottom: 16px; }
.chat-msg.sent { flex-direction: row-reverse; }
.chat-msg .msg-bubble { max-width: 70%; padding: 12px 16px; border-radius: var(--r-lg); font-size: 0.9rem; word-wrap: break-word; }
.chat-msg.received .msg-bubble { background: var(--bg-alt); border-bottom-left-radius: 4px; }
.chat-msg.sent .msg-bubble { background: var(--brand); color: white; border-bottom-right-radius: 4px; }
.chat-msg .msg-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.chat-msg.sent .msg-time { color: rgba(255,255,255,0.7); }
.chat-msg .msg-attachment { margin-top: 8px; padding: 8px 12px; background: rgba(255,255,255,0.15); border-radius: var(--r-sm); font-size: 0.82rem; display: flex; align-items: center; gap: 6px; }
.chat-msg.received .msg-attachment { background: rgba(0,0,0,0.05); }
.chat-msg .msg-attachment a { color: inherit; text-decoration: underline; }
.chat-msg .msg-audio { margin-top: 8px; }
.chat-msg .msg-audio audio { max-width: 100%; height: 32px; }
.chat-msg.unread .msg-bubble { border-left: 3px solid var(--brand); }
.chat-msg.unread.received .msg-bubble { border-left: 3px solid var(--brand); }
.msg-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; margin-left: 6px; }
.chat-toolbar { display: flex; gap: 4px; align-items: center; padding: 8px; border-top: 1px solid var(--border); }
.chat-toolbar button { background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 4px 8px; border-radius: var(--r-sm); color: var(--text-muted); transition: all 0.15s; }
.chat-toolbar button:hover { background: var(--bg-alt); color: var(--brand); }
.chat-toolbar button.recording { color: #e53e3e; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.recording-indicator { display: none; align-items: center; gap: 6px; font-size: 0.8rem; color: #e53e3e; padding: 4px 8px; }
.recording-indicator.active { display: flex; }
.recording-indicator .dot { width: 8px; height: 8px; border-radius: 50%; background: #e53e3e; animation: pulse 1s infinite; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn var(--t-slow); }
.fade-in-up { animation: fadeInUp var(--t-slow); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .dash-sidebar { position: fixed; left: -280px; z-index: 999; transition: left var(--t-base); box-shadow: var(--shadow-xl); }
  .dash-sidebar.open { left: 0; }
  .dash-content { padding: 20px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--surface); padding: 16px; box-shadow: var(--shadow-lg); border-bottom: 1px solid var(--border); }
  .nav-toggle { display: flex; }
  .hero { padding: 50px 0 40px; }
  .hero-search { flex-direction: column; }
  .hero-search .divider { display: none; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .form-row { flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 16px; }
  .modal { max-width: 100%; border-radius: var(--r-lg); }
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; height: auto; position: relative; top: 0; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}

/* ===== ACCESSIBILITY ===== */
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.btn:focus-visible, .nav-links a:focus-visible, .form-control:focus-visible { outline-offset: 3px; }
.skip-link { position: absolute; top: -100px; left: 8px; background: var(--brand); color: white !important; padding: 10px 18px; z-index: 9999; border-radius: var(--r-md); font-weight: 600; font-size: 0.87rem; transition: top 150ms ease; box-shadow: var(--shadow-lg); }
.skip-link:focus { top: 8px; outline: 3px solid var(--accent); outline-offset: 2px; }
[role="button"]:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0f172a; --bg-alt: #1e293b; --surface: #1e293b; --surface-hover: #334155; --border: #334155; --border-dark: #475569; --text: #f1f5f9; --text-secondary: #cbd5e1; --text-muted: #64748b; } }
