/* =====================================================================
   SUP-R Product Manager — interface
   Fond #0A0A0A · Rose #E9418F · Bleu #3B82F6 · Inter
   ===================================================================== */
:root {
  --bg: #0A0A0A;
  --bg-elev: #111113;
  --surface: #141416;
  --surface-2: #1A1A1D;
  --surface-3: #222226;
  --border: #26262B;
  --border-strong: #34343A;
  --text: #F5F5F7;
  --text-2: #C7C7CC;
  --muted: #8A8A92;
  --pink: #E9418F;
  --pink-hover: #F0569D;
  --pink-soft: rgba(233, 65, 143, .12);
  --blue: #3B82F6;
  --blue-soft: rgba(59, 130, 246, .12);
  --ok: #34C77B;
  --warn: #F5A524;
  --danger: #F25555;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 248px;
  --topbar: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.5; font-feature-settings: 'tnum' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--pink); }
.prose a, .dl a, .field__hint a, .list a { color: var(--pink); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; letter-spacing: -.02em; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: 5px; word-break: break-all; }
small { font-size: .7em; color: var(--muted); font-weight: 500; margin-left: 2px; }

/* --- Utilitaires ---------------------------------------------------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: .92em; }
.text-pink { color: var(--pink); }
.text-blue { color: var(--blue); }
.text-danger { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.narrow { max-width: 760px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* --- Structure ------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--bg);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 12px; z-index: 40;
}
.brand { display: flex; flex-direction: column; padding: 4px 12px 24px; }
.brand__mark { font-weight: 800; font-size: 22px; letter-spacing: .04em; color: var(--text); }
.brand__mark span { color: var(--pink); }
.brand__mark--lg { font-size: 40px; }
.brand__sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .16em; margin-top: 2px; }
.brand:hover .brand__mark { color: var(--text); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav__item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 14px; width: 100%; border: 0; background: none;
  font-family: inherit; cursor: pointer; text-align: left;
}
.nav__item .icon { color: var(--muted); }
.nav__item:hover { background: var(--surface); color: var(--text); }
.nav__item.is-active { background: var(--surface-2); color: var(--text); }
.nav__item.is-active .icon { color: var(--pink); }
.nav__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__sep { height: 1px; background: var(--border); margin: 10px 12px; }
.sidebar__foot { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar__foot form { margin: 0; }
.sidebar-backdrop { display: none; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: rgba(10, 10, 10, .85); backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--border);
}
.topbar__menu { display: none; }
.topbar__actions { display: flex; gap: 8px; margin-left: auto; }
.content { padding: 28px; max-width: 1480px; width: 100%; display: flex; flex-direction: column; gap: 20px; }

.search {
  position: relative; display: flex; align-items: center; flex: 1; max-width: 520px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; height: 38px; padding: 0 10px 0 12px;
}
.search:focus-within { border-color: var(--border-strong); }
.search .icon { color: var(--muted); }
.search input[type=search] { border: 0; background: transparent; height: 100%; flex: 1; padding: 0 10px; min-width: 0; box-shadow: none !important; }
.search kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; }
.search--inline { max-width: 380px; }

/* --- En-têtes de page ---------------------------------------------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header__sub { color: var(--muted); margin: 4px 0 0; max-width: 720px; }
.page-header__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }

/* --- Boutons -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font: 500 14px/1 var(--font); cursor: pointer;
  white-space: nowrap; transition: background-color .12s, border-color .12s, color .12s; color: var(--text);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--pink); color: #fff; }
.btn--primary:hover { background: var(--pink-hover); color: #fff; }
.btn--secondary { background: var(--surface-2); border-color: var(--border); }
.btn--secondary:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: transparent; border-color: rgba(242, 85, 85, .35); color: var(--danger); }
.btn--danger:hover { background: rgba(242, 85, 85, .12); color: var(--danger); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--icon { width: 38px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--block { width: 100%; }
.inline-form { display: inline-flex; margin: 0; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Cartes --------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.card--accent { border-color: rgba(233, 65, 143, .28); background: linear-gradient(180deg, rgba(233, 65, 143, .05), transparent 40%), var(--surface); }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card__title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card__title .icon { color: var(--pink); }
.card__body { padding: 20px; }
.card__body--sub { border-top: 1px solid var(--border); background: var(--bg-elev); border-radius: 0 0 var(--radius) var(--radius); }
.card__foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.card__foot input[type=text] { max-width: 280px; }
.card__foot--split { justify-content: space-between; }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.grid--formulation { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; margin-bottom: 20px; }
.grid--calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }

/* --- KPI ------------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpis--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); min-width: 0;
}
a.kpi:hover { border-color: var(--border-strong); color: inherit; }
.kpi__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value--pink { color: var(--pink); }
.kpi__value--blue { color: var(--blue); }
.kpi__hint { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Tableaux ------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 16px;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions > * { vertical-align: middle; }
.table--hover tbody tr[data-href] { cursor: pointer; }
.table--hover tbody tr:hover td { background: var(--surface-2); }
.table--compact td { padding: 8px 16px; }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--text); }
.table th[data-dir]::after { content: ' ↑'; color: var(--pink); }
.table th[data-dir=desc]::after { content: ' ↓'; }
.table tr.is-active-row td { background: rgba(233, 65, 143, .05); }
.table--formats td:first-child, .table--pricing td:first-child { white-space: nowrap; }
.row-edit > td { background: var(--bg-elev); padding: 20px; }
.table--compare td { min-width: 120px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* --- Badges, pills, tags -------------------------------------------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.badge--a_etudier { color: #A1A1AA; }
.badge--en_developpement { color: var(--blue); background: var(--blue-soft); }
.badge--en_test { color: var(--warn); background: rgba(245, 165, 36, .12); }
.badge--valide { color: var(--ok); background: rgba(52, 199, 123, .12); }
.badge--commercialise { color: var(--pink); background: var(--pink-soft); }
.badge--abandonne { color: #6B6B73; text-decoration: line-through; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill--pink { background: var(--pink-soft); color: var(--pink); }
.pill--blue { background: var(--blue-soft); color: var(--blue); }
.pill--ok { background: rgba(52, 199, 123, .12); color: var(--ok); }
.pill--warn { background: rgba(245, 165, 36, .14); color: var(--warn); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.tag--link:hover { border-color: var(--border-strong); color: var(--text); }

/* --- Formulaires ---------------------------------------------------- */
input[type=text], input[type=search], input[type=email], input[type=url], input[type=tel], input[type=password],
input[type=number], input[type=date], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: 400 14px var(--font);
  transition: border-color .12s, box-shadow .12s; min-width: 0;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8A92' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
