:root {
    --navy-950: #081326;
    --navy-900: #0c1b35;
    --navy-800: #10264b;
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --cyan-400: #22d3ee;
    --gold-400: #f8c65a;
    --red-500: #ef4444;
    --green-500: #22c55e;
    --white: #ffffff;
    --text: #e8eefc;
    --muted: #9fb0d0;
    --ink: #102033;
    --line: rgba(255, 255, 255, 0.16);
    --panel: rgba(255, 255, 255, 0.11);
    --panel-strong: rgba(255, 255, 255, 0.18);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
    --radius: 8px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--navy-950);
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.18), transparent 34%),
        linear-gradient(225deg, rgba(34, 211, 238, 0.10), transparent 40%),
        var(--navy-950);
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.glass-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 8px;
    color: var(--white);
    font-weight: 800;
    background: linear-gradient(135deg, var(--blue-600), #0ea5e9);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
}

.brand-lockup strong,
.brand-lockup small {
    display: block;
    overflow-wrap: anywhere;
}

.brand-lockup strong {
    color: var(--white);
    font-size: 0.98rem;
}

.brand-lockup small {
    color: var(--muted);
    margin-top: 2px;
    font-size: 0.78rem;
}

.eyebrow {
    display: inline-block;
    color: var(--cyan-400);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--white);
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
    white-space: nowrap;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--blue-600), #0ea5e9);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.34);
}

.button-outline {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.button-ghost {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.button-warning {
    color: #111827;
    background: linear-gradient(135deg, var(--gold-400), #f59e0b);
    box-shadow: 0 14px 30px rgba(245, 158, 11, 0.24);
}

.button-danger {
    background: linear-gradient(135deg, #dc2626, var(--red-500));
    box-shadow: 0 14px 30px rgba(239, 68, 68, 0.22);
}

.button-full {
    width: 100%;
}

.button-small {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.82rem;
}

.alert {
    width: 100%;
    margin: 0 0 18px;
    padding: 13px 14px;
    border-radius: 8px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.alert-error {
    border: 1px solid rgba(248, 113, 113, 0.36);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.42);
}

.alert-success {
    border: 1px solid rgba(74, 222, 128, 0.34);
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.36);
}

.field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.field label {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
}

.field small,
.muted-text,
.auth-note {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.field input,
.field select,
.field textarea,
.search-bar input {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: var(--white);
    background: rgba(5, 16, 33, 0.6);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input,
.field select,
.search-bar input {
    height: 46px;
    padding: 0 13px;
}

.field textarea {
    min-height: 108px;
    padding: 12px 13px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-bar input:focus {
    border-color: rgba(34, 211, 238, 0.74);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
    background: rgba(5, 16, 33, 0.78);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    min-height: 100vh;
    padding: 28px;
    gap: 28px;
}

.auth-visual {
    position: relative;
    display: flex;
    min-height: calc(100vh - 56px);
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(24px, 4vw, 52px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(150deg, rgba(37, 99, 235, 0.36), rgba(12, 27, 53, 0.88) 44%, rgba(8, 19, 38, 0.96)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 72px);
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 34%;
    background: linear-gradient(0deg, rgba(34, 211, 238, 0.11), transparent);
    pointer-events: none;
}

.auth-copy {
    position: relative;
    max-width: 760px;
    z-index: 1;
}

.auth-copy h1 {
    max-width: 760px;
    margin: 14px 0 16px;
    color: var(--white);
    font-size: 4.6rem;
    line-height: 0.98;
    letter-spacing: 0;
}

.auth-copy p {
    max-width: 620px;
    margin: 0;
    color: #cad7f2;
    font-size: 1.12rem;
    line-height: 1.7;
}

.security-ribbon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 560px;
    color: #d8e4fb;
    line-height: 1.5;
}

.security-ribbon span,
.secure-dot,
.trust-pill span {
    display: inline-block;
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 999px;
    background: var(--green-500);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.auth-card {
    align-self: center;
    width: 100%;
    padding: clamp(24px, 3vw, 36px);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.form-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 4px;
}

.form-heading h2,
.form-heading p {
    margin: 0;
}

.form-heading h2 {
    color: var(--white);
    font-size: 1.35rem;
}

.form-heading p {
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.5;
}

.user-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0;
}

.dashboard-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 10px 0 44px;
}

.welcome-panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: clamp(22px, 4vw, 34px);
}

.welcome-panel h1 {
    margin: 8px 0 10px;
    color: var(--white);
    font-size: 2.6rem;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.welcome-panel p {
    max-width: 720px;
    margin: 0;
    color: #c9d6ef;
    line-height: 1.65;
}

.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
    gap: 22px;
    margin-top: 22px;
    align-items: start;
}

.summary-card,
.reveal-card,
.panel {
    padding: clamp(18px, 3vw, 26px);
}

.card-heading,
.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.card-heading h2,
.panel-heading h2 {
    margin: 6px 0 0;
    color: var(--white);
    font-size: 1.3rem;
    letter-spacing: 0;
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 0 0 20px;
}

.detail-list div {
    display: grid;
    grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: rgba(5, 16, 33, 0.28);
}

.detail-list .detail-wide {
    grid-template-columns: 1fr;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.detail-list dd {
    min-width: 0;
    margin: 0;
    color: var(--white);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.masked-list dd {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0;
}

.balance-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 13px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.14);
}

.spinner {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--cyan-400);
    border-radius: 999px;
    animation: spin 800ms linear infinite;
}

.balance-result {
    min-height: 280px;
    transition: opacity 180ms ease, transform 180ms ease;
}

.balance-result.is-loading {
    opacity: 0.55;
}

.balance-result.is-revealed {
    animation: revealUp 360ms ease both;
}

.empty-state {
    display: grid;
    min-height: 280px;
    place-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
    color: var(--muted);
}

.empty-state h2,
.empty-state p {
    margin: 0;
}

.empty-state h2 {
    color: var(--white);
}

.empty-icon {
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.42), rgba(34, 211, 238, 0.18)),
        rgba(255, 255, 255, 0.06);
}

.balance-amount {
    color: #bbf7d0;
    font-size: 1.7rem;
    overflow-wrap: anywhere;
    text-align: right;
}

.withdraw-actions {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.withdraw-message {
    padding: 16px;
    border: 1px solid rgba(248, 198, 90, 0.55);
    border-radius: 8px;
    color: #111827;
    background: #facc15;
    font-weight: 900;
    line-height: 1.45;
    text-align: center;
    overflow-wrap: anywhere;
}

.withdraw-message.is-active {
    animation: warningBlink 900ms ease-in-out infinite;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.badge-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.16);
}

.badge-muted {
    color: #dbeafe;
    background: rgba(148, 163, 184, 0.18);
}

.badge-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
}

