/* Verpo agency dashboard + lender report. One stylesheet; class names are shared with the JS modules. */
:root {
  --navy:#0B1D3A; --ink:#0F1B2E; --text:#26354A; --muted:#5B6B82; --faint:#8A98AC;
  /* "blue" names kept for the JS modules; the accent is now teal */
  --blue:#0D9488; --blue-d:#0F766E; --blue-s:#E7F8F3; --blue-line:#BFE9DB;
  --teal-l:#5EEAD4; --grad:linear-gradient(135deg, #0F766E 0%, #0D9488 50%, #10B981 100%);
  --line:#E2EAE8; --line2:#D0DCD9; --bg:#F3F7F6; --surface:#FFFFFF; --hover:#F3F9F7;
  --green:#0E7A55; --green-s:#E5F5EE; --amber:#9A5408; --amber-s:#FDF2E1; --red:#B42318; --red-s:#FDECEA; --grey-s:#EFF2F6;
  --display:"Plus Jakarta Sans", system-ui, sans-serif;
  --body:"Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg:16px; --r:12px; --r-sm:9px;
  --shadow:0 1px 2px rgba(15,27,46,.04), 0 1px 1px rgba(15,27,46,.02);
  --shadow-pop:0 24px 48px -20px rgba(15,27,46,.35), 0 8px 16px -10px rgba(15,27,46,.15);
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family:var(--body); color:var(--text); background:var(--bg); font-size:14.5px; line-height:1.5; -webkit-font-smoothing:antialiased; }
a { color:var(--blue); text-decoration:none; } a:hover { text-decoration:underline; }
[hidden] { display:none !important; }
:focus-visible { outline:3px solid rgba(13,148,136,.4); outline-offset:2px; border-radius:6px; }

