:root {
    --bg-body: #181A20;
    /* Binance Midnight */
    --bg-card: #2B3139;
    /* Card/Input BG */
    --bg-hover: #3a4049;
    --text-primary: #EAECEF;
    --text-secondary: #848E9C;
    --accent: #FCD535;
    /* Binance Yellow */
    --accent-hover: #F0B90B;
    --success: #0ECB81;
    /* Trading Green */
    --danger: #F6465D;
    /* Trading Red */
    --border: #2B3139;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background: #000000 !important;
    /* Force Pure Black */
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: var(--text-primary);
    transition: 0.2s;
}

/* Layout */
.app-container {
    max-width: 1400px;
    /* Wide for data */
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: #181A20;
    /* Black text on yellow */
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* Cards */
.card-panel {
    background: #1E2329;
    /* Slightly lighter than body */
    border-radius: 8px;
    /* Slight radius */
    padding: 24px;
    border: 1px solid var(--border);
}

/* --- Responsive Layout System --- */

/* Base Layout (Desktop First) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 24px;
    margin-top: 24px;
    width: 100%;
}

/* Tablet Landscape (1024px - 1200px) */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 240px 1fr 280px;
        /* Compress Sidebars */
        gap: 16px;
    }
}

/* Tablet Portrait (768px - 1024px) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 300px;
        /* 2 Columns: Main + Right Sidebar */
    }

    /* Move Left Sidebar (Menu) to Top or Hidden */
    /* Assuming Layout change logic here or pure CSS adaptation */
    .dashboard-grid>div:nth-child(1) {
        display: none;
        /* Hide sidebar nav on tablet, use Header Nav */
    }
}

/* Mobile (Up to 768px) */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }

    .app-header {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .dashboard-grid {
        display: flex;
        /* Switch to Flex Stick for Mobile */
        flex-direction: column;
        gap: 20px;
    }

    /* Make Navigation Scrollable Horizontal */
    .nav-menu {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        margin-top: 15px;
        width: 100%;
        gap: 20px;
        -webkit-overflow-scrolling: touch;
        /* Smooth Scroll iOS */
    }

    .action-icon-btn {
        min-width: 60px;
        /* Smaller Icons */
    }

    .balance-value {
        font-size: 2rem;
        /* responsive text */
    }

    .quick-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2x2 Grid for buttons */
        gap: 10px;
    }

    .quick-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Small Mobile (Up to 480px) */
@media (max-width: 480px) {
    .balance-value {
        font-size: 1.75rem;
    }

    .card-panel {
        padding: 15px;
    }
}

/* Flexible Units & Flexbox Utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.w-100 {
    width: 100%;
}

.gap-1 {
    gap: 1rem;
}


/* Balance Section */
.balance-section {
    margin-bottom: 20px;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.balance-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-btc {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.action-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    cursor: pointer;
}

.action-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.2rem;
    transition: 0.2s;
}

.action-circle:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.action-label {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Table / Lists */
.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding: 10px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.table-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Forms */
label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid transparent;
    padding: 12px;
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: 0.2s;
}

input:focus {
    border-color: var(--accent);
    outline: none;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-item {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    /* Align with header bottom */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

/* QR Section */
.qr-box {
    background: #fff;
    padding: 10px;
    display: inline-block;
    border-radius: 8px;
}

.address-copy-row {
    display: flex;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 4px;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.address-text {
    font-family: monospace;
    color: var(--text-primary);
}

.copy-icon {
    color: var(--accent);
    cursor: pointer;
}