/* ── HandyMan Staffing Solutions – shared stylesheet ── */
:root {
  --primary: #00BCD4;
  --primary-dark: #0097A7;
  --admin-primary: #1a1a2e;
  --employer-primary: #1a1a2e;
  --bg: #f4f6f8;
  --card: #fff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --tag-bg: #e0f7fa;
  --tag-text: #00838f;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;
  --danger-text: #991b1b;
  --success-bg: #d1fae5;
  --success-border: #6ee7b7;
  --success-text: #065f46;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  background: #fff;
  color: var(--text);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  flex-shrink: 0;
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.topbar-candidate { background: #fff; }
.topbar-admin     { background: var(--admin-primary); border-bottom-color: var(--primary); }
.topbar-employer  { background: var(--admin-primary); border-bottom-color: var(--primary); }

.topbar .logo { display: flex; align-items: center; text-decoration: none; }
.topbar .logo img { height: 42px; width: auto; object-fit: contain; }
.topbar-badge {
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
}
.topbar nav a {
  color: var(--text);
  text-decoration: none;
  margin-left: 20px;
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
}
.topbar nav a:hover, .topbar nav a.active { color: var(--primary); }
.topbar nav a.active { border-bottom: 2px solid var(--primary); padding-bottom: 2px; }
/* admin/employer topbars keep white text */
.topbar-admin nav a, .topbar-employer nav a { color: rgba(255,255,255,.85); }
.topbar-admin nav a:hover, .topbar-admin nav a.active,
.topbar-employer nav a:hover, .topbar-employer nav a.active { color: var(--primary); }

/* ── Layout ── */
.page { max-width: 1100px; margin: 32px auto; padding: 0 16px; flex: 1; }
.page-narrow { max-width: 700px; margin: 32px auto; padding: 0 16px; flex: 1; }
.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.07);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.card-auth {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.09);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}
.card-header h2 { font-size: 1.05rem; font-weight: 700; }

/* ── Page header ── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p { color: var(--muted); margin-top: 4px; font-size: .9rem; }
.page-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header-row h1 { font-size: 1.5rem; font-weight: 700; }

/* ── Auth card headings ── */
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: .9rem; margin-bottom: 28px; }

