/* Eshcol Recruit - brand palette: aubergine, grape, plum, gold, sand, cream. */
:root {
  --aubergine: #320A67; --plum: #573A73; --grape: #7946B2; --lilac: #C8B6E6;
  --gold: #FFB85C; --sand: #D8B36A; --sand-soft: #E8D3A4; --sand-tint: #FBF5E8;
  --cream: #F6F3EC; --white: #FFFFFF; --ink: #2A2238; --muted: #6E6780;
  --line: #E7E2EF; --green: #42612D; --green-tint: #E8F0DF; --warn: #7E6114;
  --warn-tint: #FBF0D6; --red: #B23A48; --red-tint: #F8E6E8; --radius: 8px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--cream); }
a { color: var(--grape); }
a:hover { color: var(--aubergine); }
h1, h2, h3 { font-family: var(--serif); font-weight: normal; color: var(--aubergine); margin: 0 0 .5em; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--aubergine); color: #E8E0F4; padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: block; padding: 4px 22px 22px; text-decoration: none; color: #fff; }
.brand b { font-family: var(--serif); font-weight: normal; font-size: 22px; display: block; }
.brand span { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.nav a { display: block; padding: 10px 22px; color: #E8E0F4; text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(255,255,255,.09); border-left-color: var(--gold); color: #fff; }
.nav .sep { height: 1px; background: rgba(255,255,255,.12); margin: 12px 22px; }
.side .who { padding: 16px 22px 0; font-size: 13px; color: var(--lilac); }
.side .who form { margin-top: 6px; }
.side .who button { background: none; border: 0; color: var(--gold); padding: 0; cursor: pointer; font: inherit; }
.main { min-width: 0; }
.top { display: flex; gap: 16px; align-items: center; padding: 14px 32px; background: var(--white); border-bottom: 1px solid var(--line); }
.top form { flex: 1; max-width: 520px; }
.top input[type=search] { width: 100%; }
.page { padding: 28px 32px 48px; max-width: 1280px; }
.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 2px 0 0; }
.eyebrow { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--plum); font-weight: 600; }

/* Cards and grids */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; }
.card.sand { background: var(--sand-tint); border-color: var(--sand-soft); }
.card.accent { border-top: 3px solid var(--sand); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-top: 3px solid var(--grape); }
.stat b { display: block; font-family: var(--serif); font-size: 30px; font-weight: normal; color: var(--aubergine); }
.stat span { color: var(--muted); font-size: 13px; }
.stat.gold { border-top-color: var(--sand); }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: var(--white); }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--line); }
table.list td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:hover td { background: #FCFBFE; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: var(--white); }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; color: var(--ink); }
label .hint, .hint { font-weight: normal; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #CFC7DC; border-radius: 6px; font: inherit; background: var(--white); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lilac); outline-offset: 0; border-color: var(--grape); }
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; }
legend { padding: 0 6px; font-family: var(--serif); color: var(--aubergine); font-size: 17px; }

/* Buttons */
.btn { display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--grape); background: var(--grape); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--aubergine); border-color: var(--aubergine); color: #fff; }
.btn.ghost { background: var(--white); color: var(--grape); }
.btn.ghost:hover { background: #F4EEFB; color: var(--aubergine); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--aubergine); }
.btn.gold:hover { background: #F5A63C; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.link { background: none; border: 0; color: var(--grape); padding: 0; font-weight: normal; text-decoration: underline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Badges and chips */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EFEAF7; color: var(--plum); white-space: nowrap; }
.badge.open { background: var(--green-tint); color: var(--green); }
.badge.on_hold, .badge.draft { background: var(--warn-tint); color: var(--warn); }
.badge.filled { background: #EFEAF7; color: var(--aubergine); }
.badge.cancelled { background: var(--red-tint); color: var(--red); }
.chip { display: inline-block; padding: 3px 10px; margin: 2px 4px 2px 0; border-radius: 999px; font-size: 13px; background: #F1EBF9; color: var(--plum); border: 1px solid #E2D7F2; }
.chip.yes { background: var(--green-tint); color: var(--green); border-color: #CFE0BC; }
.chip.no { background: var(--red-tint); color: var(--red); border-color: #F0CDD2; text-decoration: line-through; }
.chip.sand { background: var(--sand-tint); color: var(--warn); border-color: var(--sand-soft); }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 32px; padding: 0 8px; border-radius: 6px; font-family: var(--serif); font-size: 19px; }
.score-high { background: var(--green-tint); color: var(--green); }
.score-mid { background: var(--warn-tint); color: var(--warn); }
.score-low { background: var(--red-tint); color: var(--red); }
.score-none { background: #F1EFF4; color: var(--muted); }
.confirm { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--warn-tint); color: var(--warn); font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.src { color: var(--muted); font-size: 12px; }

/* Scorecard */
.breakdown { display: grid; grid-template-columns: 120px 1fr 52px; gap: 6px 12px; font-size: 14px; align-items: center; }
.bar { height: 8px; background: #EFEAF7; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grape); }
.evidence { margin: 8px 0 0; padding: 0; list-style: none; }
.evidence li { font-size: 13px; color: var(--muted); padding: 4px 0 4px 10px; border-left: 2px solid var(--sand-soft); margin-bottom: 4px; }
.evidence mark { background: #FFE7BE; color: var(--ink); padding: 0 2px; border-radius: 2px; }

/* Messages */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: var(--green-tint); color: var(--green); border-color: #CFE0BC; }
.flash.info { background: #F1EBF9; color: var(--plum); border-color: #E2D7F2; }
.flash.error { background: var(--red-tint); color: var(--red); border-color: #F0CDD2; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }

/* Upload */
.drop { border: 2px dashed var(--sand); border-radius: var(--radius); background: var(--sand-tint); padding: 36px 20px; text-align: center; cursor: pointer; transition: background .15s; }
.drop.over { background: #F8EBCF; border-color: var(--grape); }
.drop b { font-family: var(--serif); font-weight: normal; font-size: 20px; color: var(--aubergine); display: block; margin-bottom: 4px; }
.progress { height: 10px; background: #EFEAF7; border-radius: 5px; overflow: hidden; margin: 14px 0 6px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--grape), var(--aubergine)); transition: width .2s; }
.out-new { color: var(--green); } .out-updated { color: var(--plum); } .out-duplicate_file { color: var(--muted); }
.out-needs_ocr { color: var(--warn); } .out-failed, .out-skipped { color: var(--red); }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--aubergine); }
.auth .box { width: 100%; max-width: 420px; background: var(--white); border-radius: 12px; padding: 32px; border-top: 4px solid var(--gold); }
.auth .box h1 { font-size: 26px; }
.auth .tag { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--grape); font-weight: 700; }
.qr { display: block; width: 200px; height: 200px; margin: 12px auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; background: var(--sand-tint); padding: 6px 10px; border-radius: 6px; display: inline-block; word-break: break-all; }

pre.cvtext { white-space: pre-wrap; font-family: var(--sans); font-size: 13px; line-height: 1.55; max-height: 520px; overflow: auto; background: #FCFBF8; border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; flex-wrap: wrap; align-items: center; padding: 10px; }
  .brand { padding: 6px 12px; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav a { padding: 8px 12px; border-left: 0; border-bottom: 3px solid transparent; }
  .nav a.on { border-bottom-color: var(--gold); }
  .nav .sep, .side .who { display: none; }
  .page, .top { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4, .split { grid-template-columns: 1fr; }
}
