:root {
  --navy: #12334a;
  --navy-deep: #092538;
  --blue: #1e6fb8;
  --blue-soft: #e9f4fb;
  --teal: #087c72;
  --teal-soft: #e6f5f2;
  --amber: #f5b942;
  --amber-soft: #fff5d2;
  --ink: #17212b;
  --muted: #5d6c77;
  --line: #d6e1e8;
  --canvas: #eef4f7;
  --danger: #b0322b;
  --danger-soft: #ffedeb;
  --shadow: 0 18px 50px rgba(16, 50, 73, .1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: var(--blue); }
.skip-link { position: fixed; z-index: 50; top: 10px; left: 10px; padding: 10px 14px; color: white; background: var(--navy-deep); border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { color: var(--navy); background: white; border-bottom: 1px solid rgba(18, 51, 74, .12); }
.header-inner { width: min(1220px, calc(100% - 32px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 12px 12px 12px 4px; font-size: 14px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; }
.brand small { color: var(--muted); font-size: 12px; }
nav { display: flex; align-items: center; gap: 18px; }
nav a { font-size: 14px; font-weight: 800; }
.back-link { padding: 9px 13px; color: white; background: var(--blue); border-radius: 9px; text-decoration: none; }
.dashboard-shell { width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 58px; }
.dashboard-head { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 34px; align-items: end; }
.eyebrow, .section-kicker { margin: 0 0 7px; color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy); font-size: clamp(38px, 5vw, 62px); line-height: 1.02; letter-spacing: -.04em; }
.dashboard-head > div > p:last-child { max-width: 760px; margin: 15px 0 0; color: var(--muted); font-size: 18px; }
.security-card { display: flex; gap: 12px; padding: 18px; color: white; background: var(--navy); border-radius: 15px; box-shadow: var(--shadow); }
.security-card > span { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; color: var(--navy); background: var(--amber); border-radius: 9px; font-weight: 900; }
.security-card strong { display: block; }
.security-card p { margin: 2px 0 0; color: #cfe0e9; font-size: 13px; }
.access-card { max-width: 820px; margin: 30px auto 0; padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.access-card h2, .panel-head h2 { margin: 0; color: var(--navy); font-size: 25px; line-height: 1.2; }
.access-card > div > p:last-child { margin: 10px 0 0; color: var(--muted); }
.access-card form { align-self: center; }
.access-card label { display: block; margin-bottom: 6px; color: var(--navy); font-size: 14px; font-weight: 850; }
.access-controls { display: grid; gap: 9px; }
input, select, textarea { width: 100%; color: var(--ink); background: white; border: 1px solid #aabdc8; border-radius: 8px; }
input, select { min-height: 44px; padding: 9px 10px; }
textarea { padding: 10px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(30, 111, 184, .24); outline-offset: 2px; }
.primary-button, .secondary-button, .open-button, .approve-button, .reject-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 13px; border-radius: 8px; font-weight: 850; }
.primary-button, .approve-button { color: white; background: var(--teal); border: 1px solid var(--teal); }
.secondary-button { color: var(--navy); background: white; border: 1px solid #9db5c5; }
.open-button { color: var(--blue); background: var(--blue-soft); border: 1px solid #a7cee6; }
.reject-button { color: white; background: var(--danger); border: 1px solid var(--danger); }
.action-status { min-height: 22px; margin: 10px 0 0; color: var(--teal); font-size: 14px; font-weight: 750; }
.action-status.error { color: var(--danger); }
.metric-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.metric-grid article { padding: 17px 19px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.metric-grid span, .metric-grid strong { display: block; }
.metric-grid span { color: var(--muted); font-size: 14px; font-weight: 750; }
.metric-grid strong { margin-top: 5px; color: var(--blue); font-size: 31px; line-height: 1; }
.view-tabs { margin-top: 20px; display: flex; gap: 8px; padding: 5px; background: #dfeaf0; border-radius: 12px; }
.view-tab { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; color: var(--navy); background: transparent; border: 0; border-radius: 9px; font-weight: 850; }
.view-tab span { min-width: 25px; padding: 2px 7px; color: var(--muted); background: rgba(255, 255, 255, .72); border-radius: 99px; font-size: 12px; text-align: center; }
.view-tab.active { color: white; background: var(--navy); box-shadow: 0 5px 15px rgba(9, 37, 56, .16); }
.view-tab.active span { color: var(--navy); background: white; }
.pilot-panel { margin-top: 17px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.panel-explanation { max-width: 700px; margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.batch-review { margin: 14px 0 17px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #f4f8fa; border: 1px solid var(--line); border-radius: 12px; }
.batch-review strong, .batch-review span { display: block; }
.batch-review strong { color: var(--navy); }
.batch-review span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.batch-review button { flex: 0 0 auto; }
.selection-cell { width: 46px; text-align: center; }
.selection-cell input { width: 18px; height: 18px; min-height: 18px; padding: 0; accent-color: var(--teal); }
.panel-actions { display: flex; align-items: end; flex-wrap: wrap; justify-content: end; gap: 8px; }
.filter-field { min-width: 180px; color: var(--muted); font-size: 12px; font-weight: 800; }
.filter-field select { display: block; margin-top: 3px; min-height: 42px; font-size: 14px; }
.table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; min-width: 830px; border-collapse: collapse; }
th, td { padding: 13px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { color: white; background: var(--navy); font-size: 12px; text-transform: uppercase; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
.record-name strong, .record-name span { display: block; }
.record-name strong { color: var(--navy); font-size: 14px; }
.record-name span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.status-pending { color: #785600; background: var(--amber-soft); }
.status-approved { color: #15584f; background: var(--teal-soft); }
.status-rejected { color: #7c2620; background: var(--danger-soft); }
.precheck-not_run { color: var(--muted); background: #edf2f5; }
.precheck-pass { color: #15584f; background: var(--teal-soft); }
.precheck-warning { color: #785600; background: var(--amber-soft); }
.precheck-fail { color: #7c2620; background: var(--danger-soft); }
.duplicate-text { color: #8a5600; font-weight: 800; }
.blocked-text { color: var(--danger); font-weight: 850; }
.muted-text { color: var(--muted); }
.empty-state { padding: 34px; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--navy); }
.empty-state span { margin-top: 4px; color: var(--muted); font-size: 13px; }
footer { width: min(1220px, calc(100% - 32px)); margin: 0 auto 34px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 13px; }
footer strong { color: var(--navy); }
footer p { margin: 3px 0 0; }
footer > div:last-child { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 18px; }
dialog { width: min(760px, calc(100% - 28px)); max-height: min(860px, calc(100vh - 34px)); padding: 0; color: var(--ink); background: white; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(4, 24, 38, .38); }
dialog::backdrop { background: rgba(7, 30, 45, .72); backdrop-filter: blur(3px); }
.dialog-head { padding: 22px 25px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; color: white; background: var(--navy); }
.dialog-head .section-kicker { color: #83d2ff; }
.dialog-head h2 { margin: 0; font-size: 27px; }
.dialog-head p:last-child { margin: 3px 0 0; color: #cfe0e9; font-size: 13px; }
.icon-button { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 9px; font-size: 25px; }
.dialog-body { overflow-y: auto; padding: 22px 25px 25px; }
.duplicate-warning { margin-bottom: 17px; padding: 12px 14px; color: #704900; background: var(--amber-soft); border-radius: 10px; }
.blocked-warning { margin-bottom: 17px; padding: 12px 14px; color: #7c2620; background: var(--danger-soft); border-radius: 10px; }
.duplicate-warning strong, .duplicate-warning span, .blocked-warning strong, .blocked-warning span { display: block; }
.duplicate-warning span, .blocked-warning span { margin-top: 2px; font-size: 13px; }
.detail-grid { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 10px; }
.detail-grid div { padding: 12px 14px; background: white; }
.detail-grid dt { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.detail-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--navy); font-size: 14px; font-weight: 750; }
.copy-block { margin-top: 16px; padding: 14px; background: #f4f8fa; border-radius: 10px; }
.copy-block h3 { margin: 0; color: var(--navy); font-size: 15px; }
.copy-block p { margin: 5px 0 0; color: var(--muted); white-space: pre-wrap; }
.review-result { margin-top: 17px; padding: 13px 14px; color: #15584f; background: var(--teal-soft); border-radius: 10px; }
.internal-notes { border-left: 4px solid var(--amber); }
.candidate-controls { margin-top: 17px; display: grid; gap: 7px; }
.candidate-controls span { display: block; padding: 9px 11px; color: var(--muted); background: #f4f8fa; border-radius: 8px; font-size: 13px; font-weight: 750; }
.candidate-workflow { margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line); }
.candidate-workflow h3 { margin: 2px 0 0; color: var(--navy); font-size: 18px; }
.workflow-steps { margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; list-style: none; }
.workflow-steps li { min-height: 92px; padding: 12px; color: var(--muted); background: #f4f8fa; border: 1px solid var(--line); border-radius: 10px; }
.workflow-steps strong, .workflow-steps span { display: block; }
.workflow-steps strong { color: var(--navy); font-size: 13px; }
.workflow-steps span { margin-top: 4px; font-size: 12px; line-height: 1.45; }
.workflow-steps li.complete { background: var(--teal-soft); border-color: #a9ded6; }
.workflow-steps li.current { background: var(--amber-soft); border-color: #f1ca72; }
.workflow-help { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.authorization-check { margin-top: 14px; padding: 12px 13px; display: flex; align-items: flex-start; gap: 9px; color: var(--navy); background: #f4f8fa; border-radius: 10px; font-size: 14px; font-weight: 750; }
.authorization-check[hidden] { display: none; }
.authorization-check input { width: 18px; height: 18px; min-height: 18px; margin: 1px 0 0; padding: 0; flex: 0 0 auto; accent-color: var(--teal); }
.candidate-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.candidate-actions button[hidden] { display: none; }
.precheck-detail { margin-top: 17px; padding: 14px; background: #f4f8fa; border-radius: 10px; }
.precheck-detail h3, .precheck-detail p { margin: 0; }
.precheck-detail h3 { color: var(--navy); font-size: 15px; }
.precheck-detail p { margin-top: 5px; }
.precheck-detail ul { margin: 8px 0; padding-left: 20px; color: #704900; }
.precheck-detail small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.45; }
#decision-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
#decision-form > label { display: block; margin-bottom: 6px; color: var(--navy); font-weight: 850; }
.decision-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }

@media (max-width: 850px) {
  .dashboard-head, .access-card { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 600px) {
  .header-inner, .dashboard-shell, footer { width: min(100% - 20px, 1220px); }
  .brand small, nav > a:first-child { display: none; }
  .dashboard-shell { padding-top: 28px; }
  h1 { font-size: 39px; }
  .dashboard-head > div > p:last-child { font-size: 16px; }
  .access-card, .pilot-panel { padding: 19px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .panel-actions, .filter-field, .panel-actions button { width: 100%; }
  .batch-review { align-items: stretch; flex-direction: column; }
  .batch-review button { width: 100%; }
  .view-tabs { align-items: stretch; flex-direction: column; }
  .view-tab { justify-content: space-between; }
  footer { align-items: flex-start; flex-direction: column; }
  footer > div:last-child { justify-content: flex-start; }
  .dialog-head, .dialog-body { padding-left: 18px; padding-right: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
  .decision-actions { align-items: stretch; flex-direction: column-reverse; }
  .workflow-steps { grid-template-columns: 1fr; }
  .workflow-steps li { min-height: 0; }
  .candidate-actions, .candidate-actions button { width: 100%; }
}

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