/* ==========================================================================
   Lucky Market Club — Aurora Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Base surfaces */
    --bg: #04060d;
    --bg-deep: #02030a;
    --surface: rgba(15, 21, 38, .72);
    --surface-solid: #0d1424;
    --surface-2: rgba(22, 30, 51, .78);
    --surface-3: rgba(255, 255, 255, .04);

    /* Lines */
    --line: rgba(148, 170, 205, .14);
    --line-strong: rgba(148, 170, 205, .24);
    --line-glow: rgba(56, 214, 255, .34);

    /* Text */
    --text: #f2f7ff;
    --text-2: #c2cfe3;
    --muted: #7c8CA6;
    --muted-2: #5f6d85;

    /* Brand */
    --cyan: #38d6ff;
    --cyan-soft: #8ceaff;
    --violet: #8b5cf6;
    --violet-soft: #c4b5fd;
    --magenta: #f8409f;
    --magenta-soft: #fda4d1;
    --gold: #ffce4d;

    /* Semantic */
    --green: #34e0a1;
    --green-soft: #a7f3d0;
    --yellow: #fbbf24;
    --yellow-soft: #fde68a;
    --red: #fb7185;
    --red-soft: #fecdd3;

    /* Gradients */
    --grad-brand: linear-gradient(120deg, var(--cyan) 0%, var(--violet) 48%, var(--magenta) 100%);
    --grad-brand-soft: linear-gradient(120deg, rgba(56, 214, 255, .16), rgba(139, 92, 246, .13), rgba(248, 64, 159, .14));
    --grad-text: linear-gradient(100deg, #ffffff 0%, #b8ecff 38%, #e6c9ff 68%, #ffc2e4 100%);

    /* Radii */
    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* Elevation */
    --shadow-sm: 0 2px 10px rgba(2, 5, 14, .34);
    --shadow-md: 0 14px 40px rgba(2, 5, 14, .44);
    --shadow-lg: 0 30px 80px rgba(2, 5, 14, .58);
    --shadow-glow: 0 0 0 1px rgba(56, 214, 255, .10), 0 18px 60px rgba(56, 214, 255, .10), 0 8px 40px rgba(248, 64, 159, .07);
    --inner-top: inset 0 1px 0 rgba(255, 255, 255, .06);

    /* Motion */
    --ease: cubic-bezier(.22, .72, .28, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --t-fast: .16s;
    --t: .26s;
    --t-slow: .44s;

    /* Metrics */
    --sidebar-w: 274px;
    --topbar-h: 76px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scrollbar-color: rgba(56, 214, 255, .45) rgba(4, 8, 18, .6);
    scrollbar-width: thin;
    -webkit-text-size-adjust: 100%;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(4, 8, 18, .5);
    border-radius: var(--r-pill);
}

*::-webkit-scrollbar-thumb {
    min-height: 40px;
    background: linear-gradient(180deg, rgba(56, 214, 255, .7), rgba(139, 92, 246, .62), rgba(248, 64, 159, .6));
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: var(--r-pill);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(140, 234, 255, .95), rgba(196, 181, 253, .9), rgba(253, 164, 209, .88));
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "ss01";
    overflow-x: hidden;
}

/* Aurora ambience ---------------------------------------------------------- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(140, 180, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 180, 255, .035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(120% 80% at 50% 0%, #000 12%, transparent 78%);
    -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 12%, transparent 78%);
}

.aurora span {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
    will-change: transform;
}

.aurora span:nth-child(1) {
    width: 46vw;
    height: 46vw;
    top: -14vw;
    left: -8vw;
    background: radial-gradient(circle, rgba(56, 214, 255, .5), transparent 68%);
    animation: drift-a 24s var(--ease) infinite alternate;
}

.aurora span:nth-child(2) {
    width: 40vw;
    height: 40vw;
    top: 22vh;
    right: -12vw;
    background: radial-gradient(circle, rgba(248, 64, 159, .42), transparent 68%);
    animation: drift-b 30s var(--ease) infinite alternate;
}

.aurora span:nth-child(3) {
    width: 52vw;
    height: 52vw;
    bottom: -22vw;
    left: 24vw;
    background: radial-gradient(circle, rgba(139, 92, 246, .4), transparent 70%);
    animation: drift-c 27s var(--ease) infinite alternate;
}

@keyframes drift-a {
    to { transform: translate3d(8vw, 6vh, 0) scale(1.15); }
}

@keyframes drift-b {
    to { transform: translate3d(-9vw, 8vh, 0) scale(1.1); }
}

@keyframes drift-c {
    to { transform: translate3d(6vw, -8vh, 0) scale(.9); }
}

a {
    color: var(--cyan);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}

a:hover {
    color: var(--cyan-soft);
}

h1, h2, h3, h4, h5 {
    font-family: "Sora", "Inter", system-ui, sans-serif;
    letter-spacing: -.02em;
}

::selection {
    background: rgba(56, 214, 255, .28);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: var(--r-xs);
}

.num,
.verification-code-input {
    font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.muted {
    color: var(--muted);
}

.gradient-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------------------------
   3. Shell
   -------------------------------------------------------------------------- */
