:root {
    /* Colors - Futuristic Polygon Theme */
    --primary: #8B5CF6;
    --primary-light: #C4B5FD;
    --primary-glow: rgba(139, 92, 246, 0.6);

    --secondary: #0ea5e9;
    --secondary-glow: rgba(14, 165, 233, 0.6);

    --accent: #F43F5E;
    --accent-glow: rgba(244, 63, 94, 0.6);

    --bg-dark: #05050A;
    /* Deeper black for higher contrast */
    --bg-panel: rgba(20, 20, 30, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;

    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* --- Dynamic Abstract Backgrounds --- */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -2;
    opacity: 0.5;
    animation: drift 25s infinite linear;
    mix-blend-mode: screen;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

.orb-2 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    animation-delay: -12s;
    animation-direction: reverse;
}

.bg-noise {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Added grid overlay for futuristic tech feel */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

@keyframes drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(-100px, 150px) rotate(120deg) scale(1.1);
    }

    66% {
        transform: translate(50px, -50px) rotate(240deg) scale(0.9);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Use color instead of text-fill-color for better support */
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

p,
.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4%;
    background: rgba(5, 5, 10, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.nav-brand i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem;
    border-radius: 100px;
    /* Pill shape */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 100px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    color: var(--text-main);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* Subtle gradient border sweep on active */
.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 100px;
    padding: 1px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% auto;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientSweep 3s linear infinite;
    pointer-events: none;
}

@keyframes gradientSweep {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* --- Buttons --- */
button {
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

/* Button hover pulse effect wrapper */
button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    transition: opacity 0.3s;
}

button:hover::after {
    opacity: 0.08;
}

button:active {
    transform: scale(0.96) !important;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 0.8rem 1.8rem;
    backdrop-filter: blur(10px);
}

.btn-primary:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
    padding: 0.8rem 1.5rem;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
    box-shadow: 0 8px 25px var(--primary-glow);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-glow:hover {
    box-shadow: 0 12px 35px var(--secondary-glow), 0 0 0 2px rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.02);
}

.w-full {
    width: 100%;
}

/* --- Containers --- */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.view-section {
    display: none;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
    display: block;
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header-section {
    text-align: center;
    margin-bottom: 4rem;
}

.header-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.3));
}

/* --- Glass Panels --- */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    /* Stronger top light for 3D feel */
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Subtle inner glow for premium feel */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    border-radius: 20px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* --- Forms & Inputs --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Make wide inputs span full row */
.form-grid .form-group:nth-child(5),
.form-grid .form-group:nth-child(6) {
    grid-column: span 2;
}

label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
}

input[type="text"],
input[type="number"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem 1.2rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(14, 165, 233, 0.15);
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

input::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 3.5rem;
}

.input-with-icon .suffix {
    position: absolute;
    right: 1.2rem;
    color: var(--primary-light);
    font-weight: 700;
}

.form-footer {
    grid-column: span 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-glass);
}

.fee-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 600;
    background: rgba(14, 165, 233, 0.08);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}

/* --- Dashboards & Search --- */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 0.6rem;
    border-radius: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-bar i {
    font-size: 1.4rem;
    color: var(--secondary);
    padding-left: 0.8rem;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem;
    box-shadow: none;
    font-size: 1.1rem;
}

.search-bar input:focus {
    box-shadow: none;
    background: transparent;
    transform: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
}

/* Dashboard Panel Layout */
.action-panel {
    display: flex;
    flex-direction: column;
}

.action-panel h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-panel h3::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 18px;
    background: var(--primary);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary-glow);
}

.action-panel>.subtitle {
    margin-bottom: 1.5rem;
}

.action-row {
    display: flex;
    gap: 0.8rem;
}

.action-row input {
    flex: 1;
}

.action-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.btn-sm {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.wide-panel {
    grid-column: 1 / -1;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr;
    gap: 1.5rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Status Cards */
.status-panel .status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.stat-box {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}

.stat-box .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-heading);
}

.stat-box .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

/* --- Investor Panel Special --- */
.stats-hero {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(14, 165, 233, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    position: relative;
}

.stats-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.huge-value {
    font-size: 4.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1;
    margin: 1rem 0;
    color: #fff;
    text-shadow: 0 0 30px var(--primary-glow);
    letter-spacing: -0.03em;
}

.huge-value .currency {
    font-size: 1.8rem;
    color: var(--primary-light);
    vertical-align: super;
}

.current-selection {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.current-selection .value {
    font-family: monospace;
    color: var(--secondary);
    font-size: 1.1rem;
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 36px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 36px;
    border: 1px solid var(--border-glass);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked+.slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
}

input:checked+.slider:before {
    transform: translateX(28px);
    background-color: white;
}

/* --- Toast Notifications (Polished) --- */
.toast-container {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 1.2rem 1.8rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transform: translateX(120%) scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 350px;
    position: relative;
    overflow: hidden;
}

/* Toast progress bar */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.7;
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

.toast.show {
    transform: translateX(0) scale(1);
}

.toast-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px currentColor);
}

.toast.success {
    color: var(--success);
    border-left: 4px solid var(--success);
}

.toast.error {
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.toast-content {
    color: var(--text-main);
}

.toast-content h4 {
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
    color: currentColor;
    /* Matches success/error color */
}

.toast-content p {
    font-size: 0.95rem;
    margin: 0;
    color: var(--text-muted);
}

/* --- Utilities --- */
.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

/* --- Responsive Layout Adjustments --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .form-grid,
    .form-grid-3,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .form-grid .form-group:nth-child(5),
    .form-grid .form-group:nth-child(6) {
        grid-column: 1;
    }

    .action-grid-2 {
        grid-template-columns: 1fr;
    }

    .stats-hero {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .nav-links {
        display: none;
    }

    .header-section h1 {
        font-size: 2.5rem;
    }

    .huge-value {
        font-size: 3.5rem;
    }
}