/* ==========================================================================
   XAU/USD Trading Helper - Premium Dark Theme Dashboard
   ========================================================================== */

:root {
    /* Backgrounds - deeper, richer darks */
    --bg-primary: #0a0e17;
    --bg-secondary: #111622;
    --bg-tertiary: #161c2a;
    --bg-hover: #1b2235;
    --bg-elevated: #1e2538;

    /* Borders */
    --border: #1e2740;
    --border-light: #2a3350;
    --border-gold: rgba(240, 185, 11, 0.25);

    /* Text */
    --text-primary: #e8edf5;
    --text-secondary: #8893a7;
    --text-muted: #5a6580;

    /* Gold accent system */
    --gold: #f0b90b;
    --gold-dim: #d4a30a;
    --gold-glow: rgba(240, 185, 11, 0.15);
    --gold-glow-strong: rgba(240, 185, 11, 0.25);
    --gold-bg: rgba(240, 185, 11, 0.06);

    /* Status colors */
    --green: #34d399;
    --green-bg: rgba(52, 211, 153, 0.12);
    --green-glow: rgba(52, 211, 153, 0.2);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, 0.12);
    --red-glow: rgba(248, 113, 113, 0.2);
    --yellow: #fbbf24;
    --yellow-bg: rgba(251, 191, 36, 0.12);
    --yellow-glow: rgba(251, 191, 36, 0.2);
    --blue: #60a5fa;
    --blue-bg: rgba(96, 165, 250, 0.12);

    /* Elevation shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.5), 0 8px 16px rgba(0, 0, 0, 0.3);
    --shadow-gold: 0 4px 20px rgba(240, 185, 11, 0.12);
    --shadow-green: 0 4px 20px rgba(52, 211, 153, 0.15);
    --shadow-red: 0 4px 20px rgba(248, 113, 113, 0.15);

    /* Radii */
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Fonts */
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.25s var(--ease);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================================================
   LOGIN PAGE
   =================================================================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(ellipse 60% 50% at 50% 45%, rgba(240, 185, 11, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(16, 24, 48, 0.8) 0%, transparent 100%),
        var(--bg-primary);
    animation: loginFadeIn 0.8s ease-out;
}

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

.login-card {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl), var(--shadow-gold);
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(145deg, rgba(240, 185, 11, 0.2), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold) 0%, #fcd34d 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.login-form .form-group { margin-bottom: 24px; }

/* ===================================================================
   ALERTS
   =================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
}

.alert-error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ===================================================================
   FORMS
   =================================================================== */
label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

input, select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

/* Select custom arrow */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23f0b90b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    cursor: pointer;
}

select:hover { border-color: var(--border-light); }

/* Input number - hide native spinner */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

input:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow), var(--shadow-sm);
    background: var(--bg-tertiary);
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border-color: var(--gold);
    color: #0a0e17;
    font-weight: 700;
}

.btn-primary:hover {
    box-shadow: var(--shadow-gold);
    filter: brightness(1.1);
}

.btn-danger {
    color: var(--red);
    border-color: rgba(248, 113, 113, 0.25);
}

.btn-danger:hover {
    background: var(--red-bg);
    border-color: rgba(248, 113, 113, 0.4);
}

.btn-full { width: 100%; padding: 13px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* ===================================================================
   DASHBOARD LAYOUT
   =================================================================== */
.dashboard {
    max-width: 1320px;
    margin: 0 auto;
    padding: 16px 20px;
}

/* ===================================================================
   HEADER
   =================================================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 12px;
}

.header__title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold) 0%, #fcd34d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.header__badge {
    font-size: 11px;
    font-weight: 600;
    -webkit-text-fill-color: var(--text-muted);
    background: none;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.header__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header__update {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

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

.header__toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
}

/* ===================================================================
   TAB NAVIGATION
   =================================================================== */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.tab-btn.active {
    color: var(--gold);
    background: var(--bg-tertiary);
    border-color: var(--border-gold);
    box-shadow: 0 0 12px rgba(240, 185, 11, 0.08);
}

.tab-content { animation: tabFadeIn 0.3s var(--ease); }

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

/* ===================================================================
   LOADING OVERLAY
   =================================================================== */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    gap: 16px;
}

.loading-overlay.hidden { display: none; }

.loading-overlay p { animation: pulse 2s ease-in-out infinite; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    box-shadow: 0 0 16px var(--gold-glow);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ===================================================================
   PRICE BAR
   =================================================================== */
.price-bar {
    display: flex;
    gap: 28px;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(240, 185, 11, 0.04) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.price-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-glow-strong), transparent);
}

