/* ==========================================================
   Slate Job Portal — design system
   ========================================================== */

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

:root {
  /* --- brand --- */
  --indigo:        #5a4be0;
  --indigo-hover:  #4a3bd0;
  --indigo-soft:   #efedfd;
  --indigo-line:   #d9d4fa;

  /* --- neutrals --- */
  --ink:           #171a2e;   /* sidebar, headings */
  --ink-soft:      #2a2e47;
  --body:          #3d4258;
  --muted:         #737890;
  --faint:         #9ba0b5;

  --canvas:        #f6f7fb;
  --surface:       #ffffff;
  --line:          #e7e9f2;
  --line-strong:   #d5d9e8;

  /* --- status --- */
  --amber:         #b45309;  --amber-bg:  #fef3c7;
  --blue:          #1d4ed8;  --blue-bg:   #dbeafe;
  --green:         #15803d;  --green-bg:  #dcfce7;
  --red:           #b91c1c;  --red-bg:    #fee2e2;
  --violet:        #5b21b6;  --violet-bg: #ede9fe;

  /* --- shape --- */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(23,26,46,.06);
  --shadow:    0 2px 10px rgba(23,26,46,.07);
  --shadow-lg: 0 18px 44px rgba(23,26,46,.13);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--canvas);
  color: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- type scale ---------- */
h1 { font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1.18; letter-spacing: -.02em; }
h2 { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.3;  letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.35; }
h4 { font-size: 15px; font-weight: 700; color: var(--ink); }

.lead      { font-size: 16px; color: var(--muted); }
.sub       { font-size: 14px; color: var(--muted); }
.tiny      { font-size: 12.5px; color: var(--faint); }
.strong    { font-weight: 700; color: var(--ink); }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.wrap        { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 640px;  margin: 0 auto; padding: 0 24px; }

.stack-sm > * + * { margin-top: 10px; }
.stack    > * + * { margin-top: 18px; }
.stack-lg > * + * { margin-top: 30px; }

.row { display: flex; gap: 16px; }
.row > * { flex: 1; min-width: 0; }

.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.center  { display: flex; align-items: center; gap: 10px; }

/* Multi-column grid rows */
.row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}

.row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-flat { box-shadow: none; }
.card-pad-lg { padding: 30px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

/* ---------- buttons ---------- */
button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--indigo);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .14s, border-color .14s, color .14s;
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .btn:hover { background: var(--indigo-hover); text-decoration: none; }

.btn-outline {
  background: var(--surface);
  color: var(--indigo);
  border-color: var(--indigo-line);
}
.btn-outline:hover { background: var(--indigo-soft); border-color: var(--indigo); }

.btn-quiet {
  background: var(--surface);
  color: var(--body);
  border-color: var(--line-strong);
}
.btn-quiet:hover { background: var(--canvas); color: var(--ink); }

.btn-ghost { background: transparent; color: var(--muted); padding: 8px 12px; }
.btn-ghost:hover { background: var(--canvas); color: var(--ink); }

.btn-sm    { padding: 8px 14px;  font-size: 13px; }
.btn-lg    { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

button:disabled { opacity: .55; cursor: not-allowed; }

button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* ---------- forms ---------- */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.field + .field,
.field + .row-2,
.field + .row-3,
.row-2 + .field,
.row-3 + .field,
.row-2 + .row-2,
.row-3 + .row-3 {
  margin-top: 16px;
}

/* Neutralize adjacent field margins inside grid containers */
.row-2 > .field,
.row-3 > .field {
  margin-top: 0 !important;
  min-width: 0;
}

input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-color .14s, box-shadow .14s;
}

/* Normalize vertical heights across standard text inputs, date pickers, and dropdowns */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  height: 44px;
  line-height: 20px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23737890' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 38px;
}

input[type="file"] {
  height: auto;
  padding: 8px 12px;
  cursor: pointer;
}

input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(90,75,224,.13);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

/* input with a leading icon */
.field-icon { position: relative; }
.field-icon input { padding-left: 42px; }
.field-icon .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--faint); pointer-events: none;
}
.field-icon .ico svg { width: 100%; height: 100%; display: block; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--body); }
.check input { width: auto; accent-color: var(--indigo); margin: 0; }

/* ---------- badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--indigo-soft);
  color: var(--violet);
}
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-quiet  { background: var(--canvas);    color: var(--muted); }

/* application status, mapped to the database CHECK constraint */
.st-submitted   { background: var(--blue-bg);   color: var(--blue); }
.st-reviewed    { background: var(--amber-bg);  color: var(--amber); }
.st-shortlisted { background: var(--violet-bg); color: var(--violet); }
.st-rejected    { background: var(--red-bg);    color: var(--red); }
.st-hired       { background: var(--green-bg);  color: var(--green); }

/* ---------- messages ---------- */
.msg {
  padding: 12px 15px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 16px;
  border: 1px solid transparent;
}
.msg.error { background: var(--red-bg);   color: var(--red);   border-color: #fbc9c9; }
.msg.ok    { background: var(--green-bg); color: var(--green); border-color: #bbf0cd; }
.msg.info  { background: var(--blue-bg);  color: var(--blue);  border-color: #c3dafd; }

.hidden { display: none !important; }

/* ---------- empty state ---------- */
.empty {
  text-align: center;
  padding: 46px 24px;
  color: var(--muted);
}
.empty h3 { margin-bottom: 6px; }
.empty p  { font-size: 14px; max-width: 380px; margin: 0 auto 18px; }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 15px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }

/* ---------- avatar ---------- */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--indigo-soft);
  color: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex: 0 0 auto;
}
.avatar-lg { width: 76px; height: 76px; font-size: 24px; }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.spacer  { flex: 1; }

@media (max-width: 760px) {
  .row-2,
  .row-3 {
    grid-template-columns: 1fr;
  }
  .row-2 > .field + .field,
  .row-3 > .field + .field {
    margin-top: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}