@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Syne:wght@600;700;800&display=swap');

/* ChartElite Terminal — full visual layer (v3) */

:root {
    --bg: #04070c;
    --bg-soft: #0a111c;
    --card: rgba(10, 18, 30, 0.78);
    --card-2: #101a2a;
    --border: #1c2c42;
    --border-soft: rgba(94, 234, 212, 0.1);
    --text: #eef6ff;
    --text-muted: #8aa0b8;
    --text-faint: #5c738c;

    --primary: #2ee6a6;
    --primary-strong: #6fffd0;
    --primary-ink: #042018;
    --accent: #3d8bff;
    --accent-soft: rgba(61, 139, 255, 0.16);

    --positive: #34f1a1;
    --positive-soft: rgba(52, 241, 161, 0.12);
    --negative: #ff5d73;
    --negative-soft: rgba(255, 93, 115, 0.14);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;

    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -20px rgba(0, 0, 0, 0.75);
    --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Syne', 'Outfit', sans-serif;

    --ce-grid: rgba(61, 139, 255, 0.045);
    --ce-glow: rgba(46, 230, 166, 0.45);
}

html { color-scheme: dark; }

body.ce-v3 {
    font-family: var(--font);
    background:
        radial-gradient(1200px 700px at 12% -10%, rgba(61, 139, 255, 0.16), transparent 58%),
        radial-gradient(900px 600px at 92% 8%, rgba(46, 230, 166, 0.1), transparent 50%),
        radial-gradient(800px 500px at 70% 110%, rgba(61, 139, 255, 0.08), transparent 55%),
        var(--bg);
}

body.ce-v3::before {
    width: 520px;
    height: 520px;
    background: #2ee6a6;
    opacity: 0.14;
    top: -220px;
    right: -80px;
    animation: ce-orb 28s ease-in-out infinite;
}

body.ce-v3::after {
    width: 640px;
    height: 640px;
    background: #3d8bff;
    opacity: 0.16;
    bottom: -280px;
    left: -180px;
    animation: ce-orb 34s ease-in-out infinite reverse;
}

@keyframes ce-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-50px, 40px) scale(1.12); }
    70% { transform: translate(30px, -20px) scale(0.94); }
}

.ce-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--ce-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--ce-grid) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
}

.grain-overlay { opacity: 0.045; }

h1, h2, .page-header h1, .gradient-text, .brand-name {
    font-family: var(--font-display);
}

