:root {
  --navy-950: #07111f;
  --navy-900: #0b1728;
  --navy-800: #14253b;
  --navy-700: #223951;
  --ink: #152033;
  --muted: #657286;
  --line: #dbe1e8;
  --soft: #f3f5f7;
  --paper: #ffffff;
  --yellow: #f5c84c;
  --yellow-soft: #fff4c8;
  --green: #26735b;
  --green-soft: #e5f3ed;
}

* { box-sizing: border-box; }

html { background: var(--soft); }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
a { color: inherit; }

.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;
}

.portal-shell { min-height: 100vh; }

.topbar {
  min-height: 72px;
  padding: 12px clamp(20px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--navy-950);
  border-bottom: 3px solid var(--yellow);
  color: white;
}

.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 48px; height: 40px; object-fit: contain; }
.brand-lockup .eyebrow { color: #aeb9c7; }
.portal-name { margin: 3px 0 0; font-size: 16px; font-weight: 700; letter-spacing: .01em; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.user-email { max-width: 210px; overflow: hidden; color: #aeb9c7; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.secure-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #31435a;
  border-radius: 999px;
  color: #d8e1eb;
  font-size: 12px;
  font-weight: 700;
}
.secure-dot { width: 7px; height: 7px; background: #5ad69d; border-radius: 50%; box-shadow: 0 0 0 3px #163c32; }
.quiet-button { padding: 8px 11px; border: 0; background: transparent; color: #d8e1eb; cursor: pointer; font-weight: 700; }
.quiet-button:hover { color: white; }

.workspace { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 26px; }

.project-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.project-heading h1 { margin: 7px 0 5px; color: var(--navy-950); font-size: clamp(30px, 4vw, 47px); line-height: 1.02; letter-spacing: -.04em; }
.project-subtitle { margin: 0; color: var(--muted); font-size: 15px; }
.updated-card { min-width: 165px; padding: 13px 16px; border-left: 3px solid var(--yellow); background: white; box-shadow: 0 7px 22px rgba(21, 32, 51, .06); }
.updated-card span, .updated-card strong { display: block; }
.updated-card span { margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.updated-card strong { color: var(--navy-900); font-size: 13px; }
.heading-actions { display: flex; align-items: stretch; gap: 10px; }
.primary-button, .secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 800;
}
.primary-button { border: 1px solid var(--yellow); background: var(--yellow); color: var(--navy-950); }
.secondary-button { border: 1px solid var(--navy-800); background: var(--navy-800); color: white; }
.primary-button:hover { background: #ffd766; }
.secondary-button:hover { background: var(--navy-950); }
.primary-button:disabled, .secondary-button:disabled, button:disabled { cursor: wait; opacity: .6; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--navy-700); cursor: pointer; font-weight: 800; }

.project-notice {
  margin: 27px 0 20px;
  display: grid;
  grid-template-columns: 185px 1fr;
  border: 1px solid #ead276;
  background: var(--yellow-soft);
}
.notice-label { padding: 17px 18px; display: flex; align-items: center; background: var(--yellow); color: var(--navy-950); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.project-notice p { margin: 0; padding: 15px 18px; color: #4b4324; font-size: 12px; line-height: 1.55; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: white; }
.metrics article { min-height: 120px; padding: 21px 22px; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics span, .metrics small, .metrics strong { display: block; }
.metrics span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metrics strong { margin: 11px 0 4px; color: var(--navy-950); font-size: 33px; letter-spacing: -.04em; }
.metrics small { color: var(--muted); font-size: 12px; }

.pipeline-section { margin-top: 38px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 6px 0 0; color: var(--navy-950); font-size: 25px; letter-spacing: -.025em; }
.count-label { color: var(--muted); font-size: 12px; font-weight: 700; }

.filters { margin: 17px 0; display: grid; grid-template-columns: 1fr 215px; gap: 10px; }
.search-field { position: relative; }
.search-field > span[aria-hidden] { position: absolute; left: 15px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 22px; }
.filters input, .filters select {
  width: 100%;
  height: 46px;
  border: 1px solid #ccd4de;
  border-radius: 4px;
  background: white;
  color: var(--ink);
  outline: none;
}
.filters input { padding: 0 15px 0 43px; }
.filters select { padding: 0 12px; }
.filters input:focus, .filters select:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(34, 57, 81, .1); }

.candidate-list { display: grid; gap: 14px; }
.candidate-card { border: 1px solid var(--line); background: white; box-shadow: 0 8px 26px rgba(22, 35, 53, .045); }
.candidate-summary-row { padding: 22px 24px 18px; display: flex; gap: 17px; }
.avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid #27425d;
  background: var(--navy-900);
  color: white;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .05em;
}
.candidate-title { min-width: 0; flex: 1; }
.title-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.title-line h3 { margin: 0; color: var(--navy-950); font-size: 19px; letter-spacing: -.02em; }
.candidate-title > p { margin: 5px 0 8px; color: var(--muted); font-size: 13px; }
.candidate-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: #47566a; font-size: 11px; }
.candidate-meta span:not(:first-child)::before { content: "•"; margin-right: 18px; color: #9ca8b6; }
.status-badge { padding: 6px 9px; flex: 0 0 auto; background: var(--yellow-soft); color: #67530a; font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.edit-button { padding: 6px 9px; border: 1px solid #cbd4de; background: white; color: var(--navy-800); cursor: pointer; font-size: 10px; font-weight: 900; }
.edit-button:hover { border-color: var(--navy-700); }

.candidate-grid { display: grid; grid-template-columns: 1.5fr .7fr .9fr; border-top: 1px solid var(--line); }
.candidate-grid > div { padding: 18px 24px; border-right: 1px solid var(--line); }
.candidate-grid > div:last-child { border-right: 0; }
.field-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list span { padding: 6px 8px; border: 1px solid #d7dee6; background: #f8f9fa; color: #334156; font-size: 11px; font-weight: 700; }
.field-value { margin: 0 0 4px; color: var(--navy-900); font-size: 13px; font-weight: 800; }
.field-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.check-list { margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; margin: 0 0 6px; padding-left: 17px; color: #425064; font-size: 11px; line-height: 1.4; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }

.profile-details { border-top: 1px solid var(--line); }
.profile-details summary { padding: 14px 24px; display: flex; justify-content: space-between; color: var(--navy-800); cursor: pointer; list-style: none; font-size: 12px; font-weight: 900; }
.profile-details summary::-webkit-details-marker { display: none; }
.profile-details[open] summary span { transform: rotate(45deg); }
.detail-content { padding: 23px 24px 25px; display: grid; grid-template-columns: 1.45fr .75fr; gap: 30px; border-top: 1px solid var(--line); background: #fafbfc; }
.detail-column > p { margin: 0; color: #3d4b5e; font-size: 13px; line-height: 1.65; }
.detail-label { margin-top: 23px; }
.screening-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.screening-list li { padding: 10px 0; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); color: #3f4d60; font-size: 11px; line-height: 1.35; }
.screening-list li > div { min-width: 0; }
.screening-list li strong { display: block; font-size: 11px; }
.screening-list li p { margin: 6px 0 0; color: #4e5c6f; line-height: 1.55; }
.screening-list span { flex: 0 0 auto; color: #96750a; font-weight: 800; }
.screening-list .answer-state.answered { color: var(--green); }
.document-panel { padding: 18px; align-self: start; border: 1px solid var(--line); background: white; }
.document-row { padding: 10px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #edf0f3; font-size: 12px; }
.document-state { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.document-state.pending { color: #8a6b00; }
.document-state.reported { color: #315b83; }
.document-state.verified { color: var(--green); }
.privacy-note { margin: 15px 0 0; padding: 12px; border-left: 3px solid var(--yellow); background: var(--yellow-soft); color: #5d5228; font-size: 10px; line-height: 1.5; }
.document-links, .existing-documents { display: grid; gap: 7px; }
.document-links a, .existing-documents a { padding: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); color: var(--navy-800); text-decoration: none; }
.document-links a:hover, .existing-documents a:hover { border-color: var(--navy-700); }
.document-links span, .existing-documents span { min-width: 0; }
.document-links strong, .document-links small, .existing-documents strong, .existing-documents small { display: block; }
.document-links strong, .existing-documents strong { font-size: 11px; }
.document-links small, .existing-documents small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.document-links b, .existing-documents b { font-size: 10px; }
.empty-state { padding: 40px; border: 1px dashed #b9c3ce; background: white; color: var(--muted); text-align: center; }

footer { margin-top: 28px; padding: 18px 0; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #cfd6de; color: var(--muted); font-size: 11px; }
footer a { color: var(--navy-800); font-weight: 700; text-decoration: none; }

.login-body { min-height: 100vh; display: grid; grid-template-rows: 4px 1fr auto; background: var(--navy-950); color: white; }
.login-accent { background: var(--yellow); }
.login-layout { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 65px 0 48px; display: grid; grid-template-columns: 1.15fr .75fr; align-items: center; gap: clamp(50px, 8vw, 110px); }
.login-intro { min-width: 0; }
.login-brand { display: flex; align-items: center; gap: 15px; }
.login-brand img { width: 55px; height: 46px; object-fit: contain; }
.login-brand .eyebrow { color: #91a0b3; }
.login-brand strong { display: block; margin-top: 4px; font-size: 15px; }
.login-copy { margin-top: 68px; }
.compact-label { display: inline-flex; padding: 9px 12px; }
.login-copy h1 { max-width: 690px; margin: 20px 0 18px; font-size: clamp(39px, 6vw, 65px); line-height: .98; letter-spacing: -.05em; }
.login-copy p { max-width: 620px; margin: 0; color: #b7c2cf; font-size: 16px; line-height: 1.7; }
.login-checks { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px 25px; color: #dbe3eb; font-size: 11px; font-weight: 800; }
.login-checks span::before { content: "✓"; margin-right: 8px; color: var(--yellow); }
.login-card { padding: 34px; background: white; color: var(--ink); box-shadow: 0 26px 80px rgba(0, 0, 0, .32); }
.login-card h2 { margin: 7px 0 8px; color: var(--navy-950); font-size: 27px; letter-spacing: -.03em; }
.login-help { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-form { display: grid; gap: 15px; }
.auth-form label, .candidate-dialog label { display: grid; gap: 7px; color: #3f4d60; font-size: 11px; font-weight: 800; }
.auth-form input, .candidate-dialog input, .candidate-dialog select, .candidate-dialog textarea { width: 100%; border: 1px solid #cbd4de; border-radius: 3px; background: white; color: var(--ink); outline: none; }
.auth-form input { height: 45px; padding: 0 12px; }
.candidate-dialog input, .candidate-dialog select { height: 42px; padding: 0 10px; }
.candidate-dialog textarea { padding: 10px; resize: vertical; }
.auth-form input:focus, .candidate-dialog input:focus, .candidate-dialog select:focus, .candidate-dialog textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(34, 57, 81, .1); }
.auth-form .text-button { justify-self: center; font-size: 11px; }
.auth-message { margin: 0 0 16px; padding: 11px 12px; border-left: 3px solid #6f8298; background: #eef2f5; color: #3e4c5e; font-size: 11px; line-height: 1.5; }
.auth-message[data-tone="error"] { border-color: #a83e3e; background: #faeaea; color: #7a2727; }
.auth-message[data-tone="success"] { border-color: var(--green); background: var(--green-soft); color: #225b49; }
.invite-note { margin-top: 24px; padding-top: 18px; display: grid; gap: 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.invite-note strong { color: var(--navy-800); font-size: 11px; }
.login-footer { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 20px 0 28px; border-color: #26364a; color: #8392a4; }
.login-footer a { color: #c7d1dd; }

.candidate-dialog { width: min(900px, calc(100% - 24px)); max-height: min(90vh, 920px); padding: 0; border: 0; border-radius: 4px; color: var(--ink); box-shadow: 0 28px 90px rgba(0, 0, 0, .34); }
.candidate-dialog::backdrop { background: rgba(4, 11, 20, .72); backdrop-filter: blur(2px); }
.candidate-dialog form { padding: 27px; display: grid; gap: 17px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 6px 0 0; color: var(--navy-950); font-size: 26px; letter-spacing: -.03em; }
.dialog-close { width: 36px; height: 36px; border: 1px solid var(--line); background: white; color: var(--navy-900); cursor: pointer; font-size: 24px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.editor-section { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.editor-section-title h3 { margin: 5px 0 14px; color: var(--navy-950); font-size: 18px; }
.screening-editor { display: grid; gap: 12px; }
.screening-editor label { padding: 13px; border: 1px solid var(--line); background: #f8f9fa; }
.document-warning { margin: 14px 0; padding: 11px 12px; border-left: 3px solid var(--yellow); background: var(--yellow-soft); color: #5d5228; font-size: 10px; line-height: 1.5; }
.upload-grid { display: grid; grid-template-columns: .8fr 1.4fr auto; align-items: end; gap: 10px; }
.dialog-actions { padding-top: 18px; display: flex; justify-content: flex-end; gap: 18px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 360px; padding: 14px 17px; border-left: 4px solid var(--green); background: var(--navy-950); color: white; box-shadow: 0 14px 40px rgba(0, 0, 0, .25); font-size: 12px; }
.toast[data-tone="error"] { border-color: #d86666; }
.error-state { border-color: #c66; color: #852f2f; }

@media (max-width: 850px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .candidate-grid { grid-template-columns: 1fr 1fr; }
  .candidate-grid > div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-content { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; padding-top: 38px; }
  .login-copy { margin-top: 42px; }
  .login-card { width: min(520px, 100%); }
  .upload-grid { grid-template-columns: 1fr 1fr; }
  .upload-grid button { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; }
  .brand-lockup { gap: 10px; }
  .portal-name { font-size: 14px; }
  .secure-chip { display: none; }
  .workspace { width: min(100% - 24px, 1180px); padding-top: 25px; }
  .project-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; flex-direction: column; }
  .heading-actions .secondary-button { width: 100%; }
  .updated-card { width: 100%; }
  .project-notice { grid-template-columns: 1fr; }
  .notice-label { padding: 11px 14px; }
  .metrics article { min-height: 104px; padding: 17px; }
  .filters { grid-template-columns: 1fr; }
  .candidate-summary-row { padding: 18px 16px 15px; }
  .title-line { align-items: flex-start; flex-direction: column; gap: 9px; }
  .candidate-meta { display: grid; gap: 5px; }
  .candidate-meta span:not(:first-child)::before { display: none; }
  .candidate-grid { grid-template-columns: 1fr; }
  .candidate-grid > div { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .candidate-grid > div:first-child { grid-column: auto; }
  .candidate-grid > div:last-child { border-bottom: 0; }
  .profile-details summary { padding: 14px 16px; }
  .detail-content { padding: 18px 16px; }
  .screening-list li { display: grid; gap: 3px; }
  footer { flex-direction: column; }
  .user-email { display: none; }
  .login-layout { width: min(100% - 24px, 1100px); padding: 24px 0 36px; }
  .login-copy { margin-top: 38px; }
  .login-copy h1 { font-size: 39px; }
  .login-card { padding: 25px 20px; }
  .login-footer { width: min(100% - 24px, 1100px); }
  .form-grid, .upload-grid { grid-template-columns: 1fr; }
  .candidate-dialog form { padding: 20px 16px; }
  .dialog-actions { justify-content: space-between; }
}

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