:root {
    /* Color Palette - Premium Dark Theme */
    --primary: #fca016;
    /* Pi Network approx color / Gold-ish */
    --primary-hover: #e08c0f;
    --secondary: #601445;
    /* Pi Network approx color / Purple-ish */
    --secondary-hover: #4a0d35;

    --bg-dark: #0f1115;
    --bg-card: #181b21;
    --bg-input: #232730;

    --text-main: #ffffff;
    --text-muted: #a0a5b1;

    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --info: #3498db;

    --border-color: #2a2f3a;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 15px rgba(252, 160, 22, 0.2);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --nav-height: 60px;
    --sidebar-width: 68px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

body {
    position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 600;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Utilities */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-heading);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 12px rgba(252, 160, 22, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(252, 160, 22, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(252, 160, 22, 0.05);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.card:hover {
    border-color: rgba(252, 160, 22, 0.3);
    box-shadow: var(--shadow-glow);
}

/* Wallet Page Specifics */
.wallet-balance-card {
    grid-column: span 3;
    background: linear-gradient(135deg, #601445, #220516);
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(252, 160, 22, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.tasks-hero-card {
    background: linear-gradient(135deg, var(--secondary), #2a0a1e);
    border: none;
    padding: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(96, 20, 69, 0.4);
    margin-bottom: 25px;
}

.tasks-hero-content {
    position: relative;
    z-index: 2;
}

.tasks-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tasks-main-title {
    color: white;
    margin-bottom: 4px;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
}

.tasks-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.tasks-streak-container {
    text-align: right;
}

.streak-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.streak-value {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.5rem;
    line-height: 1;
    margin-top: 4px;
}

.streak-unit {
    font-size: 12px;
    color: white;
    opacity: 0.6;
}

.streak-dots {
    display: flex;
    gap: 6px;
    margin-top: 20px;
}

.streak-dot {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.streak-dot.active {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}





.mission-board-title {
    grid-column: span 3;
    margin: 10px 0 15px;
}

.mission-title-text {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tasks-page-header {
    grid-column: span 3;
    margin-bottom: 5px;
}

.wallet-history-card {
    grid-column: span 2;
}

.wallet-balance-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
    width: 100%;
}

.wallet-balance-group {
    text-align: center;
    flex: 1;
    min-width: 180px;
}

.wallet-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wallet-amount {
    font-size: 42px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: #fff;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.wallet-currency {
    font-size: 18px;
}

.pika-amount .wallet-currency {
    color: var(--primary);
}

.pi-amount .wallet-currency {
    color: #f0b90b;
}

.wallet-separator {
    width: 1px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
}

.chain-sync-badge {
    font-size: 11px;
    color: #f0b90b;
    margin-top: 8px;
    opacity: 0.9;
    background: rgba(240, 185, 11, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s;
}

.chain-sync-badge:hover {
    background: rgba(240, 185, 11, 0.2);
    transform: scale(1.05);
}

.https-warning {
    font-size: 10px;
    color: #ff4757;
    margin-top: 10px;
    background: rgba(255, 71, 87, 0.1);
    padding: 5px;
    border-radius: 4px;
}

.wallet-actions {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 16px;
    position: relative;
    z-index: 2;
    width: 100%;
}





.wallet-admin-card {
    grid-column: span 3;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    padding: 24px;
}

.admin-wallet-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-wallet-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-wallet-icon {
    width: 48px;
    height: 48px;
    background: rgba(240, 185, 11, 0.1);
    color: #f0b90b;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.admin-wallet-title {
    font-weight: 600;
    font-size: 16px;
}

.admin-wallet-address {
    font-size: 13px;
    color: var(--text-muted);
    font-family: monospace;
    cursor: pointer;
}

.admin-wallet-address i {
    margin-left: 5px;
    font-size: 12px;
    vertical-align: middle;
}

.admin-chain-balance {
    font-size: 11px;
    color: #f0b90b;
    margin-top: 4px;
    opacity: 0.8;
}

.admin-transfer-btn {
    font-size: 13px;
    padding: 8px 20px;
    color: #f0b90b;
    border-color: rgba(240, 185, 11, 0.3);
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 16px 10px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    overflow-y: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar:hover {
    width: 240px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 30px;
    padding: 0 10px;
}

.sidebar-logo i {
    font-size: 28px;
    min-width: 28px;
    color: var(--primary);
}

.logo-text,
.nav-item span {
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.sidebar:hover .logo-text,
.sidebar:hover .nav-item span {
    opacity: 1;
    pointer-events: auto;
}

.logo-text span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-item i {
    font-size: 20px;
    min-width: 20px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(252, 160, 22, 0.1);
    color: var(--primary);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    /* Crucial for preventing flex children from pushing width */
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    height: var(--nav-height);
    position: sticky;
    top: 0;
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 900;
    padding: 0 15px;
    border-bottom: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

/* Dashboard Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.welcome-card {
    padding: 25px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(252, 160, 22, 0.1);
}

.scroll-x::-webkit-scrollbar {
    display: none;
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(24, 27, 33, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
    transition: all 0.3s;
}

.bottom-nav-item i {
    font-size: 22px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar-toggle {
        display: flex !important;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0%);
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.8);
    }

    .sidebar .logo-text,
    .sidebar .nav-item span {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .top-bar {
        margin-bottom: 20px;
        padding: 0 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(15, 17, 21, 0.95);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        max-width: 100vw;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
        /* Reduced from 16px */
        padding-top: 80px;
        padding-bottom: 100px;
        width: 100%;
        max-width: 100%;
    }

    .grid-container {
        grid-template-columns: 1fr !important;
        margin-top: 20px;
        gap: 16px;
    }

    .bottom-nav {
        display: flex;
    }

    .card {
        padding: 16px;
        grid-column: span 1 !important;
    }

    .stat-value {
        font-size: 24px;
    }

    .sidebar:not(.mobile-open) {
        display: none;
    }

    /* Wallet Page Mobile Fixes */
    .wallet-balance-card {
        padding: 24px 16px !important;
    }

    .wallet-balance-container {
        flex-direction: column !important;
        gap: 24px !important;
    }

    .wallet-separator {
        display: none !important;
    }

    .wallet-amount {
        font-size: 34px !important;
    }

    .wallet-actions {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .wallet-actions .btn {
        width: 100% !important;
        min-width: auto !important;
    }

    .header-balances {
        display: none !important;
    }



    .admin-transfer-btn {
        width: 100%;
    }

    .tasks-hero-main {
        flex-direction: column;
        gap: 15px;
    }

    .tasks-streak-container {
        text-align: left;
    }

    .tasks-main-title {
        font-size: 1.3rem;
    }

    .tasks-hero-card {
        padding: 20px 15px;
    }



    /* Table Responsive */
    table {
        display: block;
        width: 100%;
    }

    table thead {
        display: none;
    }

    table tbody {
        display: block;
        width: 100%;
    }

    table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 16px;
        padding: 12px;
        background: var(--bg-input);
        border-radius: 8px;
        border: 1px solid var(--border-color) !important;
    }

    table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0 !important;
        border: none !important;
        text-align: left !important;
        width: 100%;
    }

    table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: block;
    }

    #requestModal .card {
        width: 95% !important;
        max-width: none !important;
        padding: 20px !important;
    }

    #requestModal .card div[style*="width: 180px"] {
        width: 140px !important;
        height: 140px !important;
    }

    #requestModal .card i[style*="font-size: 140px"] {
        font-size: 100px !important;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    .avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .balance-mini-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .stat-mini-card {
        text-align: left !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .horizontal-actions::-webkit-scrollbar {
        display: none;
    }

    .horizontal-actions {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .dashboard-hero-buttons {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .dashboard-hero-buttons .btn {
        width: 100% !important;
        height: auto !important;
        padding: 12px !important;
    }

    .responsive-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .responsive-header .btn {
        width: 100% !important;
    }

    .grid-container {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .welcome-card {
        padding: 16px !important;
    }
}