/* ============================================================================
   MODEL DETAIL — Modern Trading Pro
   foundation.css'ten miras alır
   ============================================================================ */

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
}

body { display: flex; flex-direction: column; }

header { height: var(--header-h); flex-shrink: 0; }

main {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* === Icon button === */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--fg-muted);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    transition: all var(--t-fast);
    cursor: pointer;
}
.icon-btn:hover {
    color: var(--fg);
    background: var(--surface-2);
    border-color: var(--border-strong);
}
.icon-btn.active {
    color: var(--accent);
    border-color: var(--accent-border);
    background: var(--accent-bg);
}

/* === Responsive nav toggles === */
@media (max-width: 1023px) {
    .logo-text-full { display: none !important; }
    .logo-text-compact { display: block !important; }
    .nav-text-full { display: none !important; }
    .nav-text-compact { display: block !important; }
}
@media (min-width: 1024px) {
    .logo-text-compact { display: none !important; }
    .nav-text-compact { display: none !important; }
}

.nav-link-mobile {
    padding: 4px 8px;
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fg-muted);
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
}
.nav-link-mobile.active {
    color: var(--accent);
    background: var(--accent-bg);
}

/* === Ticker === */
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-25%); }
}

.ticker-track {
    animation: ticker-scroll 60s linear infinite;
    will-change: transform;
    display: flex !important;
    align-items: center !important;
    gap: var(--space-6) !important;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--fg-muted);
    transition: color var(--t-fast);
    white-space: nowrap;
}
.ticker-item:hover { color: var(--fg); }


/* ============================================================================
   MODEL SELECTOR — yatay scroll edilen kart sırası
   ============================================================================ */

.model-cards-container {
    margin-bottom: var(--space-6);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.model-cards-container::-webkit-scrollbar { display: none; }

.model-cards {
    display: flex;
    gap: var(--space-3);
    min-width: min-content;
    padding-bottom: 2px;     /* hover lift için clearance */
}

.model-card {
    position: relative;
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: all var(--t-base);
    min-width: 180px;
    flex-shrink: 0;
}

.model-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.model-card.active {
    border-color: var(--accent-border);
    background: var(--accent-bg);
}

.model-card-icon {
    font-size: 26px;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.model-card-name {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.model-card-capital {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}


/* ============================================================================
   STAT CARDS
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2);
    min-height: 88px;
    transition: border-color var(--t-base);
}
.stat-card:hover { border-color: var(--border-strong); }

.stat-label {
    font-family: var(--font-sans);
    font-size: var(--text-2xs);
    color: var(--fg-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: var(--leading-tight);
}

.stat-value.positive { color: var(--success-fg); }
.stat-value.negative { color: var(--danger-fg); }


/* ============================================================================
   PREMIUM STATS OVERVIEW — Hero + sectioned grid
   ============================================================================ */

.mstat-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: var(--space-6);
}

/* === HERO CARD === */
.mstat-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 0;
    align-items: stretch;
    background:
        radial-gradient(circle at 0% 0%, rgba(16,185,129,0.07) 0%, transparent 55%),
        linear-gradient(180deg, rgba(20,22,28,0.92) 0%, rgba(14,16,22,0.94) 100%);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.02) inset,
        0 12px 36px -16px rgba(0,0,0,0.55);
}
.mstat-hero::before {
    content: '';
    position: absolute; left: 0; top: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(16,185,129,0.45) 30%,
        rgba(99,102,241,0.35) 70%,
        transparent 100%);
}