.price-bar__main .price-bar__value {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--gold) 0%, #fcd34d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.price-bar__label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 4px;
}

.price-bar__item .price-bar__value {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ===================================================================
   CONFLUENCE SIGNAL
   =================================================================== */
.confluence-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.confluence-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

.confluence-badge.buy {
    background: linear-gradient(135deg, var(--green-bg) 0%, rgba(52, 211, 153, 0.04) 100%);
    border-color: rgba(52, 211, 153, 0.35);
    box-shadow: var(--shadow-md), var(--shadow-green);
}

.confluence-badge.sell {
    background: linear-gradient(135deg, var(--red-bg) 0%, rgba(248, 113, 113, 0.04) 100%);
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: var(--shadow-md), var(--shadow-red);
}

.confluence-badge.neutral {
    background: linear-gradient(135deg, var(--yellow-bg) 0%, rgba(251, 191, 36, 0.04) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.confluence-label {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confluence-badge.buy .confluence-label { color: var(--green); }
.confluence-badge.sell .confluence-label { color: var(--red); }
.confluence-badge.neutral .confluence-label { color: var(--yellow); }

.confluence-score {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.confluence-agreement {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===================================================================
   SECTIONS
   =================================================================== */
.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.section__title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    padding-left: 12px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================================================================
   MULTI-TIMEFRAME TABLE
   =================================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

.tf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tf-table th {
    text-align: center;
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-tertiary);
}

.tf-table th:first-child {
    text-align: left;
    border-radius: var(--radius) 0 0 0;
}

.tf-table th:last-child { border-radius: 0 var(--radius) 0 0; }

.tf-table td {
    padding: 9px 14px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid rgba(30, 39, 64, 0.5);
    transition: background var(--transition);
}

.tf-table td:first-child {
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
}

.tf-table tr:nth-child(even) td { background: rgba(22, 28, 42, 0.4); }
.tf-table tr:hover td { background: var(--bg-hover); }
.tf-table tr:last-child td { border-bottom: none; }

.tf-table .signal-row td {
    font-weight: 800;
    font-size: 13px;
    padding: 12px 14px;
    font-family: var(--font-sans);
    border-top: 2px solid var(--border);
    background: var(--bg-tertiary);
    letter-spacing: 0.3px;
}

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-blue { color: var(--blue); }
.text-center { text-align: center; }

/* ===================================================================
   SIGNAL CARDS GRID
   =================================================================== */
.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.signal-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all var(--transition);
    border-top: 3px solid var(--border);
}

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

.signal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.signal-card__tf {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.signal-card__badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signal-card__badge.buy {
    background: linear-gradient(135deg, var(--green-bg), rgba(52, 211, 153, 0.2));
    color: var(--green);
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.1);
}

.signal-card__badge.sell {
    background: linear-gradient(135deg, var(--red-bg), rgba(248, 113, 113, 0.2));
    color: var(--red);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.1);
}

.signal-card__badge.neutral {
    background: linear-gradient(135deg, var(--yellow-bg), rgba(251, 191, 36, 0.2));
    color: var(--yellow);
}

.signal-factor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(30, 39, 64, 0.4);
}

.signal-factor:last-child { border-bottom: none; }

.signal-factor__name { color: var(--text-secondary); }
.signal-factor__value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
}

/* ===================================================================
   LEVELS GRID
   =================================================================== */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.levels-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all var(--transition);
}

.levels-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.levels-card__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.level-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(30, 39, 64, 0.3);
    transition: background var(--transition);
}

.level-row:hover { background: rgba(255, 255, 255, 0.02); }
.level-row:last-child { border-bottom: none; }

.level-row__label { color: var(--text-secondary); font-weight: 500; }
.level-row__value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ===================================================================
   CHART
   =================================================================== */
.chart-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.chart-tf-btn.active {
    background: linear-gradient(135deg, var(--gold-glow) 0%, var(--gold-bg) 100%);
    border-color: var(--gold);
    color: var(--gold);
    font-weight: 700;
}

.chart-container {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* ===================================================================
   MONEY MANAGEMENT
   =================================================================== */
.mm-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.mm-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-content: start;
}

.mm-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mm-result-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    transition: all var(--transition);
}

