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

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #22263a;
    --border: #2a2e3d;
    --text: #e1e4eb;
    --text-muted: #8b8fa3;
    --accent: #4f8cff;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --purple: #8b5cf6;
    --radius: 8px;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navbar ─── */
.navbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a, .nav-dropdown span {
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition: all 0.15s;
    cursor: pointer;
}

.nav-links a:hover, .nav-links a.active,
.nav-dropdown span:hover, .nav-dropdown span.active {
    color: var(--text);
    background: rgba(79, 140, 255, 0.15);
    text-decoration: none;
}

.nav-dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    padding: 0.25rem 0;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.nav-dropdown:hover .dropdown-content { display: block; }

.dropdown-content a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
}

.dropdown-content a:hover {
    background: rgba(79, 140, 255, 0.15);
    color: var(--text);
    text-decoration: none;
}

.nav-session {
    margin-left: auto;
}

.nav-session select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
}

/* ─── Container ─── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

h3 { font-size: 1rem; margin-bottom: 0.5rem; }

.session-tag {
    font-size: 0.8rem;
    background: rgba(79, 140, 255, 0.2);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
}

/* ─── Session Info Bar ─── */
.session-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
}

.session-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.session-info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.session-info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

/* ─── KPI Grid ─── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.kpi-card.wide {
    padding: 1.25rem;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.kpi-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.kpi-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    margin-top: 0.75rem;
}

.kpi-mini-grid > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ─── Charts ─── */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-container.full-width { width: 100%; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
}

