:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

[hidden] {
    display: none !important;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: transparent;
    border: 1px solid #475569;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.logout-btn:hover {
    background: #1e293b;
}

.user-email-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.dashboard-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-tab {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.dashboard-tab:hover,
.dashboard-tab.active {
    background: #1e293b;
    border-color: #3b82f6;
    color: #fff;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.online {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.col-span-2, .col-span-3 { 
    grid-column: span 1 !important; 
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Metrics 3D Donuts */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1rem 0;
}

.metric-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.donut-3d {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) var(--progress, 0%), #334155 var(--progress, 0%));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 0 15px rgba(0,0,0,0.5),
        0 8px 15px rgba(0,0,0,0.4),
        0 -2px 10px rgba(255,255,255,0.1);
    transition: transform 0.3s ease;
}

.donut-3d:hover {
    transform: translateY(-5px);
}

.donut-3d.success {
    background: conic-gradient(var(--success) var(--progress, 0%), #334155 var(--progress, 0%));
    box-shadow: 
        inset 0 0 15px rgba(0,0,0,0.5),
        0 8px 15px rgba(16,185,129,0.2),
        0 -2px 10px rgba(255,255,255,0.1);
}

.donut-3d.danger {
    background: conic-gradient(var(--danger) var(--progress, 0%), #334155 var(--progress, 0%));
    box-shadow: 
        inset 0 0 15px rgba(0,0,0,0.5),
        0 8px 15px rgba(239,68,68,0.2),
        0 -2px 10px rgba(255,255,255,0.1);
}

.donut-3d.warning {
    background: conic-gradient(var(--warning) var(--progress, 0%), #334155 var(--progress, 0%));
    box-shadow: 
        inset 0 0 15px rgba(0,0,0,0.5),
        0 8px 15px rgba(245,158,11,0.2),
        0 -2px 10px rgba(255,255,255,0.1);
}

.donut-inner {
    position: absolute;
    width: 90px;
    height: 90px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 4px 8px rgba(0,0,0,0.5),
        inset 0 -2px 4px rgba(255,255,255,0.05);
    z-index: 10;
}

.donut-inner .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-container .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Progress Bars */
.risk-bar-container {
    margin-bottom: 1rem;
}

.risk-bar-container .label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress.safe { background-color: var(--success); }
.progress.warning { background-color: var(--warning); }
.progress.danger { background-color: var(--danger); }

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

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

td {
    font-size: 0.875rem;
}

/* Text Colors for Tables */
.text-success { color: var(--success); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }
.text-info { color: var(--accent); font-weight: 600; }
.text-muted { color: var(--text-secondary); font-weight: 600; }

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-blocked {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ===== USD Market Diary ===== */
.usd-diary-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid #334155 !important;
    position: relative;
    overflow: hidden;
}

.usd-diary-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.usd-bias-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 9999px;
    font-weight: 700;
    margin-left: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bias-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.bias-bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.bias-bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Composite Gauge */
.usd-composite-section {
    margin-bottom: 16px;
}

.usd-composite-gauge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gauge-label-left, .gauge-label-right {
    font-size: 0.7rem;
    color: #64748b;
    white-space: nowrap;
    min-width: 65px;
}

.gauge-label-right {
    text-align: right;
}

.usd-gauge-bar {
    flex: 1;
    height: 12px;
    background: #1e293b;
    border-radius: 6px;
    position: relative;
    border: 1px solid #334155;
    overflow: visible;
}

.usd-gauge-center {
    position: absolute;
    left: 50%;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #475569;
    transform: translateX(-50%);
    z-index: 2;
}

.usd-gauge-fill {
    position: absolute;
    top: 1px;
    bottom: 1px;
    border-radius: 4px;
    transition: all 0.5s ease;
    z-index: 1;
}

.usd-gauge-needle {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 20px;
    background: #f8fafc;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.5s ease;
    z-index: 3;
    box-shadow: 0 0 6px rgba(248, 250, 252, 0.5);
}

.usd-composite-values {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.usd-composite-values .label {
    color: #64748b;
    font-size: 0.75rem;
}

.usd-composite-values .value {
    font-weight: 700;
    font-size: 0.85rem;
}

/* Pairs Grid */
.usd-pairs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.usd-pair-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s;
}

.usd-pair-item:hover {
    border-color: #3b82f6;
}

.usd-pair-item .pair-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
}

.usd-pair-item .pair-change {
    font-size: 0.85rem;
    font-weight: 700;
}

.usd-pair-item .pair-change.up {
    color: #10b981;
}

.usd-pair-item .pair-change.down {
    color: #ef4444;
}

.usd-pair-item .pair-change.flat {
    color: #64748b;
}

.usd-pair-item.unavailable {
    opacity: 0.3;
}

/* Asset Class Impact */
.usd-impact-section {
    border-top: 1px solid #1e293b;
    padding-top: 12px;
}

.usd-impact-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 10px;
}

.usd-impact-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usd-impact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.impact-label {
    font-size: 0.8rem;
    min-width: 80px;
    color: #cbd5e1;
}

.impact-bar-container {
    flex: 1;
    height: 8px;
    background: #0f172a;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.impact-bar {
    height: 100%;
    border-radius: 4px;
    transition: all 0.5s ease;
    background: linear-gradient(90deg, #ef4444 0%, #64748b 50%, #10b981 100%);
}

.impact-adj {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 42px;
    text-align: right;
    color: #94a3b8;
}

.impact-adj.boosted {
    color: #10b981;
}

.impact-adj.reduced {
    color: #ef4444;
}

/* Extreme Warning */
.usd-extreme-warning {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    color: #f59e0b;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    animation: pulse-warning 2s infinite;
}

.bot-connection-panel {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

/* Lock overlay - hidden by default */
.bot-lock-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 6px;
    align-items: center;
    justify-content: center;
}

.bot-lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

/* Show lock overlay when panel is subscription-locked */
.bot-connection-panel.subscription-locked .bot-lock-overlay {
    display: flex;
}

/* Blur underlying content when locked */
.bot-connection-panel.subscription-locked .bot-connection-header,
.bot-connection-panel.subscription-locked .connection-field,
.bot-connection-panel.subscription-locked .connection-note,
.bot-connection-panel.subscription-locked .mt5-input-guide,
.bot-connection-panel.subscription-locked .connection-actions {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.bot-connection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.bot-connection-header h3 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.bot-connection-header span,
.connection-note {
    color: #94a3b8;
    font-size: 0.75rem;
    line-height: 1.4;
}

.mt5-input-guide,
.push-settings-note {
    color: #bfdbfe;
    font-size: 0.78rem;
    line-height: 1.5;
}

.mt5-input-guide {
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 6px;
}

.mt5-input-guide code {
    color: #dbeafe;
}

.connection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.connection-actions button {
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 7px 9px;
}

.push-settings-note {
    margin-top: 0.55rem;
    color: #94a3b8;
}

.bot-token-reset,
.copy-row button {
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
}

.bot-token-reset {
    padding: 6px 8px;
    white-space: nowrap;
}

.bot-connection-panel.subscription-locked {
    border-color: rgba(245, 158, 11, 0.35);
}

.bot-connection-panel.subscription-locked .connection-actions button[data-requires-subscription="true"],
button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.private-config-only input.locked-view,
.private-config-only select.locked-view {
    cursor: not-allowed;
    opacity: 1;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
    border-color: #475569 !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.04);
}

.private-config-only input.locked-view {
    background: #0f172a !important;
}

.private-config-only select.locked-view {
    background: #1e293b !important;
}

.private-config-only input[type="checkbox"].locked-view {
    accent-color: var(--accent);
}

.private-config-only:has(.locked-view) {
    opacity: 1;
}

button.locked-view:disabled {
    opacity: 1;
    background: #2563eb !important;
    color: #fff !important;
    border: 1px solid #3b82f6 !important;
}

.trade-action-cell {
    text-align: right;
}

.position-close-button {
    border: 1px solid rgba(239, 68, 68, 0.55);
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
}

.position-close-button:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.45);
    color: #fff;
}

.position-close-button:disabled {
    cursor: wait;
    opacity: 0.75;
}

.connection-field label {
    display: block;
    color: #94a3b8;
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 6px;
}

.copy-row input {
    min-width: 0;
    width: 100%;
    padding: 7px;
    background: #020617;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.copy-row button {
    padding: 0 8px;
}

.guide-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.guide-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 1rem;
    align-items: stretch;
}

