:root {
  --navy: #13203a;
  --navy-2: #1c2e54;
  --ink: #1e2a3b;
  --body: #44536b;
  --muted: #6b7a93;
  --amber: #c07a1a;
  --amber-soft: #fdf3e3;
  --card-bg: #ffffff;
  --page-bg: #f3f6fb;
  --border: #dfe6f0;
  --green: #1e7a3c; --green-t: #e7f4eb;
  --yellow: #b45309; --yellow-t: #fbf0dc;
  --red: #b42318; --red-t: #fbeae8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--page-bg); color: var(--body); font-size: 15px; line-height: 1.55;
}
header {
  background: var(--navy); color: #fff; padding: 18px 28px 0;
}
.brand { display: flex; gap: 14px; align-items: center; padding-bottom: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  object-fit: contain; display: block; flex-shrink: 0;
}
.brand-name { font-weight: 700; letter-spacing: 3px; font-size: 15px; }
.brand-sub { letter-spacing: 0.5px; font-weight: 400; color: #afc2e2; }
.brand-tag { font-size: 12.5px; color: #7e90b3; }
nav#roles { display: flex; gap: 4px; }
nav#roles button {
  background: transparent; border: none; color: #afc2e2; padding: 12px 22px;
  font-size: 14.5px; cursor: pointer; border-radius: 8px 8px 0 0; font-weight: 700;
}
nav#roles button:hover { color: #fff; }
nav#roles button.active { background: var(--page-bg); color: var(--navy); }

.role { display: none; }
.role.active { display: block; }
.pane { display: none; }
.pane.active { display: block; }
.subnav { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.subnav button {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  color: var(--body); padding: 7px 17px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.subnav button:hover { border-color: var(--navy-2); color: var(--navy); }
.subnav button.active { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0 4px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.form-grid input, .form-grid select {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  font-size: 14px; color: var(--ink); font-family: inherit; background: #fff;
}
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--navy-2); border-color: var(--navy-2); }
.form-section { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 18px; text-transform: uppercase; letter-spacing: 0.5px; }

.ack { text-align: center; max-width: 620px; margin: 0 auto; }
.ack-tick { font-size: 44px; }
.ack-id {
  font-size: 34px; font-weight: 800; color: var(--navy); letter-spacing: 2px;
  background: var(--amber-soft); border: 1px dashed var(--amber); border-radius: 10px;
  padding: 14px; margin: 16px auto; max-width: 340px;
}

.track-head { border-radius: 10px; padding: 14px 16px; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.track-head.ok { background: var(--green-t); color: var(--green); }
.track-head.warn { background: var(--yellow-t); color: var(--yellow); }
.track-head.bad { background: var(--red-t); color: var(--red); }
.track-status { font-weight: 700; }
.timeline { margin: 18px 4px; }
.tl-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--navy-2); flex-shrink: 0; margin-top: 3px; z-index: 1; }
.tl-label { font-weight: 600; color: var(--ink); font-size: 14px; }
.tl-when { color: var(--muted); font-size: 12px; }

.deadline { border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; }
.deadline.green { background: var(--green-t); color: var(--green); }
.deadline.yellow { background: var(--yellow-t); color: var(--yellow); }
.deadline.red { background: var(--red-t); color: var(--red); }

.verifier-intro { margin-bottom: 18px; }

main { max-width: 1200px; margin: 0 auto; padding: 26px 24px 60px; }
.tab { display: none; }
.tab.active { display: block; }

h2 { color: var(--navy); font-size: 19px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
code { background: #eef2f8; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; box-shadow: 0 2px 10px rgba(27,42,74,0.06);
}
.info-card { background: #fbfcfe; }

.dropzone {
  border: 2px dashed #b9c6da; border-radius: 10px; padding: 30px 16px;
  text-align: center; cursor: pointer; margin: 16px 0 10px; transition: all .15s;
  color: var(--body);
}
.dropzone:hover, .dropzone.drag { border-color: var(--amber); background: var(--amber-soft); }
.dz-icon { font-size: 30px; margin-bottom: 6px; }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-t); }

.samples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: var(--navy); font-weight: 600;
}
.chip-btn:hover { border-color: var(--amber); color: var(--amber); }