.app-shell,
.auth-shell {
    position: relative;
    z-index: 1;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* Sidebar ------------------------------------------------------------------ */
.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px 14px 18px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(9, 14, 27, .92), rgba(5, 9, 19, .96));
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 40;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 210px;
    background: radial-gradient(120% 100% at 0% 0%, rgba(56, 214, 255, .14), transparent 68%);
    pointer-events: none;
}

.sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 16px;
    margin-bottom: 8px;
    color: var(--text);
}

.sidebar-brand img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 0 14px rgba(56, 214, 255, .34));
    animation: logoPulse 5s var(--ease) infinite alternate;
}

@keyframes logoPulse {
    from { filter: drop-shadow(0 0 10px rgba(56, 214, 255, .26)); }
    to { filter: drop-shadow(0 0 20px rgba(248, 64, 159, .34)); }
}

.brand-text {
    display: grid;
    line-height: 1.15;
    min-width: 0;
}

.brand-name {
    font-family: "Sora", sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -.02em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.brand-tag {
    color: var(--muted-2);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 3px;
}

.sidebar-nav a,
.logout-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    color: var(--muted);
    border-radius: var(--r-sm);
    font-size: .9rem;
    font-weight: 550;
    white-space: nowrap;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.sidebar-nav a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: var(--r-pill);
    background: var(--grad-brand);
    transform: translateY(-50%);
    transition: height var(--t) var(--ease-out);
}

.sidebar-nav a svg,
.logout-link svg {
    color: var(--muted-2);
    transition: color var(--t-fast) var(--ease), transform var(--t) var(--ease-out);
}

.sidebar-nav a:hover,
.logout-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .045);
}

.sidebar-nav a:hover svg,
.logout-link:hover svg {
    color: var(--cyan);
    transform: scale(1.08);
}

.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(56, 214, 255, .16), rgba(139, 92, 246, .10) 58%, transparent);
    box-shadow: var(--inner-top);
}

.sidebar-nav a.active::before {
    height: 22px;
}

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

.sidebar svg,
.topbar svg,
.btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke-width: 1.9;
}

.sidebar-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 12px 10px;
    color: var(--muted-2);
    font-size: .66rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-section::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-strong), transparent);
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .035);
    box-shadow: var(--inner-top);
}

.sidebar-user .avatar {
    flex: 0 0 38px;
}

.sidebar-user-meta {
    min-width: 0;
    display: grid;
    line-height: 1.25;
}

.sidebar-user-meta strong {
    font-size: .86rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-meta span {
    color: var(--muted-2);
    font-size: .72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-link {
    color: var(--muted);
}

.logout-link:hover {
    color: var(--red);
    background: rgba(251, 113, 133, .1);
}

.logout-link:hover svg {
    color: var(--red);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(2, 4, 12, .66);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t) var(--ease), visibility var(--t) var(--ease);
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Avatars ------------------------------------------------------------------ */
.avatar {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: #041018;
    background: var(--grad-brand);
    font-family: "Sora", sans-serif;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 6px 18px rgba(56, 214, 255, .22), var(--inner-top);
}

.avatar-sm {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 10px;
    font-size: .7rem;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main --------------------------------------------------------------------- */
.app-main {
    min-width: 0;
    padding: 0 30px 44px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--topbar-h);
    padding: 16px 0 14px;
    margin-bottom: 24px;
    background: linear-gradient(180deg, rgba(4, 6, 13, .92) 62%, rgba(4, 6, 13, 0));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.topbar-lead {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title {
    font-size: 1.72rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.03em;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--cyan);
    font-size: .68rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-weight: 700;
}

.eyebrow::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px rgba(56, 214, 255, .9);
}

.panel-heading .eyebrow,
.metric-label {
    color: var(--muted);
}

.panel-heading .eyebrow::before {
    background: var(--magenta);
    box-shadow: 0 0 10px rgba(248, 64, 159, .8);
}

/* Language switch ---------------------------------------------------------- */
.language-switch {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    box-shadow: var(--inner-top);
}

.language-switch a {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    height: 30px;
    border-radius: var(--r-pill);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.language-switch a:hover {
    color: var(--text);
}

.language-switch a.active {
    color: #041018;
    background: var(--grad-brand);
    box-shadow: 0 4px 14px rgba(56, 214, 255, .26);
}

/* Icon button -------------------------------------------------------------- */
.icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text-2);
    background: rgba(255, 255, 255, .05);
    box-shadow: var(--inner-top);
    transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
                background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.icon-button:hover {
    color: #fff;
    border-color: var(--line-glow);
    background: rgba(56, 214, 255, .12);
    transform: translateY(-1px);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px 0 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--text);
    background: rgba(255, 255, 255, .05);
    box-shadow: var(--inner-top);
    transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.user-chip:hover {
    color: var(--text);
    border-color: var(--line-glow);
    background: rgba(56, 214, 255, .1);
    transform: translateY(-1px);
}

.user-chip .avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: var(--r-pill);
    font-size: .7rem;
}

.user-chip-meta {
    display: grid;
    line-height: 1.15;
    max-width: 150px;
}

.user-chip-meta strong {
    font-size: .82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip-meta span {
    color: var(--muted-2);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   4. Surfaces
   -------------------------------------------------------------------------- */
.metric-card,
.panel,
.package-card,
.auth-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background:
        linear-gradient(180deg, rgba(20, 27, 46, .78), rgba(10, 15, 28, .84));
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    box-shadow: var(--shadow-md), var(--inner-top);
    transition: transform var(--t) var(--ease-out), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.metric-card::before,
.panel::before,
.package-card::before,
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(56, 214, 255, .5) 22%, rgba(248, 64, 159, .45) 72%, transparent);
    opacity: .8;
}

.metric-card:hover,
.package-card:hover,
.panel:hover {
    border-color: rgba(56, 214, 255, .26);
    box-shadow: var(--shadow-lg), var(--shadow-glow), var(--inner-top);
}

.metric-card:hover,
.package-card:hover {
    transform: translateY(-3px);
}

/* Metric cards ------------------------------------------------------------- */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

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

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 146px;
    padding: 20px 22px;
    overflow: hidden;
    isolation: isolate;
}

