:root {
    --bg: #f3f7ff;
    --white: #ffffff;
    --border: #dbe6fb;
    --text: #0f1f3d;
    --muted: #5b6b8a;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --navy: #0b2a6f;
    --sky: #38bdf8;
    --blue-soft: #eaf1ff;
    --sky-soft: #e6f6fe;
    --green: #059669;
    --green-soft: #e3f8ef;
    --red: #dc2626;
    --shadow: 0 6px 24px rgba(37, 99, 235, 0.08);
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    scroll-behavior: smooth;
}

html, body {
    background: var(--bg);
    color: var(--text);
    height: 100dvh;
    overflow: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--sky);
    border-radius: 6px;
}

/* Sidebar Styling */
.sidebar {
    width: 275px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    position: fixed;
    height: 100dvh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto !important;
    box-shadow: 4px 0 20px rgba(11, 42, 111, 0.05);
}

.brand-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--sky));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.brand-logo i {
    font-size: 28px;
    color: #fff;
}

.brand-title {
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 16px;
    color: var(--navy);
}

.brand-sub {
    text-align: center;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 600;
}

.nav-link-custom {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    width: 100%;
    transition: all 0.25s ease;
}

.nav-link-custom i {
    width: 20px;
    text-align: center;
    color: var(--blue);
    transition: color 0.25s ease;
}

.nav-link-custom:hover {
    background: var(--blue-soft);
    color: var(--blue);
}

.nav-link-custom.active {
    background: linear-gradient(90deg, var(--blue), var(--sky));
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.nav-link-custom.active i {
    color: #fff;
}

/* Sidebar Overlay for Mobile Drawer */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 42, 111, 0.45);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(37, 99, 235, 0.1);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
}

.mobile-bottom-nav a i {
    font-size: 18px;
}

.mobile-bottom-nav a.active {
    color: var(--blue);
}

/* Main Content Area */
.main-content {
    margin-left: 275px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100dvh;
    background: var(--bg);
}

.top-navbar {
    height: 75px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.connect-btn {
    background: linear-gradient(90deg, var(--blue), var(--blue-dark));
    border: none;
    color: #fff;
    padding: 11px 22px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    color: #fff;
}

.content-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1350px;
    margin: 0 auto;
    width: 100%;
}

.app-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-margin-top: 90px;
}

/* Cards & Elements */
.card-glass, .stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    box-shadow: var(--shadow);
    transition: all 0.3s ease-in-out;
}

.card-glass:hover, .stat-card:hover {
    border-color: var(--blue);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.16);
}

/* Welcome Hero Card */
.welcome-card {
    background: linear-gradient(120deg, var(--navy), var(--blue) 60%, var(--sky));
    border-radius: 20px;
    padding: 26px;
    color: #fff;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
    transition: all 0.3s ease;
}

.card-inner {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.balance-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 14px 0;
}

.mini-balance-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.swap-input-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-top: 10px;
}

.live-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-soft);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background-color: var(--green);
    border-radius: 50%;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    50% { opacity: 0.35; }
}

.welcome-card h1 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    color: #fff;
    margin: 8px 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-value {
    font-size: clamp(18px, 2.4vw, 23px);
    font-weight: 800;
    color: var(--navy);
    word-break: break-word;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .5px;
    margin-top: 4px;
}

.btn-primary-custom {
    background: linear-gradient(90deg, var(--blue), var(--blue-dark));
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.btn-primary-custom:hover {
    opacity: .95;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    color: #fff;
}

.wallet-address-text {
    word-break: break-all;
    font-family: 'Courier New', monospace;
    color: var(--navy);
    font-weight: 700;
}

.welcome-content-flex {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.withdraw-grid-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

.staked-banner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Responsive Rules */
@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .withdraw-grid-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 8px 0 30px rgba(11, 42, 111, 0.18);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding-bottom: 76px;
    }
    .content-body {
        padding: 18px 16px 30px;
        gap: 16px;
    }
    .balance-row {
        grid-template-columns: 1fr;
    }
    .welcome-bottom-row {
        flex-direction: column;
        align-items: stretch;
    }
    .staked-banner-grid {
        grid-template-columns: 1fr !important;
    }
}