/* ---------------------------------------------------------------- app shell */
.shell { display:grid; grid-template-columns:260px minmax(0, 1fr); min-height:100vh; }
.side { position:sticky; top:0; height:100vh; overflow-y:auto; background:linear-gradient(185deg, #0B1D3A 0%, #0B2A3D 55%, #0D3A42 100%); color:#C9D8DE; display:flex; flex-direction:column; padding:20px 14px 16px; gap:18px; z-index:40; }
.side .brand-link { display:flex; align-items:center; gap:11px; padding:2px 8px; color:#fff; text-decoration:none; }
.side .brand-link:hover { text-decoration:none; }
.brand-text { display:flex; flex-direction:column; line-height:1; }
.side .brand { font-family:var(--display); font-weight:800; font-size:21px; letter-spacing:-.02em; }
.brand-sub { font-size:11px; font-weight:600; color:var(--teal-l); margin-top:4px; white-space:nowrap; }
.org { display:flex; align-items:center; gap:10px; padding:10px; border:1px solid rgba(255,255,255,.09); border-radius:var(--r); background:rgba(255,255,255,.05); min-width:0; }
.org .avatar { flex:none; width:34px; height:34px; border-radius:10px; background:var(--grad); color:#fff; display:grid; place-items:center; font-family:var(--display); font-weight:800; font-size:15px; box-shadow:0 6px 14px -8px rgba(16,185,129,.8); }
.org .tag { font-size:13.5px; font-weight:600; color:#fff; line-height:1.3; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.side nav { display:flex; flex-direction:column; gap:3px; flex:1; min-height:0; }
.side nav .label { font-size:11.5px; font-weight:700; color:#6F8A97; padding:6px 10px 4px; }
.side nav a { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:11px; color:#C9D8DE; font-weight:500; font-size:14.5px; text-decoration:none; position:relative; transition:background .12s, color .12s; }
.side nav a svg { flex:none; color:#7D9AA7; transition:color .12s; }
.side nav a:hover { background:rgba(255,255,255,.06); color:#fff; text-decoration:none; }
.side nav a:hover svg { color:#C9D8DE; }
.side nav a.on { background:linear-gradient(90deg, rgba(45,212,191,.22), rgba(45,212,191,.08)); color:#fff; font-weight:600; box-shadow:inset 0 0 0 1px rgba(94,234,212,.18); }
.side nav a.on svg { color:var(--teal-l); }
.side nav a.on::before { content:""; position:absolute; left:-14px; top:9px; bottom:9px; width:4px; border-radius:0 4px 4px 0; background:var(--teal-l); }
.side nav .sep { height:1px; background:rgba(255,255,255,.08); margin:10px 6px; }
.side nav .grow { flex:1; }
.side nav button.ghost { justify-content:flex-start; width:100%; height:42px; padding:0 12px; color:#C9D8DE; font-weight:500; gap:12px; border-radius:11px; }
.side nav button.ghost svg { color:#7D9AA7; }
.side nav button.ghost:hover { background:rgba(255,255,255,.06); color:#fff; }
.side .badge { background:#F43F5E; }
.content { min-width:0; background:radial-gradient(1100px 380px at 30% -120px, rgba(16,185,129,.10), rgba(16,185,129,0) 70%); }
main#app { max-width:1240px; margin:0 auto; padding:32px 40px 80px; display:grid; gap:20px; align-content:start; }

/* phone header + drawer (hidden on larger screens) */
.mbar { display:none; }
.scrim { display:none; }

/* signed out: no sidebar, centred card on a quiet backdrop */
.shell:has(#nav[hidden]) { grid-template-columns:1fr; background:radial-gradient(900px 420px at 50% -6%, #DDF4EC 0%, rgba(221,244,236,0) 70%); }
.shell:has(#nav[hidden]) .side { position:static; height:auto; overflow:visible; background:transparent; padding:28px 24px 0; align-items:center; color:var(--ink); }
.shell:has(#nav[hidden]) .side .brand-link { color:var(--navy); }
.shell:has(#nav[hidden]) .brand-sub { color:var(--blue-d); }
.shell:has(#nav[hidden]) .org { display:none; }
.shell:has(#nav[hidden]) .content { background:none; }
.shell:has(#nav[hidden]) .mbar { display:none !important; }

@media (max-width: 1080px) {
  .shell { grid-template-columns:224px minmax(0, 1fr); }
  main#app { padding:26px 24px 72px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns:1fr; }
  .side { position:fixed; left:0; top:0; bottom:0; width:min(84vw, 290px); height:auto; transform:translateX(-102%); transition:transform .22s ease; box-shadow:24px 0 48px -24px rgba(11,29,58,.6); }
  .shell.open .side { transform:none; }
  .shell.open .scrim { display:block; position:fixed; inset:0; background:rgba(11,29,58,.45); z-index:30; }
  .mbar { display:flex; align-items:center; gap:12px; position:sticky; top:0; z-index:20; padding:10px 14px; background:linear-gradient(90deg, #0B1D3A, #0D3A42); color:#fff; }
  .mbar .brand-link { display:flex; align-items:center; gap:10px; color:#fff; font-weight:800; font-size:18px; letter-spacing:-.02em; text-decoration:none; }
  .mbar button { height:40px; width:40px; padding:0; background:rgba(255,255,255,.08); box-shadow:none; border-radius:10px; }
  .mbar button:hover { background:rgba(255,255,255,.14); }
  main#app { padding:20px 16px 64px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition:none; } }

/* ---------------------------------------------------------------- lender report header (report.html) */
.top { background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:1000; }
.bar { max-width:1180px; margin:0 auto; padding:14px 24px; display:flex; align-items:center; gap:14px; }
.top .brand-link { display:flex; align-items:center; gap:10px; color:var(--navy); text-decoration:none; margin-right:auto; }
.top .brand { font-family:var(--display); font-weight:700; font-size:21px; letter-spacing:-.02em; }
.top .tag { font-size:13.5px; color:var(--muted); border-left:1px solid var(--line); padding-left:12px; }
body > main#app { max-width:1180px; padding:28px 24px 80px; }

/* ---------------------------------------------------------------- type */
h1 { font-family:var(--display); font-size:28px; line-height:1.15; letter-spacing:-.025em; font-weight:800; color:var(--ink); margin:0; }
h2 { font-family:var(--display); font-size:18px; line-height:1.3; letter-spacing:-.01em; font-weight:700; color:var(--ink); margin:0 0 14px; }
h3 { font-size:15px; font-weight:600; color:var(--ink); margin:0; }
.muted { color:var(--muted); font-size:14px; line-height:1.55; }
.small { font-size:13px; }
strong { color:var(--ink); font-weight:600; }

/* ---------------------------------------------------------------- layout primitives */
.card { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:22px; box-shadow:0 1px 2px rgba(15,27,46,.04), 0 12px 28px -24px rgba(11,58,66,.35); min-width:0; }
.card > h2:first-child { margin-top:-2px; }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.spread { justify-content:space-between; }
main#app > .row.spread:first-child { align-items:flex-end; padding-bottom:4px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.grid3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
@media (max-width: 960px) { .grid2, .grid3 { grid-template-columns:1fr; } }
.form { display:grid; gap:16px; }

/* ---------------------------------------------------------------- controls */
button, .btn { font:inherit; font-weight:600; font-size:14.5px; height:40px; padding:0 16px; border-radius:10px; border:1px solid transparent; background:var(--grad); color:#fff; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; white-space:nowrap;
  box-shadow:0 6px 14px -8px rgba(13,148,136,.75), inset 0 1px 0 rgba(255,255,255,.16); transition:background .12s, border-color .12s, box-shadow .12s; }
button:hover, .btn:hover { background:var(--grad); filter:brightness(1.06); text-decoration:none; }
button:active, .btn:active { transform:translateY(.5px); }
button.secondary, .btn.secondary { background:var(--surface); color:var(--ink); border-color:var(--line2); box-shadow:var(--shadow); }
button.secondary:hover, .btn.secondary:hover { background:var(--hover); border-color:#9FD8CC; filter:none; }
button.ghost { background:transparent; color:var(--muted); height:34px; padding:0 10px; box-shadow:none; font-weight:500; }
button.ghost:hover { background:var(--grey-s); color:var(--ink); filter:none; }
button.danger { background:var(--surface); color:var(--red); border-color:#F1C7C2; box-shadow:var(--shadow); }
button.danger:hover { background:var(--red-s); filter:none; }
button.dangerfill { background:var(--red); box-shadow:0 1px 2px rgba(180,35,24,.3); } button.dangerfill:hover { background:#912018; }
button:disabled, .btn[aria-disabled="true"] { opacity:.5; cursor:not-allowed; }

label { display:grid; gap:6px; font-size:13px; font-weight:600; color:var(--text); }
input, select, textarea { font:inherit; font-weight:400; font-size:14.5px; color:var(--ink); padding:9px 12px; min-height:40px; border:1px solid var(--line2); border-radius:10px; background:var(--surface); width:100%; transition:border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color:#9AA7B8; }
input:hover, select:hover, textarea:hover { border-color:#BFC9D7; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(13,148,136,.16); }
input[type=checkbox], input[type=radio] { width:16px; height:16px; min-height:0; accent-color:var(--blue); }
select { appearance:none; padding-right:34px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B6B82' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; }
textarea { min-height:88px; resize:vertical; line-height:1.5; }
label.inline { display:inline-flex; flex-direction:row; align-items:center; gap:8px; font-weight:500; color:var(--ink); }
label.inline input[type=checkbox] { width:16px; }
label.inline input[type=number] { width:90px; }
.filters input, .filters select { height:40px; }
details > summary { list-style:none; } details > summary::-webkit-details-marker { display:none; }
details > summary::after { content:"+"; float:right; color:var(--faint); font-weight:500; }
details[open] > summary::after { content:"–"; }

/* ---------------------------------------------------------------- status */
.pill { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; padding:3px 10px 3px 8px; border-radius:999px; white-space:nowrap; line-height:1.4; border:1px solid transparent; }
.pill::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.9; }
.pill.green { background:var(--green-s); color:var(--green); border-color:#C9EBDC; }
.pill.amber { background:var(--amber-s); color:var(--amber); border-color:#F6DDB6; }
.pill.red { background:var(--red-s); color:var(--red); border-color:#F5CCC7; }
.pill.grey { background:var(--grey-s); color:#3D4B60; border-color:#E1E6ED; }
.pill.blue { background:var(--blue-s); color:var(--blue-d); border-color:var(--blue-line); }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot.green { background:#12A06E; } .dot.amber { background:#E5930F; } .dot.red { background:#E5483A; } .dot.grey { background:#9AA7B8; } .dot.blue { background:#14B8A6; }
.badge { display:inline-grid; place-items:center; min-width:19px; height:19px; padding:0 6px; border-radius:10px; background:var(--red); color:#fff; font-size:11px; font-weight:700; margin-left:auto; }
.banner { border-radius:var(--r); padding:12px 14px; display:flex; gap:12px; align-items:flex-start; border:1px solid transparent; font-size:14px; }
.banner.green { background:var(--green-s); border-color:#C9EBDC; color:#0B5A3F; }
.banner.amber { background:var(--amber-s); border-color:#F6DDB6; color:#7A4306; }
.banner.red { background:var(--red-s); border-color:#F5CCC7; color:#8E1C12; }
.banner.grey { background:#F7F9FC; border-color:var(--line); }
.banner a { font-weight:600; }

/* ---------------------------------------------------------------- tables */
.tablewrap { overflow-x:auto; padding:0; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; font-size:12.5px; font-weight:700; color:var(--muted); padding:12px 16px; background:#F5FAF9; border-bottom:1px solid var(--line); white-space:nowrap; }
td { padding:13px 16px; border-bottom:1px solid #EDF1F6; vertical-align:middle; }
tbody tr:last-child td { border-bottom:0; }
tr.click { cursor:pointer; } tr.click:hover td { background:var(--hover); }
.card.tablewrap th:first-child { border-top-left-radius:var(--r-lg); } .card.tablewrap th:last-child { border-top-right-radius:var(--r-lg); }

/* ---------------------------------------------------------------- overview */
.kpis { display:grid; grid-template-columns:repeat(6, 1fr); gap:12px; }
@media (max-width: 1180px) { .kpis { grid-template-columns:repeat(3, 1fr); } }
@media (max-width: 560px) { .kpis { grid-template-columns:repeat(2, 1fr); } }
.kpi { position:relative; overflow:hidden; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:18px 16px 16px; text-decoration:none; color:var(--ink); display:grid; gap:6px; box-shadow:var(--shadow); transition:border-color .12s, box-shadow .12s; }
.kpi:hover { border-color:#9FD8CC; box-shadow:0 12px 24px -16px rgba(13,148,136,.55); text-decoration:none; }
.kpi .n { font-family:var(--display); font-size:30px; font-weight:800; line-height:1; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.kpi .l { font-size:13px; color:var(--muted); }
.kpi::after { content:""; position:absolute; left:0; right:0; top:0; height:3px; background:var(--grad); opacity:.85; }
.kpi.amber::after { background:#E5930F; } .kpi.amber .n { color:var(--amber); }
.kpi.red::after { background:#E5483A; } .kpi.red .n { color:var(--red); }
.kpi.green .n { color:var(--green); } .kpi.green::after { background:#10B981; }
.stats { display:grid; grid-template-columns:1fr 1fr; gap:18px 20px; }
.stats div { display:grid; gap:2px; padding-left:12px; border-left:3px solid #BFE9DB; }
.stats .n { font-family:var(--display); font-size:26px; font-weight:800; color:var(--ink); letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.stats .l { font-size:13px; color:var(--muted); }
.listrow { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:11px 10px; margin:0 -10px; border-radius:10px; text-decoration:none; color:var(--ink); border-bottom:1px solid #EDF1F6; }
a.listrow:hover { background:var(--hover); text-decoration:none; }
.listrow:last-child { border-bottom:0; }
.timeline { display:grid; gap:0; max-height:400px; overflow:auto; }
.tl { display:flex; gap:12px; align-items:baseline; padding:8px 0; font-size:14px; text-decoration:none; color:var(--ink); border-bottom:1px dashed #EDF1F6; }
.tl:hover { text-decoration:none; color:var(--blue-d); }
.tl .dot { flex:0 0 8px; transform:translateY(-1px); }

/* ---------------------------------------------------------------- tabs */
.tabs { display:flex; gap:2px; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.tab { padding:10px 14px; text-decoration:none; color:var(--muted); font-weight:600; font-size:14px; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tab:hover { color:var(--ink); text-decoration:none; }
.tab.on { color:var(--blue-d); border-bottom-color:var(--blue); }
.tab .count { font-weight:600; font-size:12px; background:var(--grey-s); border-radius:9px; padding:1px 7px; margin-left:6px; color:var(--muted); }
.tab.on .count { background:var(--blue-s); color:var(--blue-d); }
.bulkbar { display:flex; align-items:center; gap:10px; background:var(--blue-s); border:1px solid var(--blue-line); border-radius:var(--r); padding:8px 12px; font-weight:600; color:var(--blue-d); }

/* ---------------------------------------------------------------- case pages */
.map { height:340px; border-radius:var(--r); overflow:hidden; border:1px solid var(--line); }
dl { display:grid; grid-template-columns:max-content 1fr; gap:10px 20px; margin:0; font-size:14px; }
dt { color:var(--muted); } dd { margin:0; color:var(--ink); }
.photo { border:1px solid var(--line); border-radius:var(--r); overflow:hidden; background:var(--surface); display:flex; flex-direction:column; box-shadow:var(--shadow); }
.photo .img { aspect-ratio:3/4; background:#0F1B2E; display:grid; place-items:center; color:#94A3B8; }
.photo img { width:100%; height:100%; object-fit:cover; display:block; cursor:zoom-in; }
.photo .body { padding:12px 14px; display:grid; gap:8px; font-size:13px; }
.checks { display:grid; gap:5px; }
.check { display:flex; gap:8px; align-items:center; }
.empty { border:1.5px dashed #BFE9DB; border-radius:var(--r-lg); padding:40px 24px; text-align:center; background:#F7FCFA; display:grid; gap:6px; justify-items:center; }
.empty h2 { margin:0; }
.shots { display:grid; gap:8px; }
.shot { display:grid; grid-template-columns:1fr 1.4fr auto; gap:8px; align-items:center; }
.qrow { display:grid; grid-template-columns:1fr 120px auto auto; gap:8px; align-items:center; }
.qrow .span { grid-column:1 / -1; }
fieldset.checks-list { border:1px solid var(--line); border-radius:var(--r); padding:10px 12px; display:grid; gap:6px; margin:0; }
.code { font-family:var(--display); font-size:30px; letter-spacing:5px; font-weight:700; color:var(--ink); }
.results { display:grid; gap:4px; max-height:220px; overflow:auto; }
.results button { justify-content:flex-start; height:auto; padding:8px 10px; background:var(--surface); color:var(--ink); border:1px solid var(--line); font-weight:500; font-size:14px; text-align:left; box-shadow:none; white-space:normal; }
.results button:hover { background:var(--hover); filter:none; }
.qr { width:132px; height:132px; border-radius:var(--r); border:1px solid var(--line); }
td input[type=checkbox], th input[type=checkbox] { width:16px; height:16px; }

/* ---------------------------------------------------------------- sign-in screens */
.auth { width:100%; max-width:440px; margin:4vh auto 0; padding:30px; border-radius:22px; box-shadow:0 30px 60px -30px rgba(11,58,66,.45); border-color:#DCEAE6; }
.auth h1 { font-size:26px; }
.auth.alt { margin-top:0; box-shadow:none; background:transparent; border-style:dashed; }
.auth button[type=submit] { height:44px; }

/* ---------------------------------------------------------------- overlays */
#toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:linear-gradient(90deg, #0B1D3A, #0D3A42); color:#fff; padding:12px 18px; border-radius:12px; font-size:14px; font-weight:500; z-index:2000; max-width:90vw; box-shadow:var(--shadow-pop); }
dialog { border:1px solid var(--line); border-radius:18px; padding:0; max-width:min(92vw, 900px); box-shadow:var(--shadow-pop); color:var(--text); }
dialog img { display:block; max-width:100%; max-height:85vh; }
dialog.modal { padding:26px; width:min(92vw, 500px); }
dialog.modal.wide { width:min(92vw, 740px); }
dialog.modal h2 { font-size:20px; }
dialog::backdrop { background:rgba(11,29,58,.42); backdrop-filter:blur(2px); }
dialog.photozoom { padding:0; background:transparent; border:0; box-shadow:none; }
.spin { width:18px; height:18px; border:2.5px solid #D0DCD9; border-top-color:var(--blue); border-radius:50%; animation:s .8s linear infinite; display:inline-block; flex:none; }
@keyframes s { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration:2s; } * { transition:none !important; } }