input:disabled { color: var(--muted); background: var(--surface-2); }
input::placeholder, textarea::placeholder { color: #5C5C64; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7); }
input[type=checkbox] { accent-color: var(--pink); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.input-xs { width: 72px !important; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid--inner { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: span 2; }
.field--full { grid-column: 1 / -1; }
.field--end { justify-content: flex-end; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; color: var(--danger); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.check { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); display: flex; }
.divider-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--border); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.form-actions--inline { justify-content: space-between; flex-wrap: wrap; }

.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group input, .input-group select { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.input-group > span, .input-group > select:last-child {
  display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-size: 13px; white-space: nowrap;
}
.input-group > select:last-child { width: auto; flex: 0 0 auto; padding-right: 30px; color: var(--text); }
.input-group--sm { min-width: 110px; justify-content: flex-end; }
.input-group--sm input { height: 32px; text-align: right; font-size: 13px; padding: 0 8px; }
.input-group--sm > span { padding: 0 8px; font-size: 12px; }
.input-group--xs { min-width: 80px; }
.ratio-input { display: flex; align-items: center; gap: 8px; }
.ratio-input input { text-align: center; font-weight: 600; font-size: 16px; }
.ratio-input span { color: var(--pink); font-weight: 700; font-size: 18px; }
.output-value { display: flex; align-items: center; height: 38px; font-weight: 600; font-size: 15px; color: var(--text); }
.inline-edit { display: flex; gap: 8px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip--btn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-elev); font-size: 13px; color: var(--text-2); font-weight: 500;
}
.chip--btn { font-family: inherit; cursor: pointer; }
.chip--btn:hover, .chip:hover span { border-color: var(--pink); color: var(--text); }
.chip input:checked + span { background: var(--pink-soft); border-color: var(--pink); color: var(--pink); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--pink-soft); }
.chips-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }

.equiv { font-size: 13px; color: var(--text-2); background: var(--bg-elev); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.6; }
.equiv strong { color: var(--pink); }
.equiv--block { margin-top: 14px; }

