* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #0e0e11;
    --bg-2: #16161c;
    --bg-3: #1e1e26;
    --accent: #8b5cf6;
    --accent-2: #a78bfa;
    --text: #ffffff;
    --text-2: #a0a0a8;
    --text-3: #6b6b76;
    --border: #2a2a35;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 14px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.4;
    overscroll-behavior: none;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 17px;
}

.header__logo-icon { font-size: 22px; }

.header__user-name {
    font-size: 13px;
    color: var(--text-2);
    background: var(--bg-3);
    padding: 6px 12px;
    border-radius: 20px;
}

.content {
    flex: 1;
    padding: 16px;
}

.card {
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.card__title {
    font-size: 13px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 600;
}

.balance-card {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    color: #fff;
}

.balance-card__title { font-size: 13px; opacity: 0.85; margin-bottom: 8px; }
.balance-card__amount { font-size: 32px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.5px; }

.balance-card__currencies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.balance-card__currency {
    background: rgba(255, 255, 255, 0.18);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s;
    width: 100%;
    font-family: inherit;
}

.btn:active { transform: scale(0.97); opacity: 0.85; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn--success { background: var(--success); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--warning { background: var(--warning); color: #fff; }
.btn--small { padding: 8px 14px; font-size: 13px; width: auto; }

.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.tile {
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.tile:active { background: var(--bg-3); }
.tile__icon { font-size: 28px; margin-bottom: 6px; display: block; }
.tile__label { font-size: 13px; font-weight: 600; }

.lot {
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.lot__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.lot__name { font-weight: 600; font-size: 15px; flex: 1; }
.lot__price { color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.lot__meta { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }

.lot__id {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg-3);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 6px;
}

.input {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    margin-bottom: 10px;
}

.input:focus { border-color: var(--accent); }

.input-label {
    display: block;
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 6px;
    margin-top: 4px;
    font-weight: 600;
}

textarea.input { resize: vertical; min-height: 80px; }

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottomnav__btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 6px 0;
    font-family: inherit;
    transition: color 0.15s;
}

.bottomnav__btn.active { color: var(--accent-2); }
.bottomnav__icon { font-size: 20px; }
.bottomnav__label { font-size: 10px; font-weight: 600; }

.hidden { display: none !important; }

.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-3);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
    max-width: 90%;
    text-align: center;
    border: 1px solid var(--border);
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast--success { border-color: var(--success); }
.toast--error { border-color: var(--danger); }

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 16px;
}

.modal.show { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); }

.modal__content {
    position: relative;
    background: var(--bg-2);
    border-radius: 16px;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty-state__icon { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state__text { font-size: 14px; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.badge--success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge--danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge--warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge--info { background: rgba(139, 92, 246, 0.15); color: var(--accent-2); }

.admin-tile {
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.15s;
}

.admin-tile:active { background: var(--bg-3); }

.admin-tile__icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-3);
    border-radius: 10px;
}

.admin-tile__content { flex: 1; }
.admin-tile__title { font-weight: 600; font-size: 14px; }
.admin-tile__subtitle { font-size: 12px; color: var(--text-2); }

.log-item {
    background: var(--bg-2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
}

.log-item__row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.log-item__label { color: var(--text-2); font-size: 12px; }
.log-item__value { font-family: monospace; color: var(--text); word-break: break-all; }

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.section-title__back {
    background: var(--bg-3);
    border: none;
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}