:root {
    --ink: #10141f;
    --muted: #6d7586;
    --line: #e3e7ef;
    --soft: #f6f8fb;
    --panel: #ffffff;
    --primary: #f0b90b;
    --primary-dark: #d99f00;
    --accent: #15b8a6;
    --navy: #0b1220;
    --navy-2: #151d2c;
    --danger: #cf3f4f;
    --success: #168a4a;
    --warning: #a76c00;
    --shadow: 0 18px 40px rgba(4, 12, 24, .14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(240, 185, 11, .16), transparent 32rem),
        radial-gradient(circle at top right, rgba(21, 184, 166, .13), transparent 30rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px clamp(16px, 4vw, 48px);
    background: rgba(11, 18, 32, .92);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 16px 36px rgba(4, 12, 24, .20);
    backdrop-filter: blur(16px);
}

main {
    flex: 1 0 auto;
    width: 100%;
}

.has-bottom-tabs main {
    padding-bottom: 86px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: white;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #121212;
    background: linear-gradient(135deg, var(--primary), #ffe48a);
    font-size: 14px;
}

.nav-menu {
    position: relative;
    color: white;
}

.nav-menu summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 8px;
    color: #111827;
    background: var(--primary);
    font-weight: 900;
    cursor: pointer;
}

.nav-menu summary::-webkit-details-marker {
    display: none;
}

.nav-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    min-width: 190px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: #111827;
    box-shadow: var(--shadow);
}

.nav-menu-panel a {
    padding: 11px 12px;
    border-radius: 7px;
    color: rgba(255, 255, 255, .82);
    font-weight: 800;
}

.nav-menu-panel a:hover {
    color: white;
    background: rgba(255, 255, 255, .08);
}

.hero {
    min-height: calc(100vh - 72px);
    display: grid;
    align-items: center;
    padding: 36px clamp(16px, 5vw, 72px) 24px;
    background:
        linear-gradient(115deg, rgba(5, 10, 22, .94), rgba(16, 30, 50, .84), rgba(21, 184, 166, .55)),
        url("../img/hero-market.svg") center/cover no-repeat;
    color: white;
}

.hero-grid {
    display: grid;
    gap: 28px;
    max-width: 1160px;
    margin: 0 auto;
    width: 100%;
}

.hero h1 {
    margin: 0;
    max-width: 740px;
    font-size: clamp(38px, 8vw, 76px);
    line-height: .98;
    letter-spacing: 0;
}

.hero-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 12px;
    border: 1px solid rgba(240, 185, 11, .38);
    border-radius: 999px;
    color: #ffe48a;
    background: rgba(240, 185, 11, .12);
    font-weight: 800;
    font-size: 13px;
}

.hero-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #21e7a6;
    box-shadow: 0 0 18px #21e7a6;
}

.hero p {
    max-width: 660px;
    color: rgba(255, 255, 255, .84);
    font-size: 17px;
    line-height: 1.7;
}

.hero-actions,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hero-stat {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .12);
    border-radius: 8px;
}

.hero-stat strong {
    display: block;
    font-size: 24px;
}

.section {
    padding: 42px clamp(16px, 5vw, 72px);
}

.section-inner {
    max-width: 1160px;
    margin: 0 auto;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head h2,
.panel-title h1,
.auth-card h1 {
    margin: 0;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2,
.grid-3,
.grid-4 {
    grid-template-columns: 1fr;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 14px 35px rgba(17, 31, 49, .07);
}

.glass-card {
    color: white;
    border-color: rgba(255, 255, 255, .22);
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .08));
    box-shadow: none;
}

.asset-chip {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    border-radius: 8px;
    color: white;
    background: linear-gradient(135deg, #111827, var(--asset-color, var(--accent)));
    font-weight: 900;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--asset-color, var(--accent)) 35%, transparent);
    animation: floatIcon 4s ease-in-out infinite;
}

