/* =============================================
   TATARI — Premium Design System
   Global Styles, Variables, Components
   ============================================= */

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

/* -----------------------------------------------
   CSS Custom Properties (Design Tokens)
----------------------------------------------- */
:root {
  /* Colors - Light Mode */
  --bg-primary: #f0f4ff;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-code: #f1f5f9;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-secondary: #0ea5e9;
  --accent-secondary-hover: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-focus: #6366f1;
  --border-strong: #cbd5e1;

  --success: #10b981;
  --success-light: #d1fae5;
  --success-text: #065f46;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --danger-text: #991b1b;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --warning-text: #92400e;
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --info-text: #075985;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.16);
  --shadow-accent: 0 8px 32px rgba(99,102,241,0.25);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 260px;
  --topbar-height: 64px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}

/* Dark Mode */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0a0f1e;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-sidebar: #0a0f1e;
  --bg-hover: #1e293b;
  --bg-input: #0f172a;
  --bg-code: #1e293b;

  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-light: #1e1b4b;
  --accent-secondary: #38bdf8;
  --accent-secondary-hover: #0ea5e9;

  --text-primary: #f1f5f9;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --text-inverse: #0f172a;

  --border: #1e293b;
  --border-focus: #818cf8;
  --border-strong: #334155;

  --success: #34d399;
  --success-light: #064e3b;
  --success-text: #a7f3d0;
  --danger: #f87171;
  --danger-light: #450a0a;
  --danger-text: #fca5a5;
  --warning: #fbbf24;
  --warning-light: #451a03;
  --warning-text: #fde68a;
  --info: #38bdf8;
  --info-light: #0c4a6e;
  --info-text: #bae6fd;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

button { cursor: pointer; font-family: var(--font-sans); }

input, textarea, select {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-primary);
}

ul { list-style: none; }
hr { border: none; border-top: 1px solid var(--border); }

/* -----------------------------------------------
   Typography Scale
----------------------------------------------- */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* -----------------------------------------------
   Layout Utilities
----------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.grid { display: grid; }
.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(280px, 1fr)); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.p-2 { padding: 8px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }

/* -----------------------------------------------
   Card Component
----------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2, .card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-hover);
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover::before { opacity: 1; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.purple { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-icon.blue { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.stat-icon.pink { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

.stat-info h3 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* -----------------------------------------------
   Button Component
----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning {
  background: var(--warning);
  color: #000;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-xl { padding: 16px 36px; font-size: 1.0625rem; font-weight: 700; }

.btn-block { width: 100%; justify-content: center; }

.btn[disabled], .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* -----------------------------------------------
   Badge Component
----------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: capitalize;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-danger { background: var(--danger-light); color: var(--danger-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-info { background: var(--info-light); color: var(--info-text); }
.badge-secondary { background: var(--bg-hover); color: var(--text-muted); }
.badge-default { background: var(--accent-light); color: var(--accent); }
.badge-accent { background: var(--accent); color: #fff; }

.badge-remote { background: #d1fae5; color: #065f46; }
.badge-fulltime { background: var(--info-light); color: var(--info-text); }
.badge-parttime { background: var(--warning-light); color: var(--warning-text); }
.badge-contract { background: var(--accent-light); color: var(--accent); }
.badge-internship { background: #fce7f3; color: #9d174d; }

[data-theme="dark"] .badge-remote { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-fulltime { background: var(--info-light); color: var(--info-text); }

/* -----------------------------------------------
   Form Components
----------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: var(--bg-secondary);
}

.form-control::placeholder { color: var(--text-light); }

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Ensure all options and optgroups have correct backgrounds and text colors inside dropdowns */
select option,
select optgroup {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  padding: 8px 12px;
}

[data-theme="dark"] select option,
[data-theme="dark"] select optgroup {
  background-color: #1a2236 !important;
  color: #f1f5f9 !important;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .form-control {
  padding-left: 40px;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Skill Tags Input */
.skill-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  min-height: 48px;
  cursor: text;
  transition: var(--transition);
}

.skill-tags-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: default;
}

.skill-tag .remove-tag {
  background: rgba(255,255,255,0.3);
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  color: #fff;
  padding: 0;
  transition: var(--transition);
}

.skill-tag .remove-tag:hover {
  background: rgba(255,255,255,0.5);
}

/* Skill Checkboxes Grid */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.skill-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.skill-checkbox:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.skill-checkbox input:checked + span {
  color: var(--accent);
  font-weight: 600;
}

.skill-checkbox:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* -----------------------------------------------
   Table Component
----------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.data-table thead {
  background: var(--bg-hover);
}

.data-table th {
  padding: 12px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* -----------------------------------------------
   Avatar Component
----------------------------------------------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.avatar-xs { width: 28px; height: 28px; }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 96px; height: 96px; }
.avatar-2xl { width: 128px; height: 128px; }