.guide-hero-panel,
.guide-status-panel,
.guide-section,
.guide-step,
.guide-note,
.guide-check-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.guide-hero-panel {
    padding: 1.5rem;
}

.guide-kicker {
    color: #60a5fa;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.guide-title {
    font-size: clamp(1.7rem, 4vw, 2.75rem);
    line-height: 1.05;
    margin-bottom: 0.85rem;
}

.guide-lede {
    color: var(--text-secondary);
    max-width: 760px;
    line-height: 1.7;
}

.guide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.guide-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid #475569;
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.86rem;
}

.guide-button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.guide-button:hover {
    border-color: #60a5fa;
}

.guide-status-panel {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.guide-status-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 0.75rem;
    align-items: start;
}

.guide-status-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: #93c5fd;
    font-size: 0.8rem;
    font-weight: 900;
}

.guide-status-item strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.guide-status-item span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.guide-section {
    padding: 1.25rem;
}

.guide-section h2 {
    margin-bottom: 0.35rem;
}

.guide-section > p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.guide-steps {
    display: grid;
    gap: 0.8rem;
}

.guide-step {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: #0f172a;
}

.guide-step-number {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #1e293b;
    border: 1px solid #334155;
    color: #93c5fd;
    font-weight: 900;
}

.guide-step h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.guide-step p,
.guide-step li,
.guide-note,
.guide-check-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
}

