:root {
  --viewport-height: 100vh;
  --viewport-top: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  --ink: #14231f;
  --muted: #71807b;
  --line: #e4e9e7;
  --soft: #f4f7f6;
  --paper: #ffffff;
  --green-950: #09241f;
  --green-900: #0d3028;
  --green-700: #17604f;
  --green-600: #1c7862;
  --green-100: #dff1eb;
  --lime: #c9f45f;
  --amber: #dd8f22;
  --amber-soft: #fff3df;
  --red: #c64949;
  --red-soft: #fdebea;
  --shadow: 0 18px 50px rgb(15 47 39 / 10%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

@supports (height: 100dvh) {
  :root { --viewport-height: 100dvh; }
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--soft); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--soft); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .26; pointer-events: none; }
.ambient-one { width: 380px; height: 380px; background: #c9f45f; left: -170px; top: -190px; }
.ambient-two { width: 460px; height: 460px; background: #77bba9; right: -250px; bottom: -280px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 12px; color: var(--green-600); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow-light { color: var(--lime); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--green-950); font-size: 20px; font-weight: 500; letter-spacing: -.03em; text-decoration: none; }
.brand b { font-weight: 800; }
.brand-light { color: white; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 2px; width: 29px; height: 29px; padding: 6px; border-radius: 9px; background: var(--lime); transform: rotate(-3deg); }
.brand-mark i { display: block; width: 4px; border-radius: 3px; background: var(--green-950); }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 11px; }
.brand-mark.has-logo { width: 40px; height: 36px; padding: 0; transform: none; background: transparent; }
.brand-mark.has-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }

