:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d29;
    --bg-card: #222536;
    --text-primary: #e4e6eb;
    --text-secondary: #8b8fa3;
    --accent: #4f7df9;
    --accent-hover: #3d6ae8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #2d3148;
    --sidebar-width: 220px;
    --topbar-height: 56px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

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

.sidebar-brand {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    font-size: 1.4rem;
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
    background: rgba(79, 125, 249, 0.08);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(79, 125, 249, 0.15);
    color: var(--accent);
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================================================
   MOBILE HEADER & SIDEBAR TOGGLE
   ================================================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 90;
}

.hamburger {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

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

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================================================================
   TOP BAR
   ================================================================ */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    min-height: var(--topbar-height);
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ================================================================
   PAGE SECTIONS
   ================================================================ */
.page-section {
    display: none;
    padding: 24px 28px;
    flex: 1;
}

.page-section.active {
    display: block;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-compact {
    padding: 14px 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header-row .card-title {
    margin-bottom: 0;
}

/* ================================================================
   CONTAINER (legacy, kept for login page)
   ================================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Header (legacy, kept for login page) */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    margin-bottom: 24px;
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.logo span { color: var(--text-secondary); font-weight: 400; font-size: 0.85rem; margin-left: 8px; }

/* ================================================================
   ENV BADGE
   ================================================================ */
.env-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.env-demo { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.env-live { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ================================================================
   GRID
   ================================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; }
.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 12px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.inline-form input:focus,
.inline-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.form-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.group-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* ================================================================
   TABLES
   ================================================================ */
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* ================================================================
   STATUS BADGES
   ================================================================ */
.status {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-active, .status-processed { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.status-error, .status-blocked { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-received, .status-pending { background: rgba(79, 125, 249, 0.15); color: var(--accent); }

/* ================================================================
   WEBHOOK URL BOX
   ================================================================ */
.webhook-url {
    background: var(--bg-primary);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.webhook-url code { color: var(--accent); flex: 1; }
.copy-btn {
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    padding: 4px 10px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ================================================================
   CONNECTION CARDS GRID
   ================================================================ */
.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.connection-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.connection-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(79, 125, 249, 0.1);
}
.connection-card.selected {
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px rgba(79, 125, 249, 0.15);
}
.connection-card.unhealthy { border-color: var(--danger); }
.connection-card .conn-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.connection-card .conn-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.connection-card .conn-name { font-size: 0.9rem; font-weight: 700; word-break: break-word; }
.connection-card .conn-meta { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }
.connection-card .conn-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}
.connection-card .conn-balance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.connection-card .conn-bal-item .label { font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; }
.connection-card .conn-bal-item .value { font-size: 0.95rem; font-weight: 700; }
.connection-card .conn-bal-item .value.positive { color: var(--success); }
.connection-card .conn-bal-item .value.negative { color: var(--danger); }

/* Legacy connection item (keep for groups etc) */
.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
}
.connection-info h3 { font-size: 0.9rem; }
.connection-info p { font-size: 0.75rem; color: var(--text-secondary); }

/* ================================================================
   TOAST
   ================================================================ */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ================================================================
   BALANCE DISPLAY
   ================================================================ */
.balance-display {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.balance-item {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 130px;
    flex: 1;
}
.balance-item .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}
.balance-item .value {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 2px;
}
.balance-item .value.positive { color: var(--success); }
.balance-item .value.negative { color: var(--danger); }

/* ================================================================
   POSITION ROWS
   ================================================================ */
.position-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
}
.position-info { display: flex; gap: 24px; align-items: center; }
.position-symbol { font-weight: 700; font-size: 1rem; min-width: 100px; }
.position-detail { font-size: 0.8rem; color: var(--text-secondary); }
.position-detail span { color: var(--text-primary); font-weight: 600; }
.position-pnl { font-weight: 700; font-size: 0.9rem; min-width: 80px; text-align: right; }
.position-pnl.positive { color: var(--success); }
.position-pnl.negative { color: var(--danger); }
.btn-close-pos {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 16px;
}
.btn-close-pos:hover { background: #dc2626; }

/* ================================================================
   COLLAPSIBLE SECTIONS
   ================================================================ */
.collapsible {
    cursor: pointer;
    user-select: none;
}
.collapsible:hover { color: var(--accent); }
.collapse-icon {
    font-size: 0.7rem;
    margin-left: 6px;
    transition: transform 0.2s;
    display: inline-block;
}
.collapse-icon.collapsed { transform: rotate(-90deg); }
.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}
.collapsible-content.hidden {
    max-height: 0;
    opacity: 0;
}

/* ================================================================
   RISK LOCK BANNER
   ================================================================ */
.risk-lock-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
/* Range slider custom styling — consistent across browsers */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}
input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; transition: background 0.2s; cursor: pointer; }
.toggle-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.empty { text-align: center; padding: 24px; color: var(--text-secondary); font-size: 0.85rem; }

/* ================================================================
   JSON SAMPLE
   ================================================================ */
pre.json-sample {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.8rem;
    overflow-x: auto;
    color: var(--text-secondary);
}

/* ================================================================
   SECTION DESCRIPTIONS & LABELS
   ================================================================ */
.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sample-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.alert-reference {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ================================================================
   RESPONSIVE: MOBILE
   ================================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: var(--topbar-height);
    }

    .page-section {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

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

    .inline-form {
        width: 100%;
    }

    .inline-form input,
    .inline-form select {
        flex: 1;
        min-width: 0;
    }

    .position-row {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

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

    .balance-display {
        flex-direction: column;
    }

    .balance-item {
        min-width: auto;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .group-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ================================================================
   RESPONSIVE: TABLET (sidebar overlay mode)
   ================================================================ */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: var(--topbar-height);
    }
}

/* ================================================================
   LOGIN PAGE (inline styles supplement)
   ================================================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 32px;
}

/* ================================================================
   SCROLLBAR STYLING
   ================================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ================================================================
   STATISTICS PAGE
   ================================================================ */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

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

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s;
}

.stats-card:hover {
    border-color: var(--accent);
}

.stats-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.stats-card-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stats-card-value.positive { color: var(--success); }
.stats-card-value.negative { color: var(--danger); }
.stats-card-value.neutral  { color: var(--accent); }

.stats-chart-container {
    position: relative;
    width: 100%;
    height: 320px;
}

.stats-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.stats-range-btn {
    min-width: 44px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.stats-range-btn.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

/* ================================================================
   TRADING JOURNAL
   ================================================================ */
.journal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.journal-nav-label {
    font-size: 1rem;
    font-weight: 700;
    min-width: 140px;
    text-align: center;
    color: var(--text-primary);
}

.journal-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.journal-weekday {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    padding: 10px 0;
}

.journal-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.journal-day {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 10px 12px;
    min-height: 100px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.journal-day:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(79, 125, 249, 0.12);
    transform: translateY(-1px);
}

.journal-day.profit {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.30);
}

.journal-day.loss {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.30);
}

.journal-day.today {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px var(--danger), 0 0 18px rgba(239, 68, 68, 0.25);
}

.journal-day.profit.today {
    box-shadow: 0 0 0 2px var(--danger), 0 0 18px rgba(239, 68, 68, 0.25);
    border-color: var(--danger);
}

.journal-day.loss.today {
    box-shadow: 0 0 0 2px var(--danger), 0 0 18px rgba(239, 68, 68, 0.25);
    border-color: var(--danger);
}

.journal-day.weekend {
    background: rgba(15, 17, 23, 0.6);
}

.journal-day.weekend.profit {
    background: rgba(34, 197, 94, 0.10);
}

.journal-day.weekend.loss {
    background: rgba(239, 68, 68, 0.10);
}

.journal-day.empty-day {
    background: transparent;
    border-color: transparent;
    cursor: default;
    min-height: 0;
}

.journal-day.empty-day:hover {
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.journal-day-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    align-self: flex-start;
    margin-bottom: 4px;
}

.journal-day.today .journal-day-number {
    color: var(--danger);
    font-weight: 700;
}

.journal-day-pnl {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin: auto 0 2px;
    font-variant-numeric: tabular-nums;
}

.journal-day-pnl.positive { color: var(--success); }
.journal-day-pnl.negative { color: var(--danger); }

.journal-day-winrate {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2px;
}

.journal-day-note {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.8;
}

/* Journal Modal */
.journal-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

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

.journal-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.journal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.journal-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.journal-modal-pnl {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}

.journal-modal-pnl.positive { color: var(--success); }
.journal-modal-pnl.negative { color: var(--danger); }
.journal-modal-pnl.neutral { color: var(--text-secondary); }

.journal-modal-textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
    margin-bottom: 16px;
}

.journal-modal-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.journal-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive journal */
@media (max-width: 768px) {
    .journal-day {
        min-height: 72px;
        padding: 6px 5px 8px;
    }

    .journal-day-pnl {
        font-size: 0.75rem;
    }

    .journal-day-winrate {
        font-size: 0.6rem;
    }

    .journal-day-number {
        font-size: 0.65rem;
    }

    .journal-day-note {
        font-size: 0.6rem;
        bottom: 3px;
        right: 4px;
    }

    .journal-nav-label {
        font-size: 0.85rem;
        min-width: 110px;
    }

    .journal-modal-card {
        margin: 16px;
        padding: 20px;
    }
}

/* ==================== Dashboard FAQ ==================== */
.faq-list-inline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.faq-item-inline {
    background: var(--bg-card, #1a1d2e);
    border: 1px solid var(--border, #2a2d42);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.faq-item-inline[open] {
    border-color: var(--accent, #6366f1);
}

.faq-item-inline summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text, #e5e7eb);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.faq-item-inline summary::-webkit-details-marker {
    display: none;
}

.faq-item-inline summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--accent, #6366f1);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.faq-item-inline[open] summary::after {
    content: '−';
}

.faq-item-inline summary:hover {
    background: rgba(99, 102, 241, 0.05);
}

.faq-item-inline > p {
    padding: 0 18px 16px 18px;
    margin: 0;
    color: var(--text-muted, #9ca3af);
    font-size: 13.5px;
    line-height: 1.6;
}

.faq-item-inline code {
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--accent, #818cf8);
}
