/* ========================================
   EXPENSE CONTROLLER - FULL APP
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-green: #10b981;
    --accent-green-light: rgba(16, 185, 129, 0.1);
    --accent-red: #ef4444;
    --accent-red-light: rgba(239, 68, 68, 0.1);
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --sidebar-width: 260px;
    --mobile-header-height: 60px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   APP LAYOUT
   ======================================== */

.app {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   MOBILE HEADER
   ======================================== */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 200;
}

.burger-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
}

.burger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-rate {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 20px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transition: transform 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--border-color);
}

.icon-sun, .icon-moon {
    font-size: 1.25rem;
    transition: opacity 0.3s ease;
}

.icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: inline;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    margin-top: 8px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent-red-light);
    color: var(--accent-red);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--accent-red);
    color: white;
}

.logout-icon {
    font-size: 1.25rem;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.exchange-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.exchange-icon {
    font-size: 1.25rem;
}

/* ========================================
   STATS GRID
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.balance-card::before { background: linear-gradient(90deg, var(--accent-primary), var(--accent-purple)); }
.income-card::before { background: var(--accent-green); }
.expense-card::before { background: var(--accent-red); }
.transactions-card::before { background: var(--accent-blue); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-icon { font-size: 2rem; }

.edit-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    opacity: 0;
}

.stat-card:hover .edit-btn { opacity: 1; }

.edit-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-secondary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   CONTENT GRID & PANELS
   ======================================== */

.content-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

.panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.panel.full-width {
    width: 100%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.panel-body {
    padding: 24px;
}

.view-all-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.action-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:active { transform: scale(0.98); }
.btn-icon { font-size: 1.25rem; font-weight: 700; }

.btn-income {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-income:hover {
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-expense {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-expense:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-primary { background: var(--accent-primary); color: white; }
.btn-primary:hover { background: var(--accent-primary-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border-color); }
.btn-danger { background: var(--accent-red-light); color: var(--accent-red); }
.btn-danger:hover { background: var(--accent-red); color: white; }

.btn-small {
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-icon-only:hover {
    background: var(--accent-red);
    transform: scale(1.05);
}

/* Search & Filter */
.search-input, .filter-select {
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input { width: 180px; }
.search-input:focus { outline: none; border-color: var(--accent-primary); width: 220px; }
.filter-select { cursor: pointer; }

/* ========================================
   TRANSACTIONS LIST
   ======================================== */

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.transactions-list.full-height {
    max-height: calc(100vh - 300px);
}

.transactions-list::-webkit-scrollbar { width: 6px; }
.transactions-list::-webkit-scrollbar-track { background: transparent; }
.transactions-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.transactions-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.transaction-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    animation: fadeInUp 0.3s ease;
}

.transaction-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.transaction-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.transaction-icon.income { background: var(--accent-green-light); }
.transaction-icon.expense { background: var(--accent-red-light); }

.transaction-info { flex: 1; min-width: 0; }

.transaction-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transaction-category {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    color: var(--text-muted);
}

.transaction-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.transaction-amount {
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.transaction-amount.income { color: var(--accent-green); }
.transaction-amount.expense { color: var(--accent-red); }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state.small { padding: 30px 20px; }
.empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state.small .empty-icon { font-size: 2.5rem; }
.empty-state p { font-size: 1.1rem; color: var(--text-secondary); font-weight: 500; }
.empty-hint { font-size: 0.9rem; color: var(--text-muted); margin-top: 8px; }

/* ========================================
   ANALYTICS PAGE
   ======================================== */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.summary-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.summary-value.balance { color: var(--accent-primary); }
.summary-value.income { color: var(--accent-green); }
.summary-value.expense { color: var(--accent-red); }

/* Categories Breakdown */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    font-size: 1.5rem;
}

.category-info {
    flex: 1;
}

.category-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.category-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-amount {
    font-weight: 600;
    color: var(--text-primary);
}

/* Top Expenses */
.top-expenses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-expense-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.top-expense-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-red-light);
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.top-expense-info { flex: 1; }
.top-expense-desc { font-weight: 500; }
.top-expense-date { font-size: 0.8rem; color: var(--text-muted); }
.top-expense-amount { font-weight: 700; color: var(--accent-red); }

/* Activity Stats */
.activity-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.activity-icon { font-size: 1.5rem; }
.activity-info { flex: 1; }
.activity-label { color: var(--text-muted); font-size: 0.9rem; }
.activity-value { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }

/* ========================================
   SETTINGS PAGE
   ======================================== */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.settings-panel .panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    gap: 16px;
}

.setting-item.danger {
    border: 1px solid var(--accent-red-light);
}

.setting-info { flex: 1; }
.setting-label { font-weight: 600; margin-bottom: 4px; }
.setting-desc { font-size: 0.85rem; color: var(--text-muted); }

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* About Info */
.about-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.about-label { color: var(--text-muted); }
.about-value { font-weight: 600; }

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 { font-size: 1.25rem; font-weight: 600; }

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-tertiary);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.modal-close:hover { background: var(--accent-red); color: white; }

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.radio-group { display: flex; gap: 24px; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.radio-label input { width: 18px; height: 18px; accent-color: var(--accent-primary); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1400px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
    .mobile-header { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        top: var(--mobile-header-height);
        height: calc(100vh - var(--mobile-header-height));
    }

    .sidebar.open { transform: translateX(0); }

    .main {
        margin-left: 0;
        padding-top: calc(var(--mobile-header-height) + 24px);
    }

    .content-grid { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .main { padding: 16px; padding-top: calc(var(--mobile-header-height) + 16px); }
    .stat-value { font-size: 1.5rem; }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-actions {
        width: 100%;
    }

    .search-input {
        flex: 1;
        width: 100%;
    }

    .search-input:focus { width: 100%; }

    .filter-select { flex: 1; }

    .action-buttons { grid-template-columns: 1fr; }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn { width: 100%; }

    .header { flex-direction: column; align-items: flex-start; }
    .exchange-badge { display: none; }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake { animation: shake 0.5s ease; }
.loading { opacity: 0.7; pointer-events: none; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent-green);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.error { border-left-color: var(--accent-red); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}