.guide-step ul {
    margin-left: 1rem;
    display: grid;
    gap: 0.35rem;
}

.guide-code {
    display: block;
    width: 100%;
    margin: 0.6rem 0;
    padding: 0.8rem;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 6px;
    color: #dbeafe;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    overflow-x: auto;
}

.guide-note {
    padding: 0.85rem;
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
}

.guide-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.guide-check-card {
    padding: 1rem;
}

.guide-check-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.hosted-setup-card {
    background: #111827;
}

.hosted-setup-copy {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.hosted-status-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.hosted-status-panel > div {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.8rem;
}

.hosted-label {
    display: block;
    color: #94a3b8;
    font-size: 0.74rem;
    margin-bottom: 0.3rem;
}

.hosted-status-panel strong {
    font-size: 0.9rem;
}

.hosted-form {
    display: grid;
    gap: 0.8rem;
}

.hosted-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.hosted-form label {
    display: grid;
    gap: 0.35rem;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 700;
}

.hosted-form input,
.hosted-form select,
.hosted-form textarea {
    width: 100%;
    min-width: 0;
    padding: 0.62rem;
    background: #020617;
    border: 1px solid #334155;
    border-radius: 5px;
    color: #f8fafc;
    font: inherit;
    font-weight: 500;
}

.hosted-form textarea {
    resize: vertical;
}

.hosted-security-note {
    padding: 0.8rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 6px;
    color: #f8d08a;
    font-size: 0.82rem;
    line-height: 1.5;
}

.hosted-submit {
    justify-self: start;
    background: #3b82f6;
    color: white;
    border: 0;
    border-radius: 5px;
    padding: 0.72rem 1rem;
    cursor: pointer;
    font-weight: 800;
}

.hosted-submit:disabled {
    cursor: wait;
    opacity: 0.65;
}

.hosted-submit-status {
    color: #94a3b8;
    font-size: 0.82rem;
}

.subscription-gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow-y: auto;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(10px);
    padding: clamp(1rem, 3vw, 2rem);
}

.subscription-panel {
    width: min(1120px, 100%);
    margin: 0 auto;
    background: #111827;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: clamp(1rem, 3vw, 1.5rem);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.subscription-header,
.binance-payment-panel {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.subscription-kicker {
    color: #60a5fa;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.subscription-header h2 {
    margin: 0.35rem 0;
    font-size: clamp(1.6rem, 4vw, 2.35rem);
}

.subscription-header p,
.binance-payment-panel p {
    color: #cbd5e1;
    line-height: 1.6;
    max-width: 780px;
}

.subscription-status-badge {
    border-radius: 999px;
    padding: 0.42rem 0.7rem;
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    font-weight: 900;
    white-space: nowrap;
}

.subscription-plan-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.1rem 0;
}

.subscription-plan-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
}

.subscription-plan-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.subscription-plan-card h3 {
    margin: 0 0 0.45rem;
}

.subscription-plan-card .plan-price {
    color: #f8fafc;
    font-size: 1.45rem;
    font-weight: 900;
}

.subscription-plan-card p,
.subscription-plan-card ul {
    color: #94a3b8;
    line-height: 1.5;
    font-size: 0.86rem;
}