/* ─── Tables ─── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr:hover { background: var(--bg-card-hover); }

.trade-row { cursor: pointer; }
.trade-row.win { border-left: 3px solid var(--green); }
.trade-row.loss { border-left: 3px solid var(--red); }

.trade-detail td {
    padding: 1rem;
    background: rgba(79, 140, 255, 0.05);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem 2rem;
    font-size: 0.85rem;
}

.empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ─── Badges ─── */
.dir-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dir-badge.long {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

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

.result-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.result-badge.win {
    background: rgba(34, 197, 94, 0.2);
    color: var(--green);
}

.result-badge.loss {
    background: rgba(239, 68, 68, 0.2);
    color: var(--red);
}

/* ─── Colors ─── */
.positive { color: var(--green); }
.negative { color: var(--red); }
.detail { color: var(--text-muted); font-size: 0.8rem; }
.trade-id { font-family: monospace; font-size: 0.75rem; color: var(--text-muted); }

/* ─── Buttons ─── */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(79, 140, 255, 0.15);
    color: var(--accent);
    border: 1px solid rgba(79, 140, 255, 0.3);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:hover {
    background: rgba(79, 140, 255, 0.25);
    text-decoration: none;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-small {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

.btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ─── Filters bar (redesign 2026-05-06) ─── */
.filters-bar {
    display: flex;
    gap: 0.85rem;
    align-items: flex-end;   /* aligne sur la baseline des controls */
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(71, 85, 105, 0.35);
    border-radius: 8px;
}
.filters-form {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 0;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.filter-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding-left: 0.15rem;
}
.filter-select {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.42rem 0.75rem;
    border-radius: 5px;
    font-size: 0.88rem;
    height: 34px;
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.filter-select:hover { border-color: rgba(99, 102, 241, 0.5); }
.filter-select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.filter-select-buy { border-left: 3px solid rgba(34,197,94,0.55); }
.filter-select-sell { border-left: 3px solid rgba(239,68,68,0.55); }

.btn-analyze {
    height: 34px;
    padding: 0 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(99,102,241,0.18);
    color: #c7d2fe;             /* indigo-200 */
    border: 1px solid rgba(99,102,241,0.5);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.12s;
}
.btn-analyze:hover {
    background: rgba(99,102,241,0.28);
    border-color: rgba(99,102,241,0.7);
    color: #e0e7ff;
}

.filter-divider {
    width: 1px;
    height: 34px;
    background: rgba(71, 85, 105, 0.5);
    align-self: flex-end;
    margin: 0 0.2rem;
}

/* ─── TF button group (redesign) ─── */
.tf-btn-group {
    display: inline-flex;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    background: var(--bg-card);
    height: 34px;
    align-items: stretch;
}
.tf-btn {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tf-btn:not(:last-child) { border-right: 1px solid rgba(71,85,105,0.4); }
.tf-btn:hover { background: rgba(99,102,241,0.15); color: #e2e8f0; }
.tf-btn.active {
    background: rgba(99,102,241,0.22);
    color: #c7d2fe;             /* indigo-200, doux */
    box-shadow: inset 0 -2px 0 rgba(99,102,241,0.5);
}
.tf-btn.active:hover { background: rgba(99,102,241,0.3); }
.tf-btn:focus { outline: 2px solid rgba(99,102,241,0.4); outline-offset: -2px; }

/* ─── Pagination ─── */
.pagination {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    margin-top: 1rem;
}

/* ─── Sort Links ─── */
.sort-link {
    color: var(--text-muted);
    text-decoration: none;
}

.sort-link.active { color: var(--accent); }
.sort-link:hover { color: var(--text); text-decoration: none; }

/* ─── Preset Nav ─── */
.preset-nav {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.action-bar {
    margin-top: 1rem;
    text-align: center;
}

/* ─── Nav User ─── */
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
}

.nav-username {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Login Page ─── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
}

.login-title {
    text-align: center;
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 2rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.2);
}

.btn-login {
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.15s;
    margin-top: 0.5rem;
}

.btn-login:hover {
    opacity: 0.9;
}

/* ─── Log viewer ─── */
.log-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    max-height: 70vh;
    overflow: auto;
}

.log-container pre {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* ─── Preset KPI Summary (overview) ─── */
.preset-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.preset-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preset-kpi-card .preset-name {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 100px;
    color: var(--accent);
}

.preset-kpi-card .preset-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.preset-kpi-card .preset-stats span {
    white-space: nowrap;
}

.preset-kpi-card .stat-label {
    color: var(--text-muted);
    margin-right: 0.2rem;
}

/* ─── Chart toggles ─── */
.chart-toggles {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.chart-toggles label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.chart-toggles label:hover {
    background: rgba(79, 140, 255, 0.1);
}

.chart-toggles input[type="checkbox"] {
    accent-color: var(--accent);
}

/* ─── Price Chart Page ─── */
.range-buttons {
    display: flex;
    gap: 0.25rem;
}

.chart-container-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.input-date {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
}

.chart-trade-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-arrow {
    font-size: 0.9rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ─── Tooltips ─── */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(79, 140, 255, 0.15);
    color: var(--accent);
    font-size: 9px;
    font-weight: 700;
    cursor: help;
    margin-left: 4px;
    position: relative;
}
.tooltip-icon:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e2130;
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    z-index: 100;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    line-height: 1.4;
}

/* ─── Settings Page ─── */
.settings-section { margin-bottom: 0.75rem; }

.section-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    user-select: none;
}
.section-header:hover { background: rgba(79, 140, 255, 0.05); }
.section-header.open { border-radius: var(--radius) var(--radius) 0 0; }

.section-body {
    display: none;
    padding: 1rem;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--bg-card);
}
.section-body.open { display: block; }

.chevron { transition: transform 0.2s; font-size: 0.8rem; }

.filter-toggle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-right: 1rem;
}
.filter-toggle input { accent-color: var(--accent); }
.section-header.open .chevron { transform: rotate(180deg); }

.preset-card { margin-bottom: 0.5rem; }
.preset-card .section-header { font-size: 0.85rem; padding: 0.4rem 0.75rem; }

.badge { font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 3px; margin-left: 0.3rem; font-weight: 600; }
.badge-green { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: var(--red); }

/* Preset header icons */
.preset-header-info { display: flex; align-items: center; gap: 0.6rem; }
.preset-name-label { font-weight: 600; }
.preset-icons { display: flex; align-items: center; gap: 0.2rem; font-size: 0.75rem; }
.icon-status { font-size: 0.7rem; }
.icon-status.icon-on { color: var(--green); }
.icon-status.icon-off { color: var(--text-muted); opacity: 0.3; }
.icon-model { font-size: 0.8rem; }
.icon-model.icon-ok { color: var(--accent); }
.icon-model.icon-missing { color: var(--red); opacity: 0.5; }
.icon-sep { color: var(--border); font-size: 0.6rem; margin: 0 0.15rem; }

/* Badge No model */
.badge-no-model {
    font-size: 0.65rem;
    color: var(--red);
    background: rgba(255, 75, 75, 0.15);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}

/* Delete preset button */
.btn-delete-preset {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    opacity: 0.4;
    transition: opacity 0.2s, color 0.2s;
}
.btn-delete-preset:hover {
    opacity: 1;
    color: var(--red);
    background: rgba(255, 75, 75, 0.15);
}

/* Preset header layout */
.preset-header-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
}

/* Rescan button */
.btn-rescan {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    margin-left: 0.5rem;
}
.header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

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

.param-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}
.param-group legend {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 0.3rem;
    color: var(--accent);
}