.metric-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -30%;
    bottom: -60%;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow, rgba(56, 214, 255, .3)), transparent 68%);
    opacity: .34;
    filter: blur(20px);
    transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-out);
}

.metric-card:hover::after {
    opacity: .62;
    transform: scale(1.12);
}

.metric-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.metric-label {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.metric-card .metric-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 13px;
    border: 1px solid var(--accent-line, rgba(56, 214, 255, .28));
    background: var(--accent-bg, rgba(56, 214, 255, .12));
    color: var(--accent, var(--cyan));
    box-shadow: var(--inner-top);
}

.metric-card .metric-icon svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.metric-value {
    display: block;
    margin-top: auto;
    font-family: "Sora", sans-serif;
    font-size: 2.05rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 0 34px var(--accent-glow, rgba(56, 214, 255, .28));
    overflow-wrap: anywhere;
}

.metric-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted-2);
    font-size: .76rem;
}

.metric-foot svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

/* Accent variants */
.accent-cyan {
    --accent: var(--cyan);
    --accent-bg: rgba(56, 214, 255, .12);
    --accent-line: rgba(56, 214, 255, .3);
    --accent-glow: rgba(56, 214, 255, .34);
}

.accent-violet {
    --accent: var(--violet-soft);
    --accent-bg: rgba(139, 92, 246, .14);
    --accent-line: rgba(139, 92, 246, .32);
    --accent-glow: rgba(139, 92, 246, .34);
}

.accent-magenta {
    --accent: var(--magenta-soft);
    --accent-bg: rgba(248, 64, 159, .13);
    --accent-line: rgba(248, 64, 159, .3);
    --accent-glow: rgba(248, 64, 159, .32);
}

.accent-green {
    --accent: var(--green-soft);
    --accent-bg: rgba(52, 224, 161, .13);
    --accent-line: rgba(52, 224, 161, .3);
    --accent-glow: rgba(52, 224, 161, .3);
}

.accent-gold {
    --accent: var(--gold);
    --accent-bg: rgba(255, 206, 77, .13);
    --accent-line: rgba(255, 206, 77, .3);
    --accent-glow: rgba(255, 206, 77, .28);
}

/* Layout grid -------------------------------------------------------------- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* Panels ------------------------------------------------------------------- */
.panel {
    padding: 22px 24px 24px;
    overflow: hidden;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.panel-heading > div:first-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.16rem;
    font-weight: 650;
    letter-spacing: -.02em;
}

.panel-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 13px;
    border: 1px solid rgba(248, 64, 159, .24);
    background: rgba(248, 64, 159, .1);
    color: var(--magenta-soft);
    box-shadow: var(--inner-top);
}

.panel-icon svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    stroke-width: 1.8;
}

.panel-heading > svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: var(--magenta-soft);
    stroke-width: 1.8;
}

/* --------------------------------------------------------------------------
   5. Forms
   -------------------------------------------------------------------------- */
.form-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-2);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.form-control,
.form-select {
    min-height: 46px;
    padding: 10px 14px;
    color: var(--text);
    background: rgba(4, 8, 18, .6);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
    font-size: .92rem;
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.form-control::placeholder {
    color: var(--muted-2);
}

.form-control:hover,
.form-select:hover {
    border-color: var(--line-strong);
}

.form-control:focus,
.form-select:focus {
    color: var(--text);
    background: rgba(4, 8, 18, .86);
    border-color: rgba(56, 214, 255, .65);
    box-shadow: 0 0 0 4px rgba(56, 214, 255, .12);
}

.form-control:disabled,
.form-control[readonly] {
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
}

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

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
}

.copy-field .btn {
    min-width: 48px;
    padding-inline: 0;
}

.copy-field .form-control {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .78rem;
}

/* Buttons ------------------------------------------------------------------ */
.btn {
    position: relative;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: .88rem;
    font-weight: 650;
    letter-spacing: -.01em;
    white-space: nowrap;
    transition: transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease),
                border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
                box-shadow var(--t-fast) var(--ease);
}

.btn:active {
    transform: translateY(1px) scale(.99);
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: .8rem;
}