button.primary {
  background: var(--navy-2); color: #fff; border: none; border-radius: 8px;
  padding: 11px 22px; font-size: 14.5px; font-weight: 600; cursor: pointer; width: 100%;
}
button.primary:hover:not(:disabled) { background: var(--navy); }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px;
}
.row button { width: auto; }

.status-line { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: #eef2f8; font-size: 14px; }
.status-line.err { background: var(--red-t); color: var(--red); }

.spinner {
  display: inline-block; width: 15px; height: 15px; border: 2.5px solid #c6d2e4;
  border-top-color: var(--navy-2); border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: -3px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.risk-banner { border-radius: 10px; padding: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 14px; }
.risk-banner.green { background: var(--green-t); color: var(--green); }
.risk-banner.yellow { background: var(--yellow-t); color: var(--yellow); }
.risk-banner.red { background: var(--red-t); color: var(--red); }
.risk-score { font-size: 30px; font-weight: 800; line-height: 1; }
.risk-label { font-weight: 700; font-size: 15px; }

.fields-table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 13.5px; }
.fields-table td { padding: 6px 8px; border-bottom: 1px solid #edf1f7; vertical-align: top; }
.fields-table td:first-child { color: var(--muted); width: 42%; }
.fields-table td:last-child { color: var(--ink); font-weight: 600; }

.check { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf1f7; font-size: 13.5px; }
.check:last-child { border-bottom: none; }
.check .dot { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 800; margin-top: 1px; }
.check.pass .dot { background: var(--green); }
.check.warn .dot { background: var(--yellow); }
.check.fail .dot { background: var(--red); }
.check .label { font-weight: 600; color: var(--ink); }
.check .detail { color: var(--muted); font-size: 12.5px; }

.steps { padding-left: 20px; margin: 10px 0; }
.steps li { margin-bottom: 9px; }

.committee-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.queue-stats { display: flex; gap: 8px; }
.stat-chip { border-radius: 999px; padding: 4px 13px; font-size: 12.5px; font-weight: 700; }
.stat-chip.green { background: var(--green-t); color: var(--green); }
.stat-chip.yellow { background: var(--yellow-t); color: var(--yellow); }
.stat-chip.red { background: var(--red-t); color: var(--red); }

.queue { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.queue-item {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; display: grid; grid-template-columns: 90px 1fr 160px 120px; gap: 14px;
  align-items: center; cursor: pointer; transition: box-shadow .15s;
}
.queue-item:hover { box-shadow: 0 3px 12px rgba(27,42,74,0.12); }
.queue-item .app-id { font-weight: 700; color: var(--navy); }
.queue-item .who { color: var(--ink); font-weight: 600; }
.queue-item .who .sub { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.band-chip { border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; text-align: center; }
.band-chip.green { background: var(--green-t); color: var(--green); }
.band-chip.yellow { background: var(--yellow-t); color: var(--yellow); }
.band-chip.red { background: var(--red-t); color: var(--red); }
.band-chip.pending { background: #eef2f8; color: var(--muted); }
.status-tag { font-size: 12px; color: var(--muted); text-align: right; }

.detail { margin-top: 6px; }
.detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail img { width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.decision-row { display: flex; gap: 10px; margin-top: 16px; }
.decision-row button { flex: 1; border: none; border-radius: 8px; padding: 11px; font-weight: 700; cursor: pointer; font-size: 13.5px; }
.btn-approve { background: var(--green); color: #fff; }
.btn-clarify { background: var(--yellow); color: #fff; }
.btn-reject { background: var(--red); color: #fff; }
.decision-row button:disabled { opacity: .4; cursor: not-allowed; }

.verdict { border-radius: 10px; padding: 18px; margin-top: 16px; }
.verdict.VERIFIED { background: var(--green-t); }
.verdict.PENDING { background: var(--yellow-t); }
.verdict.REJECTED, .verdict.NOT_FOUND { background: var(--red-t); }
.verdict h3 { font-size: 21px; margin-bottom: 6px; }
.verdict.VERIFIED h3 { color: var(--green); }
.verdict.PENDING h3 { color: var(--yellow); }
.verdict.REJECTED h3, .verdict.NOT_FOUND h3 { color: var(--red); }
.hash { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 8px; }

.ledger { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ledger-entry {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px;
  display: grid; grid-template-columns: 54px 170px 1fr; gap: 14px; align-items: start; font-size: 13px;
}
.ledger-entry .idx { font-weight: 800; color: var(--navy); font-size: 15px; }
.ledger-entry .event { font-weight: 700; color: var(--navy); }
.ledger-entry .when { color: var(--muted); font-size: 12px; }
.ledger-entry .hashes { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--muted); word-break: break-all; }
.chain-ok { background: var(--green-t); color: var(--green); border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 13px; }
.chain-bad { background: var(--red-t); color: var(--red); border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 13px; }

.pe-link { color: var(--amber); font-weight: 600; text-decoration: none; }
.pe-link:hover { text-decoration: underline; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 22px; border-top: 1px solid var(--border); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.kpi .num { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.accent .num { color: var(--amber); }
.bar-row { margin: 10px 0; font-size: 13px; }
.bar-row .bar-label { display: flex; justify-content: space-between; color: var(--ink); margin-bottom: 4px; }
.bar-track { background: #edf1f7; border-radius: 999px; height: 14px; overflow: hidden; display: flex; }
.bar-seg { height: 100%; }
.bar-seg.green { background: var(--green); }
.bar-seg.yellow { background: #d99a2b; }
.bar-seg.red { background: var(--red); }
.bar-seg.navy { background: var(--navy-2); }

.chat { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; max-height: 420px; overflow-y: auto; }
.msg { border-radius: 10px; padding: 12px 15px; font-size: 14px; white-space: pre-wrap; max-width: 92%; }
.msg.q { background: var(--navy-2); color: #fff; align-self: flex-end; }
.msg.a { background: #eef2f8; color: var(--ink); align-self: flex-start; }
.msg.a .eng { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); }

.expired-note { color: var(--yellow); font-weight: 700; }
.match-chip {
  display: inline-block; background: var(--amber-soft); border: 1px solid #ecd9b8;
  color: #7a5514; border-radius: 7px; padding: 2px 9px; font-size: 11px;
  margin: 3px 3px 0 0; line-height: 1.5; max-width: 100%; word-break: break-word;
}
#searchResults .queue-item { grid-template-columns: 80px 1fr 90px; }
#searchResults .status-tag { display: none; }
.sfilter:disabled { opacity: 0.5; cursor: not-allowed; }
.api-example {
  background: #0f1a2e; color: #cfe0f5; border-radius: 8px; padding: 14px 16px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; overflow-x: auto;
  margin-top: 10px; line-height: 1.6;
}
.api-response { background: #f7f9fc; color: #1e2a3b; border: 1px solid var(--border); max-height: 320px; overflow-y: auto; }
.btn-renew { background: #0e7490; color: #fff; }
.btn-archive { background: #475569; color: #fff; }
.link-demo { color: var(--muted); font-size: 12px; text-decoration: underline dotted; }
.history-events { margin-top: 10px; border-top: 1px solid var(--border); }
.hist-row { display: grid; grid-template-columns: 170px 150px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid #edf1f7; font-size: 12.5px; align-items: baseline; }
.hist-event { font-weight: 700; color: var(--navy); }
@media (max-width: 700px) { .hist-row { grid-template-columns: 1fr; gap: 2px; } }

.validity-link {
  display: inline-block; margin-top: 12px; background: var(--amber-soft); border: 1px solid var(--amber);
  color: var(--amber); border-radius: 8px; padding: 9px 14px; font-weight: 700; font-size: 13px; text-decoration: none;
}
.validity-link:hover { background: var(--amber); color: #fff; }
.btn-revoke { background: #5b21b6; color: #fff; }