/* --- Résultats de calcul ------------------------------------------- */
.result-list { margin: 12px 0 0; display: flex; flex-direction: column; }
.result-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.result-list > div:last-child { border-bottom: 0; }
.result-list dt { color: var(--muted); }
.result-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.mix-bar { height: 8px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; margin-top: 14px; }
.mix-bar__conc { display: block; height: 100%; background: var(--pink); border-radius: 999px; transition: width .2s ease; }
.big-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.big-result { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.big-result span { font-size: 12px; color: var(--muted); }
.big-result strong { font-size: 24px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big-result--pink strong { color: var(--pink); }
.big-result--blue strong { color: var(--blue); }

.compare-bars { display: flex; flex-direction: column; gap: 8px; }
.compare-bars__row { display: grid; grid-template-columns: 70px 1fr 110px; gap: 12px; align-items: center; }
.compare-bars__label { font-weight: 600; font-size: 13px; }
.compare-bars__track { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.compare-bars__fill { display: block; height: 100%; background: var(--blue); border-radius: 999px; transition: width .2s ease; }
.compare-bars__fill.is-best { background: var(--pink); }
.compare-bars__fill.is-negative { background: var(--danger); }
.compare-bars__value { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.formula-note { margin: 14px 0 0; }

.bar-row { display: grid; grid-template-columns: 130px 1fr 32px; gap: 12px; align-items: center; padding: 6px 0; }
.bar-row__label { font-size: 13px; color: var(--text-2); }
.bar-row__track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-row__fill { display: block; height: 100%; border-radius: 999px; background: #71717A; }
.bar-row__fill--en_developpement { background: var(--blue); }
.bar-row__fill--en_test { background: var(--warn); }
.bar-row__fill--valide { background: var(--ok); }
.bar-row__fill--commercialise { background: var(--pink); }
.bar-row__fill--abandonne { background: #3F3F46; }
.bar-row__value { text-align: right; font-weight: 600; font-size: 13px; }

/* --- Listes, timeline, définitions ---------------------------------- */
.list { list-style: none; margin: 0; padding: 4px 0; }
.list li { padding: 10px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list--links li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list--links a { color: var(--text); }
.timeline { list-style: none; margin: 0; padding: 8px 0; max-height: 480px; overflow-y: auto; }
.timeline li { display: flex; flex-direction: column; gap: 2px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline__what { font-size: 12px; color: var(--pink); font-weight: 500; }
.timeline__detail { font-size: 13.5px; }
.timeline__meta { font-size: 12px; color: var(--muted); }
.dl { margin: 0; padding: 6px 0; }
.dl > div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.prose h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; color: var(--text-2); }
.note-card { border-style: dashed; }

/* --- Onglets -------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 10px 14px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); }
.tab.is-active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--pink); border-radius: 2px; }
.tab__count { font-size: 11px; background: var(--surface-3); border-radius: 999px; padding: 1px 7px; margin-left: 4px; color: var(--text-2); }
.tab-panel { display: flex; flex-direction: column; gap: 20px; }

/* --- Barre d'outils / filtres -------------------------------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar select { width: auto; min-width: 170px; }

/* --- Messages ------------------------------------------------------- */
.flash { position: relative; padding: 12px 44px 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); transition: opacity .3s; }
.flash.is-hiding { opacity: 0; }
.flash--success { border-color: rgba(52, 199, 123, .35); background: rgba(52, 199, 123, .08); }
.flash--error { border-color: rgba(242, 85, 85, .4); background: rgba(242, 85, 85, .08); }
.flash--warning { border-color: rgba(245, 165, 36, .4); background: rgba(245, 165, 36, .08); }
.flash__close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; width: 28px; height: 28px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty p { margin: 0; }
.error-page { text-align: center; padding: 80px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.error-page__code { font-size: 72px; font-weight: 800; color: var(--pink); letter-spacing: -.04em; line-height: 1; }

.idle-warning { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.idle-warning__box { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 24px; max-width: 360px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.idle-warning__box p { margin: 0 0 6px; color: var(--text-2); }

.export-card .card__body { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.export-card__actions { display: flex; gap: 6px; }

/* --- Page de connexion ---------------------------------------------- */
.guest { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(233, 65, 143, .10), transparent 60%), var(--bg); }
.guest__wrap { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.guest__brand { text-align: center; display: flex; flex-direction: column; align-items: center; }
.guest__card { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.guest__title { font-size: 18px; }
.guest__foot { text-align: center; color: var(--muted); font-size: 12px; margin: 0; }

/* --- Barre d'impression (écran) ------------------------------------- */
.print-page { background: #1a1a1a; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--border); }
.print-toolbar__form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; margin: 0; }
.print-toolbar__form select { width: auto; height: 32px; font-size: 13px; }
.print-toolbar__form input { width: auto; height: 32px; font-size: 13px; }
.print-toolbar__label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hide-md { display: none; }
}
@media (max-width: 1024px) {
  .grid--main, .grid--formulation, .grid--calc { grid-template-columns: minmax(0, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 35; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar__menu { display: inline-flex; }
  .search kbd { display: none; }
  .content { padding: 20px 16px; }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .hide-sm { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi__value { font-size: 21px; }
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field--wide { grid-column: auto; }
  .big-results { grid-template-columns: minmax(0, 1fr); }
  .dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .toolbar select { flex: 1; min-width: 140px; }
  .search--inline { max-width: none; flex-basis: 100%; }
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
  .page-header__actions { width: 100%; }
  .compare-bars__row { grid-template-columns: 56px 1fr 90px; }
  .bar-row { grid-template-columns: 110px 1fr 28px; }
}