.mm-result-card:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.mm-result-card--highlight {
    grid-column: 1 / -1;
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(240, 185, 11, 0.08) 0%, rgba(240, 185, 11, 0.03) 100%);
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.mm-result-card--highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.mm-result-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.mm-result-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.mm-result-card--highlight .mm-result-value {
    font-size: 24px;
    background: linear-gradient(135deg, var(--gold) 0%, #fcd34d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================================================
   SETTINGS
   =================================================================== */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.settings-row--grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.settings-status {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.settings-status.ok {
    color: var(--green);
    border-color: rgba(52, 211, 153, 0.25);
    background: var(--green-bg);
}

.settings-status.error {
    color: var(--red);
    border-color: rgba(248, 113, 113, 0.25);
    background: var(--red-bg);
}

.settings-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 4px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
}

.settings-hint a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}

.settings-hint a:hover { text-decoration: underline; }

.settings-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
}

.settings-feedback {
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.settings-feedback.ok { color: var(--green); }
.settings-feedback.error { color: var(--red); }

.checkbox-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all var(--transition);
}

.checkbox-label:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
}

/* ===================================================================
   AI ANALYSIS
   =================================================================== */
.ai-section {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(240, 185, 11, 0.03) 100%);
}

.ai-container { min-height: 80px; }

.ai-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
}

.ai-empty p { margin-bottom: 16px; font-size: 14px; }

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    gap: 14px;
    color: var(--text-secondary);
}

.ai-loading p { animation: pulse 2s ease-in-out infinite; }

.ai-error {
    text-align: center;
    padding: 20px;
    color: var(--red);
    font-size: 14px;
}

.ai-error p { margin-bottom: 12px; }

.hidden { display: none !important; }

/* AI Result */
.ai-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ai-badge {
    font-size: 22px;
    font-weight: 900;
    padding: 8px 28px;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-badge--buy {
    background: linear-gradient(135deg, var(--green-bg) 0%, rgba(52, 211, 153, 0.25) 100%);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.35);
    box-shadow: var(--shadow-green);
}

.ai-badge--sell {
    background: linear-gradient(135deg, var(--red-bg) 0%, rgba(248, 113, 113, 0.25) 100%);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.35);
    box-shadow: var(--shadow-red);
}

.ai-badge--hold {
    background: linear-gradient(135deg, var(--yellow-bg) 0%, rgba(251, 191, 36, 0.25) 100%);
    color: var(--yellow);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.ai-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-meta-item {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.ai-analysis-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border-left: 3px solid var(--gold);
}

.ai-factor {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
    padding-left: 16px;
}

.ai-levels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.ai-level-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    transition: all var(--transition);
}

.ai-level-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.ai-level-card--sl { border-top: 3px solid var(--red); }
.ai-level-card--tp { border-top: 3px solid var(--green); }

.ai-level-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ai-level-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ai-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.ai-cache-info {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ===================================================================
   NEWS
   =================================================================== */
.news-loading {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

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

.news-card {
    display: block;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    border-left: 3px solid var(--gold);
}

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

.news-card__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.news-card__source { font-weight: 600; color: var(--gold); }

.news-error {
    color: var(--red);
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

/* AI Reasoning Toggle */
.ai-reasoning-toggle {
    margin-bottom: 14px;
}

.ai-reasoning-btn {
    color: var(--text-secondary);
    border-color: var(--border);
    font-size: 12px;
}

.ai-reasoning-btn:hover {
    color: var(--gold);
    border-color: var(--border-gold);
}

.ai-reasoning-content {
    margin-top: 10px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* ===================================================================
   TRADE TAB
   =================================================================== */
.trade-generate__inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.trade-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    gap: 14px;
    color: var(--text-secondary);
}

.trade-loading p { animation: pulse 2s ease-in-out infinite; }

.trade-error {
    text-align: center;
    padding: 20px;
    color: var(--red);
    font-size: 14px;
}

.trade-error p { margin-bottom: 12px; }

/* Trade Card (Suggestion + Open) */
.trade-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
    transition: all var(--transition);
}

.trade-card--suggestion {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(240, 185, 11, 0.04) 100%);
}

.trade-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.trade-badge {
    font-size: 18px;
    font-weight: 900;
    padding: 6px 22px;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trade-badge--buy {
    background: linear-gradient(135deg, var(--green-bg) 0%, rgba(52, 211, 153, 0.25) 100%);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.35);
    box-shadow: var(--shadow-green);
}

.trade-badge--sell {
    background: linear-gradient(135deg, var(--red-bg) 0%, rgba(248, 113, 113, 0.25) 100%);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.35);
    box-shadow: var(--shadow-red);
}

