/* ───────────────────────────────────────────────
   Recruiter App — Shared Stylesheet
   ─────────────────────────────────────────────── */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255,255,255,0.06);
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --surface: #ffffff;
  --bg: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 10px 30px rgba(0,0,0,0.08);
}

html, body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Layout ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-body {
  padding: 2rem 2.5rem;
  flex: 1;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  color: white;
  font-weight: 800;
}

.sidebar-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.01em;
}

.sidebar-brand-tag {
  font-size: 0.6rem;
  background: rgba(99,102,241,0.3);
  color: #a5b4fc;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #475569;
  padding: 0.5rem 0.5rem 0.4rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.nav-item.active {
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-icon {
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-post-btn {
  margin: 0 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  display: block;
  transition: background 0.15s;
}

.sidebar-post-btn:hover {
  background: var(--accent-hover);
  color: white;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--sidebar-border);
}

.recruiter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.recruiter-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.recruiter-info .recruiter-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.recruiter-info .recruiter-company {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.sidebar-logout {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.5rem;
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-logout:hover { background: rgba(239,68,68,0.1); }

/* ─── Top Header ─── */
.page-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ─── Flash Messages ─── */
.flash-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.flash-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ─── Stat Cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon.indigo  { background: #eef2ff; color: var(--accent); }
.stat-icon.green   { background: #f0fdf4; color: var(--success); }
.stat-icon.amber   { background: #fffbeb; color: var(--warning); }
.stat-icon.violet  { background: #f5f3ff; color: #7c3aed; }

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

/* ─── Cards / Panels ─── */
.panel {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ─── Job Table ─── */
.job-table {
  width: 100%;
  border-collapse: collapse;
}

.job-table thead th {
  background: #f8fafc;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.job-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.job-table tbody tr:last-child { border-bottom: none; }
.job-table tbody tr:hover { background: #fafbff; }

.job-table tbody td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.job-title-cell .job-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.job-title-cell .job-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Status Badges ─── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-published { background: #f0fdf4; color: #15803d; }
.badge-closed    { background: #f1f5f9; color: #64748b; }
.badge-draft     { background: #fffbeb; color: #b45309; }
.badge-applied       { background: #eff6ff; color: #1d4ed8; }
.badge-under_review  { background: #fefce8; color: #854d0e; }
.badge-shortlisted   { background: #f0fdf4; color: #15803d; }
.badge-rejected      { background: #fef2f2; color: #b91c1c; }
.badge-hired         { background: #f0fdf4; color: #065f46; }
.badge-pending       { background: #fffbeb; color: #92400e; }
.badge-accepted      { background: #f0fdf4; color: #15803d; }
.badge-declined      { background: #fef2f2; color: #b91c1c; }

/* ─── Applicant / Candidate Cards ─── */
.person-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.person-card:hover {
  border-color: #a5b4fc;
  box-shadow: var(--shadow-md);
}

.person-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.person-headline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.person-meta i { color: #94a3b8; margin-right: 4px; }

.skill-chip {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0.15rem 0.15rem 0.15rem 0;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 1rem;
  display: block;
}

.empty-state h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p { font-size: 0.875rem; }

/* ─── Forms ─── */
.form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  outline: none;
}

.form-text { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.3rem; }

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

/* ─── Buttons ─── */
.btn-primary-custom {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn-primary-custom:hover { background: var(--accent-hover); color: white; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger-custom {
  background: #fef2f2;
  color: var(--danger);
  border: 1.5px solid #fecaca;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-danger-custom:hover { background: #fee2e2; }

/* ─── Filter Bar ─── */
.filter-bar {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-bar .form-group { flex: 1; min-width: 160px; }

/* ─── Sticky Job Context Panel ─── */
.context-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 1.5rem;
}

.context-panel .job-title-big {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.context-panel .context-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}

/* ─── Company Profile ─── */
.profile-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.profile-section h5 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
  list-style: none;
  padding: 0;
}

.page-item .page-link {
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.page-item.disabled .page-link { opacity: 0.4; pointer-events: none; }
.page-item .page-link:hover:not(.page-item.disabled .page-link) {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Auth Pages ─── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: white;
  font-weight: 800;
}

.auth-logo-name { font-size: 1.2rem; font-weight: 800; color: var(--text); }

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.auth-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.75rem; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ─── Password strength ─── */
.strength-bar-wrap { height: 4px; background: #e2e8f0; border-radius: 2px; margin-top: 6px; }
.strength-bar { height: 4px; border-radius: 2px; width: 0; transition: width 0.3s, background 0.3s; }

/* ─── Dropdown (actions) ─── */
.actions-dropdown .dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 180px;
  padding: 0.5rem;
}

.actions-dropdown .dropdown-item {
  border-radius: 7px;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  color: var(--text);
}

.actions-dropdown .dropdown-item:hover { background: #f1f5f9; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .page-body { padding: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}