:root {
  --navy: #071f34;
  --blue: #0b71d9;
  --cyan: #22b8d5;
  --ink: #102336;
  --muted: #637487;
  --line: #dce4ea;
  --soft: #f3f7f9;
  --success: #138a61;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--navy);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0%, #12456a, transparent 32rem), var(--navy); }
.page-shell { width: min(100%, 760px); margin: auto; padding: 44px 18px 28px; }
.hero { color: white; padding: 12px 8px 30px; }
.eyebrow { color: #66d7ea; text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 800; margin: 0 0 12px; }
h1 { font-size: clamp(2.15rem, 8vw, 4.6rem); line-height: .98; letter-spacing: -.045em; margin: 0; max-width: 690px; }
.intro { color: #c9d9e5; line-height: 1.6; font-size: 1.04rem; max-width: 570px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; }
.trust-row span { background: #ffffff12; border: 1px solid #ffffff1f; border-radius: 999px; padding: 7px 10px; font-size: .76rem; color: #d7e6ef; }
.card { background: #fff; border-radius: 22px; box-shadow: 0 24px 70px #0007; }
.form-card { padding: clamp(20px, 5vw, 38px); }
.step { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.step > span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--navy); color: white; font-weight: 800; }
.step strong, .step small { display: block; }
.step small { color: var(--muted); margin-top: 3px; }
.receipt-step { margin-top: 30px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-size: .84rem; font-weight: 750; margin: 14px 0; }
input:not([type="file"]):not([type="checkbox"]), select { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; font: inherit; color: var(--ink); background: white; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0b71d91c; }
.optional { color: var(--muted); font-weight: 500; }
.upload-box { position: relative; overflow: hidden; display: grid; place-items: center; text-align: center; min-height: 180px; padding: 22px; border: 2px dashed #b9c9d5; border-radius: 16px; background: var(--soft); cursor: pointer; }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box small { color: var(--muted); margin-top: 5px; }
.camera-icon { display: grid; place-items: center; width: 44px; height: 44px; color: white; background: linear-gradient(135deg, var(--blue), var(--cyan)); border-radius: 13px; margin-bottom: 9px; }
#preview { display: none; max-height: 260px; max-width: 100%; margin-top: 14px; border-radius: 9px; object-fit: contain; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.consent input { margin-top: 3px; }
.primary { border: 0; border-radius: 12px; background: linear-gradient(110deg, var(--blue), #0856ad); color: white; padding: 15px 20px; width: 100%; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 10px 22px #0b71d930; }
.primary:disabled { opacity: .6; cursor: wait; }
.result { padding: 24px; border-radius: 14px; }
.result strong { font-size: 1.3rem; }
.result p { margin-bottom: 0; line-height: 1.5; }
.result.success { color: #07583e; background: #e7f8f1; }
.result.review { color: #744e00; background: #fff4d6; }
.result.error { color: #8a2430; background: #ffeaed; }
.demo-note { text-align: center; color: #9fb4c4; font-size: .75rem; }
.admin-body { background: #eef3f6; }
.admin-shell { max-width: 1240px; margin: auto; padding: 32px 20px; }
.admin-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.admin-header h1 { font-size: clamp(2rem, 5vw, 3.4rem); color: var(--navy); }
.admin-header a { color: var(--blue); font-weight: 750; }
.warning { margin: 24px 0; padding: 12px 15px; background: #fff2c7; border: 1px solid #f1d878; border-radius: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stats div { padding: 20px; background: white; border-radius: 14px; box-shadow: 0 4px 20px #17344b0d; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 2rem; color: var(--navy); }
.stats span { color: var(--muted); font-size: .82rem; }
.admin-toolbar { margin: 20px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-toolbar .primary { width: auto; flex: 0 0 auto; }
.search-form { display: flex; flex: 1; gap: 8px; }
.search-form input { margin: 0 !important; min-width: 260px; }
.search-form select { margin: 0; width: auto; min-width: 145px; }
.search-form button { border: 0; border-radius: 10px; padding: 0 17px; background: var(--navy); color: white; font-weight: 750; cursor: pointer; }
.draw-result { min-height: 28px; margin-bottom: 10px; }
.table-card { background: white; border-radius: 15px; box-shadow: 0 4px 24px #17344b12; overflow: hidden; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid #e7edf1; vertical-align: top; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; background: #f8fafb; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 4px; line-height: 1.4; }
.text-button { padding: 0; border: 0; color: var(--blue); background: none; font: inherit; font-weight: 750; cursor: pointer; }
.reference-link { color: var(--navy); font-weight: 850; white-space: nowrap; }
.empty-state { text-align: center; padding: 34px; color: var(--muted); }
textarea { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; font: inherit; color: var(--ink); resize: vertical; }
.detail-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.detail-header a { display: inline-block; color: var(--blue); font-weight: 750; margin-bottom: 24px; }
.detail-header h1 { color: var(--navy); font-size: clamp(1.8rem, 5vw, 3.2rem); }
.status-pill { padding: 9px 14px; border-radius: 999px; text-transform: capitalize; font-weight: 800; background: #e4ebef; }
.status-pill[data-status="eligible"] { color: #07583e; background: #dff5eb; }
.status-pill[data-status="review"] { color: #744e00; background: #fff0c4; }
.status-pill[data-status="rejected"] { color: #8a2430; background: #ffe3e7; }
.detail-grid { display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(360px, .95fr); gap: 18px; align-items: start; }
.detail-column { display: grid; gap: 18px; }
.detail-card { background: white; border-radius: 16px; padding: 22px; box-shadow: 0 4px 24px #17344b12; }
.detail-card h2 { margin: 0 0 16px; }
.detail-card .eyebrow { color: var(--cyan); margin-bottom: 6px; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.section-heading a { color: var(--blue); font-weight: 750; }
.receipt-frame { min-height: 560px; display: grid; place-items: center; padding: 16px; border-radius: 12px; background: #e8eef1; overflow: hidden; }
.receipt-frame img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 4px; box-shadow: 0 12px 30px #071f3433; }
.confidence { font-size: 1.7rem; color: var(--success); }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
.detail-list > div { padding: 11px 0; border-bottom: 1px solid #e8edf0; }
.detail-list > div:nth-child(odd) { padding-right: 12px; }
.detail-list dt { color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.detail-list dd { margin: 4px 0 0; font-weight: 700; }
.ocr-text-card { grid-column: 1 / -1; }
.ocr-text-card pre { max-height: 420px; }
dialog { width: min(700px, calc(100% - 30px)); border: 0; border-radius: 16px; padding: 24px; box-shadow: 0 20px 80px #0007; }
dialog::backdrop { background: #071f34aa; }
.close-dialog { float: right; border: 0; background: none; font-size: 1.8rem; cursor: pointer; }
pre { white-space: pre-wrap; max-height: 65vh; overflow: auto; background: var(--soft); padding: 14px; border-radius: 10px; }
.error-text { color: #a12634; }
@media (max-width: 650px) {
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .admin-header, .admin-toolbar, .detail-header { align-items: flex-start; flex-direction: column; }
  .search-form { width: 100%; flex-direction: column; }
  .search-form input, .search-form select, .search-form button { width: 100%; min-width: 0; min-height: 44px; }
  .detail-grid { grid-template-columns: 1fr; }
  .receipt-frame { min-height: 350px; }
}
