:root {
    --bg-base: #0b0f19;
    --bg-surface: #151a2a;
    --bg-surface-hover: #1c2333;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #3b82f6;
    --accent-blue-alpha: rgba(59, 130, 246, 0.15);
    --accent-purple: #8b5cf6;
    --accent-purple-alpha: rgba(139, 92, 246, 0.15);
    
    --color-positive: #10b981;
    --color-positive-alpha: rgba(16, 185, 129, 0.15);
    --color-negative: #ef4444;
    --color-negative-alpha: rgba(239, 68, 68, 0.15);
    
    --border-light: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.1);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 40%), radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

.mono { font-family: var(--font-mono); letter-spacing: -0.5px; }
.text-green { color: var(--color-positive); }
.text-red { color: var(--color-negative); }
.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }

.bg-blue { background-color: var(--accent-blue-alpha); color: var(--accent-blue); }
.bg-purple { background-color: var(--accent-purple-alpha); color: var(--accent-purple); }
.bg-gray { background-color: rgba(255,255,255,0.05); color: var(--text-secondary); }

.flex-center { display: flex; align-items: center; justify-content: center; }

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.dashboard-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-placeholder {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: white;
    box-shadow: var(--shadow-glow);
}

.title-area h1 {
    font-size: 22px;
    font-weight: 600;
}

.title-area .subtitle {
    font-weight: 400;
    color: var(--text-secondary);
}

.status-area {
    display: flex;
    align-items: center;
    gap: 24px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    font-size: 14px;
}

.dot.live {
    width: 8px;
    height: 8px;
    background-color: var(--color-positive);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-positive);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-badge .label { color: var(--text-secondary); }
.status-badge .value { font-weight: 600; }

.last-update {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}
.last-update span {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.hero-cards .amount {
    font-size: 32px;
    font-weight: 700;
}

.positive-border { border-top: 3px solid var(--color-positive); }
.negative-border { border-top: 3px solid var(--color-negative); }

.charts-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-card {
    display: flex;
    flex-direction: column;
}

.chart-actions {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    padding: 4px;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition-fast);
}

.action-btn:hover { color: var(--text-primary); }
.action-btn.active {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.chart-container {
    flex: 1;
    position: relative;
    min-height: 280px;
    width: 100%;
}

.chart-legend-custom {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}
.legend-color.buy { background-color: var(--color-positive); }
.legend-color.sell { background-color: var(--accent-blue); }

.details-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border-medium), transparent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.stat-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-fast);
}

.stat-box:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-medium);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.stat-value {
    font-size: 17px;
    font-weight: 600;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background-color: #1e1b4b; /* Dark purple/blue matching the image */
    color: white;
    box-shadow: 0 4px 10px rgba(30, 27, 75, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background-color: #312e81;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: #fbbf24;
    color: #451a03;
}

.btn-warning:hover {
    background-color: #f59e0b;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-md);
}

/* --- Account Summary Panel --- */
.account-summary-panel {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.account-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.account-provider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.provider-name {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.account-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    color: var(--text-primary);
}

.user-id {
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
}

.account-last-update {
    font-size: 12px;
}

.account-profit-percent {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.account-stats-row {
    font-size: 14px;
    margin-bottom: 4px;
}

.text-primary { color: var(--text-primary) !important; }
.text-muted { color: var(--text-muted); }

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 250px;
    align-items: flex-end;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 4px;
}

.flag-icon {
    font-size: 16px;
}

/* --- History Trades Table --- */
.table-wrapper-card {
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 13px;
    white-space: nowrap;
}

.data-table th {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-medium);
    display: table-cell;
    vertical-align: middle;
}

.data-table th svg {
    vertical-align: middle;
    margin-left: 2px;
    opacity: 0.5;
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.1);
}

.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-medium);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition-fast);
}

.page-btn:hover:not(.text-muted) {
    background: var(--bg-surface-hover);
}

.page-btn.active {
    color: var(--accent-blue);
    font-weight: 700;
}

.page-dots {
    padding: 0 8px;
}

.form-select, .page-input {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.form-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.page-input {
    width: 40px;
    text-align: center;
}

@media (max-width: 1024px) {
    .charts-area { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header-content { flex-direction: column; align-items: flex-start; }
    .status-area { width: 100%; justify-content: space-between; }
    .hero-cards .amount { font-size: 28px; }
    .stats-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .account-summary-panel { flex-direction: column; }
    .account-actions { min-width: 100%; align-items: flex-start; }
    .pagination-footer { flex-direction: column; }
}