.btn-sm svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.btn-glow {
    color: #02121c;
    border: 0;
    background: linear-gradient(120deg, var(--cyan), var(--violet) 46%, var(--magenta) 78%, var(--cyan));
    background-size: 220% 220%;
    box-shadow: 0 10px 30px rgba(56, 214, 255, .24), 0 4px 14px rgba(248, 64, 159, .16), var(--inner-top);
    animation: gradientShift 6s var(--ease) infinite;
    overflow: hidden;
}

.btn-glow::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .42) 50%, transparent 80%);
    transform: translateX(-120%);
    transition: transform .7s var(--ease-out);
}

.btn-glow:hover {
    color: #02121c;
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 16px 42px rgba(56, 214, 255, .3), 0 6px 20px rgba(248, 64, 159, .2);
}

.btn-glow:hover::after {
    transform: translateX(120%);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-soft {
    color: var(--text-2);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    box-shadow: var(--inner-top);
}

.btn-soft:hover {
    color: #fff;
    border-color: var(--line-glow);
    background: rgba(56, 214, 255, .12);
    transform: translateY(-1px);
}

.btn-danger {
    color: #fff;
    border: 1px solid rgba(251, 113, 133, .36);
    background: rgba(251, 113, 133, .16);
    box-shadow: var(--inner-top);
}

.btn-danger:hover {
    color: #fff;
    border-color: rgba(251, 113, 133, .6);
    background: rgba(251, 113, 133, .28);
    transform: translateY(-1px);
}

.btn:disabled,
.btn.disabled {
    opacity: .58;
    transform: none;
    filter: saturate(.7);
}

/* --------------------------------------------------------------------------
   6. Tables
   -------------------------------------------------------------------------- */
.table-responsive {
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: rgba(4, 8, 18, .32);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: transparent;
    --bs-table-hover-bg: transparent;
    --bs-table-hover-color: var(--text);
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    box-shadow: none;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 13px 16px;
    color: var(--muted);
    background: linear-gradient(180deg, rgba(17, 24, 42, .96), rgba(13, 19, 34, .96));
    border-bottom: 1px solid var(--line-strong);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    color: var(--text-2);
    border-bottom: 1px solid rgba(148, 170, 205, .08);
    font-size: .88rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--t-fast) var(--ease);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table tbody tr:hover td {
    background: rgba(56, 214, 255, .05);
    color: var(--text);
}

.table tbody tr:hover td:first-child {
    box-shadow: inset 2px 0 0 var(--cyan);
}

.table .text-end {
    text-align: right;
}

.table-empty {
    padding: 42px 16px !important;
    text-align: center;
}

.table-empty-inner {
    display: inline-grid;
    justify-items: center;
    gap: 10px;
    color: var(--muted);
}

.table-empty-inner svg {
    width: 34px;
    height: 34px;
    color: var(--muted-2);
    opacity: .7;
}

.table code {
    color: var(--cyan-soft);
    font-size: .78rem;
    word-break: break-all;
}

code {
    color: var(--cyan-soft);
    word-break: break-all;
}

/* Status pills ------------------------------------------------------------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    padding: 0 11px;
    border: 1px solid rgba(139, 92, 246, .26);
    border-radius: var(--r-pill);
    color: var(--violet-soft);
    background: rgba(139, 92, 246, .12);
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .02em;
    white-space: nowrap;
}

.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.status-confirmed,
.status-active,
.status-paid,
.status-approved,
.status-available,
.status-completed,
.status-verified {
    color: var(--green-soft);
    border-color: rgba(52, 224, 161, .28);
    background: rgba(52, 224, 161, .11);
}

.status-pending,
.status-manual_review,
.status-paused,
.status-unverified {
    color: var(--yellow-soft);
    border-color: rgba(251, 191, 36, .28);
    background: rgba(251, 191, 36, .1);
}

.status-failed,
.status-rejected,
.status-suspended,
.status-expired {
    color: var(--red-soft);
    border-color: rgba(251, 113, 133, .3);
    background: rgba(251, 113, 133, .12);
}

.status-direct {
    color: var(--cyan-soft);
    border-color: rgba(56, 214, 255, .3);
    background: rgba(56, 214, 255, .11);
}

.status-binary {
    color: var(--magenta-soft);
    border-color: rgba(248, 64, 159, .3);
    background: rgba(248, 64, 159, .11);
}

.status-reward,
.status-pool_reward {
    color: var(--violet-soft);
    border-color: rgba(139, 92, 246, .3);
    background: rgba(139, 92, 246, .13);
}

.amount-positive {
    color: var(--green-soft);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. Packages
   -------------------------------------------------------------------------- */
.package-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.package-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 300px;
    padding: 24px 22px 22px;
    overflow: hidden;
    isolation: isolate;
}

.package-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto -30% -50% -30%;
    height: 220px;
    background: radial-gradient(60% 100% at 50% 100%, rgba(56, 214, 255, .26), transparent 70%);
    opacity: .5;
    transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease-out);
}

.package-card:hover::after {
    opacity: .95;
    transform: translateY(-10px);
}

