:root {
  --brand: #9b102b;
  --brand-dark: #720b20;
  --ink: #202124;
  --muted: #68707a;
  --line: #dfe2e6;
  --canvas: #f4f5f6;
  --surface: #ffffff;
  --green: #24744b;
  --amber: #9a6812;
  --red: #a43535;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Noto Sans Thai", Arial, sans-serif; }
button, input { font: inherit; }
.page-shell { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 56px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--brand); font-size: 14px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.lookup-card, .detail-card, .application-row { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.lookup-card { padding: 30px; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 11px; font-weight: 700; }
h1 { margin: 0; font-size: 28px; line-height: 1.35; }
.intro { max-width: 640px; margin: 7px 0 24px; color: var(--muted); font-size: 14px; }
.lookup-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
input { width: 100%; height: 42px; padding: 8px 10px; border: 1px solid #cbd0d6; border-radius: 6px; background: #fff; color: var(--ink); }
input:focus { outline: 3px solid rgba(155, 16, 43, .14); border-color: var(--brand); }
button, .button-link { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 8px 15px; border: 1px solid var(--brand); border-radius: 6px; background: var(--brand); color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
button:hover, .button-link:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
button:disabled { cursor: wait; opacity: .65; }
.message { margin: 16px 0 0; font-size: 13px; font-weight: 600; }
.message.error { color: var(--red); }
.message.success { color: var(--green); }
.results-section { margin-top: 20px; }
.application-list { display: grid; gap: 10px; }
.application-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; }
.application-row strong, .application-row span { display: block; }
.application-row strong { font-size: 15px; }
.application-row span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.status { display: inline-flex; min-height: 24px; align-items: center; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.status.pending { background: #fff6df; color: var(--amber); }
.status.editing { background: #f2ebfb; color: #7040a2; }
.status.reviewing { background: #eaf1fc; color: #366ba8; }
.status.approved { background: #eaf5ef; color: var(--green); }
.status.rejected { background: #faecec; color: var(--red); }
.detail-card { margin-top: 18px; overflow: hidden; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 0; font-size: 19px; }
.detail-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button-link.secondary { background: #fff; border-color: #cbd0d6; color: #42464d; }
.button-link.secondary:hover { border-color: var(--brand); color: var(--brand); }
.recall-button { background: #fff; border-color: #8d5b18; color: #70440e; }
.recall-button:hover { background: #fff8e9; border-color: #70440e; color: #59350a; }
.detail-body { padding: 20px; }
.notice { margin: 0 0 18px; padding: 12px; border-left: 3px solid var(--brand); background: #faf2f4; font-size: 13px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.info-item { min-height: 72px; padding: 12px; border-bottom: 1px solid var(--line); }
.info-item:nth-child(odd) { border-right: 1px solid var(--line); }
.info-item:nth-last-child(-n + 2) { border-bottom: 0; }
.info-item span, .info-item strong { display: block; }
.info-item span { color: var(--muted); font-size: 11px; }
.info-item strong { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 15px; }
.file-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) { .page-shell { width: min(100% - 20px, 960px); padding-top: 16px; } .lookup-card { padding: 20px; } h1 { font-size: 23px; } .lookup-form { grid-template-columns: 1fr; } .application-row, .detail-head { align-items: stretch; flex-direction: column; } .info-grid { grid-template-columns: 1fr; } .info-item:nth-child(odd) { border-right: 0; } .info-item:nth-last-child(2) { border-bottom: 1px solid var(--line); } }
