/* =========================================================
   BUYWELL CORE BASE — SUPER GALAXY FOUNDATION UI
   Global base for Dashboard / Wallet / History / Salary / Profile / Operations
   Keep existing HTML and class names
========================================================= */

:root {
    color-scheme: dark;

    --bg: #030511;
    --bg-2: #071022;
    --bg-3: #0d0620;

    --glass: rgba(12, 20, 42, 0.58);
    --glass-2: rgba(18, 29, 56, 0.74);
    --glass-3: rgba(255, 255, 255, 0.064);

    --line: rgba(255, 255, 255, 0.125);
    --line-strong: rgba(255, 255, 255, 0.235);

    --text: #f8fbff;
    --muted: #aab6ca;
    --soft: #7989a4;

    --cyan: #20e8d2;
    --green: #44f0a8;
    --blue: #68a2ff;
    --pink: #ff72d2;
    --gold: #ffd166;
    --red: #ff6179;
    --violet: #a989ff;

    --radius: 24px;
    --radius-sm: 16px;
    --radius-lg: 34px;

    --shadow: 0 28px 96px rgba(0, 0, 0, 0.48);
    --shadow-soft: 0 18px 58px rgba(0, 0, 0, 0.32);
    --glow-cyan: 0 0 42px rgba(32, 232, 210, 0.14);
    --glow-pink: 0 0 42px rgba(255, 114, 210, 0.13);
    --glow-gold: 0 0 42px rgba(255, 209, 102, 0.12);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    --header-h: 82px;
    --nav-h: 84px;

    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ==============================
   Reset / Base
============================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family: var(--font);
    letter-spacing: 0;
    background:
        radial-gradient(circle at 12% 10%, rgba(32, 232, 210, 0.25), transparent 31rem),
        radial-gradient(circle at 88% 8%, rgba(255, 114, 210, 0.19), transparent 30rem),
        radial-gradient(circle at 54% 88%, rgba(104, 162, 255, 0.2), transparent 32rem),
        radial-gradient(circle at 12% 92%, rgba(255, 209, 102, 0.12), transparent 26rem),
        linear-gradient(180deg, #030511 0%, #071022 48%, #030511 100%);
    background-attachment: fixed;
}

body::selection {
    color: #03120f;
    background: var(--cyan);
}

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

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

button {
    border: 0;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a[href] {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

img {
    display: block;
    max-width: 100%;
}

svg {
    display: block;
}

.translate-anchor,
.goog-te-banner-frame,
.goog-te-balloon-frame,
.skiptranslate iframe {
    display: none !important;
}

body {
    top: 0 !important;
}

html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] .mono,
html[dir="rtl"] code {
    direction: ltr;
}

html[dir="rtl"] .mono,
html[dir="rtl"] code {
    text-align: left;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ui-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 3px solid rgba(32, 232, 210, 0.72);
    outline-offset: 3px;
}

/* ==============================
   Animated Galaxy Backdrop
============================== */

.animated-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
}

.animated-backdrop::before,
.animated-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
}

.animated-backdrop::before {
    opacity: 0.48;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.8px),
        radial-gradient(circle, rgba(32, 232, 210, 0.54) 0 1px, transparent 1.7px),
        radial-gradient(circle, rgba(255, 209, 102, 0.52) 0 1px, transparent 1.7px);
    background-position: 0 0, 34px 48px, 70px 18px;
    background-size: 94px 94px, 132px 132px, 178px 178px;
    mask-image: linear-gradient(to bottom, black, rgba(0, 0, 0, 0.24));
    animation: starDrift 32s linear infinite;
}

.animated-backdrop::after {
    opacity: 0.4;
    background:
        linear-gradient(115deg, transparent 0 24%, rgba(32, 232, 210, 0.12) 36%, transparent 52%),
        linear-gradient(75deg, transparent 0 34%, rgba(255, 209, 102, 0.105) 44%, transparent 60%),
        linear-gradient(245deg, transparent 0 38%, rgba(255, 114, 210, 0.095) 50%, transparent 64%);
    filter: blur(2px);
    animation: nebulaSweep 18s ease-in-out infinite alternate;
}

.animated-backdrop span {
    position: absolute;
    width: 44rem;
    height: 44rem;
    border-radius: 50%;
    opacity: 0.19;
    filter: blur(62px);
    background: conic-gradient(from 90deg, var(--cyan), var(--blue), var(--pink), var(--cyan));
    animation: plasmaFloat 18s ease-in-out infinite;
}

.animated-backdrop span:nth-child(1) {
    top: -22rem;
    left: -14rem;
}

.animated-backdrop span:nth-child(2) {
    top: 10rem;
    right: -18rem;
    background: conic-gradient(from 45deg, var(--gold), var(--pink), var(--violet), var(--gold));
    animation-delay: -6s;
}

.animated-backdrop span:nth-child(3) {
    left: 26%;
    bottom: -27rem;
    background: conic-gradient(from 210deg, var(--green), var(--cyan), var(--blue), var(--green));
    animation-delay: -10s;
}

.animated-backdrop span:nth-child(4) {
    right: 22%;
    bottom: -31rem;
    opacity: 0.12;
    background: conic-gradient(from 130deg, var(--violet), var(--blue), var(--gold), var(--violet));
    animation-delay: -14s;
}

/* ==============================
   Global Animations
============================== */