.avatar-initials {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* -----------------------------------------------
   Alert / Flash Messages
----------------------------------------------- */
.flash-messages {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4.7s forwards;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.flash-success {
  background: var(--success-light);
  color: var(--success-text);
  border-color: var(--success);
}

.flash-error {
  background: var(--danger-light);
  color: var(--danger-text);
  border-color: var(--danger);
}

.flash-warning {
  background: var(--warning-light);
  color: var(--warning-text);
  border-color: var(--warning);
}

.flash-info {
  background: var(--info-light);
  color: var(--info-text);
  border-color: var(--info);
}

.flash-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.flash-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  margin-left: auto;
  opacity: 0.6;
  padding: 0;
  flex-shrink: 0;
}

.flash-close:hover { opacity: 1; }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(30px); pointer-events: none; }
}

/* Alert blocks */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.alert-success { background: var(--success-light); color: var(--success-text); border-color: var(--success); }
.alert-danger { background: var(--danger-light); color: var(--danger-text); border-color: var(--danger); }
.alert-warning { background: var(--warning-light); color: var(--warning-text); border-color: var(--warning); }
.alert-info { background: var(--info-light); color: var(--info-text); border-color: var(--info); }

/* -----------------------------------------------
   Pagination
----------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  transition: var(--transition);
}

.pagination-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.pagination-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination-ellipsis {
  color: var(--text-muted);
  padding: 0 8px;
}

/* -----------------------------------------------
   Tabs Component
----------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover { color: var(--accent); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* -----------------------------------------------
   Modal
----------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; }

.modal-close {
  background: var(--bg-hover);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* -----------------------------------------------
   PUBLIC LAYOUT
----------------------------------------------- */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.nav-brand-name {
  font-size: 1.375rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
  font-size: 0.9375rem;
}

.nav-link:hover, .nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile Nav Toggle & Menu */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: space-between;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  box-shadow: var(--shadow-lg);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 99;
}

.nav-mobile-menu.active {
  display: flex;
  max-height: 500px;
  opacity: 1;
}

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.nav-mobile-link {
  padding: 12px 16px;
  color: var(--text-primary);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1rem;
}

.nav-mobile-link:hover, .nav-mobile-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.nav-mobile-actions .btn {
  width: 100%;
  justify-content: center;
}

/* -----------------------------------------------
   HERO SECTION
----------------------------------------------- */
.hero {
  padding: 80px 24px 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(99,102,241,0.2);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary), #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-search {
  display: flex;
  gap: 0;
  max-width: 600px;
  margin: 0 auto 48px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  padding: 6px;
  gap: 6px;
}

.hero-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 48px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.stats-bar-item {
  text-align: center;
}

.stats-bar-number {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stats-bar-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* -----------------------------------------------
   JOB CARD
----------------------------------------------- */
.job-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.job-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.job-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.company-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.job-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.job-card-company {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.job-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.job-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.job-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-pill {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(99,102,241,0.2);
}

[data-theme="dark"] .skill-pill {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.3);
}

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* -----------------------------------------------
   CANDIDATE CARD
----------------------------------------------- */
.candidate-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: var(--transition);
}

.candidate-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.candidate-info { flex: 1; min-width: 0; }
.candidate-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.candidate-title {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* -----------------------------------------------
   DASHBOARD LAYOUT (authenticated)
----------------------------------------------- */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.06);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-name span {
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: capitalize;
  margin-top: 2px;
}

.sidebar-role-badge {
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  padding: 8px 12px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #94a3b8;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: #f1f5f9;
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.2), rgba(14,165,233,0.1));
  color: #818cf8;
  border: 1px solid rgba(99,102,241,0.15);
}

.sidebar-link.active .sidebar-icon { color: #818cf8; }

.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Main Content Area */
.dashboard-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

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

.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

.topbar-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}

/* Dashboard Content */
.dashboard-content {
  padding: 28px;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.625rem;
  font-weight: 800;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.9375rem;
}

/* Section Headings */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* -----------------------------------------------
   Profile Components
----------------------------------------------- */
.profile-header {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 24px;
}

.profile-cover {
  height: 160px;
  background: linear-gradient(135deg, #6366f1 0%, #0ea5e9 50%, #10b981 100%);
}

.profile-header-content {
  padding: 0 28px 28px;
  position: relative;
}

.profile-avatar-wrap {
  margin-top: -52px;
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

.profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow-md);
}

.availability-dot {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
}

.availability-dot.available { background: var(--success); }
.availability-dot.open { background: var(--warning); }
.availability-dot.not_available { background: var(--text-muted); }

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -----------------------------------------------
   Filter Sidebar
----------------------------------------------- */
.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.filter-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.filter-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* -----------------------------------------------
   Empty State
----------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* -----------------------------------------------
   Chart Container
----------------------------------------------- */
.chart-container {
  position: relative;
  height: 280px;
}

