/* ============================================================
 * SC SCPI — Comparateur / boîte à outils (/scpi/comparatif-scpi/)
 * Dépend de as-sc-scpi-css (cadre .sc-scpi-wrap + classes .scs-* + tokens).
 * Préfixe local : .scc-
 * ============================================================ */

/* ---------- Info-bulle didactique ---------- */
.scc-tip {
	display: inline-flex; align-items: center; justify-content: center;
	width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 700;
	background: var(--sc-line); color: var(--sc-muted); cursor: help; vertical-align: middle;
	font-family: var(--sc-font-body);
}
.scc-tip:hover, .scc-tip:focus { background: var(--sc-accent); color: #0e1525; outline: none; }

/* ---------- Onglets ---------- */
.scc-tabs { margin: 4px 0 18px; }
.scc-pane { animation: sc-fade .25s ease; }
.scc-tool-intro { margin-bottom: 16px; }
.scc-tool-h { font-family: var(--sc-font-head); font-weight: 700; font-size: 1.2rem; color: #fff; margin: 0 0 6px; }
.scc-tool-intro p { font-size: .95rem; color: var(--sc-ink-2); margin: 0; }

.scc-empty-tool { text-align: center; color: var(--sc-muted); padding: 24px 12px; font-style: italic; background: var(--sc-card); border: 1px dashed var(--sc-line-2); border-radius: var(--sc-radius-sm); }
.scc-link { background: none; border: 0; color: var(--sc-accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

/* ============ EXPLORATEUR ============ */
.scc-filters {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
	background: var(--sc-card); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm);
	padding: 16px; margin-bottom: 14px; align-items: end;
}
.scc-f { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: var(--sc-muted); font-weight: 600; }
.scc-f > span { text-transform: uppercase; letter-spacing: .04em; font-size: .68rem; }
.scc-f input[type="search"], .scc-f input[type="number"], .scc-f select {
	font-family: var(--sc-font-body); font-size: .9rem; color: var(--sc-ink);
	background: var(--sc-bg-2); border: 1px solid var(--sc-line-2); border-radius: 9px; padding: 9px 11px; width: 100%;
}
.scc-f select { cursor: pointer; }
.scc-f input:focus, .scc-f select:focus { outline: none; border-color: var(--sc-accent); }
.scc-f-search { grid-column: 1 / -1; }
.scc-f-check { flex-direction: row; align-items: center; gap: 8px; color: var(--sc-ink-2); font-size: .85rem; text-transform: none; letter-spacing: 0; }
.scc-f-check input { width: 17px; height: 17px; accent-color: var(--sc-accent); }
.scc-f-check span { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.scc-reset {
	font-family: var(--sc-font-body); font-size: .82rem; font-weight: 600; color: var(--sc-ink-2);
	background: var(--sc-card-2); border: 1px solid var(--sc-line-2); border-radius: var(--sc-radius-pill);
	padding: 9px 16px; cursor: pointer; height: 38px; transition: all .15s ease;
}
.scc-reset:hover { color: #fff; border-color: var(--sc-accent); }
.scc-explorer-bar { font-size: .82rem; color: var(--sc-muted); margin-bottom: 10px; }
.scc-count { font-family: var(--sc-font-head); font-weight: 700; color: var(--sc-ink); }

.scc-table { min-width: 760px; }
.scc-table .scc-name { color: var(--sc-ink); font-weight: 600; text-decoration: none; }
.scc-table .scc-name:hover { color: var(--sc-accent); }
.scc-sortable { cursor: pointer; user-select: none; position: relative; }
.scc-sortable:hover { color: var(--sc-ink); }
.scc-sortable::after { content: "⇅"; opacity: .35; margin-left: 4px; font-size: .85em; }
.scc-sortable[data-dir="asc"]::after { content: "↑"; opacity: 1; color: var(--sc-accent); }
.scc-sortable[data-dir="desc"]::after { content: "↓"; opacity: 1; color: var(--sc-accent); }
.scc-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--sc-radius-pill); }
.scc-badge-ok { background: rgba(95,217,160,.15); color: var(--sc-enr); }
.scc-th-act { text-align: center !important; }
.scc-actions { text-align: center; white-space: nowrap; }
.scc-add {
	width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--sc-line-2);
	background: var(--sc-card-2); color: var(--sc-ink-2); cursor: pointer; font-size: 14px; line-height: 1;
	transition: all .15s ease; margin: 0 1px;
}
.scc-add:hover { border-color: var(--sc-accent); background: var(--sc-accent-bg); transform: translateY(-1px); }

/* ============ SÉLECTION (compare / portefeuille) ============ */
.scc-pick { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.scc-pick-input {
	flex: 1 1 240px; min-width: 0; font-family: var(--sc-font-body); font-size: .92rem; color: var(--sc-ink);
	background: var(--sc-bg-2); border: 1px solid var(--sc-line-2); border-radius: 10px; padding: 11px 14px;
}
.scc-pick-input:focus { outline: none; border-color: var(--sc-accent); }
.scc-pick-btn {
	flex: none; font-family: var(--sc-font-body); font-weight: 700; font-size: .9rem; color: #0e1525;
	background: linear-gradient(100deg, var(--sc-accent), var(--sc-accent-2)); border: 0;
	border-radius: 10px; padding: 0 20px; cursor: pointer; transition: filter .15s ease;
}
.scc-pick-btn:hover { filter: brightness(1.08); }
.scc-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.scc-chip {
	display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600; color: var(--sc-ink);
	background: var(--sc-accent-bg); border: 1px solid var(--sc-line-2); border-radius: var(--sc-radius-pill); padding: 5px 7px 5px 13px;
}
.scc-chip button { width: 19px; height: 19px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: var(--sc-ink); cursor: pointer; font-size: 13px; line-height: 1; }
.scc-chip button:hover { background: var(--sc-neg); color: #fff; }

/* ============ COMPARATEUR CÔTE À CÔTE ============ */
.scc-cmp-scroll { overflow-x: auto; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); }
.scc-cmp-table { width: 100%; border-collapse: collapse; font-family: var(--sc-font-body); font-size: 13.5px; background: var(--sc-card); }
.scc-cmp-table th, .scc-cmp-table td { padding: 11px 14px; border-bottom: 1px solid var(--sc-line); text-align: center; }
.scc-cmp-table thead th { background: var(--sc-card-2); color: #fff; font-family: var(--sc-font-head); font-weight: 600; font-size: .9rem; vertical-align: top; }
.scc-cmp-table thead th a { color: #fff; text-decoration: none; }
.scc-cmp-table thead th a:hover { color: var(--sc-accent); }
.scc-cmp-sub { display: block; font-family: var(--sc-font-body); font-weight: 500; font-size: .72rem; color: var(--sc-muted); margin-top: 2px; }
.scc-cmp-corner { background: var(--sc-card) !important; }
.scc-cmp-lbl { text-align: left !important; color: var(--sc-muted); font-weight: 600; font-size: .8rem; position: sticky; left: 0; background: var(--sc-card); min-width: 160px; }
.scc-cmp-table tbody tr:hover td { background: var(--sc-card-2); }
.scc-cmp-best { color: var(--sc-enr) !important; font-weight: 700; background: rgba(95,217,160,.08); position: relative; }
.scc-cmp-best::before { content: "★"; font-size: .7em; margin-right: 3px; opacity: .8; }
.scc-cmp-note { font-size: .78rem; color: var(--sc-muted); margin: 10px 0 0; font-style: italic; }

/* ============ PORTEFEUILLE ============ */
.scc-pf-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.scc-pf-line {
	display: flex; align-items: center; gap: 12px; background: var(--sc-card); border: 1px solid var(--sc-line);
	border-radius: var(--sc-radius-sm); padding: 10px 14px; flex-wrap: wrap;
}
.scc-pf-line-name { flex: 1 1 200px; min-width: 0; }
.scc-pf-line-name a { color: var(--sc-ink); font-weight: 600; text-decoration: none; }
.scc-pf-line-name a:hover { color: var(--sc-accent); }
.scc-pf-line-name em { display: block; font-style: normal; font-size: .76rem; color: var(--sc-muted); margin-top: 2px; }
.scc-pf-line-amt { flex: none; color: var(--sc-muted); font-size: .9rem; }
.scc-pf-line-amt input { width: 110px; font-family: var(--sc-font-head); font-size: .95rem; color: var(--sc-ink); background: var(--sc-bg-2); border: 1px solid var(--sc-line-2); border-radius: 9px; padding: 8px 10px; text-align: right; }
.scc-pf-line-amt input:focus { outline: none; border-color: var(--sc-accent); }
.scc-pf-rm { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--sc-line-2); background: var(--sc-card-2); color: var(--sc-muted); cursor: pointer; font-size: 14px; }
.scc-pf-rm:hover { border-color: var(--sc-neg); color: var(--sc-neg); }

.scc-pf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.scc-pf-kpi { background: var(--sc-card); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); padding: 16px; }
.scc-pf-kpi-l { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sc-muted); font-weight: 600; }
.scc-pf-kpi-v { font-family: var(--sc-font-head); font-weight: 700; font-size: 1.5rem; color: #fff; margin: 5px 0 2px; }
.scc-pf-kpi-s { font-size: .74rem; color: var(--sc-ink-2); }

.scc-pf-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.scc-pf-chart { background: var(--sc-card-2); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); padding: 18px; }
.scc-pf-chart-h { font-family: var(--sc-font-head); font-weight: 600; font-size: .95rem; color: var(--sc-ink); margin-bottom: 12px; }

.scc-pf-div { background: var(--sc-card-2); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); padding: 18px; margin-bottom: 14px; }
.scc-div-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.scc-div-title { font-family: var(--sc-font-head); font-weight: 600; font-size: .95rem; color: var(--sc-ink); }
.scc-div-score { font-family: var(--sc-font-head); font-weight: 800; font-size: 1.6rem; }
.scc-div-score i { font-size: .55em; font-style: normal; color: var(--sc-muted); font-weight: 600; }
.scc-div-bar { height: 10px; background: var(--sc-bg-2); border-radius: 999px; overflow: hidden; }
.scc-div-fill { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.scc-div-lvl { font-size: .82rem; color: var(--sc-ink-2); margin-top: 9px; }
.scc-div-warn { color: var(--sc-autre); font-weight: 600; }
.scc-div-good { color: var(--sc-enr); } .scc-div-fill.scc-div-good { background: var(--sc-enr); }
.scc-div-mid  { color: var(--sc-immo); } .scc-div-fill.scc-div-mid  { background: var(--sc-immo); }
.scc-div-low  { color: #f0b86e; } .scc-div-fill.scc-div-low  { background: #f0b86e; }
.scc-div-bad  { color: var(--sc-neg); } .scc-div-fill.scc-div-bad  { background: var(--sc-neg); }
.scc-pf-tip { font-size: .86rem; color: var(--sc-ink-2); background: var(--sc-accent-bg); border-radius: var(--sc-radius-sm); padding: 12px 14px; margin: 0; }

/* ============ SIMULATEUR ============ */
.scc-sim-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; background: var(--sc-card); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); padding: 18px; margin-bottom: 16px; align-items: end; }
.scc-sim-form .scc-f input[type="range"] { accent-color: var(--sc-accent); padding: 0; height: 6px; }
.scc-sim-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.scc-sim-result .scc-pf-kpi-v { color: var(--sc-enr); }
.scc-sim-box { height: 300px; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
	.scc-pf-charts { grid-template-columns: 1fr; }
	.scc-cmp-lbl { min-width: 130px; }
}
