:root {
    --navy: #17365d;
    --navy-2: #1f4a7a;
    --navy-3: #e8eef6;
    --saffron: #b85c0a;
    --green: #146c43;
    --red: #a71d2a;
    --amber: #8a5a00;
    --ink: #1b1f24;
    --muted: #5a6472;
    --line: #cfd7e2;
    --bg: #f4f6f9;
    --white: #fff;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(20, 40, 70, .08);
    --focus: 0 0 0 3px rgba(37, 99, 235, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--navy-2); }
a:hover { color: var(--navy); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.skip-link {
    position: absolute; top: -50px; left: 8px; z-index: 1000;
    background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 0 0 6px 6px;
}
.skip-link:focus { top: 0; }
.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;
}

/* Header */
.gov-strip { background: #0f2743; color: #dce6f2; font-size: 12px; padding: 4px 0; }
.gov-strip .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-header { background: #fff; border-bottom: 3px solid var(--saffron); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.brand { display: flex; align-items: center; gap: 14px; padding: 14px 0; text-decoration: none; color: inherit; }
.brand-emblem {
    width: 52px; height: 52px; border-radius: 50%; background: var(--navy);
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px;
    border: 3px solid #d9a441; flex: 0 0 auto;
}
.brand-text strong { display: block; font-size: 18px; color: var(--navy); line-height: 1.2; }
.brand-text span { font-size: 12.5px; color: var(--muted); }
.site-nav { background: var(--navy); }
.site-nav .container { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a, .site-nav button.linklike {
    color: #e9eff7; text-decoration: none; padding: 12px 14px; font-size: 14px; font-weight: 500;
    background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.site-nav a:hover, .site-nav button.linklike:hover, .site-nav a.active { background: var(--navy-2); color: #fff; }
.site-nav .spacer { flex: 1; }
.site-nav .user-chip { color: #c9d8ea; font-size: 13px; padding: 0 8px; }

/* Layout */
.container { width: min(1180px, 94%); margin: 0 auto; }
.narrow { width: min(760px, 94%); margin: 0 auto; }
main { padding: 26px 0 48px; min-height: 60vh; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 2px; }
.page-head .subtitle { color: var(--muted); margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.08rem; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 14px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }

/* Alerts */
.flash-stack { margin-bottom: 18px; }
.alert { border: 1px solid; border-left-width: 5px; border-radius: 6px; padding: 11px 14px; margin-bottom: 10px; font-size: 14px; }
.alert-success { background: #e9f7ef; border-color: #8fc7a7; color: #0d4b2c; }
.alert-error { background: #fdecee; border-color: #e3a0a7; color: #76131d; }
.alert-warning { background: #fff6e5; border-color: #e5c07b; color: #6a4300; }
.alert-info { background: #eaf1fb; border-color: #a7c1e4; color: #143b68; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
.badge-success { background: #d7f0e1; color: #0d4b2c; }
.badge-warning { background: #ffedc9; color: #6a4300; }
.badge-danger { background: #fbdde0; color: #76131d; }
.badge-info { background: #dbe8f9; color: #143b68; }
.badge-muted { background: #e7eaef; color: #414a56; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: 6px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.3;
    background: #e9edf3; color: var(--ink); transition: background .15s, transform .05s;
}
.btn:hover { filter: brightness(.97); color: inherit; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-accent { background: var(--saffron); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.linklike { background: none; border: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.linklike.danger { color: var(--red); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { margin-bottom: 15px; }
.field > label, .field-label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; color: #26303c; }
.req { color: var(--red); margin-left: 2px; }
.help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=datetime-local], input[type=time], input[type=search], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #aeb9c7; border-radius: 6px;
    font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); box-shadow: var(--focus); outline: none; }
input[readonly], input[disabled], select[disabled], textarea[disabled] { background: #f0f2f5; color: #4c5561; }
input[type=checkbox], input[type=radio] { accent-color: var(--navy); width: 16px; height: 16px; }
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.checkline input { margin-top: 3px; flex: 0 0 auto; }
.option-list { display: flex; flex-wrap: wrap; gap: 10px 18px; padding-top: 4px; }
.option-list label { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 400; }
.field-error { display: block; color: var(--red); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.invalid input, .invalid select, .invalid textarea { border-color: var(--red); background: #fff8f8; }
.field-hidden { display: none !important; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.inline-form { display: inline-block; }
.filter-bar { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 10px; align-items: end; }
.filter-bar .field { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 4px; margin: 0 0 18px; }
legend { font-weight: 700; color: var(--navy); padding: 0 6px; font-size: 14px; }

/* Notices */
.notice { border-left: 4px solid var(--navy-2); background: #eef3fa; padding: 12px 15px; border-radius: 0 6px 6px 0; margin-bottom: 16px; font-size: 14px; }
.notice.warning { border-color: var(--amber); background: #fff6e5; }
.notice.danger { border-color: var(--red); background: #fdecee; }
.notice.success { border-color: var(--green); background: #e9f7ef; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.table th { background: #f0f4f9; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: #3a4655; white-space: nowrap; }
table.table tbody tr:hover { background: #fafbfd; }
table.table tr:last-child td { border-bottom: 0; }
table.table.compact th, table.table.compact td { padding: 7px 9px; font-size: 13px; }
.empty-state { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty-state h3 { color: var(--muted); }

/* Pagination */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; padding: 12px 0 0; }
.page-link { padding: 6px 11px; border: 1px solid var(--line); border-radius: 5px; text-decoration: none; background: #fff; font-size: 13px; }
.page-link.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-gap { padding: 6px 4px; color: var(--muted); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat-grid.dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 8px; padding: 14px 16px; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
a.stat:hover { border-color: var(--navy); box-shadow: 0 6px 18px rgba(15, 39, 71, .12); transform: translateY(-1px); }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 27px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat.green { border-left-color: var(--green); } .stat.green .value { color: var(--green); }
.stat.amber { border-left-color: var(--amber); } .stat.amber .value { color: var(--amber); }
.stat.red { border-left-color: var(--red); } .stat.red .value { color: var(--red); }

/* Stepper / tabs */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: #fff; font-size: 13px; color: var(--ink); font-weight: 600; }
.step .num { width: 22px; height: 22px; border-radius: 50%; background: #e3e9f1; color: var(--navy); display: grid; place-items: center; font-size: 11.5px; }
.step.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.step.active .num { background: #fff; color: var(--navy); }
.step.completed { border-color: #a8d5ba; background: #eef9f2; color: #0d4b2c; }
.step.completed .num { background: var(--green); color: #fff; }
.step.has-error { border-color: #e0aeb4; background: #fff4f5; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; font-size: 14px; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; white-space: nowrap; }
.tabs a.active, .tabs button.active { color: var(--navy); border-bottom-color: var(--saffron); }
.progress { display: block; height: 9px; background: #e3e9f1; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-2)); border-radius: 999px; }

/* Admin layout */
.admin-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { background: #102a47; color: #dce6f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-brand { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; gap: 10px; align-items: center; }
.admin-brand .brand-emblem { width: 40px; height: 40px; font-size: 14px; border-width: 2px; }
.admin-brand strong { display: block; font-size: 14px; color: #fff; line-height: 1.2; }
.admin-brand span { font-size: 11px; color: #9db4cf; }
.admin-nav { padding: 12px 10px; flex: 1; }
.admin-nav .group-label { padding: 12px 12px 5px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #8ea8c6; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; color: #d5e1ef; text-decoration: none; font-size: 13.5px; margin-bottom: 2px; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: var(--saffron); color: #fff; font-weight: 600; }
.admin-side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #9db4cf; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 11px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; position: sticky; top: 0; z-index: 20; }
.admin-topbar .title { font-weight: 700; color: var(--navy); }
.admin-content { padding: 24px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.sidebar-toggle { display: none; }
.mobile-menu { display: none; }

/* Public footer */
.site-footer { background: #102a47; color: #b9c9dc; padding: 26px 0; font-size: 13px; margin-top: 20px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: #d8e6f5; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Hero */
.hero { background: linear-gradient(135deg, #16365b 0%, #1f4a7a 65%, #2b5d94 100%); color: #eaf2fb; border-radius: 12px; padding: 34px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero h1 { color: #fff; font-size: 2rem; max-width: 880px; }
.hero p { color: #d4e2f2; max-width: 840px; }
.hero .meta { display: flex; gap: 22px; flex-wrap: wrap; margin: 18px 0 22px; }
.hero .meta div { font-size: 13px; color: #c5d7ea; }
.hero .meta strong { display: block; font-size: 17px; color: #fff; }
.hero .btn-primary { background: var(--saffron); }
.hero .btn-outline { border-color: #cfe0f2; color: #fff; }
.notice-board { border: 1px solid #e2c891; background: #fff9ec; border-radius: 8px; overflow: hidden; }
.notice-board h3 { background: #f3e2bd; margin: 0; padding: 10px 14px; color: #6a4300; font-size: 14px; border-bottom: 1px solid #e2c891; }
.notice-board .body { padding: 12px 14px; font-size: 13.5px; }

/* Photo capture */
.camera-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #f9fbfd; }
.camera-frame { position: relative; width: 100%; max-width: 420px; aspect-ratio: 4 / 3; background: #0c1b2b; border-radius: 10px; overflow: hidden; margin: 0 auto 12px; }
.camera-frame video, .camera-frame canvas, .camera-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face-guide { position: absolute; inset: 12% 28%; border: 2px dashed rgba(255,255,255,.75); border-radius: 48% 48% 44% 44%; pointer-events: none; }
.camera-note { font-size: 12.5px; color: var(--muted); text-align: center; }
.camera-status { margin-top: 10px; }
.photo-thumb { width: 120px; height: 150px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #eef2f7; }
.doc-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px dashed #b9c5d4; border-radius: 8px; padding: 10px 12px; margin-top: 8px; background: #fbfcfe; }
.doc-meta { font-size: 13px; }
.doc-thumb { width: 64px; height: 80px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #eef2f7; }
.doc-meta strong { display: block; }
.file-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Definition list */
.dl { display: grid; grid-template-columns: 190px 1fr; gap: 0; font-size: 14px; }
.dl dt { padding: 8px 12px; background: #f4f7fb; border-bottom: 1px solid var(--line); font-weight: 600; color: #3a4655; }
.dl dd { padding: 8px 12px; margin: 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid #dbe3ee; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .what { font-weight: 600; font-size: 13.5px; }

/* Detail print / receipt */
.receipt-sheet { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 26px; max-width: 840px; margin: 0 auto; }
.receipt-head { display: flex; justify-content: space-between; gap: 18px; border-bottom: 2px solid var(--navy); padding-bottom: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.receipt-head h1 { font-size: 1.4rem; margin: 0; }
.receipt-head .org { color: var(--muted); font-size: 13px; }
.section-block { margin-bottom: 18px; }
.section-block h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; font-size: 13.5px; }
.kv div span { color: var(--muted); }
.sandbox-badge { background: #76131d; color: #fff; padding: 6px 14px; border-radius: 6px; display: inline-block; font-weight: 700; letter-spacing: .5px; }
.verify-code { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; color: var(--muted); }

/* Form builder */
.builder-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.builder-panel { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.tab-card { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.tab-card .head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 13px; background: #f4f7fb; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab-card .head strong { color: var(--navy); }
.field-chip { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 13px; border-bottom: 1px solid #edf0f5; font-size: 13px; }
.field-chip:last-child { border-bottom: 0; }
.field-chip .meta { color: var(--muted); font-size: 12px; }
.validation-list { margin: 0; padding-left: 20px; font-size: 13.5px; }
.validation-list li { margin-bottom: 5px; }
.code-tag { font-family: Consolas, monospace; background: #eef2f7; border: 1px solid #d7dee8; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* Candidate experience */
body.candidate-app { background: #eef2f8 radial-gradient(1100px 460px at 50% -240px, #d9e6f7, transparent); }
body.candidate-app .card { border-color: #e2e8f0; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,33,58,.04), 0 14px 34px -26px rgba(16,33,58,.55); }
body.candidate-app .card-header { border-bottom: 1px solid #eef2f7; background: linear-gradient(180deg, #fbfdff, #fff); border-radius: 14px 14px 0 0; }
body.candidate-app main { padding: 30px 0 56px; }
.candidate-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 30px 32px; color: #eaf2fb; background: linear-gradient(120deg, #123253 0%, #1c4a7d 55%, #2f6bab 100%); box-shadow: 0 20px 44px -24px rgba(16,45,84,.8); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px; align-items: center; margin-bottom: 22px; }
.candidate-hero::after { content: ""; position: absolute; right: -80px; top: -100px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%); }
.candidate-hero > * { position: relative; z-index: 1; }
.candidate-hero .eyebrow { font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; color: #9fc0e4; font-weight: 700; }
.candidate-hero h1 { color: #fff; font-size: 1.85rem; margin: 4px 0 6px; }
.candidate-hero p { color: #cfe0f2; margin: 0; max-width: 720px; }
.candidate-hero .hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.candidate-hero .pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); color: #eef5fc; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; }
.candidate-hero .hero-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.candidate-hero .btn { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.candidate-hero .btn:hover { background: rgba(255,255,255,.28); color: #fff; }
.candidate-hero .btn-primary { background: var(--saffron); border-color: var(--saffron); }
.candidate-hero .btn-primary:hover { background: #a04f08; }
.progress-ring { --pct: 0; width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(#fff calc(var(--pct) * 1%), rgba(255,255,255,.18) 0); display: grid; place-items: center; flex: 0 0 auto; }
.progress-ring .ring-inner { width: 104px; height: 104px; border-radius: 50%; background: #17395f; display: grid; place-items: center; color: #fff; text-align: center; line-height: 1.1; }
.progress-ring .ring-inner strong { font-size: 1.6rem; display: block; }
.progress-ring .ring-inner span { font-size: 10.5px; color: #a9c5e2; text-transform: uppercase; letter-spacing: .6px; }
.candidate-stats { margin-bottom: 22px; }
.stat .stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.stat .stat-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 15px; background: #eaf0f8; color: var(--navy); flex: 0 0 auto; }
.stat .stat-icon.green { background: #e2f4ea; color: var(--green); }
.stat .stat-icon.amber { background: #fdf0d8; color: var(--amber); }
.stat .stat-icon.red { background: #fbe4e7; color: var(--red); }
.stat .value.sm { font-size: 1.4rem; }
.stat .value.xs { font-size: 1.1rem; line-height: 1.4; }
.progress.lg { height: 10px; }
.list-group { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.list-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 13px 15px; border: 1px solid #e6ebf2; border-radius: 12px; background: #fff; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.list-item:hover { border-color: #9db4d4; box-shadow: 0 12px 26px -20px rgba(16,45,84,.7); transform: translateY(-1px); }
.section-list { display: grid; gap: 10px; padding: 14px; }
.section-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid #e6ebf2; border-radius: 12px; background: #fff; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.section-card:hover { border-color: #9db4d4; box-shadow: 0 12px 26px -20px rgba(16,45,84,.7); transform: translateY(-1px); }
.section-card .section-mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #eef2f8; color: var(--navy); flex: 0 0 auto; }
.section-card.done .section-mark { background: var(--green); color: #fff; }
.section-card .section-info { flex: 1; min-width: 0; }
.section-card .section-info strong { display: block; }
.section-card .section-info .progress { margin-top: 7px; max-width: 260px; }
.app-head { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(16,33,58,.04), 0 14px 34px -26px rgba(16,33,58,.55); }
.app-head .eyebrow { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--saffron); font-weight: 700; }
.app-head h1 { margin: 3px 0 4px; }
.app-head .app-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.app-head .app-progress { margin: 16px 0 4px; }
.app-head .progress.lg { height: 10px; }
.app-head .stepper { margin: 16px 0 0; }

/* Tab buttons inside the application header */
.app-head .stepper {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 18px 0 0;
    padding: 0;
    background: #fff;
    border: 1px solid #d9e2ee;
    border-radius: 12px;
    overflow: hidden;
}
.app-head .step {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-right: 1px solid #e2e8f1;
    border-radius: 0;
    background: #eef2f7;
    color: #5b6b80;
    padding: 11px 8px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.app-head .step:last-child { border-right: 0; }
.app-head .step .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.app-head .step .num {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    background: #fff;
    color: #5b6b80;
    border: 1px solid #d3dbe6;
    font-size: 11.5px;
    font-weight: 700;
}
.app-head .step:hover {
    background: #e2e8f1;
    color: var(--navy);
    transform: none;
    box-shadow: none;
}
.app-head .step.active,
.app-head .step.active:hover {
    background: var(--navy);
    color: #fff;
    box-shadow: none;
}
.app-head .step.active .num { background: #fff; color: var(--navy); border-color: #fff; }
.app-head .step.completed,
.app-head .step.completed:hover {
    background: var(--green);
    color: #fff;
    box-shadow: none;
}
.app-head .step.completed .num { background: rgba(255, 255, 255, .24); border-color: transparent; color: #fff; }

/* Multi-column application form */
.form-grid.field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    align-items: start;
}
.form-grid.field-grid .field { margin-bottom: 0; }
.form-grid.field-grid .field-wide { grid-column: 1 / -1; }
.form-grid.field-grid .field-file,
.form-grid.field-grid .field-signature,
.form-grid.field-grid .field-photo_capture {
    padding: 14px;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    background: #fbfdff;
}
.form-grid.field-grid .field-wide textarea { min-height: 110px; }
.form-grid.field-grid .field .option-list { padding-top: 6px; }
.form-grid.field-grid .field .doc-row { margin-bottom: 10px; }

/* Repeatable groups (multi-entry qualifications) */
.repeater { padding: 12px; border: 1px solid #e6ebf2; border-radius: 12px; background: #fbfdff; }
.repeater-rows { display: flex; flex-direction: column; gap: 10px; }
.repeater-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid #e6ebf2; border-radius: 10px; background: #fff; }
.repeater-fields { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.repeater-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.repeater-cell > span { font-size: 12px; font-weight: 600; color: #5b6b80; }
.repeater-cell .req { margin-left: 2px; color: var(--red); }
.repeater-cell input, .repeater-cell select { width: 100%; }
.repeater-remove { flex: 0 0 auto; margin-top: 18px; }
.repeater-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 860px) {
    .repeater-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .repeater-row { flex-direction: column; }
    .repeater-fields { grid-template-columns: 1fr; }
    .repeater-remove { align-self: flex-end; margin-top: 0; }
}

/* Responsive */
@media (max-width: 980px) {
    .split, .builder-layout { grid-template-columns: 1fr; }
    .builder-panel { position: static; max-height: none; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-grid.dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-105%); transition: transform .2s ease; }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
    .admin-content { padding: 18px; }
    .dl { grid-template-columns: 150px 1fr; }
}
@media (max-width: 640px) {
    body { font-size: 14.5px; }
    h1 { font-size: 1.55rem; }
    .hero { padding: 24px 20px; }
    .hero h1 { font-size: 1.5rem; }
    .grid-2, .grid-3, .form-grid, .stat-grid.dashboard-stats { grid-template-columns: 1fr; }
    .form-grid.field-grid { grid-template-columns: 1fr; gap: 14px; }
    .app-head .step { padding: 9px 5px; font-size: 11px; gap: 4px; }
    .app-head .step .num { width: 18px; height: 18px; font-size: 10px; }
    .filter-bar { grid-template-columns: 1fr; }
    .dl { grid-template-columns: 1fr; }
    .dl dt { border-bottom: 0; padding-bottom: 2px; }
    .dl dd { padding-top: 0; }
    .kv { grid-template-columns: 1fr; }
    .brand-text strong { font-size: 15px; }
    .brand-emblem { width: 44px; height: 44px; }
    .site-nav a, .site-nav button.linklike { padding: 10px 11px; font-size: 13px; }
    .stepper { gap: 4px; }
    .step { padding: 6px 9px; font-size: 12px; }
    .receipt-sheet { padding: 16px; }
    .admin-topbar { padding: 10px 14px; }
}
@media (max-width: 860px) {
    .candidate-hero { grid-template-columns: 1fr; padding: 24px; }
    .candidate-hero .progress-ring { justify-self: start; }
}
@media (max-width: 640px) {
    .candidate-hero { padding: 20px 18px; }
    .candidate-hero h1 { font-size: 1.45rem; }
    .progress-ring { width: 112px; height: 112px; }
    .progress-ring .ring-inner { width: 86px; height: 86px; }
    .progress-ring .ring-inner strong { font-size: 1.35rem; }
    .list-group { padding: 10px; }
    .section-list { padding: 10px; }
}
/* Reset dialog and danger zone */
.danger-zone { border-color: #e3a0a7; }
.danger-zone .card-header { background: #fdecee; border-bottom-color: #e3a0a7; }
.danger-zone .card-header h2 { color: #76131d; }
.modal {
    width: 100%; max-width: min(720px, calc(100vw - 32px));
    margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink);
}
.modal::backdrop { background: rgba(9, 20, 35, .62); backdrop-filter: blur(2px); }
.modal-panel {
    background: #fff; border-radius: 14px; border: 1px solid rgba(255,255,255,.4);
    box-shadow: 0 24px 70px rgba(8, 20, 36, .35); overflow: hidden; text-align: left;
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 3px 0 0; font-size: 1.25rem; color: var(--navy); line-height: 1.25; }
.modal-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; color: var(--red); }
.modal-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #f4f7fb; color: #475569; font-size: 22px; line-height: 1; cursor: pointer; flex: 0 0 auto; }
.modal-close:hover { background: #e8edf4; color: var(--ink); }
.modal-body { padding: 20px 22px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.reset-scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.reset-scope > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fbfcfe; }
.reset-scope h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #3a4655; }
.reset-scope ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #41516a; }
.reset-scope li + li { margin-top: 4px; }
.backup-file { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border: 1px solid var(--line); background: #f4f7fb; border-radius: 10px; padding: 14px 16px; }
.backup-file strong { display: block; word-break: break-all; color: var(--navy); }
.backup-file span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.reset-final-form { margin-top: 16px; }
body:has(dialog[open]) { overflow: hidden; }

@media (max-width: 640px) {
    .reset-scope { grid-template-columns: 1fr; }
    .modal-head, .modal-body { padding: 16px; }
    .modal-actions .btn { width: 100%; }
}

@media print {
    body { background: #fff; font-size: 12px; }
    .site-header, .site-nav, .gov-strip, .site-footer, .no-print, .admin-sidebar, .admin-topbar { display: none !important; }
    main { padding: 0; }
    .container { width: 100%; }
    .receipt-sheet, .card { border: 0; box-shadow: none; padding: 0; }
}
