/* ================================================
   HIREHUB — Admin Panel Stylesheet
   ================================================ */

:root {
  --bg: #0d0e1a;
  --bg-card: #111222;
  --bg-hover: #161728;
  --sidebar-bg: #0b0c18;
  --border: #1e2040;
  --text: #e8eaf6;
  --text-muted: #7986cb;
  --text-soft: #a0a8cc;
  --accent: #f0c040;
  --accent-hover: #ffd060;
  --accent-glow: rgba(240,192,64,0.12);
  --primary: #302b63;
  --green: #66bb6a;
  --green-bg: rgba(76,175,80,0.12);
  --red: #ef5350;
  --red-bg: rgba(239,83,80,0.12);
  --yellow: #ffa726;
  --yellow-bg: rgba(255,167,38,0.12);
  --blue: #42a5f5;
  --blue-bg: rgba(66,165,245,0.12);
  --purple: #ba68c8;
  --purple-bg: rgba(186,104,200,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --sidebar-w: 220px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* ---- LOGIN PAGE ---- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { position: relative; width: 100%; max-width: 440px; padding: 24px; }
.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 36px;
  position: relative; z-index: 1;
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 22px;
  margin-bottom: 28px; justify-content: center;
}
.logo-mark {
  width: 38px; height: 38px; background: var(--accent);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 18px; color: #1a1a2e;
}
.login-site-name { color: var(--text); }
.login-title { font-family: var(--font-head); font-weight: 800; font-size: 26px; text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.login-alert { margin-bottom: 20px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-btn { margin-top: 4px; }
.password-wrap { position: relative; }
.toggle-pwd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-muted);
}
.back-to-site {
  display: block; text-align: center; margin-top: 20px;
  font-size: 13px; color: var(--text-muted); transition: color 0.2s;
}
.back-to-site:hover { color: var(--accent); }
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.login-orb {
  position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.2;
}
.login-orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, #302b63, transparent); top: -200px; left: -200px; }
.login-orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, #f0c040, transparent); bottom: -100px; right: -100px; opacity: 0.08; }

/* ---- ADMIN LAYOUT ---- */
.admin-layout { display: flex; min-height: 100vh; }

/* ---- SIDEBAR NAV ---- */
.sidebar-nav {
  width: var(--sidebar-w); background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 10;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 20px;
  font-family: var(--font-head); font-weight: 700; font-size: 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-menu {
  flex: 1; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: all 0.2s;
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-link:hover { color: var(--text); background: var(--bg-hover); }
.sidebar-link.active { color: var(--accent); background: var(--accent-glow); }
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.logout-link:hover { color: var(--red) !important; background: var(--red-bg) !important; }

/* ---- ADMIN MAIN ---- */
.admin-main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
  height: 56px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: var(--sidebar-bg);
  position: sticky; top: 0; z-index: 5;
}
.topbar-crumb { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--text-soft); }
.topbar-user { font-size: 13px; color: var(--text-muted); }
.admin-content { padding: 28px; flex: 1; }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}
.page-title { font-family: var(--font-head); font-weight: 800; font-size: 26px; }
.page-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ---- BUTTONS ---- */
.btn-primary {
  background: var(--accent); color: #1a1a2e;
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent; color: var(--text);
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---- ALERTS ---- */
.alert-error {
  background: var(--red-bg); border: 1px solid rgba(239,83,80,0.3);
  color: #ef9a9a; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px; margin-bottom: 20px;
}
.alert-success {
  background: var(--green-bg); border: 1px solid rgba(76,175,80,0.3);
  color: #a5d6a7; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px; margin-bottom: 20px;
}

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  display: flex; align-items: center; gap: 14px;
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card-icon { font-size: 28px; }
.stat-card-num {
  font-family: var(--font-head); font-weight: 800; font-size: 28px;
  line-height: 1;
}
.stat-card-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-blue .stat-card-num { color: var(--blue); }
.stat-green .stat-card-num { color: var(--green); }
.stat-yellow .stat-card-num { color: var(--yellow); }
.stat-purple .stat-card-num { color: var(--purple); }

/* ---- DASHBOARD GRID ---- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.dash-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.dash-card-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.dash-card-link { font-size: 13px; color: var(--accent); }
.empty-dash { font-size: 14px; color: var(--text-muted); padding: 20px 0; text-align: center; }

.recent-list { display: flex; flex-direction: column; gap: 12px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }
.recent-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.recent-info { flex: 1; min-width: 0; }
.recent-name { display: block; font-size: 14px; font-weight: 600; }
.recent-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.recent-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.job-summary-list { display: flex; flex-direction: column; gap: 10px; }
.job-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.job-summary-row:last-child { border-bottom: none; }
.job-summary-title { font-size: 14px; font-weight: 500; display: block; }
.job-summary-meta { font-size: 12px; color: var(--text-muted); }
.job-summary-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.active { background: var(--green); }
.status-dot.inactive { background: var(--text-muted); }

/* ---- TABLE ---- */
.table-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  background: var(--sidebar-bg); padding: 12px 16px;
  text-align: left; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }
