:root {
    --blue: #2f6fed;
    --blue-soft: #e8f1ff;
    --ink: #1c2434;
    --muted: #8b93a7;
    --line: #e7ebf3;
    --green: #e7f8ef;
    --card: #f4f7fb;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: #f6f8fb;
    font-family: "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f4f7fb;
}
.login-card {
    width: min(420px, calc(100% - 32px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 36px 32px;
}
.brand-logo { height: 42px; width: auto; display: block; }
.login-card .brand-logo { height: 52px; margin-bottom: 8px; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
}
.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 28px;
}
.nav-item {
    width: 100%;
    border: 0;
    background: var(--blue-soft);
    color: var(--blue);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}
.nav-item em {
    margin-left: auto;
    font-style: normal;
    font-size: 10px;
    letter-spacing: .04em;
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
    padding: 3px 7px;
}
.nav-flag {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(#ff9933 0 33%, #fff 33% 66%, #138808 66%);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.sidebar-foot { margin-top: auto; font-size: 14px; }
.sidebar-foot a { color: var(--muted); }
.who { font-weight: 600; margin-bottom: 6px; }
.workspace { margin-left: 260px; min-height: 100vh; }
.topbar { padding: 22px 28px 0; }
.topbar h1 { font-size: 22px; margin: 0; }
#content { padding: 18px 28px 40px; }
.loading, .empty { color: var(--muted); padding: 18px 0; }
.wallet-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 22px;
}
.balance-card, .panel-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}
.balance-card { background: var(--card); padding: 22px; margin-bottom: 16px; }
.balance-label { display: flex; align-items: center; gap: 8px; color: #667085; }
.balance-value { font-size: 40px; font-weight: 700; margin: 8px 0 18px; }
.action-row { display: flex; gap: 28px; }
.action-btn {
    border: 0;
    background: transparent;
    color: #667085;
    display: grid;
    justify-items: center;
    gap: 6px;
    font-size: 13px;
}
.action-btn svg {
    width: 46px;
    height: 46px;
    background: #e7f0ff;
    border-radius: 14px;
    padding: 12px;
    stroke: var(--blue);
    fill: none;
    stroke-width: 1.8;
}
.panel-card { padding: 8px 18px 12px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.panel-head h2 { font-size: 16px; margin: 0; }
.panel-head input {
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 220px;
}
.holding-row, .tx-row, .invoice-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.token-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e8f8ef;
    color: #12a150;
    font-weight: 700;
}
.tx-time { font-weight: 600; font-size: 13px; }
.tx-date, .tx-kind { color: var(--muted); font-size: 12px; }
.tx-kind { min-width: 110px; }
.tx-amt { margin-left: auto; font-weight: 600; }
.status {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #12a150;
    background: #e7f8ef;
    border-radius: 8px;
    padding: 4px 8px;
}
.status-failed, .status-expired, .status-disputed { color: #c2410c; background: #fff1e8; }
.status-pending, .status-created, .status-initiated, .status-confirming, .status-waiting-for-payment { color: #b45309; background: #fff7e8; }
.link-btn, .text-btn {
    border: 0;
    background: transparent;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}
.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(22, 28, 45, .35);
    display: grid;
    place-items: center;
    z-index: 20;
    padding: 24px;
}
.modal-back[hidden] { display: none !important; }
.sheet {
    width: min(680px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    padding: 18px 22px 22px;
}
.sheet-head, .sheet-tabs { display: flex; align-items: center; gap: 8px; }
.sheet-head { justify-content: space-between; margin-bottom: 14px; }
.sheet-tab, .close-x {
    border: 0;
    background: #f3f5f8;
    border-radius: 999px;
    padding: 6px 12px;
}
.sheet-tab.active { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.close-x { width: 32px; height: 32px; }
.segment {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}
.segment button { border: 0; background: #fff; padding: 12px; color: #98a2b3; font-weight: 700; }
.segment button.active { background: var(--blue-soft); color: var(--blue); border-radius: 12px; }
.info-banner {
    background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3C/svg%3E");
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    color: #3f6b52;
}
.field { display: block; margin-bottom: 14px; }
.field span { display: block; color: #667085; font-size: 13px; margin-bottom: 6px; }
.field i, .req-rose, .req-mint, .info-dot {
    font-style: normal;
    border-radius: 6px;
    font-size: 10px;
    padding: 1px 5px;
    font-weight: 700;
}
.req-rose, .field i { color: #e11d48; background: #ffe4ea; }
.field i.req-mint { color: #12a150; background: #e7f8ef; }
.info-dot {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 50%;
    color: #98a2b3;
    background: #f2f4f7;
}
.receive-sheet { width: min(760px, 100%); min-height: min(820px, calc(100vh - 48px)); display: flex; flex-direction: column; }
.receive-sheet [data-receive-pane="form"] { display: flex; flex-direction: column; flex: 1; }
.receive-sheet .sheet-submit { margin-top: auto; }
.receive-sheet [data-receive-pane="form"][hidden] { display: none; }
.receive-banner { display: flex; align-items: center; justify-content: space-between; }
.receive-banner.is-collapsed span { display: none; }
.banner-toggle { border: 0; background: transparent; color: #3f6b52; font-size: 18px; line-height: 1; }
.picker { position: relative; }
.picker-face {
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 36px 10px 14px;
    background: #fff;
}
.picker select {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    height: 100%;
}
.coin {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex: none;
    background: #98a2b3;
}
.coin-usdt { background: #26a17b; }
.coin-usdc { background: #2775ca; }
.coin-dai { background: #f5ac37; color: #fff; }
.coin-trx { background: #ef0027; }
.coin-eth { background: #627eea; }
.coin-bsc { background: #f3ba2f; color: #1c2434; }
.coin-matic { background: #8247e5; }
.picker-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.picker-copy strong, .picker-copy small { display: block; }
.picker-copy small, .picker-side { color: #98a2b3; font-size: 12px; }
.picker-side { margin-left: auto; }
.picker-chevron { position: absolute; right: 14px; color: #98a2b3; }
.field input, .field select, .amount-line input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.amount-line { position: relative; }
.amount-line .text-btn { position: absolute; right: 12px; top: 12px; }
.hint-row, .quote-box div, .invoice-row { display: flex; justify-content: space-between; gap: 12px; }
.hint-row { color: #667085; font-size: 13px; margin-top: 8px; }
.quote-box {
    background: #f7f8fb;
    border-radius: 14px;
    padding: 14px;
    margin: 8px 0 12px;
}
.quote-box div { padding: 6px 0; }
.details { background: #f7f8fb; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.sheet-submit {
    width: 100%;
    border: 0;
    background: #f3f4f6;
    color: #98a2b3;
    border-radius: 12px;
    padding: 14px;
    font-weight: 700;
    letter-spacing: .08em;
}
.sheet-submit:not(:disabled) { background: var(--blue); color: #fff; }
.form-msg { min-height: 1.2em; color: #c2410c; font-size: 14px; }
.form-msg.ok { color: #15803d; }
.result-box {
    background: #f4fbf7;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    word-break: break-all;
}
@media (max-width: 980px) {
    .sidebar { position: static; width: auto; }
    .workspace { margin-left: 0; }
    .wallet-grid, .field-grid { grid-template-columns: 1fr; }
}
