:root {
  --ink: #172523;
  --ink-soft: #41514f;
  --teal-900: #123c38;
  --teal-700: #087f72;
  --teal-100: #dceeea;
  --amber: #c88a21;
  --amber-soft: #fff4d8;
  --red: #b94040;
  --red-soft: #ffeded;
  --green: #16725f;
  --surface: #ffffff;
  --canvas: #f2f5f4;
  --line: #d9e0de;
  --muted: #6a7977;
  --sidebar-width: 244px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; letter-spacing: 0; }
a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 28px; line-height: 1.25; }
h2 { margin-bottom: 6px; font-size: 18px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--teal-900); color: white; padding: 24px 16px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; color: white; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.42); background: var(--amber); color: #172523; font-weight: 900; font-family: Georgia, serif; font-size: 22px; }
.brand strong, .brand small { display: block; letter-spacing: 0; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; font-size: 8px; color: #b9d3ce; }
.brand.large .brand-mark { width: 46px; height: 46px; font-size: 26px; }
.environment { margin: 28px 0 20px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.14); font-size: 12px; color: #cfe0dd; display: flex; gap: 8px; align-items: center; }
.environment span { width: 8px; height: 8px; border-radius: 50%; background: #60d5a7; box-shadow: 0 0 0 3px rgba(96,213,167,.14); }
.nav-list { display: grid; gap: 5px; }
.nav-list a { min-height: 54px; padding: 9px 10px; color: #cfe0dd; display: flex; gap: 12px; align-items: center; border-left: 3px solid transparent; }
.nav-list a:hover { background: rgba(255,255,255,.07); color: white; text-decoration: none; }
.nav-list a.active { background: #1b514b; color: white; border-left-color: var(--amber); }
.nav-list a span:last-child { font-size: 13px; }
.nav-list small { display: block; margin-top: 2px; color: #8eb6af; font-size: 8px; }
.nav-symbol { width: 29px; height: 29px; border: 1px solid rgba(255,255,255,.2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.12); color: #d6e4e1; font-size: 10px; }
.sidebar-footer small { display: block; color: #7fa8a1; margin-top: 4px; font-size: 8px; }
.main-column { grid-column: 2; min-width: 0; }
.topbar { height: 72px; padding: 0 32px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.topbar-title strong, .topbar-title small { display: block; }
.topbar-title strong { font-size: 15px; }
.topbar-title small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.user-menu { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.user-menu form { margin: 0; }
.role-tag { background: var(--amber-soft); color: #78500f; padding: 5px 8px; border: 1px solid #efd8a3; }
.icon-text-button, .menu-button { border: 0; background: transparent; cursor: pointer; color: var(--ink-soft); }
.icon-text-button { padding: 7px; }
.menu-button { display: none; width: 38px; height: 38px; font-size: 20px; }
.content { padding: 32px; max-width: 1500px; margin: 0 auto; }
.page-heading { margin-bottom: 26px; }
.page-heading p:last-child { color: var(--muted); margin-bottom: 0; font-size: 13px; }
.split-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.eyebrow { color: var(--teal-700); font-size: 10px; font-weight: 800; margin-bottom: 8px; }
.primary-button, .secondary-button, .danger-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; border-radius: 4px; font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; }
.primary-button { background: var(--teal-700); color: white; }
.primary-button:hover { background: #06695f; text-decoration: none; }
.secondary-button { background: white; color: var(--teal-900); border-color: #afc3bf; }
.secondary-button:hover { border-color: var(--teal-700); text-decoration: none; }
.danger-button { background: white; color: var(--red); border-color: #dfa6a6; }
.full { width: 100%; }
button:disabled { opacity: .48; cursor: not-allowed; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { padding: 12px 14px; border: 1px solid; border-radius: 4px; font-size: 13px; }
.flash.error { color: #842f2f; background: var(--red-soft); border-color: #efc1c1; }
.flash.success { color: #0e5b4d; background: #e5f5ef; border-color: #b8dfd2; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: white; border: 1px solid var(--line); margin-bottom: 34px; }
.metric-strip div { padding: 18px 20px; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip span, .metric-strip strong { display: block; }
.metric-strip span { font-size: 11px; color: var(--muted); }
.metric-strip strong { margin-top: 8px; font-size: 26px; }
.section-heading { margin: 24px 0 14px; display: flex; justify-content: space-between; align-items: end; }
.section-heading h2 { margin: 0; }
.section-heading a { font-size: 12px; }
.balance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.balance-card { min-height: 164px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; }
.balance-card.primary-account { border-top: 3px solid var(--teal-700); }
.balance-card-head { display: flex; justify-content: space-between; align-items: center; }
.currency-badge { min-width: 43px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal-100); color: var(--teal-900); font-weight: 800; font-size: 12px; margin-right: 9px; }
.status-dot { font-size: 10px; color: var(--muted); }
.status-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--red); }
.status-dot.ok::before { background: var(--green); }
.balance-card > strong { font-size: 24px; margin-top: 22px; overflow-wrap: anywhere; }
.balance-card .muted { font-size: 10px; color: var(--muted); margin-top: 4px; }
.balance-card small { margin-top: auto; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.table-section { background: white; border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { background: #f8faf9; color: var(--muted); text-align: left; font-size: 10px; font-weight: 700; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account-table td:first-child { min-width: 145px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.empty-state { color: var(--muted); text-align: center; padding: 36px; }
.status-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border: 1px solid var(--line); background: #f6f8f7; color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.status-pill.large { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.status-pending_review { background: var(--amber-soft); border-color: #ebd39a; color: #775010; }
.status-completed, .status-submitted { background: #e3f4ee; border-color: #addbcd; color: #0e5f50; }
.status-bank_rejected, .status-rejected, .status-failed { background: var(--red-soft); border-color: #edbdbd; color: #8d3232; }
.form-surface { max-width: 720px; background: white; border: 1px solid var(--line); padding: 24px; }
.form-surface.narrow { max-width: 520px; }
.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #bcc8c6; border-radius: 3px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--teal-700); box-shadow: 0 0 0 3px rgba(8,127,114,.11); }
.fx-workspace { max-width: 680px; margin: 0 auto; padding: 16px; background: #e9efed; border: 1px solid #d4dfdc; }
.fx-form { background: white; border: 1px solid var(--line); padding: 24px; }
.fx-form-header { display: flex; justify-content: space-between; gap: 18px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.fx-form-header p { color: var(--muted); font-size: 11px; margin: 0; }
.countdown { padding: 6px 8px; background: var(--amber-soft); color: #745014; font-size: 10px; white-space: nowrap; }
.currency-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; margin-top: 18px; }
.amount-field input { text-align: right; font-size: 24px; font-weight: 800; min-height: 60px; }
.quote-output { min-height: 60px; padding: 9px 12px; border: 1px solid #bcc8c6; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.quote-output span { font-size: 10px; color: var(--muted); }
.quote-output strong { font-size: 23px; margin-top: 4px; }
.account-hint { color: var(--muted); font-size: 9px; margin: 7px 0 0; }
.swap-button { display: grid; place-items: center; width: 38px; height: 38px; margin: 10px auto -8px; border: 1px solid #a9bfbb; border-radius: 50%; background: var(--teal-900); color: white; cursor: pointer; font-size: 18px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; margin: 20px 0 14px; border: 1px solid var(--line); }
.segmented-control label { display: block; cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { min-height: 40px; display: grid; place-items: center; background: white; font-size: 11px; }
.segmented-control label + label span { border-left: 1px solid var(--line); }
.segmented-control input:checked + span { background: var(--teal-100); color: var(--teal-900); }
.quote-message { min-height: 42px; margin-bottom: 12px; padding: 12px; background: var(--amber-soft); color: #765114; font-size: 11px; }
.fx-form .primary-button { margin-top: 10px; }
.review-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.review-heading h1 { margin-bottom: 0; }
.queue-count { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; background: var(--amber-soft); border: 1px solid #ebd39a; color: #775010; font-size: 11px; font-weight: 700; white-space: nowrap; }
.review-table-section { border-top: 3px solid var(--amber); }
.review-table { min-width: 1260px; }
.review-table tbody tr:hover td { background: #fbfcfc; }
.review-table th, .review-table td { padding: 12px; }
.review-table th:nth-child(1) { width: 190px; }
.review-table th:nth-child(2) { width: 105px; }
.review-table th:nth-child(3) { width: 150px; }
.review-table th:nth-child(4) { width: 105px; }
.review-table th:nth-child(5) { width: 230px; }
.review-table th:nth-child(6) { width: 150px; }
.review-order-cell > a { display: block; font-weight: 800; color: var(--teal-900); overflow-wrap: anywhere; }
.currency-pair { font-size: 14px; white-space: nowrap; }
.amount-summary strong { white-space: nowrap; }
.amount-summary small { margin-top: 4px; }
.rate-value { font-size: 13px; }
.account-summary small { margin: 0 0 2px; }
.account-summary small:not(:first-child) { margin-top: 7px; }
.account-summary span { display: block; white-space: nowrap; }
.review-action-head, .review-action-cell { position: sticky; right: 0; min-width: 250px; background: white; border-left: 1px solid var(--line); }
.review-action-head { z-index: 2; background: #f8faf9; }
.review-action-cell { display: grid; grid-template-columns: 72px 1fr 48px; gap: 7px; align-items: center; box-shadow: -6px 0 10px rgba(18,60,56,.04); }
.review-action-cell form { margin: 0; }
.reject-inline-form { display: grid; grid-template-columns: minmax(96px, 1fr) 64px; gap: 6px; }
.reject-inline-form input { min-height: 34px; padding: 6px 8px; font-size: 11px; }
.compact-button { width: 100%; min-height: 34px; padding: 0 10px; font-size: 11px; }
.detail-link { text-align: center; font-size: 11px; }
.empty-panel { padding: 40px; background: white; border: 1px solid var(--line); text-align: center; }
.empty-panel p { color: var(--muted); font-size: 12px; margin-bottom: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: white; border: 1px solid var(--line); }
.detail-grid > div { min-height: 100px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid > div:nth-child(4n) { border-right: 0; }
.detail-grid span, .detail-grid strong { display: block; }
.detail-grid span { color: var(--muted); font-size: 10px; }
.detail-grid strong { margin-top: 10px; font-size: 13px; overflow-wrap: anywhere; }
.review-actions { margin-top: 24px; padding: 22px; background: white; border: 1px solid var(--line); border-left: 3px solid var(--amber); }
.action-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.action-forms form { display: grid; gap: 10px; }
.detail-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.audit-section { margin-top: 30px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; padding: 0 0 18px; }
.timeline li > span { width: 9px; height: 9px; border-radius: 50%; background: var(--teal-700); margin-top: 4px; }
.timeline strong { font-size: 12px; }
.timeline p { color: var(--muted); font-size: 10px; margin: 4px 0 0; }
.error-panel { max-width: 600px; padding: 50px; background: white; border: 1px solid var(--line); text-align: center; margin: 10vh auto; }
.error-panel > strong { font-size: 50px; color: var(--teal-700); }
.login-body { background: var(--teal-900); }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.2fr .8fr; }
.login-brand { padding: 54px 7vw; color: white; display: flex; flex-direction: column; background: var(--teal-900); }
.login-copy { margin: auto 0; max-width: 620px; }
.login-copy .eyebrow { color: #75cdbd; }
.login-copy h1 { font-size: 46px; max-width: 520px; }
.login-copy p:last-child { color: #c8ddda; line-height: 1.8; max-width: 560px; }
.trust-row { display: flex; gap: 24px; color: #9fc3bd; font-size: 10px; }
.login-panel { background: #f4f7f6; display: grid; place-items: center; padding: 30px; }
.login-form-wrap { width: min(390px, 100%); }
.login-form-wrap h2 { font-size: 26px; margin-bottom: 24px; }
.security-note { color: var(--muted); font-size: 10px; margin: 16px 0 0; }
.sidebar-scrim { display: none; }

@media (max-width: 1050px) {
  .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid > div:nth-child(2n) { border-right: 0; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(10,28,26,.48); z-index: 25; }
  .menu-open .sidebar-scrim { display: block; }
  .main-column { width: 100%; }
  .topbar { height: 62px; padding: 0 14px; }
  .menu-button { display: block; }
  .topbar-title { margin-right: auto; margin-left: 8px; }
  .user-name { display: none; }
  .content { padding: 20px 14px 40px; }
  h1 { font-size: 24px; }
  .split-heading { align-items: flex-start; flex-direction: column; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip div:nth-child(2) { border-right: 0; }
  .metric-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .balance-grid { grid-template-columns: 1fr 1fr; }
  .currency-row, .action-forms { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div { border-right: 0; }
  .review-heading { align-items: flex-start; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: 38vh; padding: 30px; }
  .login-copy { margin: 46px 0 30px; }
  .login-copy h1 { font-size: 31px; }
  .trust-row { flex-wrap: wrap; gap: 12px; }
  .login-panel { min-height: 62vh; }
}

@media (max-width: 460px) {
  .balance-grid { grid-template-columns: 1fr; }
  .user-menu { gap: 6px; }
  .role-tag { display: none; }
  .fx-workspace { padding: 8px; }
  .fx-form { padding: 17px; }
}