@keyframes starDrift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-96px, 96px, 0);
    }
}

@keyframes nebulaSweep {
    from {
        transform: translateX(-4%) scale(1);
    }
    to {
        transform: translateX(4%) scale(1.045);
    }
}

@keyframes plasmaFloat {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    }
    50% {
        transform: translate3d(2rem, -1.6rem, 0) rotate(26deg) scale(1.08);
    }
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.982);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes shimmer {
    0%,
    42% {
        transform: translateX(-130%);
    }
    72%,
    100% {
        transform: translateX(130%);
    }
}

@keyframes softPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(32, 232, 210, 0.28);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(32, 232, 210, 0);
    }
}

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

@keyframes heroGridDrift {
    to {
        background-position: 32px 32px, 32px 32px;
    }
}

@keyframes navSweep {
    0%,
    42% {
        transform: translateX(-120%);
    }
    62%,
    100% {
        transform: translateX(120%);
    }
}

/* ==============================
   Site Loader
============================== */

.site-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    gap: 24px;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 42%, rgba(32, 232, 210, 0.25), transparent 20rem),
        radial-gradient(circle at 58% 52%, rgba(255, 114, 210, 0.17), transparent 24rem),
        radial-gradient(circle at 45% 60%, rgba(255, 209, 102, 0.11), transparent 22rem),
        linear-gradient(180deg, rgba(5, 7, 19, 0.985), rgba(6, 9, 24, 0.965));
    opacity: 1;
    visibility: visible;
    transition:
        opacity 420ms ease,
        visibility 420ms ease,
        transform 420ms var(--ease),
        filter 420ms ease;
}

.site-loader:not(.is-active) {
    display: none;
}

.site-loader.is-hidden {
    animation: loaderFadeOut 520ms var(--ease) forwards;
}

.loader-cosmos {
    position: relative;
    width: min(62vw, 310px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.loader-ring,
.loader-core,
.loader-cosmos i {
    position: absolute;
    border-radius: 50%;
}

.loader-ring {
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background:
        conic-gradient(
            from 0deg,
            transparent,
            rgba(32, 232, 210, 0.9),
            transparent 34%,
            rgba(255, 114, 210, 0.72),
            transparent 64%,
            rgba(255, 209, 102, 0.86),
            transparent
        );
    mask: radial-gradient(circle, transparent 61%, black 62%);
    filter: drop-shadow(0 0 24px rgba(32, 232, 210, 0.2));
    animation: loaderOrbit 3.2s linear infinite;
}

.ring-two {
    inset: 15%;
    opacity: 0.78;
    animation: loaderOrbitReverse 4.5s linear infinite;
}

.ring-three {
    inset: 28%;
    opacity: 0.86;
    animation-duration: 2.4s;
}

.loader-core {
    width: 28%;
    aspect-ratio: 1;
    background:
        radial-gradient(circle at 35% 30%, #ffffff, var(--gold) 20%, var(--cyan) 48%, var(--pink) 82%);
    animation: loaderCorePulse 1.8s ease-in-out infinite;
}

.loader-cosmos i {
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    background: #fff;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.8);
    --spark-rotate: 0deg;
    animation: loaderSpark 1.8s ease-in-out infinite;
}

.loader-cosmos i:nth-of-type(2) {
    --spark-rotate: 58deg;
    animation-delay: -0.2s;
    background: var(--cyan);
}

.loader-cosmos i:nth-of-type(3) {
    --spark-rotate: 126deg;
    animation-delay: -0.45s;
    background: var(--gold);
}

.loader-cosmos i:nth-of-type(4) {
    --spark-rotate: 198deg;
    animation-delay: -0.68s;
    background: var(--pink);
}

.loader-cosmos i:nth-of-type(5) {
    --spark-rotate: 262deg;
    animation-delay: -0.92s;
    background: var(--blue);
}

.loader-cosmos i:nth-of-type(6) {
    --spark-rotate: 318deg;
    animation-delay: -1.18s;
    background: var(--green);
}

.loader-copy {
    position: fixed;
    left: 50%;
    bottom: clamp(42px, 9vh, 90px);
    width: min(340px, calc(100% - 48px));
    display: grid;
    gap: 14px;
    transform: translateX(-50%);
    text-align: center;
}

.loader-copy strong {
    font-size: clamp(1.4rem, 5vw, 2.4rem);
    font-weight: 950;
    text-transform: uppercase;
    text-shadow: 0 0 28px rgba(32, 232, 210, 0.34);
}

.loader-bar {
    height: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.loader-bar span {
    display: block;
    width: 72%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--gold), var(--pink));
    box-shadow: 0 0 24px rgba(32, 232, 210, 0.45);
    transform-origin: left;
    animation: loaderBar 1.35s ease-in-out infinite;
}

@keyframes loaderFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
        transform: scale(1.02);
        filter: blur(14px);
    }
}

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

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

@keyframes loaderCorePulse {
    0%,
    100% {
        transform: scale(0.92);
        box-shadow:
            0 0 34px rgba(32, 232, 210, 0.42),
            0 0 86px rgba(255, 114, 210, 0.22);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 54px rgba(255, 209, 102, 0.42),
            0 0 110px rgba(32, 232, 210, 0.26);
    }
}

