/* =============================================
   AIHired Design System
   Shared tokens, primitives, and utility classes.
   Used by every page so updates propagate via one file.
   ============================================= */

:root {
  /* Color tokens */
  --ink: #0d0e12;
  --ink2: #1a1c24;
  --ink3: #262a36;
  --ink4: #323648;
  --chalk: #f0f1f4;
  --chalk2: #c8cad4;
  --chalk3: #8a8e9e;
  --chalk4: #5a5e6e;

  /* Brand accents */
  --lime: #b8ff57;
  --lime-d: #8fd422;
  --lime-l: #d4ff8f;
  --sky: #57c8ff;
  --rose: #ff5787;
  --amber: #ffc857;
  --violet: #a878ff;

  /* Status */
  --ok: #4ade80;
  --warn: #ffc857;
  --err: #ff5787;

  /* Radii / spacing */
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-lime: 0 12px 40px rgba(184, 255, 87, 0.25);

  /* Type */
  --font-sans: 'Cabinet Grotesk', system-ui, -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--ink);
  color: var(--chalk);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* ============= Accessibility helpers =============
   Visually hide an element while keeping it in the accessibility tree.
   Use on a <label> when the visual layout doesn't have room for visible
   label text — beats relying on placeholder alone (which screen readers
   announce inconsistently and which disappears on focus). */
.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;
}

/* ============= Background grid + orbs ============= */
.bg-grid::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--ink3) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink3) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.orb-1 { width: 600px; height: 600px; background: rgba(184, 255, 87, 0.06); top: -200px; left: -200px; }
.orb-2 { width: 500px; height: 500px; background: rgba(87, 200, 255, 0.05); bottom: -200px; right: -100px; }
.orb-3 { width: 400px; height: 400px; background: rgba(255, 87, 135, 0.04); top: 40%; left: 50%; }

/* ============= Nav ============= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(13, 14, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-logo {
  font-weight: 900;
  font-size: 22px;
  color: var(--chalk);
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo-badge {
  background: var(--lime);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
}
.nav-links a {
  color: var(--chalk3);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--chalk); }
.nav-cta { display: flex; gap: 10px; align-items: center; }

/* ============= Buttons ============= */
.btn {
  font-family: var(--font-sans);
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.btn-primary { background: var(--lime); color: var(--ink); }
.btn-primary:hover { background: var(--lime-d); transform: translateY(-1px); box-shadow: var(--shadow-lime); }
.btn-secondary { background: transparent; color: var(--chalk); border: 1px solid rgba(255, 255, 255, 0.18); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.35); }
.btn-ghost { background: transparent; color: var(--chalk2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); color: var(--chalk); }
.btn-danger { background: rgba(255, 87, 135, 0.12); color: var(--rose); border: 1px solid rgba(255, 87, 135, 0.3); }
.btn-danger:hover { background: rgba(255, 87, 135, 0.2); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============= Cards ============= */
.card {
  background: var(--ink2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r);
  padding: 24px;
  transition: border-color 0.2s, background 0.2s;
}
.card:hover { border-color: rgba(184, 255, 87, 0.2); }
.card-flat { background: var(--ink2); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--r); }

/* ============= Forms ============= */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--chalk2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.input, .select, .textarea {
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--ink);
  color: var(--chalk);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--lime);
  background: var(--ink2);
}
.textarea { resize: vertical; min-height: 100px; font-family: var(--font-sans); }
.input::placeholder, .textarea::placeholder { color: var(--chalk4); }

/* ============= Badges / Chips ============= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-lime { background: rgba(184, 255, 87, 0.12); color: var(--lime); }
.badge-sky { background: rgba(87, 200, 255, 0.12); color: var(--sky); }
.badge-rose { background: rgba(255, 87, 135, 0.12); color: var(--rose); }
.badge-amber { background: rgba(255, 200, 87, 0.12); color: var(--amber); }
.badge-violet { background: rgba(168, 120, 255, 0.12); color: var(--violet); }
.badge-muted { background: rgba(255, 255, 255, 0.06); color: var(--chalk3); }

/* ============= Stats ============= */
.stat {
  background: var(--ink2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r);
  padding: 22px;
}
.stat-label { font-size: 12px; color: var(--chalk3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-value { font-size: 36px; font-weight: 900; color: var(--chalk); margin-top: 6px; letter-spacing: -0.03em; }
.stat-delta { font-size: 12px; color: var(--lime); margin-top: 4px; font-weight: 600; }

/* ============= Layout helpers ============= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page { padding: 100px 24px 60px; position: relative; z-index: 1; min-height: 100vh; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav { padding: 14px 18px; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.text-muted { color: var(--chalk3); }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }

/* ============= Section heads ============= */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--lime);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.section-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--lime); }
.section-sub {
  font-size: 16px;
  color: var(--chalk3);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ============= Tables ============= */
.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r);
  background: var(--ink2);
}
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.t th {
  text-align: left;
  font-weight: 600;
  color: var(--chalk3);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--ink3);
  position: sticky; top: 0;
}
table.t td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--chalk2);
}
table.t tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ============= Modal ============= */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--ink2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: pop 0.18s ease-out;
}
@keyframes pop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 22px; font-weight: 800; margin-bottom: 18px; }

/* ============= Toasts =============
   Respect iOS safe-area so toasts don't sit under the home-indicator or
   notch when the user opens the app from a PWA install. */
.toast-host {
  position: fixed;
  top: max(80px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-host > * { pointer-events: auto; }
.toast {
  background: var(--ink3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--lime);
  border-radius: 8px;
  padding: 14px 18px;
  min-width: 260px;
  max-width: 360px;
  font-size: 14px;
  color: var(--chalk);
  box-shadow: var(--shadow);
  animation: slide-in 0.25s ease-out;
}
.toast.err { border-left-color: var(--rose); }
.toast.warn { border-left-color: var(--amber); }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============= Spinner ============= */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============= Skeletons ============= */
.skeleton {
  background: linear-gradient(90deg, var(--ink3) 0%, var(--ink4) 50%, var(--ink3) 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============= Tabs ============= */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 24px; }
.tab {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--chalk3);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab.active { color: var(--lime); border-bottom-color: var(--lime); }
.tab:hover { color: var(--chalk); }

/* ============= Misc ============= */
.divider { height: 1px; background: rgba(255, 255, 255, 0.07); margin: 24px 0; border: none; }

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--ink3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--chalk2);
}

/* Accessible focus */
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