.trade-card__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trade-meta-item {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.trade-card__levels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.trade-level {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
}

.trade-level--sl { border-top: 3px solid var(--red); }
.trade-level--tp { border-top: 3px solid var(--green); }

.trade-level__label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.trade-level__value {
    display: block;
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.trade-card__details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.trade-detail {
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.trade-detail__label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
    font-weight: 600;
}

.trade-detail__value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.trade-card__analysis {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 14px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border-left: 3px solid var(--gold);
}

.trade-card__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.trade-card__pnl {
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-mono);
    padding: 8px 16px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 10px;
}

.trade-card__pnl--positive {
    color: var(--green);
    background: var(--green-bg);
}

.trade-card__pnl--negative {
    color: var(--red);
    background: var(--red-bg);
}

.trade-empty-msg {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Trade Stats */
.trade-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.trade-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    transition: all var(--transition);
}

.trade-stat-card:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.trade-stat-card--green { border-top: 3px solid var(--green); }
.trade-stat-card--red { border-top: 3px solid var(--red); }

.trade-stat__label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.trade-stat__value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Trade History Table */
.trade-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.trade-status-badge--win {
    background: var(--green-bg);
    color: var(--green);
}

.trade-status-badge--loss {
    background: var(--red-bg);
    color: var(--red);
}

.trade-status-badge--cancelled {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.trade-status-badge--open {
    background: var(--blue-bg);
    color: var(--blue);
}

.btn-icon {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    color: var(--red);
    border-color: rgba(248, 113, 113, 0.3);
    background: var(--red-bg);
}

/* Close Trade Modal */
.trade-close-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.trade-close-modal__content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
}

.trade-close-modal__content h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.trade-close-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-green {
    background: linear-gradient(135deg, var(--green-bg), rgba(52, 211, 153, 0.2));
    border-color: rgba(52, 211, 153, 0.35);
    color: var(--green);
    font-weight: 700;
}

.btn-green:hover {
    box-shadow: var(--shadow-green);
    filter: brightness(1.1);
}

.btn-red {
    background: linear-gradient(135deg, var(--red-bg), rgba(248, 113, 113, 0.2));
    border-color: rgba(248, 113, 113, 0.35);
    color: var(--red);
    font-weight: 700;
}

.btn-red:hover {
    box-shadow: var(--shadow-red);
    filter: brightness(1.1);
}

/* ===================================================================
   DISCLAIMER
   =================================================================== */
.disclaimer {
    margin-top: 28px;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.7;
    border-left: 3px solid var(--yellow);
}

.disclaimer strong {
    color: var(--yellow);
    font-weight: 700;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
    .dashboard { padding: 10px 12px; }

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

    .price-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px 20px;
    }

    .price-bar__main .price-bar__value { font-size: 26px; }

    .confluence-section { flex-direction: column; }

    .mm-container { grid-template-columns: 1fr; }
    .mm-inputs { grid-template-columns: 1fr; }
    .mm-results { grid-template-columns: 1fr; }

    .signals-grid { grid-template-columns: 1fr; }
    .levels-grid { grid-template-columns: 1fr; }

    .settings-row--grid { grid-template-columns: 1fr; }
    .settings-actions { flex-direction: column; align-items: flex-start; }

    .ai-levels { grid-template-columns: 1fr; }
    .ai-header { flex-direction: column; align-items: flex-start; }
    .news-grid { grid-template-columns: 1fr; }

    .trade-generate__inputs { grid-template-columns: 1fr; }
    .trade-card__levels { grid-template-columns: 1fr; }
    .trade-card__details { grid-template-columns: 1fr; }
    .trade-stats { grid-template-columns: repeat(2, 1fr); }

    .tabs { flex-direction: row; }
    .tab-btn { padding: 10px 16px; font-size: 12px; }

    .login-card { padding: 36px 28px; }
}

@media (max-width: 480px) {
    .header__title { font-size: 18px; }
    .price-bar__main .price-bar__value { font-size: 22px; }
    .confluence-label { font-size: 15px; }
    .confluence-badge { padding: 12px 18px; }

    .tf-table { font-size: 11px; }
    .tf-table th, .tf-table td { padding: 7px 8px; }

    .mm-result-card--highlight .mm-result-value { font-size: 20px; }

    .login-card { padding: 30px 22px; }
    .login-header h1 { font-size: 26px; }
}