@keyframes loaderBar {
    0% {
        transform: translateX(-100%) scaleX(0.28);
    }
    45% {
        transform: translateX(-18%) scaleX(0.82);
    }
    100% {
        transform: translateX(100%) scaleX(0.35);
    }
}

@keyframes loaderSpark {
    0%,
    100% {
        opacity: 0.25;
        transform: rotate(var(--spark-rotate)) translateY(-112px) scale(0.82);
    }
    50% {
        opacity: 1;
        transform: rotate(var(--spark-rotate)) translateY(-132px) scale(1.2);
    }
}

/* ==============================
   Page Shell / Page Transitions
============================== */

.page-shell {
    width: min(1380px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--header-h) + 30px) 0 calc(var(--nav-h) + 30px);
    transform-origin: 50% 46%;
    animation: pageIn 560ms var(--ease) both;
    transition:
        opacity 260ms ease,
        transform 260ms var(--ease),
        filter 260ms ease;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    transform-origin: 50% 46%;
    animation: pageIn 560ms var(--ease) both;
    transition:
        opacity 260ms ease,
        transform 260ms var(--ease),
        filter 260ms ease;
}

.page-dashboard .page-shell {
    animation-name: pageInCommand;
}

.page-wallet .page-shell {
    animation-name: pageInDock;
}

.page-history .page-shell {
    animation-name: pageInLedger;
}

.page-salary .page-shell {
    animation-name: pageInLift;
}

.page-profile .page-shell {
    animation-name: pageInPrism;
}

.page-operation .page-shell {
    animation-name: pageInOperation;
}

.page-leave .page-shell,
.page-leave .auth-shell {
    opacity: 0;
    transform: translateY(-12px) scale(0.985);
    filter: blur(12px);
}

.page-transition {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 48%, rgba(32, 232, 210, 0.24), transparent 18rem),
        rgba(2, 5, 14, 0.58);
    backdrop-filter: blur(0);
    transition:
        opacity 260ms ease,
        backdrop-filter 260ms ease;
}

.page-transition span {
    position: absolute;
    width: min(46vw, 340px);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(32, 232, 210, 0.34);
    box-shadow: 0 0 44px rgba(32, 232, 210, 0.18);
    opacity: 0;
    transform: scale(0.8);
}

.page-transition span:nth-child(2) {
    width: min(62vw, 470px);
    border-color: rgba(255, 114, 210, 0.28);
    box-shadow: 0 0 54px rgba(255, 114, 210, 0.14);
}

.page-transition strong {
    color: var(--text);
    font-size: clamp(1rem, 3vw, 1.7rem);
    font-weight: 950;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 220ms ease,
        transform 220ms var(--ease);
}

.transition-grid,
.transition-beam {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.transition-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    transform: perspective(900px) rotateX(68deg) translateY(18%);
    transform-origin: 50% 100%;
}

.transition-beam {
    background:
        linear-gradient(
            90deg,
            transparent 0 18%,
            rgba(32, 232, 210, 0.22) 38%,
            rgba(255, 209, 102, 0.17) 50%,
            rgba(255, 114, 210, 0.22) 62%,
            transparent 82%
        ),
        linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    clip-path: polygon(0 38%, 100% 25%, 100% 76%, 0 62%);
    transform: translateX(-110%);
}

.page-leave .page-transition {
    opacity: 1;
    backdrop-filter: blur(22px) saturate(165%);
}

.page-leave .page-transition span {
    opacity: 1;
    animation: transitionOrbit 780ms linear infinite;
}

.page-leave .page-transition strong {
    opacity: 1;
    transform: translateY(0) scale(1.04);
}

.page-leave .transition-grid {
    opacity: 0.42;
    animation: transitionGridRush 560ms var(--ease) both;
}

.page-leave .transition-beam {
    opacity: 1;
    animation: transitionBeam 560ms var(--ease) both;
}

@keyframes pageInCommand {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
        filter: blur(10px) saturate(80%);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0) saturate(100%);
    }
}