/* -----------------------------------------------
   File Upload Drop Zone
----------------------------------------------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-hover);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* -----------------------------------------------
   Admin Layout
----------------------------------------------- */
.admin-sidebar .sidebar-link.active {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border-color: rgba(239,68,68,0.2);
}

[data-theme="dark"] .admin-sidebar .sidebar-link.active {
  background: rgba(239,68,68,0.1);
}

/* -----------------------------------------------
   Notification Dropdown
----------------------------------------------- */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  display: none;
}

.notif-dropdown.open { display: block; animation: fadeIn 0.2s ease; }

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--accent-light); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.notif-text p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.4; }
.notif-text small { color: var(--text-muted); font-size: 0.75rem; }

/* -----------------------------------------------
   Theme Toggle
----------------------------------------------- */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
  color: var(--text-muted);
}

.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* -----------------------------------------------
   Footer
----------------------------------------------- */
.public-footer {
  background: var(--bg-sidebar);
  color: #94a3b8;
  padding: 48px 24px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.footer-brand-name span {
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-desc { line-height: 1.7; font-size: 0.9375rem; max-width: 280px; }
.footer-col-title { font-weight: 700; color: #f1f5f9; margin-bottom: 16px; font-size: 0.9375rem; }
.footer-col a { display: block; color: #94a3b8; margin-bottom: 10px; font-size: 0.9375rem; transition: var(--transition); }
.footer-col a:hover { color: #818cf8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { font-size: 0.875rem; }

/* -----------------------------------------------
   Animations
----------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn 0.4s ease both; }
.animate-slide-up { animation: slideUp 0.5s ease both; }

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 0%, var(--border) 50%, var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -----------------------------------------------
   Responsive Breakpoints & Mobile Optimization
----------------------------------------------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nav-inner { padding: 0 16px; }
  .container { padding: 0 16px; }
}

@media (max-width: 900px) {
  /* Collapse two-column layouts with inline grid-template-columns */
  .grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .filter-panel,
  .filter-panel[style*="position:sticky"],
  div[style*="position:sticky"] {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  /* Navigation on Tablet & Phone */
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .mobile-nav-toggle { display: flex; }
  .nav-inner { height: 60px; padding: 0 16px; }

  /* Sidebar Drawer */
  .sidebar {
    transform: translateX(-280px);
    width: 280px;
    box-shadow: none;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .dashboard-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .dashboard-content { padding: 16px 12px; }
  .topbar { padding: 0 16px; height: 56px; gap: 8px; }
  .page-title { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

  /* Grids & Cards */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 16px; }
  .form-row { grid-template-columns: 1fr; gap: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .footer-socials { justify-content: center; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 8px; }

  /* Hero & Home */
  .hero { padding: 48px 16px 64px; }
  .hero-title { font-size: clamp(2rem, 8vw, 2.75rem); line-height: 1.15; margin-bottom: 16px; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 28px; padding: 0 8px; }
  
  .hero-search {
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: 10px;
    gap: 10px;
  }
  .hero-search input, .hero-search select {
    width: 100%;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 12px 14px;
  }
  .hero-search button {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    justify-content: center;
  }

  .hero-actions { flex-direction: column; width: 100%; max-width: 320px; margin: 0 auto; gap: 12px; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .stats-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
    padding: 32px 16px;
  }
  .stats-bar-number { font-size: 2rem; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .stat-card { padding: 16px; }

  /* Table overflow */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
    display: block;
    width: 100%;
  }
  table.data-table { min-width: 600px; }

  /* Modals & Flash */
  .modal { border-radius: var(--radius-lg); margin: 16px; max-width: calc(100vw - 32px); }
  .flash-messages { left: 12px; right: 12px; max-width: none; bottom: 16px; }
}

@media (max-width: 600px) {
  .grid-auto { grid-template-columns: 1fr; gap: 16px; }
  .job-card { padding: 18px 16px; }
  .job-card-header { flex-wrap: wrap; gap: 10px; }
  .job-card-header .badge { margin-left: 0; align-self: flex-start; }
  .job-card-meta { gap: 10px; font-size: 0.8125rem; flex-wrap: wrap; }
  .job-card-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr 1fr; gap: 20px 10px; }
  .stats-bar-number { font-size: 1.75rem; }
  .stats-bar-label { font-size: 0.75rem; }
  .hero-title { font-size: 1.85rem; }
  .topbar { padding: 0 12px; }
  .page-title { max-width: 140px; font-size: 1rem; }
  .btn-xl { padding: 14px 24px; font-size: 1rem; }

  /* Auth & Two-column small grids */
  .auth-card div[style*="grid-template-columns:1fr 1fr"],
  .choice-grid {
    grid-template-columns: 1fr !important;
  }
}

/* -----------------------------------------------
   Utility: Visually Hidden
----------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: rgba(99,102,241,0.2); color: var(--accent); }
