:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--primary); text-decoration: none; }

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  transition: filter .15s ease, opacity .15s ease;
}

button:hover { filter: brightness(1.05); }
button:disabled { opacity: .55; cursor: not-allowed; }

button.secondary { background: #eef2ff; color: var(--primary-dark); }
button.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
button.danger { background: var(--danger); }
button.success { background: var(--success); }
button.small { padding: 5px 9px; font-size: 13px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--primary); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-card .sub { color: var(--muted); margin: 0 0 20px; }
.auth-card label { display: block; font-size: 14px; margin: 14px 0 6px; color: #374151; }
.auth-card button[type="submit"] { width: 100%; margin-top: 20px; padding: 11px; }

.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 700; font-size: 18px; }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.topbar .muted { color: var(--muted); font-size: 13px; }

.nav {
  display: flex;
  gap: 6px;
  background: #fff;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.nav button {
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 13px 16px;
  border-bottom: 2px solid transparent;
}

.nav button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.page {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.page.active { display: block; }

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

.section-head h2 { margin: 0; font-size: 20px; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.card .thumb {
  height: 180px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
}

.card .thumb { position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.resume-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  z-index: 2;
}

.card .body { padding: 14px; }

.resume-card.needs-fix {
  outline: 2px solid #f59e0b;
  outline-offset: 1px;
}
.resume-card .value.bad {
  color: #b91c1c;
  font-weight: 700;
}

.resume-card .field { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0; }

.resume-card .field span.label { color: var(--muted); min-width: 42px; }
.resume-card .field span.value { word-break: break-all; }
.resume-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.unassigned { background: #fef3c7; color: #92400e; }
.status-pill.assigned { background: #dcfce7; color: #166534; }

.tag-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
}

.toolbar-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.upload-zone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 16px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #eff6ff; }

.upload-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 16px;
  padding: 10px 12px;
  width: fit-content;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: default;
}

.upload-date-row label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.upload-date-row input[type="date"] {
  width: auto;
  min-width: 150px;
}

.progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 12px 0; }
.progress > span { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s ease; }

.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.table th { background: #f8fafc; color: #475569; font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 18px;
}

.modal-mask.show { display: flex; }
.modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 22px;
}

.modal h3 { margin: 0 0 16px; }
.modal .row { margin-bottom: 13px; }
.modal label { display: block; font-size: 14px; margin-bottom: 5px; color: #374151; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  display: none;
}

.alert.error { display: block; background: #fee2e2; color: #991b1b; }
.alert.success { display: block; background: #dcfce7; color: #166534; }

.check { display: inline-flex; gap: 6px; align-items: center; }
.check input { width: auto; }

.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 760px) {
  .two-cols { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .page { padding: 14px; }
}
