:root {
  --side: #2b333e; --side-2: #232a33; --side-ink: #c9d0d8; --side-dim: #8f99a5;
  --bg: #f3f4f8; --card: #fff; --ink: #3b4350; --dim: #7a8391; --line: #e7e9ef;
  --head: #343b47; --filter: #eef0f5;
  --green: #198754; --green-row: #a3ead2; --red-row: #fecaca; --yellow-row: #fcd98d;
  --yellow: #f5c518; --blue: #6366f1; --red: #c62828; --teal: #20c997;
  font-family: "Nunito", system-ui, sans-serif; color: var(--ink); font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.boot { padding: 40px; color: var(--dim); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); }
.login-side { background: var(--side-2); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { font-size: 44px; line-height: 1.1; margin: 0 0 16px; font-weight: 800; max-width: 12ch; }
.login-side p { color: var(--side-ink); font-size: 17px; max-width: 40ch; margin: 0; }
.login-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 40px; max-width: 520px; }
.login-stats div { background: var(--side); border-radius: 8px; padding: 14px 16px; }
.login-stats b { display: block; font-size: 22px; }
.login-stats span { color: var(--side-dim); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand i { width: 34px; height: 34px; border-radius: 8px; background: var(--teal); display: grid; place-items: center; font-style: normal; color: var(--side-2); }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { margin: 0 0 6px; font-size: 26px; }
.login-form .sub { color: var(--dim); margin: 0 0 28px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 13px; }
.field small { color: var(--dim); font-size: 12px; line-height: 1.5; }
.field small.warn { color: var(--red); }
.input, select.input, textarea.input { width: 100%; height: 40px; border: 1px solid #d5d9e1; border-radius: 4px; background: #fff; padding: 0 12px; outline: none; }
textarea.input { height: 100px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: #8b95a5; box-shadow: 0 0 0 3px rgba(52, 59, 71, .12); }
.input[readonly] { background: #edf0f4; }
.group { display: flex; }
.group .input { border-radius: 4px 0 0 4px; text-align: right; }
.group span { min-width: 40px; display: grid; place-items: center; padding: 0 10px; background: #e9ecf1; border: 1px solid #d5d9e1; border-left: 0; border-radius: 0 4px 4px 0; }
.btn { height: 38px; padding: 0 16px; border-radius: 4px; border: 0; background: var(--head); color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); }
.btn.green { background: var(--green); }
.btn.yellow { background: var(--yellow); color: #3a2e00; }
.btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #d5d9e1; }
.btn.block { width: 100%; justify-content: center; height: 44px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.error { color: var(--red); background: #fdecec; border-radius: 4px; padding: 10px 12px; margin-bottom: 16px; }
.ok { color: #0f5132; background: #d1f2e3; border-radius: 4px; padding: 10px 12px; margin-bottom: 16px; }

/* shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 16px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 22px 20px; color: #fff; font-size: 18px; }
.side .brand i { width: 30px; height: 30px; }
.nav-group > button, .nav-link { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: none; border: 0; color: var(--side-ink); font-weight: 700; text-decoration: none; text-align: left; }
.nav-group > button svg:last-child { margin-left: auto; transition: transform .15s; }
.nav-group.open > button svg:last-child { transform: rotate(90deg); }
.nav-group > button:hover, .nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-sub { display: none; padding: 2px 0 8px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub a { display: block; padding: 7px 22px 7px 56px; text-decoration: none; color: var(--side-dim); font-weight: 600; }
.nav-sub a:hover { color: #fff; }
.nav-sub a.active { color: #fff; font-weight: 800; }
.nav-sub a .soon { font-size: 10px; background: rgba(255, 255, 255, .1); border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.main { display: flex; flex-direction: column; min-width: 0; }
.top { height: 60px; background: #fff; display: flex; align-items: center; gap: 12px; padding: 0 24px; box-shadow: 0 1px 0 var(--line); }
.top .menu-btn { display: none; background: none; border: 0; padding: 6px; }
.crumbs { color: var(--dim); font-size: 13px; }
.crumbs b { color: var(--ink); }
.top .user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--head); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.content { padding: 24px; flex: 1; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.card { background: var(--card); border-radius: 6px; box-shadow: 0 1px 3px rgba(20, 30, 50, .06); padding: 22px; margin-bottom: 20px; }
.card-head { background: var(--filter); margin: -4px -4px 20px; padding: 14px 16px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.foot { height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; color: var(--dim); font-size: 13px; box-shadow: 0 -1px 0 var(--line); }
.rate { display: flex; border: 1px solid #d5d9e1; border-radius: 4px; overflow: hidden; min-width: 240px; }
.rate i { background: #1e2329; color: #f0b90b; width: 48px; display: grid; place-items: center; font-style: normal; }
.rate b { flex: 1; text-align: right; padding: 4px 12px; }
.rate span { border-left: 1px solid #d5d9e1; padding: 4px 12px; }
.demo-note { background: #fff7db; color: #7a5b00; border-radius: 4px; padding: 8px 12px; font-size: 13px; margin-bottom: 16px; }

/* tables */
.tbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--dim); flex-wrap: wrap; }
.tbar select { width: 80px; height: 34px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.filters td { background: var(--filter); padding: 10px 6px; }
.filters .input { height: 34px; font-size: 13px; }
thead th { background: var(--head); color: #fff; text-align: left; padding: 10px 10px; font-weight: 800; white-space: nowrap; }
tbody td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
tbody tr.g td { background: var(--green-row); border-color: #8fdcc2; }
tbody tr.r td { background: var(--red-row); border-color: #f5b5b5; }
tbody tr.y td { background: var(--yellow-row); border-color: #f0c86d; }
tbody tr.off td { color: #9aa2ae; }
tfoot td { background: var(--head); color: #fff; padding: 10px; font-weight: 800; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.copy { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit; }
.copy svg { opacity: .6; flex: none; }
.bank { display: inline-flex; align-items: center; gap: 8px; }
.bank-logo { width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; flex: none; }

.tag { display: inline-block; background: var(--yellow); color: #3a2e00; border-radius: 4px; font-size: 11px; font-weight: 800; padding: 1px 6px; margin-top: 4px; }
.tag.blue { background: var(--blue); color: #fff; }
.pill { display: inline-block; border-radius: 4px; font-size: 11.5px; font-weight: 800; padding: 2px 7px; background: #d1f2e3; color: #0f5132; }
.pill.red { background: #fde2e2; color: #9b1c1c; }
.pill.gray { background: #e9ecf1; color: #4b5563; }
.net { border: 1.5px solid var(--ink); border-radius: 4px; font-size: 11px; font-weight: 800; padding: 1px 5px; }
.chk { width: 26px; height: 26px; border-radius: 5px; background: #c8f1df; color: var(--green); display: inline-grid; place-items: center; }
.toggle { width: 38px; height: 20px; border-radius: 10px; border: 1px solid #cdd3dc; background: #e9ecf1; position: relative; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.toggle.on { background: var(--green); border-color: var(--green); }
.toggle.on::after { left: 20px; }
.row-menu { background: none; border: 0; padding: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; color: var(--dim); flex-wrap: wrap; gap: 10px; }
.pager .pages { display: flex; border: 1px solid #d5d9e1; border-radius: 4px; overflow: hidden; }
.pager .pages button { border: 0; background: #fff; padding: 8px 14px; color: var(--dim); }
.pager .pages button.cur { background: #6c757d; color: #fff; }
.pager .pages button + button { border-left: 1px solid #d5d9e1; }
.empty { text-align: center; color: var(--dim); padding: 40px 10px; }
.limit-low { color: var(--red); font-weight: 800; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; align-items: start; }
.form-grid .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dash-card h3 svg, .recon svg { width: 15px; height: 15px; vertical-align: -2px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 16px; }
.check input { width: 16px; height: 16px; accent-color: #0ea5c6; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }

/* dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.dash-card { background: var(--card); border-radius: 6px; box-shadow: 0 1px 3px rgba(20, 30, 50, .06); padding: 22px; }
.dash-card h3 { margin: 0 0 18px; font-size: 13px; letter-spacing: .03em; display: flex; justify-content: space-between; }
.dash-card h3 small { color: var(--dim); font-weight: 600; letter-spacing: 0; }
.mini th { background: var(--filter); color: var(--ink); }
.mini td { white-space: normal; }
.mini .sub td { color: var(--dim); font-style: italic; padding-left: 28px; }
.amt { display: inline-block; border: 1.5px solid; border-radius: 4px; padding: 1px 6px; font-weight: 800; font-size: 13px; }
.amt.g { color: var(--green); } .amt.r { color: var(--red); } .amt.b { color: var(--blue); } .amt.k { color: var(--ink); }
.recon td { padding: 10px 12px; }
.recon .h td { background: var(--filter); font-weight: 800; }
.recon .in td { background: #cdf5e6; font-weight: 800; }
.recon .out td { background: #fde0e4; font-weight: 800; }
.recon .s td { color: var(--dim); }
.bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; color: #fff; font-size: 12px; font-weight: 800; margin-top: 12px; }
.bar div { display: grid; place-items: center; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* dialog */
.overlay { position: fixed; inset: 0; background: rgba(20, 25, 35, .45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.dialog { background: #fff; border-radius: 8px; width: min(920px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; }
.dialog.small { width: min(460px, 100%); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--head); color: #fff; padding: 12px 16px; border-radius: 6px; z-index: 30; }
.menu-pop { position: absolute; background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(20, 30, 50, .18); padding: 6px; z-index: 25; min-width: 160px; }
.menu-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 4px; }
.menu-pop button:hover { background: var(--filter); }
.menu-pop button.danger { color: var(--red); }

@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 28px 20px; }
  .login-side h1 { font-size: 30px; }
  .login-stats { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 260px; z-index: 15; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(20, 25, 35, .4); }
  .top { padding: 0 16px; }
  .top .menu-btn { display: block; }
  .top .user .uname { display: none; }
  .content { padding: 16px; }
  .card { padding: 16px; }
  .form-grid, .settings-grid, .dash-grid { grid-template-columns: 1fr; }
  .foot { padding: 0 16px; }
  .foot .ver { display: none; }
  .rate { min-width: 0; }
}
.filters select.input { min-width: 110px; }
tfoot td { white-space: nowrap; }
.brand img { display: block; flex: none; }
.brand span { font-weight: 800; letter-spacing: -.01em; }
.brand span b { color: var(--teal); font-weight: 800; }
.qr { width: 200px; height: 200px; margin: 0 auto 16px; background: #fff; border-radius: 8px; padding: 8px; box-shadow: 0 1px 3px rgba(20, 30, 50, .1); }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-size: 13px; color: var(--dim); text-align: center; margin: 0 0 20px; line-height: 1.7; }
.secret code { font-size: 14px; color: var(--ink); font-weight: 700; letter-spacing: .04em; }
.input.code { font-size: 22px; letter-spacing: .4em; text-align: center; height: 50px; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; color: var(--dim); margin-top: 16px; padding: 4px 0; }
.link-btn:hover { color: var(--ink); }
.bank-icon { width: 26px; height: 26px; border-radius: 6px; flex: none; display: block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); background: #fff; }
.bank-icon.lg, .bank-logo.lg { width: 34px; height: 34px; border-radius: 8px; }
.bank b { font-weight: 700; }