.param-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
}
.param-row label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.param-row input[type="number"],
.param-row select {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-main);
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    width: 100%;
}
.param-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}
.param-row input.changed,
.param-row select.changed {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.settings-save-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    z-index: 50;
    margin-top: 1rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
}
.btn-primary:hover { opacity: 0.9; }

.alert {
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.alert-success { background: rgba(34, 197, 94, 0.12); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.25); }
.alert-error { background: rgba(239, 68, 68, 0.12); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.25); }
.alert-info { background: rgba(79, 140, 255, 0.12); color: var(--accent); border: 1px solid rgba(79, 140, 255, 0.25); }

.rule-display {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.2rem 0;
    font-family: monospace;
}
.param-info { font-size: 0.8rem; }

/* FFT labels */
.fft-label {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    z-index: 1;
    pointer-events: none;
}

/* Model info bar in preset fieldset */
.model-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(79, 140, 255, 0.06);
    border-radius: 4px;
    font-size: 0.75rem;
}
.model-name {
    font-weight: 600;
    color: var(--accent);
}
.model-scores {
    color: var(--text-muted);
    font-family: monospace;
}
.btn-json {
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    margin-left: auto;
}

/* JSON Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-size: 0.9rem;
    margin: 0;
}
.json-viewer {
    padding: 1rem;
    overflow: auto;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    flex: 1;
}

/* ─── Trading Chart / Fibonacci ─── */
.fib-info-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 0.5rem;
}
.fib-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.fib-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.fib-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.fib-value { font-size: 0.95rem; font-weight: 600; }
.fib-signal { padding: 0.5rem; border-radius: var(--radius); background: rgba(255,255,255,0.03); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: #f59e0b; }
.table-mini { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.table-mini th { color: var(--text-muted); text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.table-mini td { padding: 0.25rem 0.5rem; }
.table-mini .fib-zone-row { background: rgba(34, 197, 94, 0.08); font-weight: 600; }

/* ─── Live Monitor ─── */
.live-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.live-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.card-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.card-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
}

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

.live-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.live-section h2 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.live-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Money Management table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.data-table th {
    color: var(--text-muted);
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.75rem;
}

.data-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.data-table.compact td { padding: 0.25rem 0.4rem; }
.data-table.compact th { padding: 0.3rem 0.4rem; }

.mono { font-family: monospace; font-size: 0.78rem; }

.mm-row-disabled { opacity: 0.6; }

/* Status badges */
.status-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}
.status-active { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.status-disabled { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.status-degraded { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-insuf { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

/* Close reason tags */
.close-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.3rem;
    font-weight: 600;
}
.close-tp { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.close-sl { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.close-to { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Close reasons bars */
.close-reasons { margin-top: 0.5rem; }
.close-reason-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.close-label {
    width: 60px;
    font-size: 0.8rem;
    font-weight: 600;
}
.close-bar-bg {
    flex: 1;
    height: 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
}
.close-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.close-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
}

/* Probability distribution mini bars */
.proba-bar {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 20px;
    min-width: 80px;
}
.bar-segment {
    flex: 1;
    background: var(--accent);
    border-radius: 1px 1px 0 0;
    min-height: 1px;
    opacity: 0.7;
}
.dead-signal { opacity: 0.5; }
.row-disabled { opacity: 0.25; }
.dead-signal .proba-bar .bar-segment { background: #f59e0b; }
.preset-separator td { border-top: 2px solid var(--border); padding-top: 0.5rem; }

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}

/* ─── Fibonacci Viewer ─── */
.fib-dual-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}

.fib-zone-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.fib-zone-panel h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.fib-info-grid-compact {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.highlight-row {
    background: rgba(79, 140, 255, 0.08);
}

@media (max-width: 900px) {
    .fib-dual-panel { grid-template-columns: 1fr; }
    .live-cards { grid-template-columns: 1fr; }
    .live-grid-2 { grid-template-columns: 1fr; }
    .ctt-overview-grid { grid-template-columns: 1fr; }
}

/* ─── Panneau CTT (top de page /trading-chart) ─────────────────────── */
.ctt-overview-details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0.6rem 0 1rem;
    padding: 0.4rem 0.8rem;
}
.ctt-overview-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    user-select: none;
}
.ctt-overview-summary::-webkit-details-marker { display: none; }
.ctt-overview-summary::before {
    content: '▶';
    font-size: 0.7rem;
    color: #64748b;
    transition: transform 0.15s;
}
.ctt-overview-details[open] > .ctt-overview-summary::before { transform: rotate(90deg); }
.ctt-overview-title { font-weight: 700; color: #e2e8f0; }
.ctt-overview-counts { color: #94a3b8; font-size: 0.85rem; }
.ctt-overview-refresh { color: #64748b; font-size: 0.75rem; margin-left: auto; }
.ctt-overview-body { margin-top: 0.6rem; }
.ctt-overview-empty { color: #64748b; font-style: italic; padding: 0.4rem 0; }

.ctt-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
}
@media (max-width: 1400px) {
    .ctt-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
.ctt-col {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    min-width: 0;  /* pour permettre le text-overflow dans flex children */
}
.ctt-col-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}
.ctt-col-icon { font-size: 0.95rem; }
.ctt-col-title { font-weight: 600; color: #e2e8f0; }
.ctt-badge {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    padding: 0.05rem 0.4rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
}
.ctt-see-all {
    margin-left: auto;
    color: #64748b;
    font-size: 0.72rem;
    text-decoration: none;
}
.ctt-see-all:hover { color: #e2e8f0; }

.ctt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.ctt-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-left: 3px solid transparent;
}
.ctt-item-link { padding: 0; }
.ctt-item-anchor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.25rem 0.4rem;
    text-decoration: none;
    color: inherit;
}
.ctt-item-anchor:hover { background: rgba(255, 255, 255, 0.05); }

/* Couleurs d'urgence pour les CTT en attente */
.ctt-item.ctt-fresh    { border-left-color: #22c55e; }
.ctt-item.ctt-warning  { border-left-color: #f59e0b; }
.ctt-item.ctt-critical { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.08); }

.ctt-preset { font-weight: 600; color: #e2e8f0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctt-mode {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    letter-spacing: 0.03em;
}
.ctt-mode-buy  { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.ctt-mode-sell { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.ctt-detail    { color: #94a3b8; font-size: 0.75rem; }
.ctt-remaining { margin-left: auto; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.ctt-pnl       { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.ctt-pnl.positive { color: #22c55e; }
.ctt-pnl.negative { color: #ef4444; }
.ctt-result.positive { color: #22c55e; font-weight: 700; }
.ctt-result.negative { color: #ef4444; font-weight: 700; }
.ctt-flag {
    font-size: 0.68rem;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    padding: 0.02rem 0.3rem;
    border-radius: 3px;
}
.ctt-empty { color: #64748b; font-style: italic; font-size: 0.78rem; padding: 0.3rem 0; }

/* Bucket "Expirés" : statut + nb trades */
.ctt-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    letter-spacing: 0.03em;
}
.ctt-status-expired { background: rgba(148, 163, 184, 0.18); color: #94a3b8; }
.ctt-status-deleted { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.ctt-trades-count { color: #cbd5e1; font-variant-numeric: tabular-nums; margin-left: auto; }
.ctt-trades-zero { color: #64748b; font-style: italic; }
.ctt-item-expired { opacity: 0.85; }

/* ═══ Trading page — Status bar + Emergency Lock (déplacé depuis Admin) ═══ */
.trading-status-bar {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    align-items: stretch;
}
.trading-status-block,
.trading-lock-block {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(71, 85, 105, 0.6);
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
}
.trading-lock-block {
    border-color: rgba(239, 68, 68, 0.22);     /* moins agressif */
    background: rgba(127, 29, 29, 0.06);        /* tinted très subtil */
}
.trading-status-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}
.trading-status-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.7rem;
}
.status-item {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.08);
}
.status-item.status-ok { color: #6ee7b7; }    /* emerald-300, doux */
.status-item.status-off {
    color: #fca5a5;                             /* red-300 */
    background: rgba(239, 68, 68, 0.08);
}
.status-item.status-warn {
    color: #fcd34d;                             /* amber-300 */
    background: rgba(251, 191, 36, 0.08);
}

.trading-lock-rows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.lock-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
}
.lock-row.lock-both {
    margin-top: 0.15rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(239, 68, 68, 0.18);
}
.lock-dir-label {
    font-weight: 700;
    min-width: 80px;
    color: #cbd5e1;
}
.lock-status-locked { color: #fca5a5; font-weight: 600; }   /* red-300 */
.lock-status-active { color: #6ee7b7; font-weight: 600; }    /* emerald-300 */
.lock-detail { color: #94a3b8; font-size: 0.75rem; }
.lock-form { display: inline-flex; gap: 0.35rem; align-items: center; margin-left: auto; }
.lock-duration {
    padding: 0.18rem 0.4rem;
    font-size: 0.78rem;
    border: 1px solid #475569;
    border-radius: 4px;
    background: #1e293b;
    color: #e2e8f0;
}
/* Lock buttons : pattern tinted (cohérent avec CTA) */
.btn-lock,
.btn-lock-both,
.btn-unlock {
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-lock {
    background: rgba(239,68,68,0.14);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.4);
}
.btn-lock:hover {
    background: rgba(239,68,68,0.22);
    border-color: rgba(239,68,68,0.6);
}
.btn-lock-both {
    background: rgba(127,29,29,0.22);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.5);
}
.btn-lock-both:hover {
    background: rgba(127,29,29,0.32);
    border-color: rgba(239,68,68,0.7);
}
.btn-unlock {
    background: rgba(34,197,94,0.14);
    color: #86efac;
    border-color: rgba(34,197,94,0.4);
}
.btn-unlock:hover {
    background: rgba(34,197,94,0.22);
    border-color: rgba(34,197,94,0.6);
}
.lock-hint {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: #64748b;
    font-style: italic;
}

/* ═══ Trading page — Action panel sticky bas ═══ */
.action-panel-sticky {
    position: sticky;
    bottom: 0;
    z-index: 50;
    margin: 0.5rem -0.5rem -0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(71, 85, 105, 0.5);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
}

/* ═══ Chart container : hauteur responsive (60vh, min 400) ═══ */
.chart-container-full {
    height: 60vh !important;
    min-height: 400px;
    max-height: 800px;
}

/* Responsive : 1 col status sur mobile/portrait */
@media (max-width: 900px) {
    .trading-status-bar { grid-template-columns: 1fr; }
    .lock-form { margin-left: 0; }
}

/* ═══ Action Panel — redesign 2-col Round 1+2+3 ═══ */
.action-panel-sticky.action-panel-buy { border-top-color: rgba(34,197,94,0.3); }
.action-panel-sticky.action-panel-sell { border-top-color: rgba(239,68,68,0.3); }

.action-panel-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.direction-toggle { display: inline-flex; gap: 2px; border-radius: 6px; overflow: hidden; }
.dir-btn {
    padding: 0.4rem 1rem;
    background: rgba(30,41,59,0.7);
    color: #94a3b8;
    border: 1px solid rgba(71,85,105,0.4);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.12s ease;
}
.dir-btn:hover { background: rgba(51,65,85,0.9); color: #e2e8f0; }
.dir-btn.dir-buy.active {
    background: rgba(34,197,94,0.18);
    color: #86efac;
    border-color: rgba(34,197,94,0.5);
    box-shadow: none;
}
.dir-btn.dir-sell.active {
    background: rgba(239,68,68,0.18);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.5);
    box-shadow: none;
}
.position-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}
.position-banner.pos-long { background: rgba(34,197,94,0.08); color: #86efac; border: 1px solid rgba(34,197,94,0.22); }
.position-banner.pos-short { background: rgba(239,68,68,0.08); color: #fca5a5; border: 1px solid rgba(239,68,68,0.22); }
.pos-icon { font-size: 0.95rem; }
.pos-pnl { font-weight: 700; margin-left: auto; }
.reload-form { margin-left: auto; }
.btn-reload {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    background: transparent;
    border: 1px solid var(--border);
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
}
.btn-reload:hover { background: rgba(71,85,105,0.3); color: #e2e8f0; }

.action-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.action-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.7rem 1rem;
}
.action-col-ctt { border-left: 3px solid #6366f1; }
.action-col-order { border-left: 3px solid #f59e0b; }
.action-col-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #cbd5e1;
    margin-bottom: 0.55rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(71,85,105,0.4);
}
.action-col-hint {
    margin-left: auto;
    color: #64748b;
    cursor: help;
    font-weight: normal;
}

/* CTA buttons (renforcés, pleins) */
.cta-btn {
    display: block;
    width: 100%;
    padding: 0.55rem 1rem;
    margin-top: 0.45rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: center;
    letter-spacing: 0.02em;
}
/* CTA pattern "tinted" : bg semi-transparent + border + text coloré (moins flashy
   que background plein). Conserve hiérarchie visuelle via border 2px et hover qui
   intensifie subtilement. */
.cta-btn {
    color: #cbd5e1;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.cta-btn.cta-buy {
    background: rgba(34,197,94,0.14);
    color: #86efac;            /* green-300, lisible et doux */
    border-color: rgba(34,197,94,0.45);
    box-shadow: none;
}
.cta-btn.cta-buy:hover {
    background: rgba(34,197,94,0.22);
    border-color: rgba(34,197,94,0.65);
    color: #bbf7d0;
}
.cta-btn.cta-sell {
    background: rgba(239,68,68,0.14);
    color: #fca5a5;            /* red-300 */
    border-color: rgba(239,68,68,0.45);
    box-shadow: none;
}
.cta-btn.cta-sell:hover {
    background: rgba(239,68,68,0.22);
    border-color: rgba(239,68,68,0.65);
    color: #fecaca;
}
.cta-btn.cta-force { font-size: 1rem; padding: 0.65rem 1rem; }
.cta-btn:disabled { opacity: 0.55; cursor: wait; }
.cta-btn.loading::after {
    content: ' ⌛'; animation: pulse 1s infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }

/* Form rows */
.form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}
.form-row label { display: inline-flex; align-items: center; gap: 0.3rem; color: #94a3b8; }
.form-row .lbl-tp { color: #22c55e; }
.form-row .lbl-sl { color: #ef4444; }
.form-row input[type="range"] { width: 90px; }
.form-row .tp-inp { color: #22c55e; width: 60px; }
.form-row .sl-inp { color: #ef4444; width: 60px; }
.form-row-quick { font-size: 0.78rem; gap: 0.3rem; }
.quick-label { color: #64748b; font-size: 0.75rem; }
.quick-btn {
    padding: 0.18rem 0.55rem;
    background: rgba(71,85,105,0.3);
    color: #cbd5e1;
    border: 1px solid rgba(71,85,105,0.5);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.1s;
}
.quick-btn:hover { background: rgba(99,102,241,0.25); color: #e0e7ff; border-color: rgba(99,102,241,0.5); }
.rr-display-wrap { color: #94a3b8; margin-left: auto; }
.rr-display-wrap strong { color: #e2e8f0; font-variant-numeric: tabular-nums; }
.tp-color { color: #22c55e; }
.sl-color { color: #ef4444; }
.action-hint { color: #94a3b8; font-size: 0.78rem; }
.action-hint-foot {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.4rem;
    padding-top: 0.3rem;
    border-top: 1px dashed rgba(71,85,105,0.25);
}

/* Responsive : 1 col en dessous de 1100px */
@media (max-width: 1100px) {
    .action-panel-grid { grid-template-columns: 1fr; }
}

/* ═══ Chart preset overlay (top-left in chart) ═══ */
.chart-preset-overlay {
    position: absolute;
    top: 8px;
    left: 12px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.35rem 0.85rem;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(71, 85, 105, 0.45);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #94a3b8;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.chart-preset-name {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.chart-preset-attr {
    font-variant-numeric: tabular-nums;
    color: #cbd5e1;
}
.chart-preset-pending {
    color: #fbbf24;
    margin-left: 0.5rem;
    padding-left: 0.6rem;
    border-left: 1px solid rgba(251, 191, 36, 0.4);
}

@media (max-width: 700px) {
    .chart-preset-overlay {
        font-size: 0.78rem;
        gap: 0.55rem;
        padding: 0.25rem 0.65rem;
    }
    .chart-preset-name { font-size: 0.92rem; }
}
