:root {
  --red: #ed1c24;
  --black: #101114;
  --ink: #24262b;
  --muted: #686d76;
  --line: #dfe1e6;
  --soft: #f5f5f6;
  --warn: #fff6e6;
  --warn-line: #f1a93b;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(20, 22, 27, .09);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f1f2f4; font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.topbar { height: 76px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; color: var(--white); background: var(--black); border-top: 6px solid var(--red); }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--white); color: var(--black); font-weight: 900; clip-path: polygon(50% 0, 100% 27%, 100% 73%, 50% 100%, 0 73%, 0 27%); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .02em; }
.brand small { margin-top: 1px; color: #bfc2c8; font-size: 12px; }
.local-pill { padding: 8px 12px; border: 1px solid #454850; border-radius: 999px; color: #dfe1e6; font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-badge { color: #fff; font-size: 12px; font-weight: 800; }
.settings-button { padding: 8px 12px; color: var(--white); background: transparent; border: 1px solid #454850; border-radius: 999px; cursor: pointer; }

main { width: min(1500px, 94vw); margin: 0 auto 70px; }
.hero { padding: 54px 0 32px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.eyebrow { margin: 0 0 8px; color: var(--red); font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 14px; color: var(--black); font-size: clamp(38px, 5vw, 66px); line-height: .98; letter-spacing: -.045em; }
.hero-copy { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.steps { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 800; }
.steps span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #eceef1; }
.steps li.active { color: var(--white); background: var(--black); border-color: var(--black); }
.steps li.active span { background: var(--red); }

.upload-card, .review-section { padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-heading, .review-header, .form-title, .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2, .review-header h2 { margin-bottom: 0; font-size: 28px; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.drop-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.drop-zone { min-height: 170px; padding: 26px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; text-align: center; border: 2px dashed #c9ccd2; border-radius: 14px; background: #fafafa; cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone:focus-within, .drop-zone.dragging { border-color: var(--red); background: #fff7f7; transform: translateY(-1px); }
.drop-zone.secondary { background: #f6f6f7; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone span:not(.drop-icon) { color: var(--muted); font-size: 13px; }
.drop-icon { display: grid; place-items: center; width: 48px; height: 48px; color: var(--white); background: var(--black); border-radius: 12px; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.upload-actions { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.recent-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.recent-jobs { display: grid; gap: 8px; }
.recent-job { width: 100%; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 9px; text-align: left; cursor: pointer; }
.recent-job small { color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--red); }

.primary, .secondary-button, .download-button, .pager button { border: 0; border-radius: 10px; cursor: pointer; font-weight: 900; transition: .18s ease; }
.primary { padding: 13px 22px; color: var(--white); background: var(--red); box-shadow: 0 8px 20px rgba(237, 28, 36, .2); }
.primary:hover:not(:disabled) { background: #cf1118; transform: translateY(-1px); }
.primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.wide { width: 100%; }

.review-section { margin-top: 24px; padding: 0; overflow: hidden; }
.review-header { padding: 24px 28px; border-bottom: 1px solid var(--line); }
.status-chip { padding: 7px 12px; color: #8a5200; background: var(--warn); border: 1px solid #f1d39d; border-radius: 999px; font-size: 12px; font-weight: 900; }
.workspace { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(400px, 1.3fr) minmax(250px, .8fr); min-height: 760px; }
.preview-panel { padding: 20px; background: #eceef1; border-right: 1px solid var(--line); }
.result-panel { border-right: 0; border-left: 1px solid var(--line); }
.panel-title h3 { margin: 0; font-size: 15px; }
.panel-title span { color: var(--muted); font-size: 12px; }
.document-frame { margin-top: 14px; min-height: 420px; display: grid; place-items: start center; overflow: auto; background: #cfd2d8; border: 1px solid #c3c6cc; border-radius: 8px; }
.document-frame img { display: block; width: 100%; height: auto; background: white; }
.pager { display: flex; justify-content: space-between; margin-top: 10px; }
.pager button { padding: 7px 10px; color: var(--ink); background: transparent; border: 1px solid #c3c6cc; font-size: 12px; }
.form-panel { max-height: 950px; padding: 24px 28px 34px; overflow: auto; background: var(--white); }
.notice { margin-bottom: 22px; padding: 13px 15px; display: flex; gap: 12px; color: #6d4609; background: var(--warn); border-left: 4px solid var(--warn-line); border-radius: 8px; font-size: 13px; }
.form-section { padding: 22px 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-title { margin-bottom: 15px; }
.form-title h3 { margin: 0; font-size: 17px; }
.text-button { padding: 4px; border: 0; color: var(--red); background: transparent; cursor: pointer; font-weight: 900; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; color: #4e5259; font-size: 12px; font-weight: 800; }
input[type="text"], textarea { width: 100%; margin-top: 6px; padding: 11px 12px; color: var(--ink); background: #fafafa; border: 1px solid #d6d8dd; border-radius: 8px; outline: 0; }
input[type="text"]:focus, textarea:focus { border-color: var(--black); background: var(--white); box-shadow: 0 0 0 3px rgba(16, 17, 20, .07); }
.needs-review input, .needs-review textarea { border-color: var(--warn-line); background: #fffbf2; }
.experience-card, .education-card { margin-bottom: 13px; padding: 16px; background: #f7f7f8; border: 1px solid var(--line); border-radius: 10px; }
.experience-card .field-grid { margin-bottom: 11px; }
.card-actions { display: flex; justify-content: flex-end; }
.remove-button { border: 0; color: #9a1b21; background: transparent; cursor: pointer; font-size: 12px; font-weight: 900; }
.form-title small, .suggestion-help { color: var(--muted); font-size: 12px; }
.suggestion-help { margin: -5px 0 12px; line-height: 1.5; }
.suggestion-card { margin-bottom: 9px; padding: 12px; display: grid; grid-template-columns: auto 1fr; gap: 10px; background: #f7f7f8; border: 1px solid var(--line); border-radius: 9px; }
.suggestion-card input { margin-top: 3px; accent-color: var(--red); }
.suggestion-card strong, .suggestion-card small { display: block; }
.suggestion-card small { margin-top: 4px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.suggestion-meta { color: #8a5200 !important; font-weight: 800 !important; }
.secondary-button { margin-top: 12px; padding: 12px; color: var(--white); background: var(--black); }
.approval-box { margin-top: 18px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.approval-box .primary { margin-top: 12px; }
.download-button { margin-top: 9px; padding: 12px; display: block; text-align: center; color: var(--white); background: #1d7a46; text-decoration: none; }
.download-button.disabled { opacity: .35; pointer-events: none; }
.danger-button { width: 100%; margin-top: 9px; padding: 9px; color: #9a1b21; background: transparent; border: 1px solid #e4b8ba; border-radius: 9px; cursor: pointer; font-weight: 800; }
.reject-button { width: 100%; margin-top: 9px; padding: 9px; color: #6d4609; background: #fffaf0; border: 1px solid #e5c88e; border-radius: 9px; cursor: pointer; font-weight: 800; }
.diagnostics { padding: 12px; display: grid; gap: 6px; background: var(--soft); border-radius: 9px; font-size: 12px; }
.diagnostic-ok { color: #17643b; }
.diagnostic-warning { color: #9a1b21; }
.admin-panel { padding: 14px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 9px; }
.admin-panel select { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #d6d8dd; border-radius: 8px; }
.admin-users-heading { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-button { padding: 0; color: var(--red); background: transparent; border: 0; cursor: pointer; font-weight: 800; }
.admin-users { display: grid; gap: 10px; }
.admin-user-card { padding: 12px; display: grid; grid-template-columns: minmax(140px, 1fr) minmax(130px, .8fr); gap: 10px 12px; align-items: end; background: var(--soft); border-radius: 9px; }
.admin-user-identity { align-self: center; }
.admin-user-identity strong, .admin-user-identity small { display: block; }
.admin-user-identity small { margin-top: 3px; color: var(--muted); }
.admin-user-card input[type="password"] { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #d6d8dd; border-radius: 8px; }
.compact-button { margin: 0; padding: 10px; }
.login-dialog { width: min(440px, 92vw); }
#login-form { padding: 30px; display: grid; gap: 16px; }
#login-form h2, #login-form p { margin-bottom: 0; }
#login-form input { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid #d6d8dd; border-radius: 8px; }
.form-error { padding: 10px; color: #9a1b21; background: #fff1f1; border-radius: 8px; font-size: 13px; }

.busy { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--white); background: rgba(10, 11, 14, .86); backdrop-filter: blur(4px); }
.busy span { color: #c9ccd2; }
.spinner { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 420px; padding: 14px 17px; color: var(--white); background: #8e2025; border-radius: 10px; box-shadow: var(--shadow); }
dialog { width: min(620px, 92vw); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,11,14,.7); backdrop-filter: blur(3px); }
#settings-form { padding: 26px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin-bottom: 20px; }
.icon-button { padding: 0; color: var(--muted); background: transparent; border: 0; font-size: 30px; cursor: pointer; }
.settings-grid { display: grid; gap: 16px; }
.settings-grid input[type="password"], .settings-grid input[type="number"] { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid #d6d8dd; border-radius: 8px; }
.settings-grid label > small { display: block; margin-top: 5px; color: var(--muted); }
.toggle-row { display: flex; align-items: start; gap: 10px; padding: 13px; background: var(--soft); border-radius: 9px; }
.toggle-row input { margin-top: 3px; accent-color: var(--red); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.privacy-note { margin: 0; padding: 12px; color: #4d4f55; background: #f1f2f4; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }
.dialog-actions .secondary-button { width: auto; margin: 0; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr 1.25fr; }
  .result-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
  .result-panel .document-frame { max-width: 600px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 18px; }
  .local-pill { display: none; }
  main { width: min(94vw, 680px); }
  .hero { align-items: start; flex-direction: column; padding-top: 34px; }
  .steps { flex-wrap: wrap; }
  .drop-grid, .workspace, .field-grid { grid-template-columns: 1fr; }
  .upload-actions { align-items: stretch; flex-direction: column; }
  .preview-panel, .result-panel { border: 0; border-bottom: 1px solid var(--line); }
  .form-panel { max-height: none; }
}
