/* Partner portal additions on top of the main site's /assets/app.css */
.p-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.p-nav a.nav-link { font-weight: 650; color: #111; text-decoration: none; }
.p-nav a.nav-link:hover { color: var(--red); }
.p-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: #fdecee; color: var(--red); border-radius: 999px; padding: 3px 10px; margin-left: 10px; vertical-align: middle; }
.p-hero { padding: 56px 0 40px; background: linear-gradient(180deg, #fff3f4 0, #fff 360px); }
.p-hero-in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.p-hero h1 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; letter-spacing: -.02em; margin: 6px 0 14px; }
.p-hero p.lead { font-size: 18px; color: var(--muted); margin: 0 0 22px; }
.p-hero .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.p-doors { display: grid; gap: 10px; }
.p-door { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: #111; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.p-door:hover { border-color: var(--red); box-shadow: 0 10px 30px -22px #0005; }
.p-door .card-ico { width: 44px; height: 44px; flex-shrink: 0; }
.p-door b { display: block; }
.p-door small { color: var(--muted); }
.p-door .go { margin-left: auto; color: var(--red); font-weight: 800; }
.p-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.p-steps li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; counter-increment: s; }
.p-steps li::before { content: counter(s); display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: #fdecee; color: var(--red); font-weight: 800; align-items: center; justify-content: center; margin-bottom: 8px; }
.p-steps b { display: block; margin-bottom: 4px; }
.p-steps span { color: var(--muted); font-size: 14px; }
.p-who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.p-who .card { min-height: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.p-who .card p { color: var(--muted); margin: 0; }
.p-auth { max-width: 460px; margin: 40px auto 60px; background: #fff; padding: 28px; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 20px 50px -30px #0004; }
.p-auth.wide { max-width: 720px; }
.p-auth h1 { font-size: 26px; margin: 0 0 6px; }
.p-auth .muted { margin: 0 0 14px; }
.p-auth form .btn { width: 100%; margin-top: 16px; }
.p-auth input, .p-auth select, .p-auth textarea, .p-form input, .p-form select, .p-form textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.p-auth input:focus, .p-auth select:focus, .p-auth textarea:focus, .p-form input:focus, .p-form select:focus, .p-form textarea:focus { outline: 2px solid #f6c3c8; border-color: var(--red); }
.p-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.p-small { font-size: 13px; color: var(--muted); }
.p-ok { background: #e9f8ef; border-left: 4px solid #1a8f4c; padding: 10px 12px; border-radius: 10px; color: #135f34; margin: 0 0 12px; }
.p-auth .err { margin: 0 0 12px; }
.p-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.p-tabs a { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: #111; text-decoration: none; }
.p-tabs a.on { background: #111; border-color: #111; color: #fff; }

/* Portal (logged in) */
body.portal { background: #f6f7f9; }
.pt { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.pt-side { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.pt-side .logo img { height: 34px; width: auto; }
.pt-who { margin: 16px 4px 14px; padding: 12px; border-radius: 12px; background: #fff3f4; }
.pt-who b { display: block; font-size: 14px; }
.pt-who small { color: var(--muted); }
.pt-menu { display: grid; gap: 2px; }
.pt-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: #222; font-size: 14px; font-weight: 600; text-decoration: none; }
.pt-menu a svg { width: 18px; height: 18px; flex-shrink: 0; }
.pt-menu a:hover { background: #f3f4f6; }
.pt-menu a[aria-current="page"] { background: #111; color: #fff; }
.pt-menu a[aria-current="page"] svg, .pt-menu a[aria-current="page"] svg * { stroke: #fff; }
.pt-menu .soon { margin-left: auto; font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); background: #f1f1f1; border-radius: 999px; padding: 2px 7px; }
.pt-side form { margin-top: auto; padding-top: 14px; }
.pt-side form button { width: 100%; display: flex; gap: 8px; align-items: center; justify-content: center; }
.pt-side form button svg { width: 16px; height: 16px; }
.pt-main { padding: 26px 30px 60px; min-width: 0; }
.pt-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.pt-top h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; }
.pt-mtoggle { display: none; }
.pt-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.pt-card h2 { font-size: 18px; margin: 0 0 12px; text-align: left; }
.pt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.pt-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.pt-stat small { color: var(--muted); font-size: 13px; display: block; }
.pt-stat b { display: block; font-size: 26px; margin-top: 4px; }
.pt-stat em { font-style: normal; font-size: 12px; color: var(--muted); }
.pt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-table th, .pt-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pt-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafafa; }
.pt-scroll { overflow-x: auto; }
.st { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; }
.st-active { background: #e9f8ef; color: #1a8f4c; }
.st-pending { background: #fff5e0; color: #a26200; }
.st-suspended, .st-rejected { background: #fde8ea; color: var(--red-dark); }
.pt-inline { display: inline; }
.pt-inline button { margin: 2px 4px 2px 0; }
.pt-reassign { display: flex; gap: 4px; margin-top: 6px; min-width: 190px; }
.pt-reassign select { flex: 1; min-width: 0; max-width: 220px; padding: 4px 6px; font-size: 12px; border: 1px solid #d9dce3; border-radius: 6px; background: #fff; }
.pt-reassign .psel { flex: 1; min-width: 0; max-width: 220px; }
.pt-reassign .psel-btn { padding: 5px 8px 5px 10px; font-size: 12px; border-radius: 8px; min-height: 30px; }
.pt-reassign .btn { padding: 4px 12px; }
.ref-box { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; background: #fafafa; }
.ref-box input { border: 0; background: transparent; flex: 1; font: inherit; font-weight: 650; min-width: 0; }
.pt-empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.pt-empty svg { width: 34px; height: 34px; background: #fdecee; border-radius: 50%; padding: 7px; margin-bottom: 8px; }

@media (max-width: 1000px) {
  .p-hero-in { grid-template-columns: 1fr; }
  .p-steps, .pt-stats { grid-template-columns: repeat(2, 1fr); }
  .p-who { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .pt { grid-template-columns: 1fr; }
  .pt-side { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px #0003; }
  #pt-nav:checked ~ .pt .pt-side { transform: none; }
  .pt-mtoggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; margin: 0; }
  .pt-main { padding: 16px 14px 50px; }
}
@media (max-width: 600px) {
  .p-steps, .p-who, .pt-stats, .p-row2 { grid-template-columns: 1fr; }
  .p-nav .nav-link.hide-m { display: none; }
  .p-auth { margin: 18px 12px 40px; padding: 20px; }
}
.p-center { text-align: center; }
.p-pt0 { padding-top: 0; }
.p-mt { margin-top: 14px; }

/* Phase 2–3: leads, maps, notifications */
.pt-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.pt-menu a[aria-current="page"] .pt-badge { background: #fff; color: var(--red); }
.pt-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pt-bar .p-tabs { margin: 0; }
.pt-bar-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pt-filter input { flex: 1 1 240px; width: auto; }
.pt-filter select { flex: 0 1 200px; width: auto; }
.pt-leads tr.is-due td { background: #fff8f0; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #f1f1f1; color: #444; border-radius: 6px; padding: 2px 6px; margin-top: 3px; }
.tag-red { background: #fde8ea; color: var(--red-dark); }
.txt-red { color: var(--red-dark); font-weight: 700; }
.txt-green { color: #1a8f4c; font-weight: 700; }
.num { text-align: right; white-space: nowrap; }
.st-l-new { background: #eef2ff; color: #3446b0; }
.st-l-contacted, .st-l-survey, .st-l-feasible, .st-l-kyc { background: #fff5e0; color: #a26200; }
.st-l-installed { background: #e9f8ef; color: #1a8f4c; }
.st-l-lost, .st-l-not_feasible { background: #f1f1f1; color: #555; }
.st-l-forwarded { background: #f3e8ff; color: #6b2fb3; }
.st-a-approved, .st-s-active { background: #e9f8ef; color: #1a8f4c; }
.st-a-pending, .st-s-suspended { background: #fff5e0; color: #a26200; }
.st-a-rejected, .st-a-disabled, .st-s-disconnected { background: #f1f1f1; color: #555; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.lead-act label:first-child { margin-top: 0; }
.pt-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; }
.pt-row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pt-row-form input, .pt-row-form select { flex: 1 1 160px; width: auto; }
.pt-mt-l { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pt-alert { border-color: #f3b5bb; background: #fff7f8; }
.pt-inl { display: flex; align-items: center; gap: 6px; margin: 0; }
.pt-inl input { width: 120px; }
.props { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; margin: 14px 0; font-size: 14px; }
.props dt { color: var(--muted); font-size: 13px; }
.props dd { margin: 0; word-break: break-word; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 0 0 16px; position: relative; }
.tl li::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl-ico { width: 30px; height: 30px; border-radius: 50%; background: #f3f4f6; display: flex; align-items: center; justify-content: center; }
.tl-ico svg { width: 15px; height: 15px; }
.tl-escalated .tl-ico, .tl-fee .tl-ico { background: #fdecee; }
.tl-status .tl-ico { background: #e9f8ef; }
.tl p { margin: 0; font-size: 14px; }
.tl .tl-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.map-sm, .map-md, .map-lg { border-radius: 12px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.map-sm { height: 220px; margin-top: 8px; }
.map-md { height: 320px; }
.map-lg { height: 460px; margin-top: 10px; }
[data-jump] { margin-bottom: 8px; max-width: 280px; }
.linkish { background: none; border: 0; padding: 0; color: var(--red); cursor: pointer; text-decoration: underline; font: inherit; }
.pt-narrow { max-width: 820px; }
.pt-chk { display: flex; gap: 6px; align-items: center; margin: 0; }
.pt-chk input { width: auto; }
.sub-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: start; }
.pt-right { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.ntf { list-style: none; margin: 0; padding: 0; }
.ntf li a { display: grid; gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: #111; text-decoration: none; }
.ntf li a:hover { background: #fafafa; }
.ntf li.unread a { background: #fff7f8; border-left: 3px solid var(--red); }
.ntf span { color: #444; font-size: 14px; }
.ntf small { color: var(--muted); font-size: 12px; }
@media (max-width: 1000px) {
  .lead-grid, .sub-grid { grid-template-columns: 1fr; }
  .map-lg { height: 380px; }
}
@media (max-width: 600px) {
  .props { grid-template-columns: 90px 1fr; }
  .map-lg { height: 320px; }
}

/* Buildings & societies */
.bld-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bld-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.bld-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-1px); }
.bld-card > b { font-size: 1.1rem; }
.bld-card small { color: #666; }
.bld-kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--red-dark, #b00f1a); font-weight: 600; }
.bld-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 4px; padding: 10px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.bld-nums span { display: flex; flex-direction: column; font-size: .75rem; color: #666; }
.bld-nums b { font-size: 1.25rem; color: #111; }
.bld-nums b.txt-green { color: #1a8f4c; }
.pt-row-form select, .pt-row-form input[type=date] { max-width: 150px; }
@media (max-width: 600px) {
  .bld-nums { grid-template-columns: repeat(2, 1fr); }
  .pt-row-form select, .pt-row-form input[type=date] { max-width: none; }
}

/* Commission */
.cm-rule { display: flex; gap: 6px; min-width: 220px; }
.cm-rule select { width: auto; flex: 0 0 auto; }
.cm-rule input { width: 100px; flex: 1 1 auto; }

/* Payouts */
.st-p-requested, .st-k-submitted { background: #fff5e0; color: #a26200; }
.st-p-approved { background: #e8f0fd; color: #1a4fb0; }
.st-p-paid, .st-k-verified { background: #e9f8ef; color: #1a8f4c; }
.st-p-rejected, .st-p-cancelled, .st-k-rejected, .st-k-none { background: #f1f1f1; color: #555; }
.st-ff-pending { background: #eef2ff; color: #3446b0; }
.st-ff-due { background: #fff5e0; color: #a26200; }
.st-ff-paid { background: #e9f8ef; color: #1a8f4c; }
.st-ff-waived, .st-ff-cancelled { background: #f1f1f1; color: #555; }
.pay-form { min-width: 330px; }
.stmt-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid #eee; padding-bottom: 12px; margin-bottom: 12px; }
.stmt-r { text-align: right; }
@media print {
  .pt-side, .pt-top .pt-mtoggle, .no-print { display: none !important; }
  .pt-main { padding: 0 !important; }
}

/* Vendors & POs */
.st-po-draft { background: #f1f1f1; color: #555; }
.st-po-issued, .st-i-submitted { background: #fff5e0; color: #a26200; }
.st-po-accepted, .st-i-approved, .st-i-part_paid { background: #e8f0fd; color: #1a4fb0; }
.st-po-closed, .st-i-paid { background: #e9f8ef; color: #1a8f4c; }
.st-po-cancelled, .st-i-rejected { background: #f1f1f1; color: #888; }
.po-items input, .po-items select { min-width: 70px; }
.po-items td:first-child input { min-width: 220px; }
.pre { white-space: pre-line; }
.pt-btns form { display: inline; }

/* Reports */
.rep-filter input[type=date] { flex: 0 1 160px; }

/* Custom dropdown (replaces the browser's native select list) */
.psel { position: relative; display: block; width: 100%; min-width: 0; }
.psel > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.psel-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; color: #111; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.psel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psel-btn svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.psel-btn:hover { border-color: #c9ccd3; }
.psel-btn:focus-visible, .psel.is-open .psel-btn { outline: 2px solid #f6c3c8; border-color: var(--red); }
.psel.is-open .psel-btn svg { transform: rotate(180deg); color: var(--red); }
.psel.is-empty .psel-btn span { color: var(--muted); }
.psel.is-invalid .psel-btn { border-color: var(--red); }
.psel-btn:disabled { background: #f6f7f9; color: var(--muted); cursor: not-allowed; }
.pt-filter .psel { flex: 0 1 200px; width: auto; }
.pt-row-form .psel { flex: 1 1 160px; width: auto; max-width: 150px; }
.cm-rule .psel { flex: 0 0 auto; width: auto; }
.psel-panel { position: fixed; z-index: 1000; max-width: min(360px, calc(100vw - 16px)); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -18px #0004, 0 2px 6px #0000000d; padding: 6px; font-size: 14px; animation: psel-in .12s ease-out; }
.psel-panel.is-up { animation-name: psel-in-up; }
@keyframes psel-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes psel-in-up { from { opacity: 0; transform: translateY(4px); } }
.psel-search { width: 100%; padding: 8px 10px; margin: 0 0 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; }
.psel-search:focus { outline: 2px solid #f6c3c8; border-color: var(--red); }
.psel-list { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.psel-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.psel-group:first-child { padding-top: 4px; }
.psel-opt { position: relative; padding: 8px 30px 8px 10px; border-radius: 8px; color: #111; cursor: pointer; line-height: 1.3; }
.psel-opt.psel-ph { color: var(--muted); }
.psel-opt.is-act { background: #fff3f4; }
.psel-opt.is-sel { font-weight: 700; color: var(--red-dark, #b00f1a); }
.psel-opt.is-sel::after { content: ""; position: absolute; right: 12px; top: 50%; width: 5px; height: 9px; border: solid var(--red); border-width: 0 2px 2px 0; transform: translateY(-65%) rotate(45deg); }
.psel-opt.is-dis { color: #aaa; cursor: not-allowed; }
@media (max-width: 600px) {
  .pt-row-form .psel { max-width: none; }
  .psel-opt { padding: 11px 30px 11px 10px; }
}

/* Email log */
.st-o-sent { background: #e9f8ef; color: #1a8f4c; }
.st-o-queued { background: #fff5e0; color: #a26200; }
.st-o-failed { background: #fde8ea; color: #b00f1a; }
.st-o-logged, .st-o-skipped { background: #f1f1f1; color: #555; }
pre.code { background: #f6f6f6; border-radius: 8px; padding: 12px; overflow-x: auto; font-size: .85rem; }
.p-prose h2 { font-size: 18px; margin: 22px 0 6px; }
.p-prose p, .p-prose li { line-height: 1.6; }
.p-prose ul { padding-left: 20px; margin: 0; }
.p-prose li { margin: 4px 0; }

/* Lead delete + recycle bin */
.pt-bar-r .btn svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.pt-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: #fff3f4; border: 1px solid #f6c3c8; position: sticky; top: 8px; z-index: 5; }
.pt-bulk[hidden] { display: none; }
.pt-bulk b { margin-right: 4px; }
.pt-bulk .psel { flex: 0 1 230px; width: auto; }
.pt-bulk input[name=reason_note] { flex: 1 1 200px; width: auto; padding: 8px 10px; }
.pt-bulk .psel-btn { padding: 8px 10px; }
.pt-bulk .btn svg, .pt-binned .btn svg, .pt-danger .btn svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.pt-chkcol { width: 34px; padding-right: 0 !important; }
.pt-chkcol input { width: 16px; height: 16px; accent-color: var(--red); cursor: pointer; }
.pt-leads tr.is-picked td { background: #fff7f8; }
.pt-binned h2 svg { width: 20px; height: 20px; vertical-align: -4px; }
.pt-danger { border-color: #f3d3d6; }
.pt-danger h2 { color: var(--red-dark, #b00f1a); }
.pt-bin-info { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pt-bin-info h2 svg { width: 20px; height: 20px; vertical-align: -4px; }
.pt-bin-info p { margin: 0; max-width: 620px; }
.pt-bin-days input { flex: 0 0 80px !important; width: 80px; }
@media (max-width: 600px) {
  .pt-bulk .psel, .pt-bulk input[name=reason_note] { flex: 1 1 100%; }
}

/* Assign / referral picker */
.asg-trigger { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 12px; font-weight: 650; color: #111; cursor: pointer; transition: border-color .15s, background .15s; }
.asg-trigger svg { width: 14px; height: 14px; }
.asg-trigger:hover, .asg-trigger:focus-visible { border-color: var(--red); background: #fff7f8; outline: none; }
.asg-trigger-lg { display: flex; width: 100%; margin: 0 0 6px; padding: 11px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.asg-trigger-lg svg { width: 16px; height: 16px; }
.pt-row-form .btn svg { width: 14px; height: 14px; vertical-align: -2px; }
.asg-back { position: fixed; inset: 0; z-index: 999; background: transparent; }
.asg { position: fixed; z-index: 1000; width: 400px; max-width: calc(100vw - 16px); max-height: min(560px, calc(100vh - 16px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px -24px #0005, 0 2px 8px #0000000f; overflow: hidden; animation: psel-in .14s ease-out; font-size: 14px; }
.asg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 4px; }
.asg-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; border-radius: 6px; }
.asg-x:hover { color: #111; background: #f3f4f6; }
.asg-search { position: relative; margin: 8px 12px; }
.asg-search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.asg-search input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.asg-search input:focus { outline: 2px solid #f6c3c8; border-color: var(--red); }
.asg-head, .asg-search { flex-shrink: 0; }
.asg-chips { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.asg-chip { flex: 0 0 auto; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 12px; font-weight: 700; color: #333; cursor: pointer; }
.asg-chip span { color: var(--muted); font-weight: 600; margin-left: 2px; }
.asg-chip.on { background: #111; border-color: #111; color: #fff; }
.asg-chip.on span { color: #bbb; }
.asg.has-foot .asg-chips { display: none; }
.asg-list { flex: 1 1 auto; min-height: 96px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 6px 8px; }
.asg-sec { position: sticky; top: -4px; z-index: 1; padding: 10px 8px 4px; background: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.asg-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.asg-row.is-act { background: #fff3f4; }
.asg-row.is-cur { cursor: default; opacity: .6; }
.asg-av { flex: 0 0 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; background: #6b7280; }
.asg-av-staff { background: #111; }
.asg-av-lco { background: var(--red); }
.asg-av-isp_partner { background: #6b2fb3; }
.asg-av-referrer { background: #1a8f4c; }
.asg-av-queue { background: #e5e7eb; color: #111; }
.asg-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.asg-name { font-weight: 650; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-name mark { background: #fde2e5; color: inherit; border-radius: 3px; padding: 0 1px; }
.asg-code { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--muted); background: #f3f4f6; border-radius: 5px; padding: 1px 5px; }
.asg-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-why { font-size: 12px; color: var(--red-dark, #b00f1a); font-weight: 600; }
.asg-tag { flex: 0 0 auto; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #f1f1f1; color: #555; border-radius: 6px; padding: 2px 6px; }
.asg-empty, .asg-more { margin: 0; padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.asg-more { padding: 10px 12px; font-size: 12px; }
.asg-foot { flex-shrink: 0; display: grid; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fafafa; }
.asg-foot[hidden] { display: none; }
.asg-to { font-size: 13px; }
.asg-foot input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 13px; }
.asg-foot input:focus { outline: 2px solid #f6c3c8; border-color: var(--red); }
.asg-act { display: flex; gap: 8px; }
.asg.is-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; max-height: 85vh; border-radius: 18px 18px 0 0; animation: asg-up .18s ease-out; }
.asg.is-sheet ~ .asg-back, .asg-back:has(+ .asg.is-sheet) { background: #0006; }
.asg.is-sheet .asg-row { padding: 11px 8px; }
@keyframes asg-up { from { transform: translateY(30px); opacity: 0; } }

/* Email sending settings */
.mail-lead { margin: -4px 0 14px; }
.mail-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mail-m { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: left; color: #111; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mail-m:hover { border-color: #bbb; }
.mail-m.is-on { border-color: var(--red); box-shadow: 0 0 0 3px #fde3e6; }
.mail-m.is-off { cursor: default; background: #fafafa; color: #777; }
.mail-m.is-off:hover { border-color: var(--line); }
.mail-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #f3f3f3; color: #333; }
.mail-ico svg { width: 18px; height: 18px; }
.mail-m.is-on .mail-ico { background: #fdecee; color: var(--red); }
.mail-txt { flex: 1; min-width: 0; padding-right: 64px; }
.mail-txt b { display: block; font-size: 14px; }
.mail-txt small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.mail-tag { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #e9f8ef; color: #1a8f4c; }
.mail-m.is-on .mail-tag { background: var(--red); color: #fff; }
.mail-tag-soon { background: #f1f1f1; color: #777; }
.mail-sub { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 20px 0 10px; }
.mail-sub span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f1f1f1; color: #666; }
.mail-apis .mail-txt { padding-right: 48px; }
.mail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-side { display: grid; gap: 16px; }
.mail-side .pt-card, .mail-grid > .pt-card { margin: 0; }
.mail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mail-head h2 { margin: 0; }
.mail-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.mail-check svg { width: 14px; height: 14px; }
.mail-check.is-ok { background: #e9f8ef; color: #1a8f4c; }
.mail-check.is-bad { background: #fde8ea; color: #b00f1a; }
.mail-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.mail-row-eq { grid-template-columns: 1fr 1fr; }
.mail-note { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; }
.mail-note svg { width: 14px; height: 14px; flex: 0 0 14px; }
.mail-hint { background: #f6f7fb; border: 1px solid #e3e6f0; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #333; margin: 0 0 12px; }
.mail-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.mail-presets { display: grid; gap: 6px; margin-top: 10px; }
.mail-preset { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.mail-preset:hover { border-color: #bbb; background: #fafafa; }
.mail-preset.is-on { border-color: var(--red); background: #fff7f8; }
.mail-preset b { font-size: 13px; }
.mail-preset small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .mail-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .mail-row, .mail-row-eq { grid-template-columns: 1fr; gap: 0; } .mail-preset small { display: none; } }

/* Referral share card with QR */
.ref-share { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.ref-qr { margin: 0; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fafafa; text-align: center; }
.ref-qr-code { background: #fff; border-radius: 10px; padding: 10px; width: 180px; height: 180px; margin: 0 auto 12px; }
.ref-qr-code svg { display: block; width: 100%; height: 100%; }
.ref-qr figcaption { display: grid; gap: 6px; justify-items: center; }
.ref-qr figcaption span { color: var(--muted); font-size: 13px; }
.ref-qr figcaption .btn { margin-top: 4px; }
@media (max-width: 760px) {
  .ref-share { grid-template-columns: 1fr; }
}

/* Site visits and KYC */
.sv-head { font-size: 15px; margin: 18px 0 8px; }
.sv-head span { color: var(--muted); font-weight: 600; }
.sv-head-late { color: var(--red-dark); }
.sv-list { padding: 0; }
.sv-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--line); }
.sv-row:first-child { border-top: 0; }
.sv-row p { margin: 0 0 3px; }
.sv-date { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: #fdecee; color: var(--red-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; line-height: 1.1; }
.sv-date b { font-size: 19px; color: var(--ink, #111); }
.sv-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sv-slot { display: flex; gap: 12px; align-items: center; }
.sv-slot p { margin: 0 0 2px; }
.sv-past { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.sv-past li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.st-sv-feasible, .st-kyc-verified { background: #e9f8ef; color: #1a8f4c; }
.st-sv-not_feasible, .st-sv-cancelled, .st-kyc-rejected { background: #f1f1f1; color: #555; }
.st-kyc-collected { background: #fff5e0; color: #a26200; }
@media (max-width: 640px) {
  .sv-row { grid-template-columns: 52px minmax(0, 1fr); }
  .sv-acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* 2-step login */
.tf-steps { list-style: none; counter-reset: tf; margin: 16px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.tf-steps > li { counter-increment: tf; position: relative; padding: 18px 18px 18px 58px; border-top: 1px solid var(--line); }
.tf-steps > li:first-child { border-top: 0; }
.tf-steps > li::before { content: counter(tf); position: absolute; left: 18px; top: 17px; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.tf-steps h3 { margin: 0 0 6px; font-size: 16px; }
.tf-steps p { margin: 0 0 6px; }
.tf-scan { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: center; }
.tf-scan .ref-qr-code { margin: 0; border: 1px solid var(--line); }
.tf-key code { font-size: 16px; letter-spacing: .06em; word-break: break-word; background: #fafafa; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: inline-block; }
.tf-form { display: grid; gap: 8px; max-width: 280px; }
.tf-code { font-size: 22px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.tf-codes { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 420px; }
.tf-codes code { display: block; text-align: center; font-size: 15px; letter-spacing: .08em; background: #fafafa; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.tf-codes-card { border-color: #f0c36d; background: #fffaf0; }
@media (max-width: 600px) {
  .tf-steps > li { padding-left: 50px; padding-right: 14px; }
  .tf-steps > li::before { left: 14px; }
  .tf-scan { grid-template-columns: 1fr; }
  .tf-form { max-width: none; }
}

/* Complaints */
.cp-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #f1f2f4; font-size: 12px; font-weight: 700; text-align: center; }
a.on .cp-count { background: rgba(255,255,255,.22); color: inherit; }
.cp-list { display: grid; gap: 10px; }
.cp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); gap: 12px; align-items: center; text-decoration: none; color: inherit; margin: 0; }
.cp-row:hover { border-color: var(--red); }
.cp-row.is-late { border-left: 4px solid var(--red); }
.cp-main, .cp-side { display: grid; gap: 4px; min-width: 0; }
.cp-side span { display: flex; align-items: center; gap: 6px; }
.cp-side svg { width: 14px; height: 14px; flex: none; }
.cp-top { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cp-title { font-weight: 600; overflow-wrap: anywhere; }
.cp-warn { color: var(--red-dark, #b00d18); font-weight: 600; }
.cp-h { margin: 10px 0 6px; }
.cp-desc { white-space: normal; margin: 0 0 10px; }
.cp-fix { background: #e9f8ef; border-radius: 10px; padding: 10px 12px; }
.cp-cust { margin-top: 8px; }
.cp-props dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.cp-props dt { color: var(--muted); font-size: 14px; }
.cp-props dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cp-loc { margin: 12px 0; }
.cp-loc summary { cursor: pointer; font-weight: 600; }
.cp-dup { margin-bottom: 12px; }
.st-cp-open { background: #fff4e5; color: #9a5b00; }
.st-cp-assigned, .st-cp-in_progress { background: #e8f0fe; color: #1a4fb5; }
.st-cp-on_hold { background: #f1f2f4; color: #555; }
.st-cp-resolved, .st-cp-closed { background: #e9f8ef; color: #1a8f4c; }
.st-cp-cancelled { background: #f1f2f4; color: #777; }
.st-pr-normal { background: #f1f2f4; color: #555; }
.st-pr-high { background: #fff4e5; color: #9a5b00; }
.st-pr-urgent { background: #fde8ea; color: var(--red-dark, #b00d18); }
@media (max-width: 700px) {
  .cp-row { grid-template-columns: 1fr; }
}