.table-job-title { font-weight: 600; color: var(--accent); font-size: 14px; }
.table-company { font-size: 12px; color: var(--text-muted); }
.date-cell { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.category-tag {
  background: var(--blue-bg); color: var(--blue);
  padding: 3px 10px; border-radius: 6px; font-size: 12px;
}

/* Toggle buttons */
.toggle-btn {
  border: none; cursor: pointer; border-radius: 20px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  font-family: var(--font-body); transition: all 0.2s;
  white-space: nowrap;
}
.toggle-btn.active { background: var(--green-bg); color: var(--green); }
.toggle-btn.inactive { background: var(--bg-hover); color: var(--text-muted); }
.toggle-btn.featured { background: var(--yellow-bg); color: var(--yellow); }
.toggle-btn.not-featured { background: var(--bg-hover); color: var(--text-muted); }

.action-btns { display: flex; gap: 6px; }
.action-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.action-btn:hover { border-color: var(--accent); }
.delete-btn:hover { border-color: var(--red) !important; }

/* ---- FILTER BAR ---- */
.filter-bar { margin-bottom: 20px; }

/* ---- APPLICATIONS TABLE ---- */
.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.email-link { color: var(--accent); font-size: 13px; }
.resume-dl-btn {
  background: var(--yellow-bg); color: var(--yellow);
  border: 1px solid rgba(255,167,38,0.3);
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.2s;
}
.resume-dl-btn:hover { background: var(--yellow); color: #1a1a2e; }
.view-cover-btn {
  background: var(--blue-bg); color: var(--blue);
  border: 1px solid rgba(66,165,245,0.3);
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all 0.2s;
}
.view-cover-btn:hover { background: var(--blue); color: #fff; }
.text-muted { color: var(--text-muted); font-size: 13px; }

/* ---- MODAL ---- */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-box {
  position: relative; z-index: 1;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 90%; max-width: 560px;
  max-height: 80vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; }
.modal-content { padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.8; color: var(--text-soft); white-space: pre-wrap; }

/* ---- JOB FORM ---- */
.job-form-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; margin-bottom: 24px;
}
.form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.form-col {}
.form-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted);
  margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 18px; }
.form-group.has-error .form-input { border-color: var(--red); }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-soft); margin-bottom: 7px;
}
.required { color: var(--red); margin-left: 2px; }
.form-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-family: var(--font-body); font-size: 14px; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; display: block; }
.error-msg { font-size: 12px; color: var(--red); margin-top: 5px; display: block; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Rich text editor */
.editor-toolbar {
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 8px 12px; display: flex; gap: 6px; flex-wrap: wrap;
}
.editor-toolbar button {
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text); padding: 4px 10px; border-radius: 4px;
  cursor: pointer; font-size: 13px; font-family: var(--font-body);
  transition: all 0.15s;
}
.editor-toolbar button:hover { background: var(--accent); color: #1a1a2e; border-color: var(--accent); }
.rich-editor {
  min-height: 260px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 14px;
  font-size: 14px; color: var(--text); line-height: 1.7;
  outline: none; overflow-y: auto;
}
.rich-editor:focus { border-color: var(--accent); }
.rich-editor h4 { color: var(--text); margin: 12px 0 6px; }
.rich-editor ul, .rich-editor ol { padding-left: 20px; }
.rich-editor li { margin-bottom: 4px; }

/* Toggles */
.toggle-group { display: flex; flex-direction: column; gap: 14px; }
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-soft); }
.toggle-input { display: none; }
.toggle-switch {
  width: 44px; height: 24px; background: var(--bg-hover);
  border-radius: 12px; position: relative; transition: background 0.2s;
  flex-shrink: 0; border: 1px solid var(--border);
}
.toggle-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-muted); transition: all 0.2s;
}
.toggle-input:checked + .toggle-switch { background: var(--accent-glow); border-color: var(--accent); }
.toggle-input:checked + .toggle-switch::after { background: var(--accent); transform: translateX(20px); }

/* Preview box */
.job-preview-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.preview-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.preview-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.preview-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--bg-hover); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 6px; font-size: 12px; color: var(--text-muted);
}

/* Form actions */
.form-actions {
  display: flex; justify-content: flex-end; gap: 12px; padding-top: 20px;
  border-top: 1px solid var(--border); margin-top: 4px;
}

/* Admin empty state */
.admin-empty {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 64px 24px; text-align: center;
}
.admin-empty .empty-icon { font-size: 48px; margin-bottom: 16px; }
.admin-empty h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 8px; }
.admin-empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .form-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .sidebar-nav { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