.package-card.is-featured {
    border-color: rgba(248, 64, 159, .32);
    box-shadow: var(--shadow-lg), 0 0 46px rgba(248, 64, 159, .14), var(--inner-top);
}

.package-card.is-featured::after {
    background: radial-gradient(60% 100% at 50% 100%, rgba(248, 64, 159, .3), transparent 70%);
}

.package-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.package-name {
    font-family: "Sora", sans-serif;
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: -.01em;
    color: #fff;
}

.package-badge {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    border: 1px solid rgba(56, 214, 255, .26);
    background: rgba(56, 214, 255, .1);
    color: var(--cyan);
    box-shadow: var(--inner-top);
}

.package-badge svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
}

.package-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.package-price strong {
    font-family: "Sora", sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.045em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.package-price small {
    color: var(--muted-2);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.package-card p {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.6;
}

.package-card .btn {
    margin-top: auto;
}

.package-ribbon {
    position: absolute;
    top: 16px;
    right: -34px;
    z-index: 2;
    padding: 5px 40px;
    color: #02121c;
    background: var(--grad-brand);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    transform: rotate(38deg);
    box-shadow: 0 8px 22px rgba(248, 64, 159, .3);
}

/* Split meter -------------------------------------------------------------- */
.split-meter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.split-meter > div {
    position: relative;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .04);
    box-shadow: var(--inner-top);
    overflow: hidden;
}

.split-meter > div::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--grad-brand);
    opacity: .7;
}

.split-meter > div:last-child::before {
    background: linear-gradient(180deg, var(--magenta), var(--violet));
}

.split-meter span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.split-meter strong {
    font-family: "Sora", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.03em;
}

/* --------------------------------------------------------------------------
   8. Binary tree
   -------------------------------------------------------------------------- */
.tree-wrap {
    overflow-x: auto;
    padding: 18px 6px 10px;
}

.tree-node {
    position: relative;
    display: grid;
    gap: 6px;
    justify-items: center;
    min-width: 152px;
    padding: 14px 12px;
    border: 1px solid rgba(56, 214, 255, .26);
    border-radius: var(--r-md);
    background: linear-gradient(180deg, rgba(56, 214, 255, .11), rgba(56, 214, 255, .04));
    text-align: center;
    box-shadow: var(--inner-top), 0 10px 26px rgba(2, 5, 14, .3);
    transition: transform var(--t) var(--ease-out), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.tree-node:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 214, 255, .5);
    box-shadow: 0 0 26px rgba(56, 214, 255, .16), var(--inner-top);
}

.tree-node > strong {
    font-family: "Sora", sans-serif;
    font-size: .92rem;
    font-weight: 650;
}

.tree-node span {
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tree-node .avatar {
    margin-bottom: 2px;
}

.tree-empty {
    border-style: dashed;
    border-color: rgba(148, 170, 205, .26);
    background: rgba(255, 255, 255, .025);
    color: var(--muted-2);
}

.tree-empty:hover {
    border-color: rgba(148, 170, 205, .4);
    box-shadow: none;
}

.tree-children {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 30px;
    width: 100%;
}

.tree-children::before {
    content: "";
    position: absolute;
    top: -18px;
    left: 25%;
    right: 25%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 214, 255, .5), transparent);
}

.tree-children::after {
    content: "";
    position: absolute;
    top: -30px;
    left: 50%;
    width: 1px;
    height: 12px;
    background: rgba(56, 214, 255, .45);
}

.tree-children > .tree-node::before {
    content: "";
    position: absolute;
    top: -18px;
    left: 50%;
    width: 1px;
    height: 18px;
    background: rgba(56, 214, 255, .4);
}

/* --------------------------------------------------------------------------
   9. Modals & payment
   -------------------------------------------------------------------------- */
.modal-backdrop.show {
    opacity: .72;
    backdrop-filter: blur(4px);
}

.modal-dark {
    color: var(--text);
    background: linear-gradient(180deg, rgba(18, 25, 44, .96), rgba(9, 14, 26, .98));
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(56, 214, 255, .1);
    overflow: hidden;
}

.modal-dark::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 214, 255, .7), rgba(248, 64, 159, .6), transparent);
}

.modal-dark .modal-header {
    padding: 22px 24px 14px;
}

.modal-dark .modal-body {
    padding: 8px 24px 24px;
}

.modal-dark .modal-title {
    font-size: 1.15rem;
    font-weight: 650;
}

.payment-status {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--cyan-soft);
    background: rgba(56, 214, 255, .08);
    border: 1px solid rgba(56, 214, 255, .2);
    font-size: .84rem;
    font-weight: 550;
}

.qr-frame {
    display: grid;
    place-items: center;
    min-height: 224px;
    padding: 16px;
    border-radius: var(--r-lg);
    background:
        linear-gradient(#fff, #fff) padding-box,
        var(--grad-brand) border-box;
    border: 2px solid transparent;
    box-shadow: 0 18px 44px rgba(2, 5, 14, .4), 0 0 42px rgba(56, 214, 255, .2);
}

.payment-qr {
    width: 190px;
    height: 190px;
    display: grid;
    place-items: center;
    color: #111827;
}

.payment-qr img,
.payment-qr canvas {
    width: 190px;
    height: 190px;
}

.pulse {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 0 rgba(56, 214, 255, .6);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 12px rgba(56, 214, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 214, 255, 0); }
}