/* ── Auth branding ── */
.auth-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo { max-height: 70px; width: auto; object-fit: contain; }
.auth-tagline { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.auth-wrap .card-auth { width: 100%; }

/* ── Alerts ── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: .875rem; margin-bottom: 18px; transition: opacity 0.6s ease, margin 0.6s ease, padding 0.6s ease; }
.alert-error   { background: var(--danger-bg);  border: 1px solid var(--danger-border);  color: var(--danger-text); }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }
.alert.fade-out { opacity: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }

/* ── Word count ── */
.word-count { font-size: .8rem; margin-top: 4px; color: #6b7280; }
.word-count.ok  { color: #16a34a; }
.word-count.bad { color: #dc2626; }

/* ── Profile completeness ── */
.completeness-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.07);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.completeness-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}
.completeness-pct { color: var(--primary); font-weight: 700; }
.completeness-bar {
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.completeness-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 99px;
  transition: width .6s ease;
}
.completeness-hint { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.completeness-hint a { color: var(--primary); font-weight: 500; }

/* ── Forms ── */
.field { margin-bottom: 18px; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 5px; color: #374151; }
input[type=text], input[type=email], input[type=password],
input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  transition: border .2s, box-shadow .2s;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
input[readonly] { background: #f9fafb; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-dark      { background: var(--admin-primary); color: #fff; }
.btn-dark:hover { background: #1f2937; }
.btn-success   { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost     { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-outline   { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--tag-bg); }
.btn-full      { width: 100%; justify-content: center; }
.btn-sm        { padding: 6px 12px; font-size: .8rem; }
.btn-row       { display: flex; gap: 12px; margin-top: 24px; }

/* ── Stats ── */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.stat {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  padding: 20px 24px;
  flex: 1;
  min-width: 150px;
}
.stat .num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat .lbl { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 12px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
}
td { padding: 12px; font-size: .875rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.actions { display: flex; gap: 8px; align-items: center; }

/* ── Tags / Skills ── */
.skills-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
}

/* ── Profile table ── */
.profile-grid { display: grid; grid-template-columns: 220px 1fr; }
.profile-label {
  padding: 10px 0;
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.profile-value { padding: 10px 0; font-size: .9rem; border-bottom: 1px solid var(--border); }

/* ── CV box ── */
.cv-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cv-icon { font-size: 1.8rem; }
.cv-info .cv-name { font-weight: 600; font-size: .9rem; }
.cv-info .cv-hint { font-size: .8rem; color: var(--muted); }
.cv-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── File upload area ── */
.file-area {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  background: #fafbff;
  text-align: center;
  cursor: pointer;
  transition: border .2s, background .2s, transform .2s;
  display: block;
}
.file-area:hover {
  border-color: var(--primary);
  background: #f9fbff;
  transform: translateY(-1px);
}
.file-area input[type=file] { display: none; }
.file-hint { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.current-cv {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  margin-top: 10px;
  font-size: .875rem;
}
.current-cv a { color: var(--primary); text-decoration: none; }
.current-cv a:hover { text-decoration: underline; }

.checkbox-field .checkbox-label {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.checkbox-field .checkbox-label input[type=checkbox] {
  margin-top: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.checkbox-field .checkbox-label .checkbox-text {
  line-height: 1.4;
  white-space: nowrap;
}
.checkbox-field .checkbox-label small {
  display: inline;
  margin-left: 6px;
  font-size: .85rem;
  font-weight: 400;
  color: var(--muted);
}
.help-text {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Candidate cards ── */
.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; }
.c-card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  padding: 20px;
  border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.c-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.c-name { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.c-email { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.c-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.meta-item { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.c-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.shortlist-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.shortlist-form select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .8rem; outline: none; }
.shortlist-form input[type=text] { padding: 6px 10px; font-size: .8rem; width: 130px; }

/* ── Shortlist sidebar layout ── */
.sl-layout { display: flex; gap: 20px; }
.sl-sidebar { width: 260px; flex-shrink: 0; }
.sl-main { flex: 1; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: .875rem;
  transition: background .15s;
}
.list-item:hover { background: #f1f5f9; }
.list-item.active { background: var(--tag-bg); color: var(--primary); font-weight: 600; }
.list-count { background: var(--border); color: var(--muted); font-size: .75rem; padding: 1px 7px; border-radius: 20px; }
.new-list-form { margin-top: 14px; display: flex; gap: 8px; }
.new-list-form input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; outline: none; }
.new-list-form input:focus { border-color: var(--primary); }

/* ── Action grid (employer dashboard) ── */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.action-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, border-color .2s;
}
.action-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); border-color: var(--primary); }
.action-icon { font-size: 2rem; margin-bottom: 10px; }
.action-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.action-card p { font-size: .85rem; color: var(--muted); }

/* ── Filter bar ── */
.filter-card { background: var(--card); border-radius: 12px; box-shadow: 0 1px 8px rgba(0,0,0,.07); padding: 20px 24px; margin-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: repeat(4,1fr) auto; gap: 12px; align-items: end; }

/* ── User menu dropdown ── */
.user-menu { position:relative; }
.user-avatar { width:36px; height:36px; border-radius:50%; background:var(--primary);
  color:#fff; font-weight:700; font-size:.85rem; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.user-dropdown { display:none; position:absolute; right:0; top:44px; background:#fff;
  border:1px solid var(--border); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.12);
  min-width:220px; z-index:200; overflow:hidden; }
.user-dropdown.open { display:block; }
.user-dropdown-header { padding:12px 16px; border-bottom:1px solid var(--border);
  font-size:.82rem; color:var(--muted); }
.user-dropdown-header strong { display:block; color:var(--text); font-size:.9rem; }
.user-dropdown form { padding:12px 16px; border-top:1px solid var(--border); }
.user-dropdown form .field { margin-bottom:10px; }
.user-dropdown form .field label { font-size:.78rem; }
.user-dropdown form .field input { padding:7px 10px; font-size:.82rem; }
.user-dropdown-item { display:flex; align-items:center; gap:8px; padding:10px 16px;
  font-size:.875rem; color:var(--text); text-decoration:none; cursor:pointer;
  border:none; background:none; width:100%; text-align:left; }
.user-dropdown-item:hover { background:var(--bg); }
.user-dropdown-item.danger { color:#ef4444; }
.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--muted); font-size: .8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.links { margin-top: 20px; text-align: center; font-size: .875rem; color: var(--muted); }
.links a { color: var(--primary); text-decoration: none; font-weight: 500; }
.links a:hover { text-decoration: underline; }
.empty { text-align: center; padding: 48px; color: var(--muted); }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.muted { color: var(--muted); }
a { color: var(--primary); }
footer { text-align: center; padding: 20px; color: var(--muted); font-size: .8rem; flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { flex-direction: column; }
  .action-grid { grid-template-columns: 1fr; }
  .sl-layout { flex-direction: column; }
  .sl-sidebar { width: 100%; }
  .candidate-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

/* ── Searchable select ───────────────────────────────────────────────────────── */
.ss-wrapper { position: relative; display: block; }

.ss-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: .95rem;
  color: var(--text);
  min-height: 40px;
  user-select: none;
  transition: border-color .15s;
}
.ss-display:focus,
.ss-display.ss-open { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(0,188,212,.15); }

.ss-display-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-arrow { font-size: .7rem; color: var(--muted); margin-left: 8px; transition: transform .15s; }
.ss-display.ss-open .ss-arrow { transform: rotate(180deg); }

.ss-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 999;
  overflow: hidden;
}

.ss-search {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  outline: none;
  background: #f9fafb;
}
.ss-search:focus { background: #fff; }

.ss-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.ss-group {
  padding: 6px 12px 2px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary);
  background: #f0fdff;
  border-top: 1px solid var(--border);
}
.ss-group:first-child { border-top: none; }

.ss-option {
  padding: 8px 16px;
  font-size: .9rem;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
}
.ss-option:hover { background: #e0f7fa; }
.ss-option.ss-selected { background: #b2ebf2; font-weight: 600; }
.ss-placeholder { color: var(--muted); font-style: italic; }
.ss-none { padding: 10px 16px; color: var(--muted); font-size: .88rem; }

/* ── Requisition badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 700;
}
.badge-pending   { background:#fef3c7; color:#92400e; padding:2px 10px; border-radius:99px; font-size:.78rem; font-weight:700; }
.badge-progress  { background:#dbeafe; color:#1e40af; padding:2px 10px; border-radius:99px; font-size:.78rem; font-weight:700; }
.badge-fulfilled { background:#d1fae5; color:#065f46; padding:2px 10px; border-radius:99px; font-size:.78rem; font-weight:700; }
.badge-closed    { background:#f3f4f6; color:#6b7280; padding:2px 10px; border-radius:99px; font-size:.78rem; font-weight:700; }
.response-box    { background:#f0fdf4; border:1px solid #6ee7b7; border-radius:8px; padding:12px 16px; margin-top:8px; font-size:.88rem; }
.respond-panel   { display:none; padding:14px 16px; background:var(--bg); border-radius:8px; margin-top:10px; }
.respond-panel.open { display:block; }
