/* Asset Homez – Customer Due Diligence Form (CDD) system */
:root {
  --gold: #B6862F;
  --gold-dark: #94681c;
  --gold-soft: #f6efe2;
  --gold-line: #e5d6b8;
  --ink: #161616;
  --ink-2: #3d3d3d;
  --muted: #6f6a62;
  --line: #e4e0d8;
  --bg: #f7f5f1;
  --white: #ffffff;
  --red: #b3261e;
  --red-soft: #fdecea;
  --green: #2e7d32;
  --green-soft: #e8f3e9;
  --amber: #a15c00;
  --amber-soft: #fff4e0;
  --blue: #1d5a8c;
  --blue-soft: #e6f0f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 16, 8, .05), 0 6px 24px rgba(20, 16, 8, .06);
  --font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--gold-dark); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ok-text { color: var(--green); }
.small { font-size: 13px; }

/* ---------- top bar ---------- */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 40; border-bottom: 3px solid var(--gold); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; }
.topbar .brand img { height: 34px; display: block; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: #e9e3d8; text-decoration: none; padding: 7px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: var(--gold); color: #fff; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cfc8bb; }
.userbox .role { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; border: 1px solid #5a5040; border-radius: 4px; padding: 2px 6px; color: var(--gold); }
.userbox a { color: #cfc8bb; }
.userbox button { background: transparent; border: 1px solid #4a4a4a; color: #eee; border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; }
.userbox button:hover { border-color: var(--gold); }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

.page { max-width: 1240px; margin: 0 auto; padding: 26px 20px 120px; }
.page.narrow { max-width: 1000px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: .01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; padding: 10px 16px; font: 600 14px var(--font); cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover:not(:disabled) { background: var(--gold-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #333; }
.btn-line { background: #fff; color: var(--ink); border-color: #cfc7b8; }
.btn-line:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; padding: 6px 10px; }
.btn-ghost:hover { background: var(--gold-soft); color: var(--gold-dark); }
.btn-danger { background: #fff; color: var(--red); border-color: #e6b9b5; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 6px; }

/* ---------- cards ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #ece7dd; }
.card-pad { padding: 22px 24px; }

/* ---------- the deal form ---------- */
.sheet { background: #fff; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid #ece7dd; overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 34px 18px; flex-wrap: wrap; }
.sheet-head img { height: 64px; }
.sheet-title { text-align: right; }
.sheet-title h1 { margin: 0; color: var(--gold); font-size: 30px; line-height: 1.05; letter-spacing: .02em; font-weight: 800; }
.sheet-title .sheet-sub { color: var(--gold); font-weight: 800; letter-spacing: .12em; font-size: 16px; margin-top: 4px; }
.sheet-title p { margin: 6px 0 0; font-style: italic; color: var(--ink-2); font-size: 13.5px; }
.sheet-meta { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.sheet-body { padding: 6px 34px 34px; }

.bar { background: var(--gold); color: #fff; text-align: center; font-weight: 700; letter-spacing: .08em; font-size: 14px; text-transform: uppercase; padding: 7px 12px; border-radius: 3px; margin: 26px 0 18px; }
.bar.sub { background: var(--gold-soft); color: var(--gold-dark); text-align: left; letter-spacing: .05em; font-size: 12.5px; margin: 22px 0 12px; border-left: 3px solid var(--gold); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.grid .span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .group-label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.req { color: var(--gold); margin-left: 2px; }
.hint { color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; font: 15px var(--font); color: var(--ink); background: #fffdfa; border: 1px solid #d9d2c5; border-radius: 7px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(182, 134, 47, .16); background: #fff; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { background: var(--gold-soft); border: 1px solid #d9d2c5; border-right: 0; border-radius: 7px 0 0 7px; padding: 10px 11px; font-weight: 600; color: var(--gold-dark); font-size: 13px; display: flex; align-items: center; }
.input-prefix input { border-radius: 0 7px 7px 0; }
.err { color: var(--red); font-size: 12.5px; font-weight: 500; display: none; }
.invalid .err { display: block; }
.invalid input, .invalid select, .invalid textarea { border-color: var(--red); background: #fffafa; }
.invalid .choices { outline: 1.5px solid #e7a7a2; outline-offset: 4px; border-radius: 6px; }

/* row layout like the paper form: label on the left, options on the right */
.aml-row { display: grid; grid-template-columns: 220px 1fr; gap: 6px 18px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.aml-row:last-child { border-bottom: 0; }
.aml-row .group-label { padding-top: 8px; }
.aml-row .field { gap: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.choice { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px 8px 10px; border: 1px solid #ddd5c6; border-radius: 8px; background: #fffdfa; cursor: pointer; user-select: none; font-size: 14.5px; transition: border-color .12s, background .12s; }
.choice:hover { border-color: var(--gold); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box { width: 18px; height: 18px; border: 1.6px solid #6c655a; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: #fff; transition: all .12s; }
.choice .box::after { content: ""; width: 9px; height: 5px; border-left: 2.4px solid #fff; border-bottom: 2.4px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.choice input:checked + .box { background: var(--gold); border-color: var(--gold); }
.choice input:checked + .box::after { opacity: 1; }
.choice:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.choice input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(182,134,47,.3); }
.choice.radio .box { border-radius: 50%; }
.conditional { margin-top: 10px; animation: reveal .18s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.notice { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 8px; padding: 11px 14px; font-size: 13.5px; color: #5b4519; }
.notice.warn { background: var(--amber-soft); border-color: #f1d29d; color: #6d4100; }
.notice.danger { background: var(--red-soft); border-color: #efc0bb; color: #7a1a14; }
.notice.ok { background: var(--green-soft); border-color: #bfdcc1; color: #1e5222; }

/* ---------- document checklist / uploads ---------- */
.doc-groups { display: grid; gap: 22px; }
.doc-group h3 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.doc-group h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.doc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.doc { border: 1px solid #e3dccf; border-radius: 10px; padding: 14px; background: #fffdfa; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, background .15s; }
.doc.dragover { border-color: var(--gold); background: var(--gold-soft); border-style: dashed; }
.doc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.doc-name { font-weight: 700; font-size: 15px; }
.doc-name .tag { font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.tag.mand { background: var(--ink); color: #fff; }
.tag.opt { background: #eee8dc; color: var(--muted); }
.doc .received { padding: 6px 10px 6px 8px; font-size: 13.5px; }
.doc-state { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.doc-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-none { color: #8b857b; }
.st-ok { color: var(--green); }
.st-warn { color: var(--amber); }
.dropzone { border: 1.5px dashed #cdbf9f; border-radius: 8px; padding: 12px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; background: #fff; transition: all .15s; }
.dropzone:hover { border-color: var(--gold); color: var(--gold-dark); background: var(--gold-soft); }
.dropzone strong { color: var(--gold-dark); display: block; font-size: 14px; margin-bottom: 2px; }
.files { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; background: #fff; border: 1px solid #ebe4d6; border-radius: 7px; font-size: 13px; }
.file .ficon { width: 30px; height: 30px; border-radius: 6px; background: var(--gold-soft); color: var(--gold-dark); font-size: 9.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; letter-spacing: .03em; }
.file .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file .fmeta { color: var(--muted); font-weight: 400; font-size: 11.5px; display: block; }
.file .factions { display: flex; gap: 2px; flex: none; }
.file .factions button, .file .factions a { font-size: 12px; padding: 4px 7px; }
.progress { height: 4px; background: #eee5d3; border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--gold); width: 0; transition: width .1s; }

/* ---------- sticky action bar ---------- */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); z-index: 30; box-shadow: 0 -4px 18px rgba(0,0,0,.05); }
.actionbar-inner { max-width: 1000px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 10px; align-items: center; }
.actionbar .status-text { flex: 1; font-size: 13px; color: var(--muted); min-width: 0; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(14, 12, 8, .55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 900px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.modal.small { max-width: 480px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #faf8f4; flex-wrap: wrap; }
.preview-frame { width: 100%; height: 72vh; border: 0; background: #f1eee8; }
.preview-img { max-width: 100%; display: block; margin: 0 auto; }

/* ---------- summary (preview & deal page) ---------- */
.summary-section { margin-bottom: 22px; }
.summary-section h3 { margin: 0 0 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-dark); border-bottom: 2px solid var(--gold); padding-bottom: 6px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.kv div { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dotted #ddd5c6; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.kv .full { grid-column: 1 / -1; }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-draft { background: #f0eee9; color: #67625a; }
.s-client { background: #fdf3e1; color: #8a5a00; }
.s-clientdone { background: #e7f0ff; color: #2c4fa3; }
.s-submitted { background: var(--blue-soft); color: var(--blue); }
.s-pending { background: var(--amber-soft); color: var(--amber); }
.s-amlok { background: #e3f1f3; color: #1b6a75; }
.s-review { background: #efe8f8; color: #5b3a8c; }
.s-approved { background: var(--green-soft); color: var(--green); }
.s-rejected { background: var(--red-soft); color: var(--red); }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid #ece7dd; border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, transform .15s; text-align: left; font: inherit; color: inherit; }
.stat:hover { border-color: var(--gold); }
.stat.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--gold-soft); }
.stat .n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; padding: 14px; align-items: end; }
.filters label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
.filters input, .filters select { padding: 8px 10px; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 11px 14px; border-bottom: 2px solid var(--gold-line); background: #fcfaf6; white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid #f0ebe2; vertical-align: middle; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #fcf8f0; }
.ref { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; font-weight: 600; color: var(--gold-dark); }
.docbar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.docbar .track { width: 64px; height: 6px; border-radius: 3px; background: #eee6d6; overflow: hidden; }
.docbar .track > div { height: 100%; background: var(--green); }
.docbar.missing .track > div { background: var(--amber); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------- deal page ---------- */
.deal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.side .card + .card { margin-top: 16px; }
#docsCard { margin-top: 18px; }
#docsCard h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.doc-table .file { margin: 3px 0; }
.side h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--gold-line); margin-left: 5px; font-size: 13px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.timeline .when { color: var(--muted); font-size: 12px; }
.doc-table td { font-size: 13.5px; }
.doc-row-missing td:first-child { color: var(--amber); }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 84px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 14px; max-width: 380px; border-left: 4px solid var(--gold); animation: reveal .2s; }
.toast.error { border-left-color: #ef5350; }
.toast.ok { border-left-color: #66bb6a; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(182,134,47,.12); }
.auth-art img { width: 280px; max-width: 80%; }
.auth-art h2 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; color: #fff; font-weight: 700; }
.auth-art h2 span { color: var(--gold); }
.auth-art p { color: #bdb5a6; max-width: 420px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { margin: 0; font-size: 26px; }

/* ---------- success ---------- */
.success { text-align: center; padding: 50px 30px; }
.success .check { width: 72px; height: 72px; border-radius: 50%; background: var(--gold); margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; }
.success .check::after { content: ""; width: 26px; height: 13px; border-left: 5px solid #fff; border-bottom: 5px solid #fff; transform: rotate(-45deg) translate(2px, -3px); }
.success .refbig { font-family: ui-monospace, Consolas, monospace; font-size: 26px; font-weight: 800; color: var(--gold-dark); background: var(--gold-soft); display: inline-block; padding: 8px 18px; border-radius: 8px; margin: 10px 0 18px; border: 1px dashed var(--gold); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .deal-layout { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .menu-toggle { display: block; margin-left: auto; }
  .nav, .userbox { display: none; width: 100%; }
  .topbar.open .nav { display: flex; flex-direction: column; }
  .topbar.open .userbox { display: flex; justify-content: space-between; padding: 8px 0 4px; }
  .page { padding: 16px 12px 130px; }
  .sheet-head { padding: 20px 18px 8px; flex-direction: column; align-items: flex-start; }
  .sheet-head img { height: 48px; }
  .sheet-title { text-align: left; }
  .sheet-title h1 { font-size: 26px; }
  .sheet-meta { justify-content: flex-start; }
  .sheet-body { padding: 0 16px 24px; }
  .grid, .doc-list, .kv { grid-template-columns: 1fr; }
  .aml-row { grid-template-columns: 1fr; }
  .aml-row .group-label { padding-top: 0; }
  .kv div { grid-template-columns: 130px 1fr; }
  .actionbar-inner { flex-wrap: wrap; padding: 10px 12px; }
  .actionbar .status-text { flex-basis: 100%; }
  .actionbar .btn { flex: 1; padding: 10px 8px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 30px 24px; min-height: auto; }
  .auth-art .lead { display: none; }
  .filters { grid-template-columns: 1fr; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
}
@media print {
  .topbar, .actionbar, .no-print { display: none !important; }
  body { background: #fff; }
}

/* client self-service mode */
body.client-mode .agent-only { display: none !important; }
.client-intro { margin: 4px 0 6px; }
.success-logo { height: 56px; margin: 0 auto 18px; display: block; }
.apply-card { max-width: 760px; margin: 0 auto; }
.apply-list { padding-left: 20px; color: var(--ink-2); }
.apply-list li { margin: 6px 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