@keyframes pageInDock {
    from {
        opacity: 0;
        transform: translateX(22px) scale(0.985);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pageInLedger {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.99);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pageInLift {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pageInPrism {
    from {
        opacity: 0;
        transform: translateY(12px) rotateX(4deg) scale(0.985);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pageInOperation {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.99);
        filter: blur(9px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes transitionOrbit {
    from {
        transform: rotate(0deg) scale(0.86);
    }
    to {
        transform: rotate(360deg) scale(1.08);
    }
}

@keyframes transitionGridRush {
    from {
        transform: perspective(900px) rotateX(68deg) translateY(18%) scale(1);
    }
    to {
        transform: perspective(900px) rotateX(68deg) translateY(0) scale(1.35);
    }
}

@keyframes transitionBeam {
    0% {
        transform: translateX(-110%);
        filter: blur(0);
    }
    52% {
        transform: translateX(0);
        filter: blur(1px);
    }
    100% {
        transform: translateX(110%);
        filter: blur(0);
    }
}

/* ==============================
   Topbar
============================== */

.topbar {
    position: fixed;
    z-index: 70;
    top: 14px;
    left: 50%;
    width: min(1380px, calc(100% - 32px));
    min-height: var(--header-h);
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto minmax(290px, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(32, 232, 210, 0.12), transparent 34%),
        radial-gradient(circle at 92% 100%, rgba(255, 114, 210, 0.09), transparent 34%),
        linear-gradient(135deg, rgba(10, 18, 36, 0.84), rgba(16, 20, 42, 0.64));
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    transform: translateX(-50%);
    transition:
        transform 260ms var(--ease),
        border-color 260ms ease,
        box-shadow 260ms ease,
        background 260ms ease;
}

.topbar:hover {
    border-color: rgba(32, 232, 210, 0.22);
    box-shadow:
        var(--shadow),
        var(--glow-cyan),
        inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.topbar::before,
.glass-card::before,
.panel::before,
.stat-card::before,
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.13) 45%, transparent 62%);
    transform: translateX(-130%);
    animation: shimmer 8s ease-in-out infinite;
}

.topbar-user,
.topbar-actions,
.hero-actions,
.split-row,
.inline-fields,
.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    min-width: 0;
}

.topbar-user strong,
.topbar-user span,
.balance-pill span,
.balance-pill strong {
    display: block;
}

.topbar-actions {
    justify-content: flex-end;
    min-width: 0;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ==============================
   Header Items
============================== */

.balance-pill,
.ref-chip,
.brand,
.avatar-button,
.primary-button,
.secondary-button,
.text-link,
.bottom-nav a,
.operation-card,
.history-filters a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition:
        transform 220ms var(--ease),
        border-color 220ms ease,
        background 220ms ease,
        color 220ms ease,
        box-shadow 220ms ease;
}

.balance-pill::after,
.ref-chip::after,
.brand::after,
.primary-button::after,
.secondary-button::after,
.operation-card::after,
.history-filters a::after,
.bottom-nav a::after,
.stat-card .surface-light,
.panel .surface-light {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.2), transparent 34%);
    transition: opacity 220ms ease;
}

.balance-pill:hover::after,
.ref-chip:hover::after,
.brand:hover::after,
.primary-button:hover::after,
.secondary-button:hover::after,
.operation-card:hover::after,
.history-filters a:hover::after,
.bottom-nav a:hover::after {
    opacity: 1;
}

.balance-pill {
    min-width: 136px;
    padding: 9px 12px;
    align-items: flex-start;
    flex-direction: column;
    border: 1px solid rgba(32, 232, 210, 0.25);
    background:
        radial-gradient(circle at 8% 0%, rgba(32, 232, 210, 0.16), transparent 34%),
        rgba(32, 232, 210, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.balance-pill span,
.ref-chip span,
.stat-card span,
.fee-grid span,
.security-list span,
.qualification span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.balance-pill strong {
    color: var(--cyan);
    text-shadow: 0 0 18px rgba(32, 232, 210, 0.3);
}

.brand {
    position: relative;
    min-height: 54px;
    min-width: 208px;
    padding: 0 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 209, 102, 0.3);
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(32, 232, 210, 0.13)),
        rgba(255, 255, 255, 0.052);
    font-size: 1.06rem;
    font-weight: 950;
    text-transform: uppercase;
    box-shadow:
        0 16px 44px rgba(0, 0, 0, 0.24),
        var(--glow-gold);
}

.brand-orbit {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: conic-gradient(from 10deg, var(--cyan), var(--blue), var(--pink), var(--gold), var(--cyan));
    box-shadow: 0 0 26px rgba(32, 232, 210, 0.28);
    animation: orbitSpin 6s linear infinite;
}

.ref-chip {
    max-width: 260px;
    min-height: 44px;
    display: grid;
    padding: 0 12px;
    border: 1px solid var(--line);
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.09), transparent 34%),
        rgba(255, 255, 255, 0.055);
    color: var(--text);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065);
}

.ref-chip strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ref-chip .copy-icon {
    width: 15px;
    height: 15px;
    color: var(--cyan);
    opacity: 0.84;
}

.ref-link-chip {
    max-width: 310px;
}

.ref-link-chip .copy-icon {
    color: var(--gold);
}

.language-picker {
    position: relative;
    min-width: 112px;
    min-height: 44px;
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    padding: 0 10px;
    overflow: hidden;
    border: 1px solid rgba(104, 162, 255, 0.2);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 0%, rgba(104, 162, 255, 0.16), transparent 34%),
        rgba(255, 255, 255, 0.052);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.language-picker::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0.74;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

html[dir="rtl"] .language-picker::after {
    right: auto;
    left: 10px;
}

.language-picker .ui-icon {
    width: 17px;
    height: 17px;
    color: var(--cyan);
}

.language-picker select {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    padding: 0 16px 0 0;
    border: 0;
    outline: 0;
    appearance: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 950;
    cursor: pointer;
}

html[dir="rtl"] .language-picker select {
    padding: 0 0 0 16px;
}

.language-picker select option {
    color: #091020;
    background: #f9fbff;
}

.auth-language-wrap {
    position: fixed;
    z-index: 80;
    top: 18px;
    right: 18px;
}

html[dir="rtl"] .auth-language-wrap {
    right: auto;
    left: 18px;
}

.avatar-button {
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.54), transparent 24%),
        linear-gradient(135deg, var(--cyan), var(--blue), var(--pink));
    color: #071020;
    font-weight: 950;
    box-shadow:
        0 0 0 5px rgba(32, 232, 210, 0.045),
        0 12px 34px rgba(0, 0, 0, 0.28);
    animation: softPulse 4s ease-in-out infinite;
}

.avatar-button img,
.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==============================
   Hero
============================== */

