:root {
  --red: #B3121F; --red-dark: #8E0E18; --red-soft: #FDECEE;
  --bg: #F5F6F8; --surface: #FFFFFF; --line: #E4E6EB; --text: #1C1F24; --muted: #6A707C;
  --ok: #1B7F4B; --ok-soft: #E6F4EC; --warn: #9A6200; --warn-soft: #FFF4DB; --info: #1F5FAD; --info-soft: #E7F0FB;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .error { color: var(--red); min-height: 16px; }
a { color: var(--red); }
#app { display: flex; min-height: 100vh; }
#sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 36px; height: 36px; } .brand-name { font-weight: 800; color: var(--red); font-size: 18px; } .brand-sub { font-size: 11px; color: var(--muted); }
#nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
#nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 4px; }
#nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
#nav a:hover { background: var(--bg); } #nav a.active { background: var(--red-soft); color: var(--red-dark); font-weight: 600; }
main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
#topbar h1 { font-size: 18px; margin: 0; } .spacer { flex: 1; }
#menuBtn { display: none; }
#view { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.stat { padding: 14px 16px; } .stat .label { color: var(--muted); font-size: 12px; } .stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat.alert .value { color: var(--red); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input, .toolbar select { min-width: 160px; width: auto; flex: 0 1 260px; }
.toolbar label { flex-direction: row; align-items: center; gap: 6px; }
.modal-card h3 { margin: 18px 0 8px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red-soft); border-color: var(--red); }
textarea { min-height: 80px; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; font-size: 14px; }
label.check input { width: auto; }
.btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #C9CDD4; } .btn.primary { background: var(--red); border-color: var(--red); color: #fff; } .btn.primary:hover { background: var(--red-dark); }
.btn.ghost { background: transparent; } .btn.small { padding: 5px 10px; font-size: 12px; } .btn.block { width: 100%; }
.btn.danger { color: var(--red); border-color: #F3C2C7; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #FAFBFC; position: sticky; top: 0; white-space: nowrap; }
tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #FAFBFC; }
td.actions { white-space: nowrap; text-align: right; } td.actions .btn { margin-left: 4px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--red-soft); color: var(--red-dark); } .badge.info { background: var(--info-soft); color: var(--info); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-top: 8px; }
.form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form .full { grid-column: 1 / -1; } .form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.modal-card { width: 100%; max-width: 720px; } .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 90vw; }
.toast.err { background: var(--red-dark); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, var(--red) 0, var(--red-dark) 45%, var(--bg) 45%); }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; padding: 28px; }
.login-card h2 { margin: 0; } .login-logo { width: 56px; height: 56px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; } .kv div:nth-child(odd) { color: var(--muted); }
.row { display: flex; gap: 16px; flex-wrap: wrap; } .row > * { flex: 1 1 300px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bars .bar { flex: 1; max-width: 48px; background: var(--red); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .bar span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.bars-labels { display: flex; gap: 6px; } .bars-labels span { flex: 1; max-width: 48px; text-align: center; font-size: 10px; color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--bg); border: 1px solid var(--line); }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.notice.info { background: var(--info-soft); color: var(--info); }
.doc-frame { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 8px; }
.doc-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; word-break: break-all; }
@media (max-width: 860px) {
  #sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  #sidebar.open { transform: none; }
  #scrim { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 30; }
  #menuBtn { display: inline-block; }
  #view { padding: 12px; } #whoami { display: none; }
  .form { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; }
}

.kyc-step { margin: 10px 0; padding: 12px; }
.kyc-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
/* Business Desk */
.inbox-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item.unread { background: var(--info-soft); border-radius: 8px; padding-left: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 12px; margin-top: 6px; }
.perm-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 50vh; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.perm-group { display: flex; flex-direction: column; gap: 3px; }
.perm-group .sensitive { color: var(--warn); }
pre.code { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 40vh; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.ok { color: var(--ok); }
#deskBell { margin-right: 8px; }
textarea#lnk { width: 100%; min-height: 64px; }
/* Marketing & content */
.swatches i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); margin-right: 3px; vertical-align: middle; }
.phone { --p: #D7141F; --a: #FFC93C; --bg: #FFFFFF; width: 240px; margin: 8px auto; border: 8px solid #1C1F24; border-radius: 28px; background: var(--bg); overflow: hidden; }
.phone-bar { background: var(--p); color: #fff; padding: 12px; min-height: 44px; display: flex; align-items: center; }
.phone-bar img { max-height: 32px; }
.phone-greet { background: var(--a); padding: 10px 12px; font-weight: 700; }
.phone-banner { display: block; width: 100%; max-height: 140px; object-fit: cover; padding: 8px 0; text-align: center; }
.phone-btn { margin: 14px; background: var(--p); color: #fff; text-align: center; border-radius: 10px; padding: 10px; font-weight: 700; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; } .inline-check input { width: auto; }
