/* ===== DESIGN TOKENS ===== */
:root {
  --ink: #0a0f1a;
  --slate: #1a2234;
  --mist: #8b95a8;
  --ice: #e8ecf2;
  --snow: #f6f8fb;
  --white: #ffffff;
  --gold: #c9a227;
  --gold-light: #f5e6a3;
  --gold-glow: rgba(201, 162, 39, 0.12);
  --emerald: #1a8a6e;
  --emerald-light: #e0f5ef;
  --red: #d64545;
  --red-light: #fce8e8;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--snow);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo span { color: var(--gold); }
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-link {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mist);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-decoration: none;
}
.nav-link:hover { color: var(--ink); background: var(--snow); text-decoration: none; }
.nav-link.active { color: var(--ink); background: var(--gold-glow); }
.nav-link-muted { color: var(--mist); opacity: 0.7; }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0.5rem;
}

/* ===== MAIN ===== */
.app-main {
  padding-top: 5rem;
  min-height: calc(100vh - 120px);
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--ice);
  padding: 2.5rem 2rem 2rem;
}
.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.page-header p {
  color: var(--mist);
  font-size: 1rem;
}
.page-header-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}
.container-sm {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem;
}
.container-md {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--ice);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-subtitle {
  font-size: 0.9rem;
  color: var(--mist);
  margin-top: 0.15rem;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--ice);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.stat-card-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.stat-card-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-card-label {
  font-size: 0.85rem;
  color: var(--mist);
  margin-top: 0.25rem;
}

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: 0.4rem;
}
.form-group .req { color: var(--red); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--ice);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .hint {
  display: block;
  font-size: 0.8rem;
  color: var(--mist);
  margin-top: 0.3rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ice);
}
.form-section:last-child { border-bottom: none; }
.form-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--gold);
  color: var(--white);
}
.btn-primary:hover { background: #b8922a; }
.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--ice);
}
.btn-secondary:hover { background: var(--snow); border-color: var(--mist); }
.btn-dark {
  background: var(--ink);
  color: var(--white);
}
.btn-dark:hover { background: var(--slate); }
.btn-emerald {
  background: var(--emerald);
  color: var(--white);
}
.btn-emerald:hover { background: #167a60; }
.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-default { background: var(--ice); color: var(--slate); }
.badge-success { background: var(--emerald-light); color: var(--emerald); }
.badge-warning { background: #fef3cd; color: #856404; }
.badge-info { background: var(--blue-light); color: var(--blue); }
.badge-muted { background: var(--snow); color: var(--mist); }
.badge-gold { background: var(--gold-glow); color: var(--gold); }

/* ===== ALERTS ===== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid rgba(214,69,69,0.15); }
.alert-success { background: var(--emerald-light); color: var(--emerald); border: 1px solid rgba(26,138,110,0.15); }
.alert-info { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(59,130,246,0.15); }

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--ice);
  background: var(--white);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mist);
  background: var(--snow);
  border-bottom: 1px solid var(--ice);
}
td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--ice);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0,0,0,0.01); }

/* ===== JOB CARDS ===== */
.job-card {
  background: var(--white);
  border: 1px solid var(--ice);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.job-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gold);
}
.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.job-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.job-card-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.job-card-meta span {
  font-size: 0.85rem;
  color: var(--mist);
}
.job-card-desc {
  font-size: 0.9rem;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-card-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 5rem);
  padding: 2rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--ice);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.auth-card .auth-subtitle {
  color: var(--mist);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}
.auth-card .auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--mist);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--mist);
  font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ice);
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--mist);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}
.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.95rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ===== PIPELINE STATUS ===== */
.pipeline-row { display: flex; align-items: center; gap: 1rem; }
.pipeline-row select {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid var(--ice);
  border-radius: var(--radius-sm);
  background: var(--white);
}

/* ===== FOOTER ===== */
footer {
  padding: 2rem;
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
footer p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.25);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
}
.footer-links a:hover { color: rgba(255,255,255,0.5); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav { padding: 0.85rem 1.25rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem;
    flex-direction: column;
    border-bottom: 1px solid var(--ice);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .mobile-menu-btn { display: block; }
  .grid-2, .form-row { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .container, .container-sm, .container-md { padding: 1.25rem; }
  .page-header { padding: 2rem 1.25rem 1.5rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