.page-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    min-height: clamp(168px, 23vh, 260px);
    margin-bottom: 16px;
    padding: clamp(18px, 3vw, 28px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.02)),
        linear-gradient(100deg, color-mix(in srgb, var(--page-accent, var(--cyan)) 18%, transparent), transparent 54%),
        rgba(5, 9, 22, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.13),
        0 24px 76px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(22px) saturate(155%);
    -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.page-hero::before,
.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.page-hero::before {
    opacity: 0.3;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(90deg, black, transparent 70%);
    animation: heroGridDrift 12s linear infinite;
}

.page-hero::after {
    left: auto;
    width: min(48vw, 520px);
    background:
        linear-gradient(
            120deg,
            transparent 0 23%,
            color-mix(in srgb, var(--page-accent, var(--cyan)) 34%, transparent) 24% 25%,
            transparent 26% 44%,
            color-mix(in srgb, var(--page-accent-2, var(--pink)) 30%, transparent) 45% 46%,
            transparent 47%
        ),
        radial-gradient(
            ellipse at 70% 46%,
            color-mix(in srgb, var(--page-accent, var(--cyan)) 22%, transparent),
            transparent 68%
        );
    transform: skewX(-12deg);
}

.page-hero > * {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4.5vw, 4.1rem);
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.page-hero p:not(.eyebrow) {
    max-width: 66ch;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.62;
}

/* Page accent colors */
.page-dashboard {
    --page-accent: var(--green);
    --page-accent-2: var(--cyan);
}

.page-wallet {
    --page-accent: var(--cyan);
    --page-accent-2: var(--blue);
}

.page-history {
    --page-accent: var(--blue);
    --page-accent-2: var(--violet);
}

.page-salary {
    --page-accent: var(--gold);
    --page-accent-2: var(--green);
}

.page-profile {
    --page-accent: var(--pink);
    --page-accent-2: var(--violet);
}

.operation-deposit {
    --page-accent: var(--green);
    --page-accent-2: var(--cyan);
}

.operation-transfer {
    --page-accent: var(--gold);
    --page-accent-2: var(--violet);
}

.operation-withdraw {
    --page-accent: var(--red);
    --page-accent-2: var(--gold);
}

.page-dashboard .page-hero {
    background:
        linear-gradient(118deg, rgba(68, 240, 168, 0.17), transparent 44%),
        linear-gradient(160deg, rgba(32, 232, 210, 0.115), rgba(255, 255, 255, 0.02)),
        rgba(3, 8, 18, 0.64);
}

.page-wallet .page-hero {
    background:
        linear-gradient(90deg, rgba(32, 232, 210, 0.19), transparent 43%),
        linear-gradient(145deg, rgba(104, 162, 255, 0.14), rgba(255, 255, 255, 0.02)),
        rgba(3, 8, 18, 0.64);
}

.page-history .page-hero {
    background:
        linear-gradient(135deg, rgba(104, 162, 255, 0.18), transparent 42%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 17px),
        rgba(3, 8, 18, 0.64);
}

.page-salary .page-hero {
    background:
        linear-gradient(145deg, rgba(255, 209, 102, 0.19), transparent 45%),
        linear-gradient(40deg, rgba(68, 240, 168, 0.12), transparent 55%),
        rgba(3, 8, 18, 0.64);
}

.page-profile .page-hero {
    background:
        linear-gradient(145deg, rgba(255, 114, 210, 0.17), transparent 44%),
        linear-gradient(40deg, rgba(169, 137, 255, 0.13), transparent 56%),
        rgba(3, 8, 18, 0.64);
}

.page-operation .page-hero {
    min-height: clamp(136px, 19vh, 210px);
}

/* ==============================
   Buttons / Links
============================== */

.primary-button,
.secondary-button {
    min-height: 44px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 950;
    white-space: nowrap;
    border-radius: var(--radius);
}

.primary-button {
    background:
        radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.35), transparent 32%),
        linear-gradient(135deg, var(--cyan), var(--green));
    color: #04120f;
    box-shadow:
        0 16px 42px rgba(32, 232, 210, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.secondary-button {
    border: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
        rgba(255, 255, 255, 0.065);
    color: var(--text);
}

.primary-button:hover,
.secondary-button:hover,
.text-link:hover,
.operation-card:hover,
.history-filters a:hover,
.bottom-nav a:hover,
.balance-pill:hover,
.ref-chip:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow:
        0 20px 52px rgba(32, 232, 210, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.primary-button:active,
.secondary-button:active,
.bottom-nav a:active,
.operation-card:active {
    transform: translateY(0) scale(0.99);
}

.fill {
    width: 100%;
}

.text-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gold);
    font-weight: 950;
}

/* ==============================
   Cards / Panels / Stats
============================== */

.panel,
.stat-card,
.operation-card,
.auth-card,
.glass-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.09), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025) 38%, rgba(255, 255, 255, 0.045)),
        linear-gradient(135deg, rgba(15, 23, 42, 0.74), rgba(23, 26, 52, 0.52));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05),
        0 20px 74px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(23px) saturate(155%);
    -webkit-backdrop-filter: blur(23px) saturate(155%);
    transition:
        transform 240ms var(--ease),
        border-color 240ms ease,
        box-shadow 240ms ease,
        background 240ms ease;
}

.panel:hover,
.stat-card:hover,
.operation-card:hover,
.auth-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.205);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 26px 88px rgba(0, 0, 0, 0.36),
        0 0 44px rgba(32, 232, 210, 0.075);
}