.gradient-text {
    background: linear-gradient(115deg, #f4fbff 8%, #6fffd0 48%, #3d8bff 92%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Shell */
.app-shell { isolation: isolate; }

.sidebar {
    width: 276px;
    background:
        linear-gradient(180deg, rgba(8, 16, 28, 0.92) 0%, rgba(4, 8, 14, 0.88) 100%);
    border-right: 1px solid rgba(94, 234, 212, 0.12);
    box-shadow: 16px 0 40px -28px rgba(0, 0, 0, 0.7);
}

.sidebar-glow {
    background: radial-gradient(circle, rgba(46, 230, 166, 0.28), transparent 68%);
}

.brand-mark {
    background: linear-gradient(140deg, #6fffd0, #2ee6a6 40%, #3d8bff);
    color: #042018;
    border-radius: 14px;
    box-shadow:
        0 10px 26px -8px rgba(46, 230, 166, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.brand-name small {
    letter-spacing: 0.16em;
    color: #6fffd0;
}

.nav a .nav-glow {
    background: linear-gradient(105deg, rgba(46, 230, 166, 0.2), rgba(61, 139, 255, 0.12) 55%, transparent);
}

.nav a:hover .nav-ico {
    color: var(--primary-strong);
    border-color: rgba(46, 230, 166, 0.35);
    background: rgba(46, 230, 166, 0.1);
}

.nav a.active {
    box-shadow:
        0 0 0 1px rgba(46, 230, 166, 0.22),
        0 10px 24px -12px rgba(46, 230, 166, 0.5);
}

.nav a.active::before {
    background: linear-gradient(180deg, #6fffd0, #3d8bff);
    box-shadow: 0 0 14px 1px rgba(46, 230, 166, 0.7);
}

.nav a.active .nav-ico {
    background: linear-gradient(135deg, #6fffd0, #3d8bff);
    color: #042018;
    box-shadow: 0 4px 14px -4px rgba(46, 230, 166, 0.7);
}

.app-clock {
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(46, 230, 166, 0.16), transparent 55%),
        rgba(0, 0, 0, 0.32);
    border-color: rgba(94, 234, 212, 0.14);
}

.app-clock:hover { border-color: rgba(46, 230, 166, 0.4); }
.app-clock-icon { color: var(--primary-strong); }

.content {
    padding: 32px 42px 64px;
}

.content-stack > * {
    animation: ce-rise 0.62s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.content-stack > *:nth-child(1) { animation-delay: 0.02s; }
.content-stack > *:nth-child(2) { animation-delay: 0.07s; }
.content-stack > *:nth-child(3) { animation-delay: 0.12s; }
.content-stack > *:nth-child(4) { animation-delay: 0.17s; }
.content-stack > *:nth-child(5) { animation-delay: 0.22s; }
.content-stack > *:nth-child(6) { animation-delay: 0.27s; }
.content-stack > *:nth-child(n+7) { animation-delay: 0.32s; }

@keyframes ce-rise {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.page-header {
    position: relative;
    margin-bottom: 28px;
    padding-bottom: 6px;
}

.page-header h1 {
    font-size: 34px;
    letter-spacing: -0.04em;
}

.page-subtitle {
    max-width: 52ch;
}

/* Cards */
.card,
.ko-card,
.stat-card,
.kpi-card,
.chart-card,
.info-panel,
.empty-state-card {
    background: linear-gradient(180deg, rgba(16, 26, 42, 0.86), rgba(8, 14, 24, 0.78));
    border: 1px solid rgba(94, 234, 212, 0.1);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.card,
.stat-card,
.kpi-card,
.ko-card,
.quick-action-card {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.28s ease;
}

.card:hover,
.stat-card:hover,
.kpi-card:hover,
.ko-card:hover {
    border-color: rgba(46, 230, 166, 0.28);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card), 0 20px 40px -24px var(--ce-glow);
}

.glow-border {
    border-color: rgba(46, 230, 166, 0.28) !important;
    box-shadow: var(--shadow-card),
                0 0 40px -12px rgba(46, 230, 166, 0.45),
                0 0 70px -18px rgba(61, 139, 255, 0.35);
}

.stat-card-featured {
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(46, 230, 166, 0.12), transparent 50%),
        linear-gradient(155deg, #132033, #0a121e);
}

.ko-card-icon {
    background: rgba(46, 230, 166, 0.12);
    color: var(--primary-strong);
}

.quick-action-card {
    background: linear-gradient(160deg, rgba(46, 230, 166, 0.07), rgba(61, 139, 255, 0.05) 55%, rgba(255,255,255,0.02));
    border-color: rgba(94, 234, 212, 0.12);
}

.quick-action-card:hover {
    border-color: rgba(46, 230, 166, 0.45);
    box-shadow: 0 18px 36px -20px rgba(46, 230, 166, 0.55);
}

.kpi-card-accent .kpi-card-value { color: var(--primary-strong); }

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #7fffd4, #2ee6a6 55%, #1bbf8a);
    color: var(--primary-ink);
    box-shadow: 0 10px 24px -10px rgba(46, 230, 166, 0.7);
}

.btn-primary:hover {
    box-shadow: 0 14px 32px -10px rgba(46, 230, 166, 0.85);
}

.btn-secondary {
    background: rgba(61, 139, 255, 0.08);
    border-color: rgba(61, 139, 255, 0.25);
}

.btn-secondary:hover {
    background: rgba(61, 139, 255, 0.16);
    border-color: rgba(111, 168, 255, 0.45);
}

/* Tables / chips */
.trades-table th { letter-spacing: 0.08em; }
.trades-table tbody tr:hover { background: rgba(46, 230, 166, 0.05); }

.hub-tabs {
    background: rgba(0, 8, 16, 0.45);
    border-color: rgba(94, 234, 212, 0.12);
    padding: 5px;
}

.hub-tab.is-active,
.db-period-tab.is-active {
    color: var(--primary-ink);
    background: linear-gradient(135deg, #7fffd4, #2ee6a6);
}

.chip {
    border-radius: 999px;
}

.flash-success {
    border-color: rgba(52, 241, 161, 0.4);
    box-shadow: 0 0 24px -10px rgba(52, 241, 161, 0.45);
}

.flash-error {
    border-color: rgba(255, 93, 115, 0.4);
}

.mobile-topbar {
    background: rgba(4, 8, 14, 0.82);
    border-bottom: 1px solid rgba(94, 234, 212, 0.12);
    backdrop-filter: blur(18px);
}

.site-footer {
    color: var(--text-faint);
}

.site-footer-links a:hover { color: var(--primary-strong); }

.modal-card {
    border: 1px solid rgba(94, 234, 212, 0.18);
    background: #0c1522;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(46, 230, 166, 0.08);
}

/* Auth */
.content-auth {
    background:
        radial-gradient(ellipse 70% 50% at 20% -10%, rgba(46, 230, 166, 0.18), transparent),
        radial-gradient(ellipse 60% 45% at 90% 110%, rgba(61, 139, 255, 0.2), transparent),
        var(--bg);
}

.auth-blob-1 { background: rgba(46, 230, 166, 0.28); }
.auth-blob-2 { background: rgba(61, 139, 255, 0.32); }

.auth-shell {
    max-width: 920px;
}

body.ce-v3 .auth-shell {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: stretch;
}

.auth-card {
    border: 1px solid rgba(46, 230, 166, 0.22);
    background: rgba(8, 14, 24, 0.82);
    box-shadow:
        0 30px 70px -28px rgba(0, 0, 0, 0.8),
        0 0 60px -16px rgba(46, 230, 166, 0.28),
        0 0 90px -24px rgba(61, 139, 255, 0.28);
    animation: ce-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-card h1 { font-family: var(--font-display); letter-spacing: -0.04em; }

.auth-features {
    display: grid;
    gap: 10px;
    align-content: center;
    animation: ce-rise 0.8s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-feature {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(10, 18, 30, 0.7);
    border: 1px solid rgba(61, 139, 255, 0.16);
    backdrop-filter: blur(10px);
}

input, select, textarea {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(46, 230, 166, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(46, 230, 166, 0.12);
}

/* Assistant / misc that used amber */
.ja-send {
    background: linear-gradient(135deg, #6fffd0, #2ee6a6) !important;
}

.vps-console {
    border-color: rgba(46, 230, 166, 0.22) !important;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(46, 230, 166, 0.12), transparent 55%),
        linear-gradient(180deg, #101a2a 0%, #080e18 100%) !important;
}

.vps-console::before {
    background: linear-gradient(90deg, transparent, rgba(46, 230, 166, 0.75), transparent) !important;
}

@media (max-width: 860px) {
    body.ce-v3 .auth-shell {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
    .content { padding: 22px 16px 40px; }
    .page-header h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .content-stack > *,
    .auth-card,
    .auth-features,
    body.ce-v3::before,
    body.ce-v3::after {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .card:hover,
    .stat-card:hover,
    .kpi-card:hover,
    .ko-card:hover {
        transform: none;
    }
}
