/* ==========================================================================
   PropX Trading Dashboard - Stylesheet
   A bold, professional trading interface with dark theme
   ========================================================================== */

/* CSS Variables */
:root {
    /* Colors - Deep dark theme with vibrant accents */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: #151d2e;
    --bg-hover: #1e293b;
    
    --border-color: #2a3548;
    --border-light: #374151;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --accent-cyan: #06b6d4;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    
    /* Typography */
    --font-display: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --sidebar-width: 240px;
    --header-height: 72px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* App Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

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

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    padding: 0 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.last-update {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.header-right {
    display: flex;
    gap: 12px;
}

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

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Content */
.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Sections */
.section {
    display: none;
}

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

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

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

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-fast);
}

.summary-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.summary-icon.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.summary-icon.blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.summary-icon.orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.summary-icon.purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.summary-value.pnl.positive { color: var(--accent-green); }
.summary-value.pnl.negative { color: var(--accent-red); }

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 10px;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-primary);
    color: white;
}

/* Accounts Grid */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.account-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.account-card:hover::before {
    opacity: 1;
}

.account-card.projectx::before {
    background: var(--gradient-primary);
}

.account-card.tradovate::before {
    background: var(--gradient-success);
}

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

.account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-name {
    font-size: 1.125rem;
    font-weight: 600;
}

.account-platform {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.account-platform.projectx { color: var(--accent-primary); }
.account-platform.tradovate { color: var(--accent-cyan); }

.account-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.account-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.account-status.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-value.positive { color: var(--accent-green); }
.stat-value.negative { color: var(--accent-red); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state p {
    margin-bottom: 24px;
    font-size: 1.125rem;
}

.empty-state.small {
    padding: 24px;
}

.empty-state.small svg {
    width: 32px;
    height: 32px;
}

.empty-state.small p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-tertiary);
}

.data-table td {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.accounts-table-wrapper,
.history-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

/* Alert Generator */
.alert-generator {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.checkbox-item:hover {
    border-color: var(--accent-primary);
}

.checkbox-item input {
    accent-color: var(--accent-primary);
}

.checkbox-item.checked {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-primary);
}

/* Toggle */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: 13px;
    position: relative;
    transition: var(--transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition-fast);
}

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

.toggle-input:checked + .toggle-slider::after {
    transform: translateX(22px);
    background: white;
}

/* Code Block */
.code-block {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
}

.code-block pre {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--accent-cyan);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

.copy-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Tokens Grid */
.tokens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.token-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

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

.token-name {
    font-weight: 600;
}

.token-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.token-status.valid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.token-status.expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.token-status.expiring {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.token-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.token-details code {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.token-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.settings-card .btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

.settings-card .btn:last-child {
    margin-bottom: 0;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: var(--transition-normal);
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: var(--transition-normal);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content.modal-lg {
    max-width: 700px;
}

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

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

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

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

/* Platform Tabs */
.platform-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.platform-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.platform-tab:hover {
    border-color: var(--border-light);
}

.platform-tab.active {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.platform-logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
}

.platform-tab[data-platform="projectx"] .platform-logo {
    background: var(--gradient-primary);
    color: white;
}

.platform-tab[data-platform="tradovate"] .platform-logo {
    background: var(--gradient-success);
    color: white;
}

/* Account Forms */
.account-form {
    display: none;
}

.account-form.active {
    display: block;
}

/* Account Detail Modal */
.account-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.detail-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.detail-value.pnl.positive { color: var(--accent-green); }
.detail-value.pnl.negative { color: var(--accent-red); }

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.positions-list,
.trades-list {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
}

.position-item,
.trade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.position-item:last-child,
.trade-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.position-item:first-child,
.trade-item:first-child {
    padding-top: 0;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

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

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast.warning { border-left: 4px solid var(--accent-orange); }
.toast.info { border-left: 4px solid var(--accent-primary); }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* History Filters */
.history-filters {
    display: flex;
    gap: 12px;
}

.history-filters .form-input {
    width: auto;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.long {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge.short {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.badge.flat {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Connections List */
.connections-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.connection-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

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

.connection-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.connection-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.connection-logo.projectx {
    background: var(--gradient-primary);
}

.connection-logo.tradovate {
    background: var(--gradient-success);
}

.connection-details h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.connection-details span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.connection-actions {
    display: flex;
    gap: 8px;
}

.connection-accounts {
    padding: 16px 24px;
}

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

.connection-accounts-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.connection-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.connection-account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.connection-account-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.connection-account-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.connection-account-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.connection-account-stats {
    text-align: right;
}

.connection-account-balance {
    font-weight: 600;
    font-family: var(--font-mono);
}

.connection-account-pnl {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
}

.connection-account-pnl.positive { color: var(--accent-green); }
.connection-account-pnl.negative { color: var(--accent-red); }

/* Form Note */
.form-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 72px;
    }
    
    .logo-text,
    .nav-item span,
    .connection-status span {
        display: none;
    }
    
    .logo {
        justify-content: center;
        padding: 16px;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .main {
        margin-left: 72px;
    }
    
    .account-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 12px;
    }
    
    .header-left,
    .header-right {
        width: 100%;
    }
    
    .header-right {
        justify-content: flex-end;
    }
    
    .content {
        padding: 16px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .accounts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .platform-tabs {
        flex-direction: column;
    }
}