.asset-chip::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: rotate(35deg) translateX(-120%);
    animation: iconShine 3.4s ease-in-out infinite;
}

.market-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.market-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
}

.exchange-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(255, 255, 255, .12);
    color: white;
    background:
        linear-gradient(160deg, rgba(240, 185, 11, .18), transparent 42%),
        linear-gradient(180deg, #111827, #0b1220);
}

.exchange-card .muted,
.profile-hero .muted {
    color: rgba(255, 255, 255, .72);
}

.exchange-card::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -80px;
    top: -80px;
    border-radius: 50%;
    background: rgba(240, 185, 11, .18);
}

.phone-mock {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 24px;
    background: linear-gradient(180deg, #192236, #080d18);
    box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .03);
}

.mini-trade {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
}

.rate-panel {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.plan-card {
    display: grid;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.plan-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), #627eea);
}

.plan-card img {
    width: 100%;
    height: 132px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--soft);
}

.price {
    font-size: 26px;
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    color: #141414;
    background: var(--primary);
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    color: white;
    background: #1f2937;
}

.btn-secondary:hover {
    background: #111827;
}

.btn-danger {
    background: var(--danger);
}

.btn-small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
}

.auth-wrap {
    min-height: calc(100vh - 136px);
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.auth-card {
    width: min(100%, 460px);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

label {
    font-weight: 700;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: auto;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.alert {
    width: min(1120px, calc(100% - 32px));
    margin: 12px auto 0;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: white;
}

.alert-success {
    border-color: rgba(22, 138, 74, .35);
    color: var(--success);
}

.alert-danger {
    border-color: rgba(207, 63, 79, .35);
    color: var(--danger);
}

.alert-warning {
    border-color: rgba(167, 108, 0, .35);
    color: var(--warning);
}

.layout {
    display: grid;
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px clamp(12px, 3vw, 28px);
}

.panel-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel-nav a {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}

.panel-nav a:hover {
    color: var(--ink);
    background: var(--soft);
}

.content {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.metric {
    display: grid;
    gap: 8px;
}

.metric strong {
    font-size: 26px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    background: var(--soft);
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.badge-success {
    color: var(--success);
    background: rgba(22, 138, 74, .10);
}

.badge-warning {
    color: var(--warning);
    background: rgba(233, 185, 73, .20);
}

.badge-danger {
    color: var(--danger);
    background: rgba(207, 63, 79, .10);
}

.split {
    display: grid;
    gap: 16px;
}

.footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 24px clamp(16px, 5vw, 72px);
    color: rgba(255, 255, 255, .68);
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: var(--navy);
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes iconShine {
    0%, 55% {
        transform: rotate(35deg) translateX(-130%);
    }
    100% {
        transform: rotate(35deg) translateX(130%);
    }
}

.inline-form {
    display: inline;
}

.proof {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.pay-qr {
    width: min(260px, 100%);
    aspect-ratio: 1;
    object-fit: cover;
    margin: 0 auto;
    border: 10px solid white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
    color: white;
    background:
        linear-gradient(135deg, rgba(240, 185, 11, .18), transparent),
        linear-gradient(180deg, #111827, #0b1220);
    box-shadow: var(--shadow);
}

.profile-hero h1,
.profile-hero p {
    margin: 0 0 6px;
}

.avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    background: #1f2937;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    color: #111827;
    background: var(--primary);
    font-size: 30px;
    font-weight: 900;
}

.quick-link {
    display: grid;
    gap: 6px;
}

.quick-link strong {
    font-size: 18px;
}

.quick-link span {
    color: var(--muted);
}

.bottom-tabs {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: rgba(11, 18, 32, .94);
    box-shadow: 0 18px 40px rgba(4, 12, 24, .32);
    backdrop-filter: blur(16px);
}

.bottom-tabs a {
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 54px;
    border-radius: 7px;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 800;
}

.bottom-tabs a:hover {
    color: #111827;
    background: var(--primary);
}

.bottom-tabs span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .09);
    font-size: 12px;
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (min-width: 720px) {
    .hero-grid {
        grid-template-columns: 1.3fr .7fr;
        align-items: end;
    }

    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .market-strip {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .split {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 980px) {
    .layout {
        grid-template-columns: 240px 1fr;
        align-items: start;
    }

    .panel-nav {
        position: sticky;
        top: 82px;
        display: grid;
        overflow: visible;
    }
}

/* Premium mobile exchange app layer */
.user-app-shell {
    color: #f8fafc;
    background:
        radial-gradient(circle at 20% -10%, rgba(240, 185, 11, .18), transparent 24rem),
        radial-gradient(circle at 100% 10%, rgba(21, 184, 166, .12), transparent 22rem),
        #070b14;
}

.user-app-shell main {
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 12px 12px 100px;
}

.user-app-shell .layout {
    display: block;
    max-width: none;
    padding: 0;
}

.user-app-shell .panel-nav {
    display: none;
}

.user-app-shell .content {
    gap: 14px;
}

.user-app-shell .card,
.user-app-shell .table-wrap,
.user-app-shell .auth-card,
.user-app-shell .rate-panel {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, .09);
    background: linear-gradient(180deg, rgba(21, 29, 44, .96), rgba(11, 18, 32, .96));
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}

.user-app-shell .muted,
.user-app-shell .quick-link span,
.user-app-shell th {
    color: rgba(248, 250, 252, .62);
}

.user-app-shell input,
.user-app-shell select,
.user-app-shell textarea {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, .11);
    background: rgba(255, 255, 255, .06);
}

.user-app-shell option,
.admin-shell option {
    color: #111827;
}

.user-app-shell .grid-4,
.user-app-shell .grid-3,
.user-app-shell .grid-2,
.user-app-shell .market-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.user-app-shell .metric strong {
    font-size: 20px;
    word-break: break-word;
}

.user-app-shell .panel-title {
    align-items: flex-start;
}

.user-app-shell .panel-title h1,
.user-app-shell h1 {
    font-size: 24px;
    line-height: 1.1;
}

.app-topbar {
    min-height: 64px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, .78);
    font-weight: 800;
}

.desktop-nav a:hover {
    color: white;
}

.wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 58vw;
    padding: 7px 8px 7px 12px;
    border: 1px solid rgba(240, 185, 11, .35);
    border-radius: 999px;
    color: white;
    background: rgba(240, 185, 11, .10);
    font-size: 12px;
    font-weight: 900;
}

.wallet-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-pill img,
.wallet-pill strong {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.wallet-pill img {
    object-fit: cover;
}

.wallet-pill strong {
    display: grid;
    place-items: center;
    color: #111827;
    background: var(--primary);
}

.bottom-tabs {
    left: 50%;
    right: auto;
    bottom: 14px;
    width: min(560px, calc(100% - 24px));
    transform: translateX(-50%);
    border-radius: 22px;
}

.bottom-tabs a {
    border-radius: 16px;
}

.bottom-tabs a strong {
    line-height: 1;
}

.bottom-tabs span {
    color: #111827;
    background: var(--primary);
}

.profile-hero {
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(240, 185, 11, .28), transparent 44%),
        linear-gradient(180deg, #1a2335, #0b1220);
}

.wallet-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 20px;
    color: #111827;
    background:
        linear-gradient(135deg, #f0b90b, #ffe08a);
    box-shadow: 0 22px 60px rgba(240, 185, 11, .20);
}

.wallet-card .muted {
    color: rgba(17, 24, 39, .68);
}

.wallet-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.app-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 2px;
}

.app-section-title h2 {
    margin: 0;
    font-size: 18px;
}

.table-wrap {
    border-radius: 14px;
}

.footer {
    margin-top: auto;
}

@media (min-width: 720px) {
    .user-app-shell .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 980px) {
    .user-app-shell .layout {
        grid-template-columns: 1fr;
    }
}
