﻿:root {
    --bg: #0b0c10;
    --card: #111319;
    --card2: #0f1116;
    --text: #f5f7ff;
    --muted: #a7adbd;
    --line: #1b1f2a;
    --accent: #7c5cff;
    --good: #2ecc71;
    --bad: #ff4d4d;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    --radius: 18px;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
    background: radial-gradient(1200px 600px at 20% -20%, rgba(124,92,255,.25), transparent 60%), radial-gradient(900px 500px at 110% 10%, rgba(46,204,113,.12), transparent 55%), var(--bg);
    color: var(--text);
}

.hidden {
    display: none !important;
}

.grow {
    flex: 1
}

.tiny {
    font-size: 12px
}

.muted {
    color: var(--muted)
}

.divider {
    height: 1px;
    background: var(--line);
    margin: 14px 0
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px calc(14px + env(safe-area-inset-top));
    background: rgba(11,12,16,.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center
}

.logo {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(124,92,255,.18);
    border: 1px solid rgba(124,92,255,.35);
    box-shadow: var(--shadow);
    font-weight: 800;
}

.brandName {
    font-weight: 800;
    letter-spacing: .2px
}

.brandSub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px
}

.container {
    max-width: 460px;
    margin: 0 auto;
    padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); /* space for bottom nav */
}

.card {
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin: 12px 0;
}

.subcard {
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    padding: 12px;
    margin-top: 12px;
}

.cardHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

h1 {
    font-size: 22px;
    margin: 0 0 6px
}

h2 {
    font-size: 16px;
    margin: 0
}

h3 {
    font-size: 14px;
    margin: 0 0 10px;
    color: rgba(245,247,255,.92)
}

p {
    margin: 10px 0 0
}

.row {
    display: flex;
    align-items: center;
    gap: 12px
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    display: grid;
    place-items: center;
    font-weight: 800;
    overflow: hidden;
}

    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

.title {
    font-weight: 800
}

.pill {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(124,92,255,.18);
    border: 1px solid rgba(124,92,255,.35);
    color: rgba(245,247,255,.95);
}

.btn {
    appearance: none;
    border: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    font-weight: 800;
    letter-spacing: .2px;
    color: var(--text);
    background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(124,92,255,.65));
    box-shadow: 0 10px 24px rgba(124,92,255,.18);
    cursor: pointer;
    user-select: none;
}

    .btn:active {
        transform: translateY(1px)
    }

    .btn.small {
        padding: 10px 12px;
        font-size: 13px
    }

    .btn.ghost {
        background: rgba(255,255,255,.05);
        border: 1px solid rgba(255,255,255,.08);
        box-shadow: none;
        font-weight: 700;
    }

.stack {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px
}

    .field span {
        font-size: 12px;
        color: var(--muted)
    }

input, select {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(10,11,15,.6);
    color: var(--text);
    outline: none;
}

    input:focus, select:focus {
        border-color: rgba(124,92,255,.55);
        box-shadow: 0 0 0 4px rgba(124,92,255,.14);
    }

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px
}

.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
}

.itemLeft {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.itemCode {
    font-weight: 900
}

.itemName {
    font-size: 12px;
    color: var(--muted)
}

.itemRight {
    text-align: right
}

.amount {
    font-weight: 900
}

.subAmount {
    font-size: 12px;
    color: var(--muted)
}

.empty {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.03);
    border: 1px dashed rgba(255,255,255,.12);
    color: var(--muted);
    margin-top: 10px;
}

/* Toasts */
.toastHost {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(86px + env(safe-area-inset-bottom)); /* above bottom nav */
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
    max-width: 460px;
    margin: 0 auto;
    pointer-events: none;
}

.toast {
    pointer-events: none;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(17,19,25,.92);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

    .toast b {
        font-weight: 900
    }

    .toast.good {
        border-color: rgba(46,204,113,.35)
    }

    .toast.bad {
        border-color: rgba(255,77,77,.35)
    }

/* Mobile-only blocking overlay */
.desktopBlock {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(11,12,16,.82);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    padding: 20px;
}

.desktopBlockCard {
    width: min(520px, 100%);
    background: rgba(17,19,25,.92);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.desktopTitle {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 8px
}

.desktopText {
    color: var(--muted);
    line-height: 1.4
}

/* Bottom navigation (placeholders) */
.bottomNav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(11,12,16,.82);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,.08);
}

.navItem {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(245,247,255,.82);
    padding: 10px 8px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

    .navItem:active {
        transform: translateY(1px);
    }

.navIcon {
    font-size: 18px;
    line-height: 1;
}

.navLabel {
    font-size: 11px;
    line-height: 1;
    letter-spacing: .2px;
}

.navItem.active {
    background: rgba(124,92,255,.18);
    border: 1px solid rgba(124,92,255,.35);
    color: rgba(245,247,255,.95);
    box-shadow: 0 10px 24px rgba(124,92,255,.12);
}