.panel {
    padding: 16px;
}

.panel-head {
    justify-content: space-between;
    margin-bottom: 12px;
}

.panel-head h2,
.form-heading h2,
.profile-summary h2 {
    margin: 0;
    font-size: 1.16rem;
    letter-spacing: -0.02em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stat-card {
    min-height: 132px;
    padding: 16px;
    transform-origin: 50% 70%;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -38px;
    bottom: -74px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(9px);
    background: var(--cyan);
}

.glow-gold::after {
    background: var(--gold);
}

.glow-blue::after {
    background: var(--blue);
}

.glow-green::after {
    background: var(--green);
}

.glow-pink::after {
    background: var(--pink);
}

.stat-card strong {
    display: block;
    margin: 10px 0 7px;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.stat-card p,
.muted,
.asset-row p,
.profit-list p,
.referral-list p,
.operation-card p,
.form-heading p {
    color: var(--muted);
    line-height: 1.5;
}

/* ==============================
   Utilities / Status / Empty
============================== */

.stack {
    display: grid;
    gap: 14px;
}

.progress {
    height: 8px;
    overflow: hidden;
    margin-top: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--gold), var(--pink));
    box-shadow: 0 0 20px rgba(32, 232, 210, 0.35);
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    width: fit-content;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status.approved {
    background: rgba(68, 240, 168, 0.13);
    color: var(--green);
}

.status.pending {
    background: rgba(255, 209, 102, 0.13);
    color: var(--gold);
}

.status.rejected {
    background: rgba(255, 97, 121, 0.13);
    color: var(--red);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 120px;
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06), transparent 34%),
        rgba(255, 255, 255, 0.026);
}

.empty-state.small {
    min-height: 76px;
}

.mono {
    overflow-wrap: anywhere;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ==============================
   Forms
============================== */

.form-panel {
    display: grid;
    gap: 13px;
    padding: 24px;
}

.form-panel.inner {
    padding: 16px;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

.amount-field-with-max {
    position: relative;
    min-width: 0;
}

.amount-field-with-max .field input {
    padding-right: 70px;
}

.max-button {
    position: absolute;
    right: 8px;
    top: 32px;
    z-index: 1;
    min-width: 52px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(32, 232, 210, 0.34);
    border-radius: 11px;
    background: rgba(32, 232, 210, 0.1);
    color: var(--cyan);
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.max-button:hover {
    border-color: rgba(32, 232, 210, 0.72);
    background: rgba(32, 232, 210, 0.18);
    transform: translateY(-1px);
}

.max-button:focus-visible {
    outline: 3px solid rgba(32, 232, 210, 0.22);
    outline-offset: 2px;
}

.field span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 950;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-control,
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.045), transparent 34%),
        rgba(3, 7, 18, 0.64);
    color: var(--text);
    padding: 0 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease,
        transform 180ms var(--ease);
}

.field textarea,
textarea.form-control {
    min-height: 120px;
    padding-top: 12px;
    resize: vertical;
}

.field input[type="file"] {
    padding: 12px;
}

.form-control::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    color: rgba(170, 182, 202, 0.62);
}

.form-control:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(32, 232, 210, 0.78);
    background:
        radial-gradient(circle at 8% 0%, rgba(32, 232, 210, 0.08), transparent 34%),
        rgba(3, 7, 18, 0.76);
    box-shadow:
        0 0 0 4px rgba(32, 232, 210, 0.12),
        0 14px 34px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.password-control {
    position: relative;
    display: block;
    min-width: 0;
}

.field > .password-control {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: 0;
    text-transform: none;
}

.password-control input {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 16%, rgba(255, 255, 255, 0.18), transparent 32%),
        rgba(255, 255, 255, 0.055);
    color: var(--cyan);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.password-toggle:hover {
    border-color: rgba(32, 232, 210, 0.34);
    box-shadow: 0 0 22px rgba(32, 232, 210, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.eye-open {
    position: relative;
    width: 20px;
    height: 13px;
    color: inherit;
    border: 2px solid currentColor;
    border-radius: 999px 999px 999px 999px / 70% 70% 70% 70%;
}

.eye-open::after {
    content: "";
    position: absolute;
    inset: 3px 6px;
    border-radius: 50%;
    background: currentColor;
}

.eye-closed {
    position: absolute;
    width: 24px;
    height: 2px;
    border-radius: 999px;
    opacity: 0;
    background: var(--pink);
    transform: rotate(-38deg);
    box-shadow: 0 0 12px rgba(255, 114, 210, 0.25);
}

.password-toggle[aria-pressed="true"] .eye-open {
    color: var(--gold);
}

.password-toggle[aria-pressed="true"] .eye-closed {
    opacity: 1;
}

.inline-fields {
    align-items: flex-end;
}

.inline-fields .field {
    flex: 1;
}

.check-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.check-field input {
    width: 17px;
    height: 17px;
    accent-color: var(--cyan);
}

.field-error,
.form-errors {
    color: #ff9aab;
}

.form-errors {
    padding: 12px;
    border: 1px solid rgba(255, 97, 121, 0.32);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 97, 121, 0.12), transparent 34%),
        rgba(255, 97, 121, 0.08);
}

.form-errors p,
.switch-line {
    margin: 0;
}