.login-shell { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(430px, .95fr); min-height: 100vh; }
.login-story { display: flex; flex-direction: column; min-height: calc(100vh - 40px); margin: 20px 0 20px 20px; padding: 42px 48px; border-radius: 24px; overflow: hidden; color: white; background:
  linear-gradient(140deg, rgb(8 40 33 / 97%), rgb(15 76 62 / 91%)),
  radial-gradient(circle at 80% 20%, #b5ec69, transparent 40%);
  box-shadow: var(--shadow);
}
.login-story::after { content: ""; position: absolute; left: 14%; bottom: 4%; width: 270px; height: 270px; border: 1px solid rgb(255 255 255 / 8%); border-radius: 50%; box-shadow: 0 0 0 48px rgb(255 255 255 / 3%), 0 0 0 96px rgb(255 255 255 / 2%); }
.story-copy { position: relative; z-index: 1; max-width: 590px; margin: auto 0; }
.story-copy h1 { margin: 0 0 22px; max-width: 560px; font-size: clamp(44px, 5vw, 72px); line-height: .98; letter-spacing: -.055em; }
.story-copy > p:last-child { max-width: 530px; margin: 0; color: rgb(255 255 255 / 68%); font-size: 17px; line-height: 1.65; }
.trust-row { position: relative; z-index: 1; display: flex; gap: 28px; color: rgb(255 255 255 / 62%); font-size: 12px; }
.trust-row span { display: flex; align-items: center; gap: 8px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #83db65; box-shadow: 0 0 0 4px rgb(131 219 101 / 13%); }
.login-panel { display: grid; place-items: center; padding: 60px; }
.login-card { width: min(100%, 420px); }
.login-card h2 { margin: 0 0 10px; font-size: 34px; letter-spacing: -.04em; }
.login-card > .muted { margin: 0 0 34px; }
.mobile-brand { display: none; margin-bottom: 60px; }

.field { display: grid; gap: 9px; margin-bottom: 20px; color: #34443f; font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #dbe2df; border-radius: 12px; outline: 0; background: white; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field input { height: 50px; padding: 0 15px; }
.field select { height: 48px; padding: 0 14px; }
.field textarea { resize: vertical; min-height: 112px; padding: 14px 15px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .search-field:focus-within, .select-field:focus-within { border-color: var(--green-600); box-shadow: 0 0 0 3px rgb(28 120 98 / 10%); }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-field .icon-button { position: absolute; right: 8px; top: 7px; }
.form-error { min-height: 18px; margin: -7px 0 13px; color: var(--red); font-size: 12px; }
.security-note { display: flex; align-items: flex-start; gap: 9px; margin: 24px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.security-note svg { flex: 0 0 auto; width: 16px; height: 16px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 750; transition: transform .15s, background .15s, border-color .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-wide { width: 100%; min-height: 52px; justify-content: space-between; padding: 0 18px; }
.button-primary { color: white; background: var(--green-700); box-shadow: 0 8px 20px rgb(23 96 79 / 18%); }
.button-primary:hover { background: var(--green-900); }
.button-secondary { border-color: var(--line); background: white; }
.button-secondary:hover { border-color: #bdc9c5; }
.button-danger { color: white; background: var(--red); }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; }
.icon-button:hover { background: var(--soft); }

.app-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: var(--viewport-height); padding: calc(28px + var(--safe-top)) 18px calc(20px + var(--safe-bottom)); overflow-y: auto; color: rgb(255 255 255 / 66%); background: var(--green-950); }
.sidebar-brand { margin: 0 12px 42px; color: white; }
.navigation { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 13px; border: 0; border-radius: 11px; color: inherit; background: transparent; font-size: 13px; font-weight: 650; text-align: left; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: white; background: rgb(255 255 255 / 5%); }
.nav-item.is-active { color: var(--green-950); background: var(--lime); }
.nav-count { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 20px; color: white; background: rgb(255 255 255 / 13%); font-size: 10px; text-align: center; }
.nav-item.is-active .nav-count { color: white; background: var(--green-900); }
.sidebar-spacer { flex: 1; }
.system-card { display: flex; align-items: center; gap: 11px; margin: 12px 4px 13px; padding: 13px; border: 1px solid rgb(255 255 255 / 7%); border-radius: 12px; background: rgb(255 255 255 / 4%); }
.system-card b, .system-card small { display: block; }
.system-card b { color: white; font-size: 11px; }
.system-card small { margin-top: 3px; font-size: 9px; }
.logout { border-top: 1px solid rgb(255 255 255 / 7%); border-radius: 0; }

.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: calc(72px + var(--safe-top)); padding: var(--safe-top) 36px 0; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 82%); backdrop-filter: blur(18px); }
.topbar-context { display: flex; align-items: center; gap: 12px; font-size: 11px; }
.environment-badge { padding: 5px 8px; border-radius: 6px; color: #97611a; background: var(--amber-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: var(--green-700); font-size: 11px; font-weight: 800; }
.user-copy b, .user-copy small { display: block; }
.user-copy b { max-width: 220px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.menu-button { display: none; }

.content { width: min(100%, 1540px); margin: 0 auto; padding: 36px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 7px; font-size: 32px; letter-spacing: -.045em; }
.page-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.page-heading .eyebrow { margin-bottom: 9px; }
.page-heading svg, .button svg { width: 16px; height: 16px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { display: flex; align-items: center; gap: 14px; min-height: 122px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.metric-card.metric-attention { border-color: #cee0a3; background: linear-gradient(135deg, #fbfff1, white); }
.metric-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; color: var(--green-700); background: var(--green-100); font-size: 18px; font-weight: 800; }
.metric-attention .metric-icon { color: var(--green-950); background: var(--lime); }
.metric-card small, .metric-card strong, .metric-card div > span { display: block; }
.metric-card small { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.metric-card strong { margin: 5px 0 3px; font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.metric-card div > span { color: #91a09b; font-size: 10px; }

.surface { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: white; box-shadow: 0 4px 15px rgb(15 47 39 / 3%); }
.surface-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px 18px; }
.surface-head h2 { margin: 0 0 5px; font-size: 17px; letter-spacing: -.02em; }
.surface-head p { margin: 0; color: var(--muted); font-size: 11px; }
.toolbar { display: flex; gap: 9px; }
.search-field, .select-field { display: flex; align-items: center; height: 39px; border: 1px solid var(--line); border-radius: 10px; background: white; transition: border-color .2s, box-shadow .2s; }
.search-field { width: 240px; padding: 0 11px; }
.search-field.client-search { width: 285px; }
.search-field svg { flex: 0 0 auto; width: 16px; height: 16px; color: #98a6a1; }
.search-field input { min-width: 0; width: 100%; height: 100%; padding: 0 0 0 9px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.select-field select { height: 100%; padding: 0 30px 0 11px; border: 0; outline: 0; color: #495954; background: transparent; font-size: 11px; }

.table-wrap { position: relative; min-height: 260px; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { height: 43px; padding: 0 15px; color: #8d9a96; background: #fafcfb; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
th:first-child, td:first-child { padding-left: 24px; }
td { height: 67px; padding: 0 15px; border-top: 1px solid #edf0ef; font-size: 11px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fbfdfc; }
.operation-id { display: block; max-width: 180px; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 750; text-overflow: ellipsis; }
.operation-sub { display: block; margin-top: 4px; color: #9aa6a2; font-size: 9px; }
.amount { font-size: 12px; font-weight: 800; }
.direction { display: inline-flex; align-items: center; gap: 6px; }
.direction-mark { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: var(--green-700); background: var(--green-100); font-weight: 800; }
.direction.Withdrawal .direction-mark { color: #98631d; background: var(--amber-soft); }
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 9px; border-radius: 20px; font-size: 9px; font-weight: 750; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-Reserved { color: #8a5a15; background: var(--amber-soft); }
.status-Queued { color: #315c9b; background: #eaf1fc; }
.status-Broadcasted { color: #5c48a3; background: #f0edff; }
.status-Completed { color: var(--green-700); background: var(--green-100); }
.status-Failed { color: var(--red); background: var(--red-soft); }
.status-Waiting { color: #76549c; background: #f1eafb; }
.status-Approval { color: #315c9b; background: #eaf1fc; }
.risk-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 6px; font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.risk-High { color: var(--red); background: var(--red-soft); }
.risk-Medium { color: #8a5a15; background: var(--amber-soft); }
.risk-Low { color: var(--green-700); background: var(--green-100); }
.assignee { display: flex; align-items: center; gap: 7px; max-width: 170px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; }
.assignee i { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; color: white; background: var(--green-700); font-size: 7px; font-style: normal; font-weight: 800; }
.row-action { width: 31px; height: 31px; border: 1px solid var(--line); background: white; }
.client-cell { display: flex; align-items: center; gap: 10px; }
.client-cell b, .client-cell small { display: block; }
.client-cell b { max-width: 220px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.client-cell small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.client-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 9px; color: var(--green-700); background: var(--green-100); font-size: 9px; font-style: normal; font-weight: 850; }
.surface-footer { display: flex; align-items: center; justify-content: space-between; min-height: 55px; padding: 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 7px; }
.pagination .icon-button { width: 29px; height: 29px; border: 1px solid var(--line); font-size: 12px; }
.pagination span { min-width: 22px; color: var(--ink); font-weight: 750; text-align: center; }
.empty-state { display: grid; place-items: center; padding: 65px 20px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 12px; color: var(--green-700); background: var(--green-100); font-size: 20px; }
.empty-state h3 { margin: 0 0 7px; color: var(--ink); font-size: 14px; }
.empty-state p { margin: 0; font-size: 11px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 260px; }
.loading-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-600); animation: pulse 1s infinite ease-in-out; }
.loading-state i:nth-child(2) { animation-delay: .13s; }
.loading-state i:nth-child(3) { animation-delay: .26s; }
@keyframes pulse { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

.integrity-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; margin-bottom: 18px; padding: 20px 22px; border: 1px solid #bde0d5; border-radius: 15px; background: linear-gradient(105deg, #edfaf5, white); }
.integrity-card.is-invalid { border-color: #f0c5c1; background: var(--red-soft); }
.integrity-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 50%; color: white; background: var(--green-600); font-weight: 900; }
.integrity-card.is-invalid .integrity-icon { background: var(--red); }
.integrity-card small, .integrity-card strong { display: block; }
.integrity-card small { margin-bottom: 4px; color: var(--green-700); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.integrity-card strong { font-size: 14px; }
.integrity-card p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.integrity-card code { padding: 6px 9px; border-radius: 6px; color: var(--green-700); background: white; font-size: 9px; }
.audit-list { border-top: 1px solid var(--line); }
.audit-event { display: grid; grid-template-columns: 36px minmax(160px, .8fr) minmax(220px, 1fr) 150px; gap: 16px; align-items: center; padding: 15px 24px; border-bottom: 1px solid #edf0ef; }
.audit-sequence { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--green-700); background: var(--green-100); font-size: 9px; font-weight: 800; }
.audit-event b { display: block; font-size: 11px; }
.audit-event small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.audit-entity { overflow: hidden; color: #53635e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.audit-time { color: var(--muted); font-size: 9px; text-align: right; }

.sidebar-overlay { position: fixed; z-index: 20; inset: 0; background: rgb(7 26 22 / 42%); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 40; top: var(--viewport-top); right: 0; display: flex; flex-direction: column; width: min(100%, 440px); height: var(--viewport-height); overflow: hidden; border-left: 1px solid var(--line); background: white; box-shadow: -24px 0 60px rgb(15 47 39 / 15%); transform: translateX(105%); transition: transform .25s ease; }
.drawer.is-open { transform: translateX(0); }
.client-drawer { width: min(100%, 590px); }
.compliance-drawer { width: min(100%, 520px); }
.drawer-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(25px + var(--safe-top)) max(26px, env(safe-area-inset-right, 0px)) 20px max(26px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
.drawer-head .eyebrow { margin-bottom: 5px; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-head .icon-button { font-size: 26px; font-weight: 300; }
.drawer-content { flex: 1 1 auto; min-height: 0; padding: 25px max(26px, env(safe-area-inset-right, 0px)) 25px max(26px, env(safe-area-inset-left, 0px)); overflow-y: auto; overscroll-behavior-y: contain; }
.detail-amount { padding: 22px; border-radius: 14px; color: white; background: var(--green-950); }
.detail-amount small, .detail-amount strong, .detail-amount span { display: block; }
.detail-amount small { color: rgb(255 255 255 / 55%); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.detail-amount strong { margin: 7px 0; font-size: 28px; letter-spacing: -.04em; }
.detail-amount span { color: var(--lime); font-size: 10px; }
.detail-section { margin-top: 26px; }
.detail-section h3 { margin: 0 0 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.detail-grid { display: grid; gap: 13px; }
.detail-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 15px; font-size: 11px; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; text-align: right; }
.review-note { margin-top: 22px; padding: 15px; border: 1px solid #efd9b8; border-radius: 11px; background: var(--amber-soft); }
.review-note b, .review-note span { display: block; }
.review-note b { margin-bottom: 5px; font-size: 11px; }
.review-note span { color: #8b6a3c; font-size: 10px; line-height: 1.5; }
.drawer-actions { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 10px; max-height: 50%; overflow-y: auto; overscroll-behavior-y: contain; padding: 18px max(26px, env(safe-area-inset-right, 0px)) calc(18px + var(--safe-bottom)) max(26px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); background: white; }
.drawer-actions .button { flex: 1 1 120px; min-width: 0; min-height: 44px; padding: 10px 12px; overflow-wrap: anywhere; }
.page-actions { display: flex; gap: 9px; }
.bank-payment { display: flex; align-items: center; gap: 9px; }
.bank-payment > i { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 9px; color: var(--green-700); background: var(--green-100); font-style: normal; font-weight: 850; }
.bank-payment > i.debit { color: #98631d; background: var(--amber-soft); }
.bank-payment > span { min-width: 0; }
.bank-payment b, .bank-payment small { display: block; }
.bank-payment b { overflow: hidden; max-width: 180px; text-overflow: ellipsis; white-space: nowrap; }
.bank-payment small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.bank-hero { padding: 21px; border-radius: 14px; color: white; background: var(--green-950); }
.bank-hero small, .bank-hero strong, .bank-hero span { display: block; }
.bank-hero small { color: rgb(255 255 255 / 55%); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.bank-hero strong { margin: 8px 0; font-size: 27px; }
.bank-hero span { color: var(--lime); font-size: 10px; }
.purpose-card { margin: 0; padding: 14px; border-left: 3px solid var(--green-600); color: #52625d; background: var(--soft); font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.bank-days-surface { margin-bottom: 18px; }
.compact-table .loading-state { min-height: 110px; }
.day-cell b, .day-cell small { display: block; }
.day-cell small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.difference-ok { color: var(--green-600); font-weight: 800; }
.difference-bad { color: var(--red); font-weight: 800; }
.custody-warning { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; padding: 13px 16px; border: 1px solid #efd9b8; border-radius: 13px; background: var(--amber-soft); }
.custody-warning > span { padding: 5px 7px; border-radius: 6px; color: white; background: #a46b1d; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.custody-warning b, .custody-warning p { display: block; margin: 0; }
.custody-warning b { color: #6d4919; font-size: 10px; }
.custody-warning p { margin-top: 3px; color: #8b6a3c; font-size: 9px; }
.custody-reconciliation-card { margin-bottom: 18px; }
.custody-address { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.custody-hash { max-width: 145px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.day-balance-hero { padding: 21px; border-radius: 14px; color: white; background: var(--green-950); }
.day-balance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.day-balance-hero small, .day-balance-hero strong, .day-balance-hero span { display: block; }
.day-balance-hero small { color: rgb(255 255 255 / 55%); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.day-balance-hero strong { margin: 8px 0; font-size: 26px; }
.day-balance-hero span { color: var(--lime); font-size: 10px; }
.client-profile-hero { display: flex; align-items: center; gap: 16px; padding: 19px; border: 1px solid #d7e6e1; border-radius: 14px; background: linear-gradient(120deg, #f1faf7, white); }
.profile-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 54px; height: 54px; border-radius: 15px; color: white; background: var(--green-700); font-size: 15px; font-weight: 850; }
.client-profile-hero h3 { margin: 0 0 4px; font-size: 16px; }
.client-profile-hero p { margin: 0; color: var(--muted); font-size: 10px; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.balance-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfc; }
.balance-card small, .balance-card strong, .balance-card span { display: block; }
.balance-card small { color: var(--green-700); font-size: 9px; font-weight: 850; }
.balance-card strong { margin: 6px 0 9px; font-size: 16px; letter-spacing: -.02em; }
.balance-card span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.compact-empty { margin: 0; padding: 13px; border-radius: 9px; background: var(--soft); font-size: 10px; }
.client-activity-list { display: grid; }
.client-activity { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 57px; border-bottom: 1px solid var(--line); }
.client-activity:last-child { border-bottom: 0; }
.activity-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: var(--green-700); background: var(--green-100); font-size: 12px; font-weight: 850; }
.activity-mark.out { color: #98631d; background: var(--amber-soft); }
.activity-mark.trade { color: #315c9b; background: #eaf1fc; }
.client-activity b, .client-activity small { display: block; }
.client-activity b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.client-activity small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.client-activity > strong { font-size: 10px; text-align: right; }
.case-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px; border-radius: 14px; color: white; background: var(--green-950); }
.case-hero h3 { margin: 10px 0 5px; font-size: 19px; }
.case-hero p { margin: 0; color: rgb(255 255 255 / 58%); font-size: 10px; }
.case-hero .status-badge { flex: 0 0 auto; }
.case-reason { margin: 0; padding: 14px; border-left: 3px solid var(--green-600); color: #52625d; background: var(--soft); font-size: 11px; line-height: 1.6; }
.document-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.document-list li { position: relative; padding: 10px 12px 10px 34px; border: 1px solid var(--line); border-radius: 9px; font-size: 10px; }
.document-list li::before { content: "⌁"; position: absolute; left: 12px; color: var(--green-600); font-weight: 850; }
.document-submission { display: grid; gap: 8px; margin-bottom: 12px; }
.document-submission-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.document-submission-head span { text-align: right; }
.document-file { display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--green-950); background: #fbfdfc; cursor: pointer; text-align: left; }
.document-file:hover { border-color: var(--green-600); background: var(--green-100); }
.document-file span, .document-file small { display: block; overflow-wrap: anywhere; }
.document-file span { font-size: 11px; font-weight: 800; }
.document-file small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.decision-card { margin-top: 24px; padding: 18px; border: 1px solid #d6e3de; border-radius: 13px; background: linear-gradient(130deg, #f1faf7, white); }
.decision-card small, .decision-card strong, .decision-card span { display: block; }
.decision-card small { color: var(--green-700); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.decision-card strong { margin: 7px 0; font-size: 17px; }
.decision-card p { margin: 0 0 10px; color: #53635e; font-size: 10px; line-height: 1.5; }
.decision-card span { color: var(--muted); font-size: 9px; }

.modal-layer { position: fixed; z-index: 60; inset: var(--viewport-top) 0 auto; height: var(--viewport-height); display: grid; place-items: center; padding: calc(20px + var(--safe-top)) max(20px, env(safe-area-inset-right, 0px)) calc(20px + var(--safe-bottom)) max(20px, env(safe-area-inset-left, 0px)); background: rgb(7 26 22 / 55%); backdrop-filter: blur(4px); }
.modal { max-height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; width: min(100%, 430px); padding: 28px; border-radius: 18px; background: white; box-shadow: 0 30px 80px rgb(5 30 24 / 28%); }
.modal-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 13px; color: var(--green-950); background: var(--lime); font-size: 20px; font-weight: 900; }
.modal-mark.is-reject { color: white; background: var(--red); }
.modal h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.03em; }
.modal > p { margin: 0 0 21px; font-size: 11px; line-height: 1.5; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.modal-actions .button { flex: 1 1 120px; min-width: 0; min-height: 44px; padding: 10px 12px; }
.modal-wide { width: min(100%, 680px); max-height: 100%; }
.deposit-credit-summary { display: grid; gap: 10px; margin: 0 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.deposit-credit-summary dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 14px; margin: 0; }
.deposit-credit-summary dt { color: var(--muted); font-size: 12px; }
.deposit-credit-summary dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.custody-wallet-surface { margin-bottom: 18px; }
.trading-pairs-surface, .trading-trades-surface { margin-bottom: 18px; }
.bank-requisites-surface { margin-bottom: 18px; }
.requisite-order { display: inline-grid; place-items: center; min-width: 30px; height: 27px; padding: 0 8px; border-radius: 8px; color: var(--green-700); background: var(--green-100); font-size: 10px; font-weight: 850; }
.requisite-account { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.trading-actions { display: flex; justify-content: flex-end; gap: 7px; }
.trading-actions .table-action { white-space: nowrap; }
.rate-source-detail { max-width: 270px; overflow: hidden; text-overflow: ellipsis; }
.rate-error { max-width: 180px; color: var(--red); overflow: hidden; text-overflow: ellipsis; }
.form-hint { color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.4; }
.field input[readonly] { color: var(--muted); background: var(--soft); }
.custody-wallet-surface .surface-head p:not(.eyebrow) { max-width: 760px; overflow-wrap: anywhere; }
.custody-wallet-address { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wallet-balances { display: grid; gap: 3px; }
.wallet-balances strong { color: var(--ink); font-size: 12px; font-weight: 850; }
.wallet-balances span, .wallet-balance-unavailable { color: var(--muted); font-size: 9px; }
.wallet-balance-unavailable { white-space: normal; }
.wallet-actions { display: flex; justify-content: flex-end; gap: 8px; min-width: 210px; }
.wallet-actions .table-action { white-space: nowrap; }
.custody-wallet-modal textarea { width: 100%; resize: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.organization-form-body { padding: 4px 24px 24px; }
.organization-form .field-wide { grid-column: 1 / -1; }
.organization-actions { display: flex; justify-content: flex-end; }
.color-field { display: grid; grid-template-columns: 54px 1fr; gap: 8px; }
.color-field input[type="color"] { width: 54px; padding: 5px; }
.file-drop { display: grid; place-items: center; min-height: 105px; margin-bottom: 17px; padding: 17px; border: 1px dashed #abc6bc; border-radius: 13px; background: var(--soft); cursor: pointer; text-align: center; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop span { color: var(--green-800); font-size: 12px; font-weight: 800; }
.file-drop small { margin-top: 6px; color: var(--muted); font-size: 9px; }
.template-upload-surface { margin-bottom: 18px; }
.template-upload-body { padding: 0 24px 24px; }
.template-file-drop { margin-top: 5px; }
.template-upload-actions { display: flex; justify-content: flex-end; }
.template-code { display: inline-grid; place-items: center; min-width: 30px; height: 25px; margin-right: 8px; border-radius: 8px; color: var(--green-800); background: var(--green-100); font-size: 10px; font-weight: 850; }
.template-name { display: inline-block; max-width: 310px; vertical-align: middle; overflow-wrap: anywhere; }
.template-hash { display: block; max-width: 145px; margin-top: 4px; color: var(--muted); font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; }
.template-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.partner-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.partner-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.partner-api-key { display: block; max-width: 230px; margin-bottom: 5px; color: var(--green-800); font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.credential-warning { display: grid; gap: 4px; margin: 16px 0; padding: 14px 16px; border: 1px solid #efd29c; border-radius: 12px; background: #fff8e8; color: #765012; }
.credential-warning strong { font-size: 12px; }
.credential-warning span { font-size: 10px; }
#partner-credential-result textarea { width: 100%; resize: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 9px; width: min(calc(100% - 40px), 350px); }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; border: 1px solid #d7e4df; border-radius: 12px; background: white; box-shadow: var(--shadow); animation: toast-in .22s ease-out; }
.toast-mark { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; color: white; background: var(--green-600); font-size: 11px; font-weight: 900; }
.toast.error .toast-mark { background: var(--red); }
.toast b, .toast span { display: block; }
.toast b { font-size: 11px; }
.toast span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .login-story { padding: 36px; }
  .login-panel { padding: 42px; }
}

@media (max-width: 780px) {
  .login-shell { display: block; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 24px; }
  .mobile-brand { display: inline-flex; }
  /* z-index:auto drops the stacking context so the fixed sidebar (z-index 30)
     can sit above the shared overlay (z-index 20) instead of under its blur. */
  .app-shell { display: block; z-index: auto; }
  .sidebar { position: fixed; z-index: 30; top: var(--viewport-top); left: 0; transform: translateX(-105%); width: 236px; transition: transform .23s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .menu-button { display: inline-grid; }
  .topbar { padding: var(--safe-top) 20px 0; }
  .topbar-context { display: none; }
  .content { padding: 25px 18px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 27px; }
  .surface-head { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; }
  .compliance-toolbar { flex-wrap: wrap; }
  .search-field { flex: 1; width: auto; }
  .search-field.client-search { width: auto; }
  .audit-event { grid-template-columns: 36px 1fr 90px; }
  .partner-metrics { grid-template-columns: 1fr; }
  .audit-entity { display: none; }
}

@media (max-width: 560px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 95px; }
  .page-heading { display: block; }
  .page-heading .button { margin-top: 18px; }
  .page-actions { display: grid; }
  .page-actions .button { margin-top: 9px; }
  .toolbar { flex-direction: column; }
  .search-field, .select-field, .select-field select { width: 100%; }
  .user-copy { display: none; }
  .integrity-card { grid-template-columns: auto 1fr; }
  .integrity-card code { display: none; }
  .drawer { width: 100%; }
  .drawer-actions { padding: 15px max(18px, env(safe-area-inset-right, 0px)) calc(15px + var(--safe-bottom)) max(18px, env(safe-area-inset-left, 0px)); }
  .balance-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .deposit-credit-summary dl { grid-template-columns: 1fr; gap: 3px; }
}

.screening-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.signature-import-form { display: grid; gap: 14px; margin-top: 14px; }
.signature-import-preview { max-width: 100%; max-height: 120px; object-fit: contain; background: #fff; border: 1px solid #d8e3df; border-radius: 10px; padding: 12px; }
