:root {
    --bg: #f4f6fb;
    --card-bg: #ffffff;
    --border: #d9e1ec;
    --text: #1f2933;
    --muted: #6c7a89;
    --primary: #2f80ed;
    --danger: #d64545;
    --success: #2d9d5b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container {
    width: min(1120px, 94vw);
    margin: 0 auto;
    padding: 1.5rem 0;
}

.topbar {
    background: #0f172a;
    color: #fff;
    padding: 0.75rem 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.topbar .brand {
    font-weight: 600;
    font-size: 1.1rem;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar nav form {
    margin: 0;
}

.topbar__link-button {
    background: none;
    border: none;
    color: #cbd5f5;
    font: inherit;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.topbar__link-button:hover {
    color: #fff;
}

.topbar nav a {
    color: #cbd5f5;
    text-decoration: none;
    transition: color 0.2s;
}

.topbar nav a:hover {
    color: #fff;
}

main.container {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.section {
    margin-bottom: 2rem;
}

.section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section__header h2 {
    margin: 0;
}

.section__controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section__controls-form {
    margin: 0;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card + .card {
    margin-top: 1rem;
}

.card__section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 1.25rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 960px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.table {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.table__row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1.5fr 1.5fr;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.table__cell {
    min-width: 0;
}

.table--clients .table__row {
    grid-template-columns: 2fr 2fr 1fr 1.4fr 1.5fr;
}

.table__row--head {
    font-weight: 600;
    background: #f0f4ff;
}

.table__row:last-child {
    border-bottom: none;
}

.table__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.table__actions form {
    margin: 0;
}

.table__cell--center {
    display: flex;
    justify-content: center;
    text-align: center;
}

.table__cell--balance,
.table__cell--center {
    align-items: center;
    gap: 0.25rem;
}

.table__cell--balance {
    display: flex;
    justify-content: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(47, 128, 237, 0.3);
}

.button--secondary {
    background: #475569;
}

.button--danger {
    background: var(--danger);
}

.button--success {
    background: var(--success);
}

.button--outline {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
}

.button--small {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.badge {
    background: rgba(47, 128, 237, 0.15);
    color: var(--primary);
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.badge--danger {
    background: rgba(214, 69, 69, 0.15);
    color: var(--danger);
}

.badge--success {
    background: rgba(45, 157, 91, 0.15);
    color: var(--success);
}

.table__cell--wrap {
    word-break: break-all;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.flash {
    margin-bottom: 1.2rem;
    display: grid;
    gap: 0.6rem;
}

.flash__item {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #e2e8f0;
}

.flash__item--success {
    background: rgba(45, 157, 91, 0.15);
    border-color: rgba(45, 157, 91, 0.35);
}

.balance-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.balance-summary__primary {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.balance-summary__label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.balance-summary__value {
    font-size: 1.6rem;
    font-weight: 700;
}

.balance-summary__actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.balance-summary__actions form {
    margin: 0;
}

.balance-summary__list {
    display: grid;
    gap: 0.35rem;
}

.balance-summary__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.balance-summary__currency {
    font-weight: 600;
}

.balance-summary__amount {
    font-variant-numeric: tabular-nums;
}

.balance-summary__timestamp {
    font-size: 0.85rem;
    color: var(--muted);
}

.balance-summary__hint {
    margin-top: 0.5rem;
}

.flash__item--danger {
    background: rgba(214, 69, 69, 0.12);
    border-color: rgba(214, 69, 69, 0.35);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid--compact {
    margin-top: 1rem;
}

.form-grid label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

.form-grid__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-actions {
    display: grid;
    gap: 0.75rem;
}

.quick-actions form {
    display: inline;
}

.wallet-address {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    border-radius: 10px;
    background: #f0f4ff;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 1.15rem;
    font-weight: 600;
    word-break: break-all;
}

.wallet-address code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 10px;
    overflow: auto;
}

.footer {
    background: transparent;
    text-align: center;
    color: var(--muted);
    padding-bottom: 2rem;
}

.login-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
}

.login-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    width: min(360px, 92vw);
    display: grid;
    gap: 1rem;
}

.login-card h1 {
    margin: 0;
    text-align: center;
}

.login-card form {
    display: grid;
    gap: 0.75rem;
}

.login-card label {
    display: grid;
    gap: 0.35rem;
}

.login-card input {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

.login-card button {
    padding: 0.75rem;
    background: var(--primary);
    border-radius: 10px;
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.login-card button:hover {
    transform: translateY(-1px);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 999;
}

.modal--open {
    display: flex;
}

.modal__dialog {
    width: min(480px, 96vw);
}

.modal__content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    display: grid;
    gap: 1rem;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.25);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal__actions .button--secondary {
    background: #cbd5e1;
    color: #1f2933;
}

.button.button--secondary:hover,
.button.button--danger:hover,
.button.button--success:hover {
    transform: translateY(-1px);
}
