:root {
    --bg: #05060b;
    --bg-2: #0a0d16;
    --card: rgba(14, 18, 32, 0.86);
    --line: rgba(120, 230, 255, 0.16);
    --text: #f4f7ff;
    --muted: #8b97b3;
    --cyan: #3ee0ff;
    --blue: #4f7cff;
    --lime: #c8ff3d;
    --lime-dark: #a6e01f;
    --magenta: #ff4fd8;
    --danger: #ff5d73;
    --ok: #4ade80;
    --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: Rajdhani, Outfit, system-ui, sans-serif;
    color: var(--text);
    background:
        radial-gradient(900px 480px at 12% -10%, rgba(80, 40, 160, 0.35), transparent 55%),
        radial-gradient(800px 500px at 100% 0%, rgba(0, 180, 255, 0.18), transparent 50%),
        radial-gradient(700px 400px at 50% 100%, rgba(200, 255, 61, 0.06), transparent 45%),
        var(--bg);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.app {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
}

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

.brand-mark {
    display: block;
    font-family: Orbitron, sans-serif;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
}
.brand-sub {
    display: block;
    margin-top: 4px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.wallet-chip {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(62, 224, 255, 0.12), rgba(20, 24, 40, 0.9));
    border: 1px solid var(--line);
    color: var(--cyan);
    border-radius: 14px;
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
}
.wallet-chip strong {
    display: inline;
    color: var(--lime);
    font-size: 14px;
    font-weight: 800;
}

.app:has(.pill-nav) {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.pill-nav {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    justify-content: center;
    gap: 18px;
    background: rgba(10, 14, 26, 0.92);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 18px;
    margin: 0;
    width: fit-content;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.pill-nav-item {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #6d7d9c;
    transition: 0.2s ease;
}
.pill-nav-item svg { width: 22px; height: 22px; fill: currentColor; }
.pill-nav-item.is-active {
    background: linear-gradient(180deg, #3ee0ff, #4f7cff);
    color: #061018;
}

.flash {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 14px;
}
.flash-ok { background: #11301d; color: var(--ok); }
.flash-error { background: #3a151b; color: var(--danger); }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.section-head h1 {
    margin: 0;
    font-family: Orbitron, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: 0.18s ease;
}
.btn-lime {
    background: var(--lime);
    color: #08100a;
    width: 100%;
}
.btn-lime:hover { background: var(--lime-dark); transform: translateY(-1px); }
.btn-blue {
    background: linear-gradient(180deg, #5b8cff, #3b66e8);
    color: #fff;
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}
.btn-danger { background: #3a151b; color: var(--danger); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.filter-toggle {
    min-width: 76px;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.filter-panel {
    display: none;
    background: linear-gradient(180deg, rgba(16, 22, 40, 0.96), rgba(8, 11, 20, 0.96));
    border: 1px solid rgba(62, 224, 255, 0.28);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(62, 224, 255, 0.12);
}
.filter-panel.is-open { display: grid; gap: 12px; }
.filter-title {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cyan);
}
.filter-row { display: grid; gap: 6px; }
.filter-row label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}
.filter-panel input,
.filter-panel select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: #070b14;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 12px;
    padding: 11px 12px;
    min-height: 44px;
}
.filter-panel select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233ee0ff' d='M1.2 1.2 6 6.2l4.8-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.filter-panel input::placeholder { color: #5b6a86; }
.filter-panel input:focus,
.filter-panel select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(62, 224, 255, 0.12);
}
.filter-price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.filter-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 4px;
}
.filter-actions .btn { width: auto; }
.filter-actions .btn-lime { width: 100%; }
.filter-actions .btn-ghost { padding: 12px 18px; }

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(62, 224, 255, 0.45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.card-img {
    aspect-ratio: 1024 / 473;
    background: #07090f;
    overflow: hidden;
    position: relative;
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.35s ease;
}
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 10px; }
.card-code, .card-tier, .card-price {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}
.card-code { letter-spacing: 0.04em; text-transform: uppercase; }
.card-tier { color: var(--cyan); margin-top: 2px; font-size: 12px; }
.card-price {
    margin: 4px 0 8px;
    color: var(--lime);
    font-size: 14px;
}
.card .btn { padding: 8px; font-size: 14px; }

.detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.hero-img {
    aspect-ratio: 1024 / 473;
    border-radius: 18px;
    overflow: hidden;
    background: #07090f;
    border: 1px solid var(--line);
}
.hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: opacity 0.15s ease;
}

.detail-layout {
    display: grid;
    gap: 22px;
    background: linear-gradient(180deg, rgba(18, 24, 42, 0.95), rgba(10, 13, 22, 0.95));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
}
.detail-back {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-weight: 700;
    color: var(--text);
}
.thumb-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.thumb-grid button {
    padding: 0;
    border: 1px solid rgba(62, 224, 255, 0.22);
    background: #07090f;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1024 / 473;
    width: calc((100% - 24px) / 3);
    cursor: pointer;
}
.thumb-grid button.is-active {
    border-color: var(--cyan);
}
.thumb-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.tier-badge {
    display: inline-block;
    background: rgba(62, 224, 255, 0.14);
    color: var(--cyan);
    border: 1px solid rgba(62, 224, 255, 0.28);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.detail-side h1 {
    font-family: Orbitron, sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin: 14px 0 8px;
    letter-spacing: 0.02em;
}
.detail-price {
    margin: 0 0 12px;
    color: var(--lime);
    font-size: 32px;
    font-weight: 800;
}
.detail-copy {
    margin: 0;
    color: #d7e3f7;
    line-height: 1.5;
}
.detail-actions {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}
.btn-tg,
.btn-ms {
    width: 100%;
    padding: 16px;
    color: #fff;
    border-radius: 14px;
    font-size: 16px;
}
.btn-tg {
    background: #17324f;
}
.btn-ms {
    background: #2f56d8;
}

.page-detail .app { max-width: 1100px; }
.thumbs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.thumbs img {
    width: 120px;
    height: calc(120px * 473 / 1024);
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    flex-shrink: 0;
}

.detail h1 { font-size: 22px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.price-lg { font-size: 20px; font-weight: 800; margin: 8px 0 16px; color: var(--lime); }

.form { display: grid; gap: 12px; }
.form input, .form select, .form textarea {
    width: 100%;
    background: #0b101c;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 12px;
    padding: 12px;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none;
    border-color: var(--cyan);
}
.form label { font-size: 13px; color: var(--muted); }

.profile-hero {
    margin-bottom: 14px;
}
.profile-kicker {
    margin: 0 0 4px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.profile-identity h1 {
    margin: 0 0 4px;
    font-family: Orbitron, sans-serif;
    font-size: 26px;
    letter-spacing: 0.04em;
}
.profile-wallet,
.profile-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 14px;
    backdrop-filter: blur(12px);
}
.profile-wallet .muted { margin: 0; }
.profile-balance {
    margin: 6px 0 10px;
    color: var(--lime);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.profile-wallet-note { line-height: 1.45; }
.profile-panel h2 {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
}
.activity-scroll {
    max-height: calc((5 * 108px) + (4 * 10px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(62, 224, 255, 0.35) transparent;
}
.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.activity-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: rgba(7, 10, 18, 0.45);
}
.activity-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}
.activity-amount { font-weight: 800; }
.activity-amount.is-credit { color: var(--lime); }
.activity-amount.is-debit { color: var(--danger); }
.activity-when {
    margin: 4px 0 8px;
    font-size: 12px;
    color: var(--muted);
}

.auth-card, .panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    backdrop-filter: blur(12px);
}

.page-auth .auth-app {
    max-width: 420px;
    padding-top: 32px;
}
.auth-brand {
    display: block;
    text-align: center;
    margin-bottom: 22px;
}
.auth-brand .brand-mark { font-size: 40px; }
.auth-main { width: 100%; }
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}
.auth-tab {
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 13px;
    color: var(--muted);
}
.auth-tab.is-active {
    background: var(--lime);
    color: #08100a;
    border-color: var(--lime);
}
.auth-card h1 { margin: 0 0 6px; }
.auth-back {
    text-align: center;
    margin-top: 18px;
}
.auth-back a { color: var(--cyan); font-weight: 700; }
.auth-links {
    display: flex;
    gap: 8px;
}

.package-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.package {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    min-height: 118px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
}
.package.is-selected {
    border-color: var(--lime);
}
.package-label {
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.01em;
}
.package-pay {
    color: #c5d0e8;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.package-price {
    margin-top: auto;
    color: var(--lime);
    font-size: 17px;
    font-weight: 800;
}

.id-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}

.order-detail {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
}
.order-detail h3 {
    margin: 0 0 12px;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.order-detail dl {
    margin: 0;
    display: grid;
    gap: 8px;
}
.order-detail dl > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}
.order-detail dt {
    color: var(--muted);
    font-weight: 600;
    margin: 0;
}
.order-detail dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.order-detail .order-total {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}
.order-detail .order-total dd {
    color: var(--lime);
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
}
.cat-card {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    height: auto;
    border-radius: 22px;
    overflow: hidden;
    background: #07090f;
    display: block;
}
.cat-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cat-card-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 10px 14px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.cat-card-title {
    margin: 0;
    padding: 0;
    font-family: Rajdhani, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    text-align: left;
    color: #fff;
    line-height: 1.2;
}

.section-head .btn { width: auto; padding: 8px 12px; font-size: 13px; }
#checkIdBtn { width: auto; }

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 24px 16px 40px;
    z-index: 20;
}
.modal-backdrop.is-open {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
.modal {
    width: min(420px, 100%);
    margin: auto 0;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    flex-shrink: 0;
    pointer-events: auto;
}
.modal .order-detail {
    background: transparent;
    border: 0;
    padding: 0;
}
.order-status { min-height: 1.4em; margin: 12px 0 0; }
.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}
#orderDoneActions { grid-template-columns: 1fr; }
.modal-actions .btn { width: 100%; }
.modal-actions.is-hidden,
.is-hidden { display: none; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap { overflow-x: auto; }
.table th, .table td {
    border-bottom: 1px solid var(--line);
    padding: 8px 6px;
    text-align: left;
    vertical-align: middle;
}
.table input {
    min-width: 110px;
    padding: 8px 10px;
}
.txn-details {
    margin: 0;
    display: grid;
    gap: 4px;
}
.txn-details > div {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    font-size: 13px;
    line-height: 1.35;
}
.txn-details dt {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}
.txn-details dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.badge-ok { background: #11301d; color: var(--ok); }
.badge-sold { background: #3a151b; color: var(--danger); }
.badge-hidden { background: #1a2740; color: var(--muted); }

.footer {
    margin-top: auto;
    padding-top: 28px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line);
    margin-top: 32px;
    padding-top: 18px;
}
.footer-links { display: grid; gap: 6px; text-align: right; color: var(--cyan); }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 40px 10px;
}

.admin-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.stat-grid-3 { grid-template-columns: 1fr; }
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}
.stat-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.stat-value {
    display: block;
    margin-top: 6px;
    font-size: 20px;
    font-weight: 800;
    color: var(--lime);
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.stat-sub {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}
.dash-title {
    margin: 0 0 12px;
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.dash-split {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}
.dash-split .panel { margin: 0; }

@media (min-width: 700px) {
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-split { grid-template-columns: 1fr 1fr; }
}

.market-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.market-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lime);
}

@media (min-width: 700px) {
    .app { max-width: 900px; }
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
    .page-detail .app { max-width: 1100px; }
    .detail-layout {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        align-items: start;
        gap: 32px;
        padding: 20px;
    }
    .detail-side h1 { font-size: 36px; }
    .detail-price { font-size: 36px; }
}

@media (max-width: 699px) {
    .thumb-grid button { width: calc((100% - 24px) / 3); }
}

@media (min-width: 1100px) {
    .app { max-width: 1120px; }
    .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