.fee-preview {
    padding: 12px;
    border: 1px solid rgba(32, 232, 210, 0.24);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 10% 0%, rgba(32, 232, 210, 0.13), transparent 34%),
        rgba(32, 232, 210, 0.08);
    color: var(--cyan);
    font-weight: 900;
}

.form-submit-status {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(32, 232, 210, 0.26);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(32, 232, 210, 0.09), rgba(255, 209, 102, 0.05)),
        rgba(255, 255, 255, 0.035);
    color: var(--cyan);
    font-weight: 900;
}

.notification-menu {
    position: relative;
    z-index: 2;
}

.notification-menu.is-open {
    z-index: 90;
}

.info-button,
.notification-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    color: var(--text);
    background:
        radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.18), transparent 32%),
        linear-gradient(135deg, rgba(32, 232, 210, 0.14), rgba(139, 92, 246, 0.12)),
        rgba(255, 255, 255, 0.06);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.info-button {
    text-decoration: none;
}

.info-button span {
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.notification-button span {
    font-size: 0.78rem;
    font-weight: 950;
}

.notification-button strong {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #071020;
    background: linear-gradient(135deg, #44f0a8, #ffd166);
    font-size: 0.68rem;
    box-shadow: 0 0 18px rgba(68, 240, 168, 0.34);
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 90;
    width: min(360px, calc(100vw - 24px));
    max-height: min(520px, calc(100vh - 130px));
    overflow: auto;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    background:
        radial-gradient(circle at 0% 0%, rgba(32, 232, 210, 0.16), transparent 38%),
        linear-gradient(145deg, rgba(12, 16, 34, 0.94), rgba(18, 20, 45, 0.88));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    pointer-events: none;
    transition:
        opacity 180ms ease,
        visibility 180ms ease,
        transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-menu.is-open .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.notification-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 10px;
}

.notification-head button {
    border: 0;
    color: var(--cyan);
    background: transparent;
    font-weight: 900;
    cursor: pointer;
}

.notification-list {
    display: grid;
    gap: 8px;
}

.notification-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.045);
}

.notification-item > span {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 16px rgba(32, 232, 210, 0.35);
}

.notification-item.success > span { background: var(--green); }
.notification-item.warning > span { background: var(--gold); }
.notification-item.danger > span { background: #ff5c7a; }
.notification-item.unread {
    border-color: rgba(68, 240, 168, 0.28);
}

.notification-item p {
    margin: 4px 0;
    color: var(--soft);
    line-height: 1.55;
    font-size: 0.84rem;
}

.notification-item small,
.notification-empty {
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 760px) {
    .notification-dropdown {
        right: -86px;
    }
}

.form-submit-status::before {
    content: "";
    width: 100%;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background:
        linear-gradient(90deg, transparent, var(--cyan), var(--gold), transparent);
    background-size: 220% 100%;
    animation: submitStatusFlow 1s linear infinite;
}

@keyframes submitStatusFlow {
    to { background-position: 220% 0; }
}

.switch-line {
    color: var(--muted);
    text-align: center;
}

.switch-line a {
    color: var(--cyan);
    font-weight: 950;
}

/* ==============================
   Flash / Toast
============================== */

.flash-stack {
    position: fixed;
    z-index: 1100;
    top: 108px;
    right: 20px;
    display: grid;
    gap: 8px;
    width: min(430px, calc(100% - 40px));
}

.flash,
.toast {
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.08), transparent 34%),
        rgba(10, 18, 36, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.flash {
    transition:
        opacity 260ms ease,
        transform 260ms var(--ease),
        filter 260ms ease;
}

.flash::after {
    content: "";
    display: block;
    height: 3px;
    margin: 10px -3px -5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cyan), var(--gold), var(--pink));
    animation: flashLife 5.2s linear forwards;
    transform-origin: left;
}

.flash.is-hiding {
    opacity: 0;
    transform: translateX(20px) scale(0.98);
    filter: blur(8px);
}

@keyframes flashLife {
    to {
        transform: scaleX(0);
    }
}

.flash-success {
    border-color: rgba(68, 240, 168, 0.32);
    color: var(--green);
}

.flash-error {
    border-color: rgba(255, 97, 121, 0.32);
    color: #ff9aab;
}

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    width: min(430px, calc(100% - 40px));
    display: grid;
    gap: 9px;
    pointer-events: none;
}

.toast {
    position: relative;
    opacity: 0;
    transform: translateX(18px) scale(0.98);
    transition:
        opacity 220ms ease,
        transform 260ms var(--ease);
}

.toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast-success {
    border-color: rgba(68, 240, 168, 0.42);
    color: var(--green);
}

.toast-error {
    border-color: rgba(255, 97, 121, 0.42);
    color: #ff9aab;
}

.toast-info {
    border-color: rgba(32, 232, 210, 0.32);
    color: var(--text);
}

/* ==============================
   Bottom Navigation
============================== */

.bottom-nav {
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: min(680px, calc(100% - 32px));
    padding: 7px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(32, 232, 210, 0.1), transparent 34%),
        radial-gradient(circle at 92% 100%, rgba(255, 114, 210, 0.08), transparent 34%),
        linear-gradient(135deg, rgba(10, 18, 36, 0.86), rgba(16, 20, 42, 0.66));
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    transform: translateX(-50%);
    --nav-index: 0;
}

