:root {
  /* Ledger theme: near-black chrome, light work surface, deep green actions, bright green highlights */
  --black: #0a0f0b;
  --black-2: #151c17;
  --black-3: #2a332d;
  --green: #0e7a3d;
  --green-dark: #0a5c2e;
  --green-hi: #2bd46a;
  --green-soft: #ddf5e5;
  --ink: #0f1511;
  --muted: #5b655e;
  --line: #e3e8e4;
  --line-2: #cbd4ce;
  --bg: #f4f6f4;
  --card: #ffffff;
  --tint: #f1f4f2;
  --ok: #0e7a3d;
  --ok-bg: #ddf5e5;
  --warn: #7a4e00;
  --warn-bg: #fff3d1;
  --err: #9a2b12;
  --err-line: #c2410c;
  --err-bg: #fde6df;
  /* legacy aliases still referenced by inline styles in the JS */
  --navy: var(--ink);
  --navy-2: var(--green);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --focus: 0 0 0 3px rgba(43, 212, 106, .45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar { background: var(--black); color: #fff; }
.topbar .in { max-width: 1240px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 14px; }
.topbar .logo { width: 38px; height: 38px; border-radius: 10px; flex: none; object-fit: contain; }
.topbar .brand { font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.25; min-width: 0; }
.topbar .brand small { display: block; font-weight: 500; color: #8fa095; font-size: 12.5px; letter-spacing: 0; }
.topbar .sp { flex: 1; }
.topbar .date, .topbar .who { font-size: 13px; color: #b9c2bc; }
.topbar button.link { background: transparent; border: 1px solid var(--black-3); color: #fff; min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.topbar button.link:hover { background: var(--black-2); border-color: #3a453e; }
@media (max-width: 640px) { .topbar .who { display: none; } }
.topbar a.link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); color: #fff; font-weight: 600; font-size: 13.5px; text-decoration: none; border: 1px solid transparent; }
.topbar a.link:hover { background: var(--black-2); border-color: var(--black-3); color: #fff; }
/* Uploaded tenant logos sit on a white chip so dark artwork stays visible on the black bar */
.topbar .logo.custom { width: auto; max-width: 150px; background: #fff; padding: 4px 6px; }

/* ---------- compose email ---------- */
.modal.wide { max-width: 760px; }
.email-meta { display: grid; gap: 2px; background: var(--tint); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.email-meta div { display: flex; gap: 10px; min-width: 0; }
.email-meta span { flex: 0 0 64px; color: var(--muted); font-weight: 600; }
.email-meta b { min-width: 0; overflow-wrap: anywhere; }
.email-frame { display: block; width: 100%; height: min(52vh, 560px); border: 1px solid var(--line); border-radius: 12px; background: #f4f6f4; }
.email-steps { margin: 12px 0 0; padding-left: 20px; font-size: 13px; color: var(--muted); }
.email-steps li { margin: 2px 0; }
kbd { font-family: var(--mono); font-size: 11.5px; background: var(--tint); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; }
@media (max-width: 640px) { .modal.wide .row .btn { flex: 1 1 100%; } }

/* ---------- settings ---------- */
.panel-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.logo-preview { height: 120px; border-radius: 12px; background: var(--black); display: grid; place-items: center; padding: 20px; transition: opacity .15s; }
.logo-preview img { max-width: 100%; max-height: 72px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px 10px; }
.logo-preview .logo-ph { width: 64px; height: 64px; border-radius: 16px; background: var(--black-2); border: 1px dashed var(--black-3); color: #8fa095; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.logo-preview.busy { opacity: .5; }
.help-text { font-size: 12.5px; color: var(--muted); margin: 12px 0; }
.logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-actions .btn { flex: 1 1 auto; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 24px 120px; }
.form-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 24px; align-items: start; }

/* ---------- wizard steps ---------- */
.steps { position: sticky; top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.steps h4 { margin: 4px 8px 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.step { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 12px; padding: 7px 10px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--ink); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; transition: background .15s; }
.step:hover { background: var(--tint); }
.step.current { background: var(--black); color: #fff; font-weight: 700; }
.step .dot { width: 30px; height: 30px; border-radius: 8px; background: var(--tint); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--muted); flex: none; transition: background .15s, color .15s; }
.step.done .dot { background: var(--green-soft); color: var(--green-dark); }
.step.bad .dot { background: var(--err-bg); color: var(--err); }
.step.current .dot { background: var(--green-hi); color: var(--black); }

@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; gap: 14px; }
  .steps { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px; }
  .steps h4, .step .st { display: none; }
  .step { width: auto; min-height: 0; padding: 0; background: none !important; }
  .step .dot { width: 34px; height: 34px; }
  .step.current .dot { box-shadow: 0 0 0 2px var(--black); }
  .steps .progress { flex-basis: 100%; margin-top: 10px; }
}

#form { overflow-x: clip; min-width: 0; }
.section.slide-next { animation: slideNext .32s cubic-bezier(.2,.7,.2,1); }
.section.slide-prev { animation: slidePrev .32s cubic-bezier(.2,.7,.2,1); }
@keyframes slideNext { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes slidePrev { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .section.slide-next, .section.slide-prev { animation: none; } }
.section > header .stepno { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--green); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

/* ---------- review step ---------- */
.review-summary { padding: 18px 24px 0; }
.review-summary:empty { display: none; }
.review { padding: 18px 24px 24px; display: grid; gap: 12px; }
.rv-sec { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rv-sec.bad { border-color: #f0c3b5; }
.rv-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fafbfa; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rv-head .letter { width: 28px; height: 28px; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.rv-sec.bad .rv-head .letter { background: var(--err-bg); color: var(--err); }
.rv-head h3 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; min-width: 140px; }
.rv-sec .kv { padding: 4px 14px 10px; font-size: 13.5px; }
.rv-sec .kv .missing { color: var(--err); font-weight: 600; }
.rv-sec .kv .na { color: #9aa49d; }
.rv-sec .kv .rm { display: block; font-size: 12px; color: var(--warn); }
.progress { margin-top: 14px; padding: 0 8px 4px; }
.progress .bar { height: 8px; background: var(--tint); border-radius: 4px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--green-hi); width: 0; transition: width .3s; border-radius: 4px; }
.progress small { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }

/* ---------- page header ---------- */
.title { margin: 0 0 6px; font-size: clamp(24px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.eyebrow { display: block; font-size: 12px; font-weight: 700; color: var(--green); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.subtitle { margin: 0 0 22px; color: var(--muted); max-width: 70ch; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--black); color: #fff; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.meta div { padding: 14px 18px; box-shadow: 1px 0 0 var(--black-3), 0 1px 0 var(--black-3); }
.meta label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8fa095; font-weight: 600; margin-bottom: 2px; }
.meta span { font-weight: 700; word-break: break-word; }

.banner { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; border: 1px solid; }
.banner.warn { background: var(--warn-bg); border-color: #f0d38a; color: #5c3b00; }
.banner.ok { background: var(--ok-bg); border-color: #a9e2bf; color: #0a4a26; }
.banner.err { background: var(--err-bg); border-color: #f0c3b5; color: #7a1f0d; }
.banner h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner li a { color: inherit; }

/* ---------- sections ---------- */
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; scroll-margin-top: 16px; }
.section > header { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.section > header .letter { width: 36px; height: 36px; border-radius: 10px; background: var(--black); color: var(--green-hi); display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.section > header h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.section .intro { padding: 16px 24px 0; margin: 0; color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; padding: 18px 24px 24px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.field { padding: 8px 0; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field .lbl { display: flex; align-items: baseline; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .num { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 500; min-width: 20px; }
.field .req { color: var(--err); font-weight: 700; }
.field .pint { margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 500; color: #3a433d; background: var(--tint); border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=tel], .field input[type=date], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 11px 14px; background: #fff; min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b655e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.field textarea { min-height: 104px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #aab5ad; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }
.field input:disabled, .field select:disabled { background: var(--tint); color: #4a524c; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .msg { font-size: 12.5px; font-weight: 600; color: var(--err); margin-top: 5px; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border: 2px solid var(--err-line); background-color: #fff8f5; }
.field.invalid .msg { display: block; }
.field.warning .msg { display: block; color: var(--warn); }
.field .rmk-toggle { background: none; border: 0; color: var(--green); font-size: 12.5px; font-weight: 600; padding: 6px 0 0; cursor: pointer; }
.field .rmk { margin-top: 6px; }
.field .rmk input { font-size: 13.5px; min-height: 40px; padding: 8px 12px; background: #fafbfa; border-style: dashed; }
.field.flash { animation: flash 1.2s; border-radius: var(--radius-sm); }
@keyframes flash { 0%, 40% { background: var(--green-soft); } 100% { background: transparent; } }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 500; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.check:has(input:checked) { border: 2px solid var(--green); background: #eefaf2; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--green); flex: none; }
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; }

.declaration-text { margin: 18px 24px 0; padding: 16px 18px; background: #fafbfa; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }

/* ---------- files ---------- */
.drop { border: 1.5px dashed #b4c0b8; border-radius: 12px; padding: 20px 16px; text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer; background: #fafbfa; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--green); background: #eefaf2; color: var(--green-dark); }
.files { list-style: none; margin: 8px 0 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 6px; font-size: 13.5px; background: #fff; }
.files li::before { content: "FILE"; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--tint); color: var(--green); font-size: 9.5px; font-weight: 800; display: grid; place-items: center; }
.files li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.files li .nm a { color: var(--ink); text-decoration: none; }
.files li .nm a:hover { color: var(--green); text-decoration: underline; }
.files li small { color: var(--muted); }
.files li button { background: none; border: 0; color: var(--err); cursor: pointer; font-size: 13px; font-weight: 600; min-height: 36px; padding: 0 6px; }
.files li.busy { opacity: .6; }

/* ---------- action bar ---------- */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); z-index: 10; }
.actionbar .in { max-width: 1240px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actionbar .status { flex: 1; color: var(--muted); font-size: 13.5px; min-width: 160px; }

/* ---------- buttons ---------- */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); padding: 0 18px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: #9aa69e; color: var(--ink); }
.btn.primary { background: var(--black); color: #fff; border-color: var(--black); }
.btn.primary:hover { background: #1c241f; border-color: #1c241f; color: #fff; }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ok:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn.danger { color: var(--err); border-color: #f0c3b5; }
.btn.danger:hover { background: var(--err-bg); color: var(--err); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- read-only view ---------- */
.ro { white-space: pre-wrap; padding: 10px 0 4px; border-bottom: 1px dashed var(--line); min-height: 32px; font-weight: 500; }
.ro.empty { color: #9aa49d; font-weight: 400; }

/* ---------- toast & modal ---------- */
.toast { position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 8px); background: var(--black); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 50; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(10,15,11,.25); border-left: 4px solid var(--green-hi); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-bg { position: fixed; inset: 0; background: rgba(10,15,11,.55); display: grid; place-items: center; z-index: 40; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 18px; max-width: 540px; width: 100%; padding: 26px; box-shadow: 0 24px 64px rgba(0,0,0,.3); max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 10px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.modal .field input, .modal .field textarea, .modal .field select { width: 100%; }
.modal input[type=file] { width: 100%; padding: 14px; border: 1.5px dashed #b4c0b8; border-radius: 12px; background: #fafbfa; }

.done-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 44px 28px; text-align: center; max-width: 620px; margin: 30px auto; }
.done-card .tick { width: 64px; height: 64px; border-radius: 18px; background: var(--black); color: var(--green-hi); display: grid; place-items: center; font-size: 30px; font-weight: 800; margin: 0 auto 16px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--tint); color: #3a433d; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.Pending { background: #eef1ef; color: #3a433d; }
.pill.In.Progress { background: var(--warn-bg); color: var(--warn); }
.pill.Submitted { background: var(--black); color: #fff; }
.pill.Submitted::before { background: var(--green-hi); }
.pill.Returned { background: var(--err-bg); color: var(--err); }
.pill.Approved { background: var(--ok-bg); color: var(--green-dark); }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 6px; min-height: 92px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.stat:hover { border-color: #aab5ad; }
.stat.active { background: var(--black); border-color: var(--black); color: #fff; }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stat.active span { color: #b9c2bc; }
.stat span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green-hi); }
.stat[data-status="Pending"] span::before { background: #8a948d; }
.stat[data-status="In Progress"] span::before { background: #e0a100; }
.stat[data-status="Submitted"] span::before { background: var(--black); }
.stat.active[data-status="Submitted"] span::before { background: #fff; }
.stat[data-status="Returned"] span::before { background: #d8512b; }
.stat[data-status="Approved"] span::before { background: #16a34a; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 220px; min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 14px 0 42px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235b655e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 14px center; }
.toolbar input[type=search]:focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 14px 14px; border-bottom: 1px solid #edf1ee; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th { background: #fafbfa; font-weight: 700; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; transition: background .1s; }
tbody tr:hover { background: #f7faf8; }
td.nowrap { white-space: nowrap; }
td small { color: var(--muted); }
.ref { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.cust { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: #eef2ef; color: var(--black); font-weight: 800; font-size: 12.5px; display: grid; place-items: center; flex: none; }
.prog { display: flex; align-items: center; gap: 10px; }
.prog .bar { width: 80px; height: 6px; border-radius: 3px; background: #e6ece8; overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.prog small { font-variant-numeric: tabular-nums; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 15.5px; font-weight: 700; }
.panel.dark { background: var(--black); border-color: var(--black); color: #fff; }
.panel.dark h3 { color: #b9c2bc; font-size: 14px; }
.panel.dark .btn { background: transparent; border-color: var(--black-3); color: #fff; }
.panel.dark .btn:hover { background: var(--black-2); }
.panel.dark .btn.hi { background: var(--green-hi); border-color: var(--green-hi); color: var(--black); }
.kv { display: grid; grid-template-columns: minmax(140px, 40%) 1fr; gap: 0; font-size: 14px; }
.kv > div { padding: 9px 0; border-bottom: 1px solid #f1f4f2; min-width: 0; word-break: break-word; }
.kv .k { color: var(--muted); padding-right: 12px; }
.kv .k + div { font-weight: 600; }
.kv .k .pint { font-family: var(--mono); font-size: 10.5px; color: #3a433d; background: var(--tint); padding: 1px 5px; border-radius: 4px; }
.kv .rm { display: block; font-size: 12.5px; font-weight: 500; color: var(--warn); }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv .k { border-bottom: 0; padding-bottom: 0; } }
.linkbox { display: flex; gap: 6px; }
.linkbox input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; border: 1px solid var(--black-3); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--black-2); color: var(--green-hi); }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.timeline li { padding: 8px 0 8px 20px; border-left: 2px solid var(--line); position: relative; margin-left: 4px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #fff; }
.timeline small { color: var(--muted); display: block; }
.issues { font-size: 13.5px; margin: 0; padding-left: 18px; color: var(--err); }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-bottom: 10px; text-decoration: none; font-size: 14px; font-weight: 600; }
.head-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.head-row .avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--black); color: var(--green-hi); font-size: 18px; }

/* ---------- login ---------- */
body.auth { background: var(--black); }
body.auth .topbar { background: transparent; }
.login { max-width: 420px; margin: 8vh auto; background: var(--black-2); border: 1px solid var(--black-3); color: #fff; padding: 32px 28px; border-radius: 20px; }
.login h3 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: #fff; }
.login .lead { margin: 0 0 22px; color: #a7b3ab; font-size: 14.5px; }
.login .field .lbl { color: #dde4df; }
.login .field input { background: var(--black); border-color: var(--black-3); color: #fff; }
.login .field input:focus { border-color: var(--green-hi); }
.login .btn.primary { background: var(--green-hi); border-color: var(--green-hi); color: var(--black); font-weight: 800; min-height: 52px; font-size: 15.5px; }
.login .btn.primary:hover { background: #4fe085; border-color: #4fe085; color: var(--black); }
.login a { color: var(--green-hi); }
.login p { color: #a7b3ab !important; }

@media print {
  .topbar, .steps, .actionbar, .rmk-toggle, .drop, .files button, .btn { display: none !important; }
  body { background: #fff; }
  .form-layout { display: block; }
  .section { break-inside: avoid; }
  .meta { background: #fff; color: var(--ink); border: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .topbar .in { padding: 12px 16px; }
  .topbar .date { display: none; }
  .wrap { padding: 18px 16px 108px; }
  .section > header { padding: 16px; }
  .section > header .stepno { display: none; }
  .section .intro { padding: 14px 16px 0; }
  .grid { padding: 14px 16px 18px; }
  .declaration-text { margin: 14px 16px 0; }
  .review, .review-summary { padding-left: 16px; padding-right: 16px; }
  .field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field input[type=date], .field select, .field textarea { font-size: 16px; min-height: 52px; }
  .actionbar .status { display: none; }
  .actionbar .in { flex-wrap: nowrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 8px; }
  .actionbar .btn { flex: 1; min-height: 52px; padding: 0 8px; font-size: 15px; }
  .actionbar #btnBack { flex: 0 0 52px; font-size: 0; }
  .actionbar #btnBack::before { content: "←"; font-size: 18px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { min-height: 76px; padding: 12px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 11.5px; }
  .topbar .brand small { display: none; }
  .topbar .logo { width: 34px; height: 34px; }
  .topbar button.link { white-space: nowrap; }
  .topbar a.link { padding: 0 10px; white-space: nowrap; }
  .topbar .brand { flex: 1 1 auto; }
  .topbar .brand > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .sp { display: none; }
  /* With an uploaded logo, the logo identifies the company; drop the name to keep the bar on one line */
  .topbar .logo.custom + .brand { display: none; }
  .topbar .logo.custom ~ .sp { display: block; }
  .topbar .logo.custom { max-width: 96px; }
  .toolbar > .btn { flex: 1 1 calc(50% - 5px); white-space: normal; text-align: center; line-height: 1.25; font-size: 13px; padding: 6px 10px; }
  .toolbar > #bNew { flex-basis: 100%; font-size: 14.5px; min-height: 48px; }
  .toolbar input[type=search] { flex-basis: 100%; font-size: 16px; min-height: 48px; }
  .head-row .btn { flex: 1 1 100%; }
  .meta { grid-template-columns: 1fr 1fr; }

  /* Requests table becomes a card list */
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 14px; }
  .table-wrap td { border: 0; padding: 0 !important; }
  .table-wrap td[data-c="ref"], .table-wrap td[data-c="acct"], .table-wrap td[data-c="email"] { display: none; }
  .table-wrap td[data-c="cust"] { padding-right: 96px !important; }
  .table-wrap td[data-c="status"] { position: absolute; top: 14px; right: 14px; }
  .table-wrap td[data-c="prog"] { margin-top: 12px; }
  .table-wrap td[data-c="prog"] .bar { flex: 1; width: auto; }
  .table-wrap td[data-c="date"] { font-size: 12px; color: var(--muted); margin-top: 6px; }
  .table-wrap td[data-c="act"] { margin-top: 10px; }
  .table-wrap td[data-c="act"] .btn { width: 100%; }
}