.subscription-plan-card ul {
    margin: 0.75rem 0 0;
    padding-left: 1rem;
}

.lenco-payment-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    gap: 1rem;
    align-items: start;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.lenco-payment-panel.lenco-disabled {
    opacity: 0.72;
}

.lenco-payment-copy h3,
.binance-payment-panel h3 {
    margin-bottom: 0.35rem;
}

.lenco-payment-copy p {
    color: #cbd5e1;
    line-height: 1.6;
}

.lenco-actions,
.lenco-mobile-form {
    display: grid;
    gap: 0.65rem;
}

.lenco-mobile-form {
    grid-template-columns: minmax(0, 1fr) 120px 110px auto;
}

.lenco-actions button,
.lenco-mobile-form input,
.lenco-mobile-form select {
    min-height: 40px;
    border-radius: 5px;
    font: inherit;
}

.lenco-actions button {
    border: 1px solid rgba(16, 185, 129, 0.42);
    background: rgba(16, 185, 129, 0.16);
    color: #bbf7d0;
    cursor: pointer;
    font-weight: 900;
    padding: 0 0.85rem;
}

.lenco-actions .lenco-primary-button {
    background: #10b981;
    border-color: #10b981;
    color: #04130d;
}

.lenco-actions button:disabled,
.lenco-mobile-form input:disabled,
.lenco-mobile-form select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.lenco-mobile-form input,
.lenco-mobile-form select {
    min-width: 0;
    background: #020617;
    border: 1px solid #334155;
    color: #f8fafc;
    padding: 0 0.65rem;
}

#lenco-payment-status {
    color: #94a3b8;
    font-size: 0.84rem;
    min-height: 1.2rem;
}

#lenco-payment-status[data-tone="success"] {
    color: #86efac;
}

#lenco-payment-status[data-tone="error"] {
    color: #fecaca;
}

.binance-payment-panel {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.binance-details {
    display: grid;
    gap: 0.25rem;
    min-width: min(340px, 100%);
    background: #020617;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.8rem;
}

.binance-details span {
    color: #94a3b8;
    font-size: 0.78rem;
}

.binance-details strong {
    font-family: 'JetBrains Mono', Consolas, monospace;
    overflow-wrap: anywhere;
}

.payment-proof-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    align-items: end;
}

.payment-proof-form label {
    display: grid;
    gap: 0.35rem;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 800;
}

.payment-proof-form input,
.payment-proof-form select {
    width: 100%;
    padding: 0.65rem;
    background: #020617;
    border: 1px solid #334155;
    border-radius: 5px;
    color: #f8fafc;
}

.payment-proof-form button {
    background: #3b82f6;
    color: #fff;
    border: 0;
    border-radius: 5px;
    padding: 0.72rem 1rem;
    cursor: pointer;
    font-weight: 900;
}

#payment-submit-status,
.payment-history-list {
    color: #94a3b8;
    font-size: 0.84rem;
}

.payment-history-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.payment-history-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.7rem;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== Responsive Design (Mobile Fixes) ===== */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .col-span-3 { grid-column: span 2; }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .config-grid, #dynamic-symbols-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .guide-hero,
    .guide-check-grid,
    .hosted-status-panel,
    .hosted-form-grid,
    .subscription-plan-cards,
    .lenco-payment-panel,
    .lenco-mobile-form,
    .payment-proof-form {
        grid-template-columns: 1fr;
    }

    .subscription-header,
    .binance-payment-panel {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 1rem;
        width: 100%;
        overflow-x: hidden;
    }
    
    .grid {
        display: flex;
        flex-direction: column;
    }
    
    .col-span-2, .col-span-3 { 
        grid-column: span 1 !important; 
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .usd-pairs-grid {
        grid-template-columns: 1fr;
    }
    
    .config-grid, #dynamic-symbols-container {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column;
    }
    
    /* Make tables scrollable on mobile without breaking layout */
    .scanner-card table, .trades-card table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .dashboard-tabs::-webkit-scrollbar-thumb {
        background: #475569;
        border-radius: 4px;
    }

    .dashboard-tab {
        flex: 1 1 140px;
        justify-content: center;
    }

    .guide-step {
        grid-template-columns: 1fr;
    }

    .connection-actions button {
        flex: 1 1 160px;
    }
}