.invoice-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: .86rem;
}

.invoice-meta span {
    color: var(--muted);
}

.invoice-meta strong {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: .84rem;
    font-weight: 600;
}

.sensitive-value {
    max-width: 62%;
    overflow-wrap: anywhere;
    text-align: right;
    line-height: 1.35;
}

.invoice-expiry strong {
    color: var(--yellow-soft);
}

/* --------------------------------------------------------------------------
   10. Alerts & toasts
   -------------------------------------------------------------------------- */
.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1090;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
    pointer-events: none;
}

.toast-stack .glass-alert {
    pointer-events: auto;
    margin: 0;
    animation: toastIn .34s var(--ease-out) both;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(26px) scale(.96); }
    to { opacity: 1; transform: none; }
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.glass-alert {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 18px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(15, 21, 38, .9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md), var(--inner-top);
    font-size: .88rem;
    overflow: hidden;
}

.glass-alert::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--cyan);
}

.glass-alert svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.alert-success.glass-alert {
    border-color: rgba(52, 224, 161, .26);
    color: var(--green-soft);
}

.alert-success.glass-alert::before { background: var(--green); }

.alert-info.glass-alert {
    border-color: rgba(56, 214, 255, .26);
    color: var(--cyan-soft);
}

.alert-info.glass-alert::before { background: var(--cyan); }

.alert-warning.glass-alert {
    border-color: rgba(251, 191, 36, .28);
    color: var(--yellow-soft);
}

.alert-warning.glass-alert::before { background: var(--yellow); }

.alert-danger.glass-alert {
    border-color: rgba(251, 113, 133, .3);
    color: var(--red-soft);
}

.alert-danger.glass-alert::before { background: var(--red); }

/* --------------------------------------------------------------------------
   11. Misc blocks
   -------------------------------------------------------------------------- */
.profile-panel,
.settings-panel {
    max-width: 860px;
}

.admin-actions,
.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-actions {
    justify-content: flex-start;
}

.engine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.engine-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .035);
    box-shadow: var(--inner-top);
    transition: border-color var(--t) var(--ease), transform var(--t) var(--ease-out);
}

.engine-card:hover {
    border-color: rgba(56, 214, 255, .3);
    transform: translateY(-2px);
}

.engine-card h3 {
    margin: 0;
    font-size: .98rem;
    font-weight: 650;
}

.engine-card p {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
}

.engine-card .btn {
    width: 100%;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 16px;
    color: var(--text);
    font-family: "Sora", sans-serif;
    font-size: 1.02rem;
    font-weight: 650;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-strong), transparent);
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 14px;
    min-height: 66vh;
    text-align: center;
}

.empty-state svg {
    width: 56px;
    height: 56px;
    color: var(--magenta);
    filter: drop-shadow(0 0 20px rgba(248, 64, 159, .3));
}

.empty-state h2 {
    margin: 0;
    font-size: 1.6rem;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   12. Auth
   -------------------------------------------------------------------------- */
.auth-body {
    overflow-x: hidden;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(340px, 600px);
    min-height: 100vh;
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 26px;
    padding: 56px 6vw;
    overflow: hidden;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(56, 214, 255, .1), rgba(139, 92, 246, .07) 44%, rgba(248, 64, 159, .09)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 92px);
    pointer-events: none;
}

.brand-panel > * {
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: min(26vw, 210px);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 0 28px rgba(56, 214, 255, .26)) drop-shadow(0 0 40px rgba(248, 64, 159, .16));
    animation: float 7s var(--ease) infinite alternate;
}

@keyframes float {
    from { transform: translateY(-8px); }
    to { transform: translateY(8px); }
}

.brand-copy {
    max-width: 520px;
}

.brand-copy h1 {
    margin: 10px 0 0;
    font-size: clamp(2.2rem, 3.6vw, 3.5rem);
    line-height: 1.06;
    font-weight: 700;
    letter-spacing: -.035em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}