.mstat-hero-main {
    padding: 22px 24px;
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.mstat-hero-eyebrow {
    font-size: 10px; font-weight: 700; letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(16,185,129,0.85);
    display: flex; align-items: center; gap: 8px;
}
.mstat-hero-eyebrow svg { width: 12px; height: 12px; }
.mstat-hero-value {
    font-family: var(--font-mono);
    font-size: 38px; font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    color: #fff;
    margin: 2px 0 8px;
}
.mstat-hero-value.pos, .mstat-hero-value.positive { color: #34d399; text-shadow: 0 0 22px rgba(16,185,129,0.25); }
.mstat-hero-value.neg, .mstat-hero-value.negative { color: #f87171; text-shadow: 0 0 22px rgba(239,68,68,0.22); }

.mstat-hero-subs {
    display: flex; align-items: center; gap: 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.mstat-hero-sub {
    display: flex; flex-direction: column; gap: 2px;
}
.mstat-hero-sub-label {
    font-size: 10px; color: rgba(255,255,255,0.45);
    letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
    font-family: var(--font-sans);
}
.mstat-hero-sub-value { font-weight: 600; color: rgba(255,255,255,0.85); }
.mstat-hero-sub-value.pos, .mstat-hero-sub-value.positive { color: #34d399; }
.mstat-hero-sub-value.neg, .mstat-hero-sub-value.negative { color: #f87171; }

.mstat-hero-side {
    padding: 22px 22px;
    display: flex; flex-direction: column; justify-content: center; gap: 8px;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.mstat-hero-side:last-child { border-right: none; }
.mstat-side-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    display: flex; align-items: center; gap: 6px;
}
.mstat-side-label svg { width: 12px; height: 12px; opacity: 0.7; }
.mstat-side-value {
    font-family: var(--font-mono);
    font-size: 22px; font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
    line-height: 1.1;
}
.mstat-side-delta {
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 600;
    color: rgba(255,255,255,0.55);
    display: inline-flex; align-items: center; gap: 4px;
}
.mstat-side-delta.pos { color: #34d399; }
.mstat-side-delta.neg { color: #f87171; }

/* === SECTION GRID === */
.mstat-section {
    display: grid;
    gap: 10px;
}
.mstat-section.cols-4 { grid-template-columns: repeat(4, 1fr); }
.mstat-section.cols-3 { grid-template-columns: repeat(3, 1fr); }

.mstat-card {
    background: rgba(20,22,28,0.7);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 11px;
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 8px;
    min-height: 88px;
    transition: border-color .2s ease, background .2s ease, transform .15s ease;
    position: relative;
    overflow: hidden;
}
.mstat-card:hover {
    border-color: rgba(255,255,255,0.12);
    background: rgba(22,24,30,0.85);
    transform: translateY(-1px);
}

.mstat-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.mstat-card-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-sans);
}
.mstat-card-label svg { width: 12px; height: 12px; opacity: 0.6; }

.mstat-card-value {
    font-family: var(--font-mono);
    font-size: 20px; font-weight: 700;
    color: rgba(255,255,255,0.95);
    letter-spacing: -0.2px;
    line-height: 1.1;
}
.mstat-card-value.pos, .mstat-card-value.positive { color: #34d399; }
.mstat-card-value.neg, .mstat-card-value.negative { color: #f87171; }
.mstat-card-value.warn { color: #fbbf24; }

/* === Progress bar (used for Win Rate / Confidence) === */
.mstat-bar {
    height: 4px; width: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 999px; overflow: hidden;
    position: relative;
}
.mstat-bar-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    border-radius: inherit;
    transition: width .6s cubic-bezier(.22,.61,.36,1);
    background: linear-gradient(90deg, #10b981, #34d399);
}
.mstat-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mstat-bar-fill.neutral { background: linear-gradient(90deg, #6366f1, #818cf8); }

/* === Sharpe rating dots === */
.mstat-dots {
    display: flex; gap: 3px; align-items: center;
}
.mstat-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.10);
    transition: background .2s ease;
}
.mstat-dot.on { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.mstat-dot.on.warn { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.5); }
.mstat-dot.on.danger { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.4); }

/* === Time chip / running time === */
.mstat-time-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono);
    font-size: 14px; font-weight: 700;
    color: rgba(255,255,255,0.92);
    padding: 4px 8px;
    background: rgba(99,102,241,0.10);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 6px;
    width: max-content;
}
.mstat-time-chip svg { width: 11px; height: 11px; color: #818cf8; }

/* === Mobile === */
@media (max-width: 920px) {
    .mstat-hero { grid-template-columns: 1fr; }
    .mstat-hero-main { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .mstat-hero-side {
        border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 14px 18px;
    }
    .mstat-hero-side:last-child { border-bottom: none; }
    .mstat-section.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .mstat-section.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .mstat-hero-value { font-size: 28px; }
}
@media (max-width: 480px) {
    .mstat-section.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .mstat-section.cols-3 { grid-template-columns: 1fr; }
    .mstat-card { padding: 12px 14px; min-height: 78px; }
    .mstat-card-value { font-size: 17px; }
}


/* ============================================================================
   DAILY BREAKDOWN — 24h horizontal timeline (one row per day, replay-style)
   ============================================================================ */

.tl-wrap {
    display: flex; flex-direction: column;
    gap: 14px;
}

/* --- Per-day card --- */
.tl-day {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 16px 8px;
    transition: border-color .15s ease;
}
.tl-day:hover { border-color: rgba(255,255,255,0.10); }
.tl-day.is-today {
    border-color: rgba(16,185,129,0.25);
    background: linear-gradient(180deg, rgba(16,185,129,0.04), rgba(255,255,255,0.02));
}

/* --- Day header --- */
.tl-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.tl-head-date {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.3px;
}
.tl-today-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 9px; font-weight: 700;
    color: #34d399;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.28);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.tl-today-chip .pulse-dot {
    width: 5px; height: 5px; background: #10b981; border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
    animation: tl-pulse 1.5s ease-in-out infinite;
}
@keyframes tl-pulse { 50% { opacity: .35; } }

.tl-head-stats {
    display: inline-flex; align-items: center; gap: 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(255,255,255,0.75);
}
.tl-head-stat {
    display: inline-flex; flex-direction: column; align-items: flex-end;
    line-height: 1.15;
}
.tl-head-stat .lbl {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.40);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.tl-head-stat .val { font-weight: 700; letter-spacing: -0.2px; }
.tl-head-stat .val.positive { color: #34d399; }
.tl-head-stat .val.negative { color: #f87171; }

/* === Session legend (right side of header) === */
.tl-legend {
    display: inline-flex; gap: 10px; align-items: center;
    font-size: 9.5px; font-weight: 600;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tl-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.tl-legend-swatch {
    width: 9px; height: 9px;
    border-radius: 2px;
    display: inline-block;
}
.tl-legend-swatch.asia { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.tl-legend-swatch.eu   { background: linear-gradient(135deg, #6366f1, #818cf8); }
.tl-legend-swatch.us   { background: linear-gradient(135deg, #10b981, #34d399); }
.tl-legend-swatch.late { background: linear-gradient(135deg, #64748b, #94a3b8); }

/* === Main track === */
.tl-track {
    position: relative;
    height: 88px;
    border-radius: 8px;
    background: rgba(0,0,0,0.32);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
}

/* Session bands — colored stripes filling the track */
.tl-band {
    position: absolute; top: 0; bottom: 0;
    pointer-events: none;
}
.tl-band.asia { background: linear-gradient(180deg, rgba(245,158,11,0.10), rgba(245,158,11,0.04)); }
.tl-band.eu   { background: linear-gradient(180deg, rgba(99,102,241,0.10),  rgba(99,102,241,0.04)); }
.tl-band.us   { background: linear-gradient(180deg, rgba(16,185,129,0.10),  rgba(16,185,129,0.04)); }
.tl-band.late { background: linear-gradient(180deg, rgba(100,116,139,0.10), rgba(100,116,139,0.04)); }

/* Session boundary thin lines */
.tl-band-edge {
    position: absolute; top: 0; bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

/* Inline session label inside its band (top-left) */
.tl-band-tag {
    position: absolute; top: 4px;
    font-size: 9px; font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    padding: 0 6px;
    pointer-events: none;
    user-select: none;
}
.tl-band-tag.asia { color: rgba(251,191,36,0.7); }
.tl-band-tag.eu   { color: rgba(129,140,248,0.7); }
.tl-band-tag.us   { color: rgba(52,211,153,0.7); }
.tl-band-tag.late { color: rgba(148,163,184,0.7); }

/* Cumulative net P&L line (SVG fills the track) */
.tl-curve { position: absolute; inset: 0; pointer-events: none; }
.tl-curve path.line   { fill: none; stroke: #34d399; stroke-width: 1.5; opacity: 0.85; }
.tl-curve path.area   { fill: url(#tl-grad-pos); opacity: 0.20; }
.tl-curve path.line.neg   { stroke: #f87171; }
.tl-curve path.area.neg   { fill: url(#tl-grad-neg); }

/* Trade markers */
.tl-marker {
    position: absolute;
    width: 7px; height: 7px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
    transition: transform .15s ease, box-shadow .15s ease;
}
.tl-marker.positive { background: #34d399; box-shadow: 0 0 6px rgba(16,185,129,0.55), 0 0 0 1px rgba(0,0,0,0.4); }
.tl-marker.negative { background: #f87171; box-shadow: 0 0 6px rgba(239,68,68,0.45), 0 0 0 1px rgba(0,0,0,0.4); }
.tl-marker.neutral  { background: rgba(255,255,255,0.5); }

/* Scrubber (vertical line that follows mouse) */
.tl-scrubber {
    position: absolute; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.65) 12%, rgba(255,255,255,0.65) 88%, transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s ease;
    z-index: 4;
}
.tl-scrubber::before, .tl-scrubber::after {
    content: ''; position: absolute; left: -3px;
    width: 7px; height: 7px;
    background: #fff;
    border-radius: 50%;
}
.tl-scrubber::before { top: -2px; }
.tl-scrubber::after  { bottom: -2px; }
.tl-track.is-hover .tl-scrubber { opacity: 1; }

/* Hour ticks (under the track) */
.tl-axis {
    position: relative;
    height: 16px;
    margin-top: 4px;
}
.tl-tick {
    position: absolute; top: 0;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: rgba(255,255,255,0.40);
    font-weight: 500;
    letter-spacing: 0.4px;
    pointer-events: none;
}
.tl-tick::before {
    content: '';
    position: absolute;
    left: 50%; top: -5px;
    width: 1px; height: 4px;
    background: rgba(255,255,255,0.18);
}

/* === Status indicator (replaces tooltip) === */
.tl-status {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.55);
    margin-left: 6px;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.tl-status[data-status="live"] {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.30);
    color: #a5b4fc;
}
.tl-status[data-status="range"] {
    background: rgba(245,158,11,0.10);
    border-color: rgba(245,158,11,0.28);
    color: #fbbf24;
}
.tl-status[data-status="range-locked"] {
    background: rgba(245,158,11,0.16);
    border-color: rgba(245,158,11,0.40);
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(251,191,36,0.20);
}

/* Live-update flash on stat values */
.tl-head-stat .val.is-flash {
    transition: color .15s ease;
}

/* === Locked range markers (start / end) === */
.tl-lock {
    position: absolute; top: -2px; bottom: -2px;
    width: 2px;
    background: #fbbf24;
    pointer-events: none;
    z-index: 5;
    display: none;
    box-shadow: 0 0 8px rgba(251,191,36,0.5);
}
.tl-lock.is-visible { display: block; }
.tl-lock::before, .tl-lock::after {
    content: '';
    position: absolute; left: -4px;
    width: 10px; height: 10px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(251,191,36,0.7), 0 0 0 1.5px rgba(14,16,22,0.9);
}
.tl-lock::before { top: -3px; }
.tl-lock::after  { bottom: -3px; }

/* Caption above each lock marker */
.tl-lock-cap {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(14,16,22,0.92);
    border: 1px solid rgba(251,191,36,0.40);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
    pointer-events: none;
}

/* === Range tinted band between two locks === */
.tl-range-band {
    position: absolute; top: 0; bottom: 0;
    background: linear-gradient(180deg,
        rgba(251,191,36,0.09) 0%,
        rgba(251,191,36,0.03) 50%,
        rgba(251,191,36,0.09) 100%);
    pointer-events: none;
    z-index: 2;
    display: none;
}
.tl-range-band.is-visible { display: block; }

/* Tiny reset (✕) button in header when range is active */
.tl-reset-btn {
    appearance: none; border: none; cursor: pointer;
    background: rgba(245,158,11,0.10);
    border: 1px solid rgba(245,158,11,0.30);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    margin-left: 4px;
    line-height: 1;
    display: none;
    font-family: var(--font-sans);
    letter-spacing: 0.04em;
    transition: background .15s ease;
}
.tl-reset-btn:hover { background: rgba(245,158,11,0.18); }
.tl-reset-btn.is-visible { display: inline-flex; align-items: center; gap: 3px; }
.tl-reset-btn svg { width: 9px; height: 9px; }

/* Mobile */
@media (max-width: 720px) {
    .tl-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .tl-head-stats { flex-wrap: wrap; gap: 10px; }
    .tl-track { height: 76px; }
    .tl-tooltip { min-width: 180px; font-size: 11px; }
}


/* ============================================================================
   DAILY BREAKDOWN (old design — kept for compat, no longer used)
   ============================================================================ */

.db-wrap {
    display: flex; flex-direction: column;
    gap: 18px;
}

/* === Section sub-header === */
.db-subhead {
    display: flex; align-items: center; gap: 8px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin: 0 0 8px;
}
.db-subhead svg { width: 12px; height: 12px; opacity: 0.7; }
.db-subhead-meta {
    margin-left: auto;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.35);
    text-transform: none;
}

/* === Daily row === */
.db-day {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 11px;
    overflow: hidden;
    transition: border-color .15s ease, background .15s ease;
}
.db-day:hover { border-color: rgba(255,255,255,0.10); background: rgba(255,255,255,0.025); }
.db-day + .db-day { margin-top: 8px; }
.db-day.is-today { border-color: rgba(16,185,129,0.30); background: rgba(16,185,129,0.02); }

.db-day-head {
    display: grid;
    grid-template-columns: 1.5fr repeat(5, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.db-day-date {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.4px;
}
.db-day-today-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 9px; font-weight: 700;
    color: #34d399;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.28);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.db-day-today-chip .pulse-dot {
    width: 5px; height: 5px; background: #10b981; border-radius: 50%;
    box-shadow: 0 0 6px #10b981;
    animation: db-pulse 1.5s ease-in-out infinite;
}
@keyframes db-pulse { 50% { opacity: .35; } }

.db-cell {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    line-height: 1.1;
}
.db-cell-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.40);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.db-cell.positive { color: #34d399; }
.db-cell.negative { color: #f87171; }
.db-cell.warn     { color: #fbbf24; }
.db-cell-bold {
    font-size: 14px; font-weight: 700;
    letter-spacing: -0.2px;
}

/* === Inline session strip (under each day) === */
.db-sessions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0;
    background: rgba(0,0,0,0.20);
}
.db-session {
    display: flex; flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border-right: 1px solid rgba(255,255,255,0.03);
    position: relative;
}
.db-session:last-child { border-right: none; }
.db-session::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 2px;
}
.db-session.asia::before   { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
.db-session.eu::before     { background: linear-gradient(180deg, #6366f1, #818cf8); }
.db-session.us::before     { background: linear-gradient(180deg, #10b981, #34d399); }
.db-session.late::before   { background: linear-gradient(180deg, #64748b, #94a3b8); }

.db-session.empty { opacity: 0.45; }

.db-session-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px;
}
.db-session-name {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: rgba(255,255,255,0.78);
}
.db-session-name .db-session-emoji {
    font-size: 11px;
}
.db-session-hours {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255,255,255,0.30);
    font-weight: 500;
}
.db-session-stats {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px;
}
.db-session-pnl {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 700;
}
.db-session-pnl.positive { color: #34d399; }
.db-session-pnl.negative { color: #f87171; }
.db-session-pnl.muted    { color: rgba(255,255,255,0.30); }
.db-session-count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}

/* === TOTAL row (sticky at the bottom of daily list) === */
.db-total {
    display: grid;
    grid-template-columns: 1.5fr repeat(5, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 11px;
    margin-top: 6px;
}
.db-total .db-day-date {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
}

/* === Session aggregate cards (full-period totals) === */
.db-sess-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.db-sess-card {
    position: relative;
    background: rgba(20,22,28,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 11px;
    padding: 14px 16px;
    display: flex; flex-direction: column;
    gap: 10px;
    overflow: hidden;
    transition: border-color .15s ease, transform .15s ease;
}
.db-sess-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}
.db-sess-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
}
.db-sess-card.asia::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
.db-sess-card.eu::before   { background: linear-gradient(180deg, #6366f1, #818cf8); }
.db-sess-card.us::before   { background: linear-gradient(180deg, #10b981, #34d399); }
.db-sess-card.late::before { background: linear-gradient(180deg, #64748b, #94a3b8); }
.db-sess-card.is-best  { box-shadow: 0 0 0 1px rgba(52,211,153,0.30), 0 8px 24px -10px rgba(16,185,129,0.25); }
.db-sess-card.is-worst { box-shadow: 0 0 0 1px rgba(248,113,113,0.25); }

.db-sess-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.db-sess-title {
    display: flex; flex-direction: column;
    gap: 2px;
}
.db-sess-title-row {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.04em;
}
.db-sess-title-row .emoji { font-size: 13px; }
.db-sess-hours {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: rgba(255,255,255,0.40);
    font-weight: 500;
    letter-spacing: 0.5px;
}
.db-sess-badge {
    font-size: 9px; font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}
.db-sess-badge.best { color: #34d399; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); }
.db-sess-badge.worst { color: #f87171; background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.22); }

.db-sess-net {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.3px;
}
.db-sess-net.positive { color: #34d399; }
.db-sess-net.negative { color: #f87171; }
.db-sess-net.muted    { color: rgba(255,255,255,0.50); }

.db-sess-subrow {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    font-size: 10.5px;
    color: rgba(255,255,255,0.55);
}
.db-sess-subrow .sub-label {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 9.5px;
}
.db-sess-subrow .sub-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}
.db-sess-subrow .sub-value.win { color: #34d399; }

/* WR mini bar inside session card */
.db-sess-wr {
    display: flex; align-items: center; gap: 8px;
}
.db-sess-wr-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.db-sess-wr-bar-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: inherit;
    transition: width .5s cubic-bezier(.22,.61,.36,1);
}
.db-sess-wr-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.db-sess-wr-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #f87171); }

/* === Responsive === */
@media (max-width: 920px) {
    .db-day-head { grid-template-columns: 1fr 1fr 1fr; row-gap: 8px; }
    .db-day-head .db-cell:nth-child(4),
    .db-day-head .db-cell:nth-child(5),
    .db-day-head .db-cell:nth-child(6) { text-align: left; }
    .db-total { grid-template-columns: 1fr 1fr 1fr; row-gap: 8px; }
    .db-sess-grid { grid-template-columns: repeat(2, 1fr); }
    .db-sessions { grid-template-columns: repeat(2, 1fr); }
    .db-session { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.03); }
}
@media (max-width: 480px) {
    .db-sess-grid { grid-template-columns: 1fr; }
    .db-sessions { grid-template-columns: 1fr; }
}


/* ============================================================================
   COIN PERFORMANCE — Compact ranked rows
   ============================================================================ */

.coin-perf-wrap {
    display: flex; flex-direction: column;
    gap: 6px;
}
.coin-perf-empty {
    padding: 28px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

.coin-row {
    display: grid;
    grid-template-columns: 36px 160px 1fr 130px 88px;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(20,22,28,0.55);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
    position: relative;
    overflow: hidden;
}
.coin-row:hover {
    background: rgba(24,26,32,0.85);
    border-color: rgba(255,255,255,0.10);
    transform: translateX(2px);
}

/* Top performers get a subtle left accent stripe */
.coin-row.rank-1 { border-left: 2px solid #fbbf24; }
.coin-row.rank-2 { border-left: 2px solid #c0c0c0; }
.coin-row.rank-3 { border-left: 2px solid #cd7f32; }

/* === Rank badge === */
.coin-rank {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 13px; font-weight: 700;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.55);
    flex-shrink: 0;
}
.coin-rank.rank-medal { font-size: 16px; background: transparent; }
.coin-rank.rank-1 { color: #fbbf24; }
.coin-rank.rank-2 { color: #d4d4d8; }
.coin-rank.rank-3 { color: #cd7f32; }

/* === Coin identity (icon + symbol) === */
.coin-id {
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
}
.coin-id img {
    width: 22px; height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}
.coin-id .coin-id-symbol {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    letter-spacing: 0.3px;
}
.coin-id .coin-id-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    letter-spacing: 0.05em;
    font-family: var(--font-sans);
    text-transform: uppercase;
    margin-top: 1px;
}

/* === Win rate bar + percentage === */
.coin-wr {
    display: flex; align-items: center; gap: 12px;
    min-width: 0;
}
.coin-wr-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.04);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    min-width: 80px;
}
.coin-wr-bar-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    border-radius: inherit;
    transition: width .5s cubic-bezier(.22,.61,.36,1);
    background: linear-gradient(90deg, #10b981, #34d399);
}
.coin-wr-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.coin-wr-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #f87171); }
.coin-wr-text {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    min-width: 86px;
    display: inline-flex; gap: 4px; align-items: baseline;
}
.coin-wr-pct { color: #fff; }
.coin-wr-frac {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}

/* === P&L hero column === */
.coin-pnl {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    letter-spacing: -0.2px;
}
.coin-pnl.positive { color: #34d399; }
.coin-pnl.negative { color: #f87171; }

/* === Avg win/loss inline === */
.coin-avg {
    display: flex; flex-direction: column;
    gap: 3px;
    align-items: flex-end;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}
.coin-avg-row { display: inline-flex; align-items: center; gap: 4px; }
.coin-avg-row svg { width: 9px; height: 9px; }
.coin-avg-row.win { color: rgba(52,211,153,0.85); }
.coin-avg-row.loss { color: rgba(248,113,113,0.85); }
.coin-avg-row.muted { color: rgba(255,255,255,0.25); }

/* === Header strip === */
.coin-perf-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.coin-perf-title {
    font-size: 14px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0;
}
.coin-perf-count {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
    letter-spacing: 0.5px;
}

@media (max-width: 720px) {
    .coin-row {
        grid-template-columns: 28px 1fr 90px;
        gap: 10px;
        row-gap: 8px;
        padding: 10px 12px;
    }
    .coin-wr { grid-column: 1 / -1; order: 3; }
    .coin-avg { display: none; }
    .coin-id .coin-id-sub { display: none; }
}


/* ============================================================================
   PNL UTILITIES
   ============================================================================ */

.pnl-positive { color: var(--pnl-positive); }
.pnl-negative { color: var(--pnl-negative); }

@keyframes flash-green {
    0%, 100% { background-color: transparent; }
    50%      { background-color: var(--success-bg); }
}
@keyframes flash-red {
    0%, 100% { background-color: transparent; }
    50%      { background-color: var(--danger-bg); }
}
.flash-green { animation: flash-green 0.6s ease; }
.flash-red   { animation: flash-red 0.6s ease; }


/* ============================================================================
   TABLES — coin performance / active positions / closed trades / daily breakdown
   ============================================================================ */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--text-sm);
}

th {
    height: 38px;
    padding: 0 var(--space-3);
    text-align: left;
    font-family: var(--font-sans);
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--fg-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: transparent;
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

th.text-right { text-align: right; }

td {
    height: 42px;
    padding: 0 var(--space-3);
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--surface-2); }

td.text-right { text-align: right; font-family: var(--font-mono); }


/* === Coin badge === */
.coin-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
}


/* === Empty state === */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-5);
    color: var(--fg-subtle);
    font-size: var(--text-sm);
}


/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-4);
}

.pagination button {
    height: var(--btn-h);
    padding: 0 var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-muted);
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--t-fast);
}

.pagination button:hover:not(:disabled) {
    color: var(--fg);
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
}


/* === Loading state === */
.loading {
    text-align: center;
    padding: var(--space-12);
    color: var(--fg-subtle);
    font-size: var(--text-sm);
}


/* ============================================================================
   CHART CONTAINER — Recharts/Chart.js base
   ============================================================================ */

.chart-card,
.chart-wrapper {
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: border-color var(--t-base);
}
.chart-card:hover,
.chart-wrapper:hover {
    border-color: var(--border-strong);
}

.chart-card .chart-title,
.chart-wrapper .chart-title {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--fg);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}


/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    main { padding: var(--space-3); }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
    .stat-card { padding: var(--space-3); min-height: 76px; }
    .stat-value { font-size: var(--text-lg); }
    .model-card { min-width: 140px; padding: var(--space-3); }
    .model-card-icon { font-size: 22px; }
    table { font-size: var(--text-xs); }
    th, td { height: 34px; padding: 0 var(--space-2); }
    .pagination { gap: var(--space-2); padding: var(--space-3); }
    .pagination button { padding: 0 var(--space-3); font-size: var(--text-xs); }
}


/* ============================================================================
   SWEETALERT2 — Modern Trading Pro Theme
   ============================================================================ */

.modern-update-popup {
    background: var(--surface-1) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-lg) !important;
    backdrop-filter: blur(12px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
}

.modern-update-popup .swal2-title {
    color: var(--fg) !important;
    font-size: var(--text-xl) !important;
    font-weight: 600 !important;
    font-family: var(--font-sans) !important;
    margin-bottom: var(--space-4) !important;
    letter-spacing: -0.01em !important;
}

.modern-update-popup .swal2-html-container {
    color: var(--fg-muted) !important;
    font-family: var(--font-sans) !important;
    font-size: var(--text-sm) !important;
}

.modern-update-confirm {
    background: var(--accent) !important;
    color: var(--bg) !important;
    border: none !important;
    border-radius: var(--radius) !important;
    padding: 0 var(--space-5) !important;
    height: var(--btn-h-lg) !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    font-family: var(--font-sans) !important;
    transition: all var(--t-fast) !important;
}
.modern-update-confirm:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px) !important;
}

.modern-update-cancel {
    background: var(--surface-2) !important;
    color: var(--fg-muted) !important;
    border: 1px solid var(--border-default) !important;
    border-radius: var(--radius) !important;
    padding: 0 var(--space-5) !important;
    height: var(--btn-h-lg) !important;
    font-size: var(--text-sm) !important;
    font-weight: 500 !important;
    font-family: var(--font-sans) !important;
    transition: all var(--t-fast) !important;
}
.modern-update-cancel:hover {
    background: var(--surface-3) !important;
    color: var(--fg) !important;
    border-color: var(--border-strong) !important;
}

.swal2-loader {
    border-color: var(--accent) transparent var(--accent) transparent !important;
}

.swal2-container.swal2-backdrop-show {
    backdrop-filter: blur(8px);
}