.admin-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(6, 16, 32, 0.88);
    backdrop-filter: blur(18px);
}

.sidebar-brand {
    margin-bottom: 30px;
}

.admin-nav {
    display: grid;
    gap: 8px;
}

.admin-nav a {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 0 14px;
    border-radius: 8px;
    color: #cbd8ef;
    font-weight: 800;
    transition: background 160ms ease, color 160ms ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: var(--white);
    background: rgba(37, 99, 235, 0.25);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 22px;
    color: var(--muted);
}

.sidebar-footer strong {
    color: var(--white);
    overflow-wrap: anywhere;
}

.admin-main {
    min-width: 0;
    padding: 24px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.admin-topbar h1 {
    margin: 3px 0 0;
    color: var(--white);
    font-size: 2.1rem;
    letter-spacing: 0;
}

.icon-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.icon-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--white);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 20px;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    color: var(--white);
    font-size: 2rem;
    overflow-wrap: anywhere;
}

.admin-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 22px;
}

.panel + .panel {
    margin-top: 22px;
}

.panel-heading-actions {
    align-items: center;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.data-table th {
    color: #dce8ff;
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.data-table td {
    color: #edf4ff;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.empty-cell {
    color: var(--muted);
    text-align: center !important;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: inline;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin: 0 0 18px;
}

.search-bar input {
    flex: 1 1 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.field-wide {
    grid-column: 1 / -1;
}

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

.check-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(5, 16, 33, 0.28);
    color: var(--text);
    font-weight: 800;
}

.check-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue-600);
}

.admin-form {
    display: grid;
    gap: 22px;
}

.narrow-form {
    max-width: 560px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: rgba(5, 16, 33, 0.26);
}

.activity-item span {
    color: var(--cyan-400);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.activity-item strong {
    color: var(--white);
    overflow-wrap: anywhere;
}

.activity-item small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.danger-panel {
    border-color: rgba(239, 68, 68, 0.28);
}

.confirm-box {
    margin-bottom: 20px;
}

.confirm-box p {
    color: #fecaca;
    font-weight: 800;
    line-height: 1.55;
}

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

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes warningBlink {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(250, 204, 21, 0);
    }
    50% {
        transform: scale(1.015);
        box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.16);
    }
}

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 420px;
    }

    .auth-copy h1 {
        font-size: 3.35rem;
    }

    .welcome-panel h1 {
        font-size: 2.2rem;
    }

    .account-grid,
    .admin-content-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        z-index: 30;
        width: min(300px, 84vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: var(--shadow);
    }

    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-main {
        padding: 18px;
    }

    .icon-button {
        display: inline-block;
        flex: 0 0 44px;
    }

    .welcome-panel {
        display: grid;
    }

    .trust-pill {
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .auth-shell {
        padding: 14px;
        gap: 14px;
    }

    .auth-visual {
        min-height: 360px;
        padding: 22px;
    }

    .auth-copy h1 {
        font-size: 2.35rem;
    }

    .auth-copy p {
        font-size: 1rem;
    }

    .welcome-panel h1 {
        font-size: 1.85rem;
    }

    .balance-amount,
    .admin-topbar h1,
    .stat-card strong {
        font-size: 1.45rem;
    }

    .auth-card,
    .summary-card,
    .reveal-card,
    .panel {
        padding: 18px;
    }

    .user-topbar {
        width: min(100% - 24px, 1180px);
        align-items: flex-start;
    }

    .user-topbar .button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.86rem;
    }

    .dashboard-shell {
        width: min(100% - 24px, 1180px);
    }

    .detail-list div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stat-grid,
    .form-grid,
    .visibility-grid {
        grid-template-columns: 1fr;
    }

    .search-bar,
    .panel-heading-actions,
    .card-heading,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .search-bar {
        display: grid;
    }

    .button {
        white-space: normal;
    }
}