.auth-panel {
    position: relative;
    display: grid;
    place-items: center;
    padding: 34px 5%;
    background: linear-gradient(180deg, rgba(8, 12, 24, .5), rgba(4, 7, 16, .78));
    border-left: 1px solid var(--line);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-lang {
    position: absolute;
    top: 26px;
    right: 26px;
    z-index: 3;
}

.auth-card {
    width: min(100%, 440px);
    padding: 32px;
    border-radius: var(--r-xl);
}

.register-card {
    width: min(100%, 720px);
}

.auth-card h2 {
    margin: 8px 0 24px;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -.03em;
}

.auth-foot {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: .88rem;
}

.auth-foot a {
    font-weight: 650;
}

.auth-note {
    margin: -14px 0 24px;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.65;
}

.verification-card {
    width: min(100%, 480px);
}

.verification-code-input {
    min-height: 68px;
    text-align: center;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: .3em;
    text-indent: .3em;
}

.resend-form {
    margin-top: 12px;
}

.auth-panel .flash-stack {
    position: absolute;
    top: 82px;
    left: 5%;
    right: 5%;
    z-index: 3;
    margin: 0;
}

/* --------------------------------------------------------------------------
   13. Entrance animations
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(14px);
}

.reveal.in {
    opacity: 1;
    transform: none;
    transition: opacity .52s var(--ease-out), transform .52s var(--ease-out);
}

.app-main > section,
.app-main > div {
    animation: fadeUp .5s var(--ease-out) both;
}

.app-main > section:nth-child(2) { animation-delay: .04s; }
.app-main > section:nth-child(3) { animation-delay: .08s; }
.app-main > section:nth-child(4) { animation-delay: .12s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

.auth-card {
    animation: cardIn .6s var(--ease-out) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.985); }
    to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1400px) {
    .metric-card .metric-value {
        font-size: 1.85rem;
    }
}

@media (max-width: 1240px) {
    .package-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8 {
        grid-column: span 12;
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 290px);
        transform: translateX(-104%);
        transition: transform var(--t) var(--ease-out);
        box-shadow: var(--shadow-lg);
    }

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

    .app-main {
        padding: 0 18px 36px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        align-items: center;
        min-height: 280px;
        padding: 40px 24px;
        text-align: center;
    }

    .brand-copy {
        text-align: center;
    }

    .brand-logo {
        width: 140px;
    }


    .auth-panel {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

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

@media (max-width: 720px) {
    body {
        font-size: 14.5px;
    }

    .metric-grid,
    .metric-grid-3,
    .package-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-wrap: wrap;
        padding-top: 14px;
    }

    .page-title {
        font-size: 1.36rem;
    }

    .user-chip-meta {
        display: none;
    }

    .user-chip {
        padding: 0 6px;
    }

    .metric-value {
        font-size: 1.75rem;
    }

    .panel {
        padding: 18px 16px 20px;
    }

    .auth-card {
        padding: 22px 18px;
    }

    .auth-card h2 {
        font-size: 1.5rem;
    }

    .package-card,
    .metric-card {
        padding: 18px;
    }

    .split-meter,
    .tree-children {
        grid-template-columns: 1fr;
    }

    .tree-children::before,
    .tree-children::after {
        display: none;
    }

    .toast-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .table thead th,
    .table tbody td {
        padding: 11px 12px;
    }
}

/* --------------------------------------------------------------------------
   16. Announcements — flyers & notices
   -------------------------------------------------------------------------- */
.flyer-rail {
    position: relative;
    margin-bottom: 22px;
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeUp .5s var(--ease-out) both;
}

.flyer {
    position: relative;
    display: none;
    aspect-ratio: 16 / 9;
    max-height: 420px;
    width: 100%;
    background: var(--surface-solid);
}

.flyer.is-active {
    display: block;
    animation: flyerIn .5s var(--ease-out) both;
}

.flyer-rail:not(.is-multi) .flyer {
    display: block;
}

@keyframes flyerIn {
    from { opacity: 0; transform: scale(1.015); }
    to { opacity: 1; transform: none; }
}

.flyer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flyer-overlay {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 46px 30px 26px;
    background: linear-gradient(180deg, transparent, rgba(3, 6, 14, .82) 58%, rgba(3, 6, 14, .95));
}

.flyer-copy {
    min-width: 0;
    max-width: 62ch;
}

.flyer-copy h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -.03em;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}

.flyer-copy p {
    margin: 8px 0 0;
    color: rgba(238, 246, 255, .84);
    font-size: .92rem;
    line-height: 1.55;
}

.flyer-overlay .btn {
    flex: 0 0 auto;
}

.flyer-dots {
    position: absolute;
    right: 20px;
    top: 18px;
    display: flex;
    gap: 7px;
    padding: 7px 10px;
    border-radius: var(--r-pill);
    background: rgba(3, 6, 14, .52);
    backdrop-filter: blur(10px);
}

.flyer-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .34);
    cursor: pointer;
    transition: width var(--t) var(--ease-out), background var(--t) var(--ease);
}

.flyer-dots button.is-active {
    width: 22px;
    border-radius: var(--r-pill);
    background: var(--cyan);
    box-shadow: 0 0 12px rgba(56, 214, 255, .7);
}

.notice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.notice-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--cyan);
    border-radius: var(--r-md);
    background: linear-gradient(120deg, rgba(56, 214, 255, .07), rgba(20, 27, 46, .7));
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm), var(--inner-top);
}

.notice-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    border: 1px solid rgba(56, 214, 255, .26);
    background: rgba(56, 214, 255, .12);
    color: var(--cyan);
}

.notice-icon svg {
    width: 18px;
    height: 18px;
}

.notice-body {
    min-width: 0;
}

.notice-body strong {
    display: block;
    font-family: "Sora", sans-serif;
    font-size: .96rem;
    font-weight: 650;
    margin-bottom: 4px;
}

.notice-body p {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.55;
}

.notice-body a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: .84rem;
    font-weight: 650;
}

.notice-body a svg {
    width: 14px;
    height: 14px;
}

/* Admin announcement list -------------------------------------------------- */
.announcement-admin-list {
    display: grid;
    gap: 12px;
}

.announcement-admin {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .035);
    transition: border-color var(--t) var(--ease);
}