.bottom-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.3;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            transparent,
            color-mix(in srgb, var(--page-accent, var(--cyan)) 24%, transparent),
            transparent
        );
    transform: translateX(-120%);
    animation: navSweep 5.5s ease-in-out infinite;
}

.bottom-nav a {
    position: relative;
    z-index: 1;
    min-height: 56px;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 950;
    text-align: center;
}

.bottom-nav a span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    transition:
        background 220ms ease,
        color 220ms ease,
        box-shadow 220ms ease,
        transform 220ms var(--ease);
}

.bottom-nav a.active {
    color: var(--cyan);
}

.bottom-nav a.active span {
    color: #03120f;
    background:
        radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.32), transparent 30%),
        linear-gradient(135deg, var(--page-accent, var(--cyan)), var(--page-accent-2, var(--green)));
    box-shadow: 0 0 24px color-mix(in srgb, var(--page-accent, var(--cyan)) 28%, transparent);
}

.nav-indicator {
    position: absolute;
    z-index: 0;
    top: 7px;
    bottom: 7px;
    left: 7px;
    width: calc(25% - 6px);
    border: 1px solid rgba(32, 232, 210, 0.26);
    border-radius: var(--radius);
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--page-accent, var(--cyan)) 17%, transparent),
            color-mix(in srgb, var(--page-accent-2, var(--green)) 13%, transparent)
        ),
        rgba(32, 232, 210, 0.07);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--page-accent, var(--cyan)) 16%, transparent);
    transform: translateX(0);
    transition: transform 360ms var(--ease);
}

.bottom-nav[data-active-index="1"] .nav-indicator {
    transform: translateX(calc(100% + 6px));
}

.bottom-nav[data-active-index="2"] .nav-indicator {
    transform: translateX(calc(200% + 12px));
}

.bottom-nav[data-active-index="3"] .nav-indicator {
    transform: translateX(calc(300% + 18px));
}

/* ==============================
   Reveal / Loading States
============================== */

.reveal {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    filter: blur(8px);
}

.reveal.is-visible {
    animation: cardRise 620ms var(--ease) both;
    animation-delay: var(--reveal-delay, 0ms);
}

.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

/* ==============================
   Responsive
============================== */

@media (max-width: 1100px) {
    .page-shell {
        width: min(100% - 28px, 1380px);
    }

    .topbar {
        width: min(100% - 28px, 1380px);
    }
}

@media (max-width: 900px) {
    :root {
        --header-h: 134px;
    }

    .topbar {
        grid-template-columns: 1fr auto;
        align-items: stretch;
        border-radius: 28px;
    }

    .brand {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
    }

    .topbar-user {
        grid-column: 1;
        grid-row: 2;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        grid-column: 2;
        grid-row: 2;
    }

    .page-hero {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    :root {
        --header-h: 128px;
        --nav-h: 82px;
        --radius: 20px;
        --radius-lg: 26px;
    }

    .auth-shell {
        padding: 12px;
    }

    .page-shell {
        width: min(100% - 20px, 1380px);
        padding-top: calc(var(--header-h) + 24px);
        padding-bottom: calc(var(--nav-h) + 22px);
    }

    .topbar {
        top: 10px;
        width: calc(100% - 20px);
        gap: 10px;
        padding: 10px;
    }

    .balance-pill {
        width: 100%;
    }

    .ref-chip {
        width: 44px;
        padding: 0;
    }

    .ref-chip::before {
        content: "R";
        display: grid;
        place-items: center;
        color: var(--cyan);
        font-size: 0.76rem;
        font-weight: 950;
    }

    .ref-link-chip::before {
        content: "L";
        color: var(--gold);
    }

    .ref-chip span,
    .ref-chip strong {
        display: none;
    }

    .hero-actions,
    .inline-fields {
        align-items: stretch;
        flex-direction: column;
    }

    .page-hero {
        min-height: auto;
        padding: 18px;
    }

    .page-hero h1 {
        font-size: clamp(1.8rem, 11vw, 3rem);
    }

    .panel,
    .form-panel,
    .form-panel.inner {
        padding: 14px;
    }

    .flash-stack {
        top: calc(var(--header-h) + 18px);
        right: 10px;
        width: calc(100% - 20px);
    }

    .toast-stack {
        right: 10px;
        bottom: calc(var(--nav-h) + 18px);
        width: calc(100% - 20px);
    }

    .bottom-nav {
        bottom: 10px;
        width: calc(100% - 20px);
        border-radius: 24px;
    }

    .bottom-nav a {
        min-height: 54px;
        font-size: 0.64rem;
    }
}

@media (max-width: 420px) {
    :root {
        --header-h: 126px;
    }

    .brand {
        min-width: 0;
        min-height: 50px;
        font-size: 0.94rem;
    }

    .brand-orbit {
        width: 26px;
        height: 26px;
    }

    .avatar-button {
        width: 44px;
        height: 44px;
    }

    .bottom-nav {
        gap: 4px;
        padding: 6px;
    }

    .bottom-nav a {
        min-height: 52px;
        font-size: 0.58rem;
    }

    .bottom-nav a span {
        width: 22px;
        height: 22px;
    }

    .nav-indicator {
        top: 6px;
        bottom: 6px;
        left: 6px;
        width: calc(25% - 5px);
    }
}

/* ==============================
   Reduced Motion
============================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