.announcement-admin:hover {
    border-color: rgba(56, 214, 255, .28);
}

.announcement-admin.is-off {
    opacity: .5;
}

.announcement-admin-thumb {
    aspect-ratio: 16 / 9;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: rgba(4, 8, 18, .6);
}

.announcement-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.announcement-admin-thumb.is-notice {
    display: grid;
    place-items: center;
    color: var(--violet-soft);
}

.announcement-admin-body {
    min-width: 0;
}

.announcement-admin-top {
    display: flex;
    gap: 6px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.announcement-admin-body h3 {
    margin: 0;
    font-size: .98rem;
    font-weight: 650;
}

.announcement-admin-body p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.announcement-admin-meta {
    margin-top: 8px !important;
    color: var(--muted-2) !important;
    font-size: .75rem !important;
}

.announcement-admin-actions {
    display: flex;
    gap: 7px;
}

/* --------------------------------------------------------------------------
   17. Resources
   -------------------------------------------------------------------------- */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
}

.resource-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 40px;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: linear-gradient(180deg, rgba(20, 27, 46, .74), rgba(10, 15, 28, .8));
    backdrop-filter: blur(16px);
    color: var(--text);
    box-shadow: var(--shadow-sm), var(--inner-top);
    transition: transform var(--t) var(--ease-out), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.resource-card:hover {
    color: var(--text);
    transform: translateY(-2px);
    border-color: rgba(56, 214, 255, .3);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.resource-icon,
.file-chip {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 15px;
    border: 1px solid rgba(56, 214, 255, .24);
    background: rgba(56, 214, 255, .1);
    color: var(--cyan);
    box-shadow: var(--inner-top);
}

.file-chip {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
}

.resource-icon svg {
    width: 23px;
    height: 23px;
}

.file-chip svg {
    width: 17px;
    height: 17px;
}

.resource-body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.resource-body strong {
    font-family: "Sora", sans-serif;
    font-size: .96rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-desc {
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-meta {
    color: var(--muted-2);
    font-size: .74rem;
    font-variant-numeric: tabular-nums;
}

.resource-action {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    color: var(--muted);
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.resource-card:hover .resource-action {
    color: #02121c;
    border-color: transparent;
    background: var(--grad-brand);
}

/* --------------------------------------------------------------------------
   18. Corporate volume, callouts, form extras
   -------------------------------------------------------------------------- */
.corporate-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    border: 1px dashed rgba(196, 181, 253, .4);
    background: rgba(139, 92, 246, .1);
    color: var(--violet-soft);
    font-size: .72rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.corporate-tag svg {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
}

.callout {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    font-size: .85rem;
    line-height: 1.55;
}

.callout svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
}

.callout-warning {
    border-color: rgba(251, 191, 36, .3);
    background: rgba(251, 191, 36, .09);
    color: var(--yellow-soft);
}

.panel-note {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.6;
}

.field-hint {
    margin: 7px 0 0;
    color: var(--muted-2);
    font-size: .77rem;
    line-height: 1.5;
}

.row-muted {
    opacity: .5;
}

.table-actions form {
    display: inline;
}

textarea.form-control {
    min-height: 92px;
    padding: 12px 14px;
    resize: vertical;
}

input[type="file"].form-control {
    padding: 10px 14px;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .07);
    color: var(--text);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 650;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button:hover {
    border-color: var(--line-glow);
    background: rgba(56, 214, 255, .12);
}

/* Segmented control -------------------------------------------------------- */
.segmented {
    display: grid;
    grid-auto-flow: column;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(4, 8, 18, .5);
}

.segmented label {
    margin: 0;
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    border-radius: 10px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 650;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.segmented span svg {
    width: 16px;
    height: 16px;
}

.segmented input:checked + span {
    color: #02121c;
    background: var(--grad-brand);
    box-shadow: 0 4px 14px rgba(56, 214, 255, .22);
}

.segmented input:focus-visible + span {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

/* Flyer upload hint -------------------------------------------------------- */
.upload-drop {
    display: grid;
    gap: 12px;
}

.ratio-hint {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .025);
}

.ratio-box {
    display: grid;
    place-items: center;
    width: 76px;
    height: 43px;
    flex: 0 0 76px;
    border: 1px solid rgba(56, 214, 255, .4);
    border-radius: 7px;
    background: rgba(56, 214, 255, .09);
    color: var(--cyan);
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .06em;
}

.ratio-hint p {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .flyer-overlay {
        padding: 34px 18px 18px;
    }

    .flyer-overlay .btn {
        width: 100%;
    }

    .announcement-admin {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .announcement-admin-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }
}

/* Pool 2X progress --------------------------------------------------------- */
.pool-progress {
    display: grid;
    gap: 5px;
    min-width: 168px;
}

.pool-progress-bar {
    display: block;
    height: 6px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.pool-progress-bar span {
    display: block;
    height: 100%;
    border-radius: var(--r-pill);
    background: var(--grad-brand);
    box-shadow: 0 0 12px rgba(56, 214, 255, .35);
    transition: width var(--t-slow) var(--ease-out);
}

.pool-progress small {
    color: var(--muted-2);
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}
