/* =========================================================================
   Coverig — design system
   (Les styles des notifications et des sections repliables sont en fin de fichier.)
   Thème : html[data-theme=light|dark] · Palette : html[data-palette=…]
   ========================================================================= */

:root {
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 16px;
  --sidebar: 248px;
  --topbar: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Charte « Littoral doux et écume »
     Sable chaud #F4EFE6 · Vert sauge écume #B7CECE · Bleu horizon #84A9AC · Gris galet #52616B
     Les teintes de marque trop claires pour porter du texte (sauge, horizon) servent de fonds,
     de reflets et de dégradés ; boutons et liens utilisent leurs déclinaisons foncées (contraste AA). */
  --sable: #F4EFE6;
  --sauge: #B7CECE;
  --horizon: #84A9AC;
  --galet: #52616B;

  /* Neutres — clair */
  --bg: #F4EFE6;
  --surface: #FBF9F5;
  --surface-2: #F2EDE4;
  --surface-3: #E9E3D8;
  --border: #E3DCD0;
  --border-strong: #D2C9BA;
  --text: #26313A;
  --text-2: #52616B;
  --text-3: #7A868D;
  --overlay: rgba(38, 49, 58, .42);
  --shadow-sm: 0 1px 2px rgba(82, 97, 107, .07);
  --shadow: 0 1px 2px rgba(82, 97, 107, .05), 0 6px 20px rgba(82, 97, 107, .07);
  --shadow-lg: 0 16px 44px rgba(38, 49, 58, .16);
  --danger: #B54A3F;
  --danger-soft: #F8EAE6;
  --success: #4D7A55;
  --success-soft: #E9F0E6;
  --warning: #96682A;
  --warning-soft: #F6EEDC;
  --info: #4E7C81;
  --info-soft: #E3EDEC;
  --board-felt: #2E383F;

  /* Palette par défaut : Horizon */
  --accent: #4E7C81;
  --accent-hover: #416A6F;
  --accent-soft: #E1EBE9;
  --accent-ink: #3F6A6F;
  --on-accent: #ffffff;
  --accent-grad: linear-gradient(135deg, #3A4952 0%, #52616B 42%, #5F8589 100%);
}

html[data-palette="ecume"] { --accent: #527C6D; --accent-hover: #44685B; --accent-soft: #E2ECE6; --accent-ink: #436B5D; --accent-grad: linear-gradient(135deg, #34463F 0%, #47665B 45%, #5E8A7B 100%); }
html[data-palette="galet"] { --accent: #52616B; --accent-hover: #434F57; --accent-soft: #E6E8E7; --accent-ink: #46545D; --accent-grad: linear-gradient(135deg, #252E34 0%, #3E4A52 50%, #5A6973 100%); }
html[data-palette="sable"] { --accent: #8F6B45; --accent-hover: #785939; --accent-soft: #F1E7D8; --accent-ink: #7A5A38; --accent-grad: linear-gradient(135deg, #4E3C29 0%, #7A5A38 50%, #977350 100%); }

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #182025;
  --surface: #1F282E;
  --surface-2: #252F36;
  --surface-3: #2D3940;
  --border: #2E3A41;
  --border-strong: #43525B;
  --text: #F4EFE6;
  --text-2: #B4C1C4;
  --text-3: #84939B;
  --overlay: rgba(8, 12, 14, .62);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 6px 20px rgba(0, 0, 0, .22);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .5);
  --danger: #E8968A;
  --danger-soft: rgba(232, 150, 138, .12);
  --success: #96C49E;
  --success-soft: rgba(150, 196, 158, .12);
  --warning: #E2B872;
  --warning-soft: rgba(226, 184, 114, .12);
  --info: #9DC0C2;
  --info-soft: rgba(157, 192, 194, .12);
  --board-felt: #10161A;

  --accent: #93B8BB;
  --accent-hover: #ABCACC;
  --accent-soft: rgba(132, 169, 172, .16);
  --accent-ink: #B7CECE;
  --on-accent: #172024;
}
html[data-theme="dark"][data-palette="ecume"] { --accent: #9CC4B4; --accent-hover: #B4D3C6; --accent-soft: rgba(156, 196, 180, .15); --accent-ink: #B5D5C8; --on-accent: #142019; }
html[data-theme="dark"][data-palette="galet"] { --accent: #B5C2C9; --accent-hover: #CCD6DB; --accent-soft: rgba(181, 194, 201, .14); --accent-ink: #CCD6DB; --on-accent: #1A2227; }
html[data-theme="dark"][data-palette="sable"] { --accent: #D6BA92; --accent-hover: #E2CBA9; --accent-soft: rgba(214, 186, 146, .14); --accent-ink: #E2CBA9; --on-accent: #241A0E; }

/* ----------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01", "tnum" 0;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12.5px; }
.xsmall { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 10px); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.hidden { display: none !important; }

/* ----------------------------------------------------------------- Shell */
.app { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; font-weight: 750; font-size: 16.5px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); flex: none; }
.brand-mark svg { width: 17px; height: 17px; }
/* Logo 2C : le SVG inclut sa zone de protection (≈ 10 % de marge) ; 2C ≥ 32 px de haut visibles */
.brand-logo { display: block; line-height: 0; margin: -6px 0 -6px -8px; }
.brand-logo img { display: block; height: 46px; width: auto; }
.brand-logo-dark { display: none !important; }
html[data-theme="dark"] .brand-logo-light { display: none !important; }
html[data-theme="dark"] .brand-logo-dark { display: block !important; }
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav .count { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none !important; }
.user-chip:hover { background: var(--surface-2); }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 28px 36px 64px; max-width: 1240px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; display: block; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-2); }

/* Mobile */
.bottom-nav { display: none; }
@media (max-width: 960px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 25;
    height: var(--topbar); padding: 0 16px; background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .brand { padding: 0; font-size: 16px; }
  .topbar .brand-logo img { height: 42px; }
  .content { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 21px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 25;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500;
    color: var(--text-3); padding: 4px 0; text-decoration: none; background: none; border: 0; cursor: pointer; position: relative;
  }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--accent-ink); }
  .bottom-nav .fab { width: 46px; height: 46px; border-radius: 14px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin: -14px auto 0; box-shadow: var(--shadow); }
  .bottom-nav .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 8px; height: 8px; background: var(--accent); border-radius: 50%; border: 2px solid var(--surface); }
}

/* ----------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; }
.icon-btn.btn-sm { width: 32px; height: 32px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; }
.section-title h2 { flex: 1; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 18px 20px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi-label svg { width: 15px; height: 15px; color: var(--text-3); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.kpi.hero { background: var(--accent-grad); color: #fff; border: 0; position: relative; overflow: hidden; }
.kpi.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 26px solid rgba(255,255,255,.08); }
.kpi.hero .kpi-label, .kpi.hero .kpi-sub, .kpi.hero .kpi-label svg { color: rgba(255,255,255,.82); }
@media (max-width: 560px) { .kpis { gap: 10px; } .kpi { padding: 14px; } .kpi-value { font-size: 21px; } }

/* ----------------------------------------------------------------- Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 550; color: var(--text); display: flex; gap: 6px; align-items: center; }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .error { font-size: 12px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; outline: none;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b8b93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 40px; }
.input-group .suffix { position: absolute; right: 12px; color: var(--text-3); font-size: 13px; pointer-events: none; }
.input-group .prefix-icon { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; display: flex; }
.input-group .prefix-icon svg { width: 17px; height: 17px; }
.input-group.has-prefix .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
}
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

/* Choix segmentés / options radio en cartes */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 550; font-size: 13px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button svg { width: 15px; height: 15px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, background .15s;
}
.choice:hover { border-color: var(--text-3); }
.choice.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice .choice-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.choice.active .choice-icon { background: var(--accent-soft); color: var(--accent-ink); }
.choice .choice-icon svg { width: 18px; height: 18px; }
.choice strong { display: block; font-size: 13.5px; }
.choice span { font-size: 12.5px; color: var(--text-2); }

/* ----------------------------------------------------------------- Badges, tags */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ----------------------------------------------------------------- Alertes */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.info { background: var(--info-soft); border-color: transparent; color: var(--text); }
.alert.info svg { color: var(--info); }
.alert.success { background: var(--success-soft); border-color: transparent; }
.alert.success svg { color: var(--success); }
.alert.warning { background: var(--warning-soft); border-color: transparent; }
.alert.warning svg { color: var(--warning); }
.alert.danger { background: var(--danger-soft); border-color: transparent; }
.alert.danger svg { color: var(--danger); }
.alert.accent { background: var(--accent-soft); border-color: transparent; }
.alert.accent svg { color: var(--accent-ink); }

/* ----------------------------------------------------------------- Tableaux & listes */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .right { text-align: right; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }

/* ----------------------------------------------------------------- Collection */
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 550; cursor: pointer; white-space: nowrap; font-size: 13.5px; }
.cat-tab svg { width: 16px; height: 16px; }
.cat-tab .n { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.cat-tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.cat-tab.active .n { color: var(--bg); opacity: .7; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
@media (max-width: 560px) { .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.item-card { display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.thumb { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; display: grid; place-items: center; color: var(--text-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb > svg { width: 38%; height: 38%; opacity: .55; }
.thumb .badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.thumb .badges .badge { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); }
.item-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.item-card .brand-name { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.item-card .model { font-weight: 650; font-size: 14.5px; line-height: 1.3; }
.item-card .meta { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; font-size: 12.5px; color: var(--text-2); }
.item-card .value { margin-left: auto; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ready-dots { display: inline-flex; gap: 3px; }
.ready-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.ready-dots i.on { background: var(--success); }

/* Barres de répartition (valeur par catégorie) */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.bar-row .name { display: flex; align-items: center; gap: 8px; font-weight: 550; font-size: 13.5px; }
.bar-row .name svg { width: 16px; height: 16px; color: var(--text-3); }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; transition: width .6s var(--ease); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13.5px; min-width: 90px; }
.bar-row .val small { display: block; font-weight: 500; color: var(--text-3); font-size: 11.5px; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; } }

/* Jauge circulaire */
.ring { --p: 0; --size: 88px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); flex: none; }
.ring::before { content: ""; width: calc(var(--size) - 16px); height: calc(var(--size) - 16px); border-radius: 50%; background: var(--surface); grid-area: 1 / 1; }
.ring span { grid-area: 1 / 1; font-weight: 700; font-size: 18px; position: relative; font-variant-numeric: tabular-nums; }

.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s var(--ease); }
.progress.warn > div { background: var(--warning); }
.progress.danger > div { background: var(--danger); }
.progress.ok > div { background: var(--success); }

/* ----------------------------------------------------------------- Détail équipement */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
.gallery-main { aspect-ratio: 4 / 3; background: var(--surface-2); border-radius: var(--radius-lg); overflow: hidden; display: grid; place-items: center; color: var(--text-3); border: 1px solid var(--border); cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-main > svg { width: 30%; height: 30%; opacity: .5; }
.gallery-strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-strip button { flex: none; width: 72px; height: 54px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--surface-2); }
.gallery-strip button.active { border-color: var(--accent); }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; }
.dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.dl > div { padding: 12px 20px; border-bottom: 1px solid var(--border); min-width: 0; }
.dl > div:nth-child(odd) { border-right: 1px solid var(--border); }
.dl dt { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
@media (max-width: 560px) { .dl { grid-template-columns: minmax(0, 1fr); } .dl > div:nth-child(odd) { border-right: 0; } }
.value-card { padding: 20px; background: var(--accent-soft); border-radius: var(--radius-lg); }
.value-card .big { font-size: 30px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.file-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.file-icon svg { width: 18px; height: 18px; }
.file-icon.invoice { background: var(--success-soft); color: var(--success); }
.file-icon.photo { background: var(--info-soft); color: var(--info); }
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: center; font-size: 13.5px; list-style: none; }
.checklist ul { padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.checklist .ok { color: var(--success); }
.checklist .ko { color: var(--text-3); }
.checklist svg { width: 17px; height: 17px; flex: none; }

/* Dépôt de fichiers */
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 24px; height: 24px; color: var(--text-3); }
.photo-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 2px solid transparent; }
.photo-tile.cover { border-color: var(--accent); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .tile-actions { position: absolute; inset: auto 4px 4px 4px; display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .15s; }
.photo-tile:hover .tile-actions, .photo-tile:focus-within .tile-actions { opacity: 1; }
@media (hover: none) { .photo-tile .tile-actions { opacity: 1; } }
.tile-actions button { width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tile-actions svg { width: 14px; height: 14px; }
.photo-tile .cover-tag { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700; background: var(--accent); color: var(--on-accent); padding: 1px 6px; border-radius: 99px; }

.form-actions { position: sticky; bottom: 12px; margin-top: 20px; padding: 12px 16px; z-index: 5; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
@media (max-width: 960px) { .form-actions { bottom: calc(76px + env(safe-area-inset-bottom)); } .form-actions .muted { flex-basis: 100%; } }

/* Auto-complétion */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg);
  max-height: 300px; overflow-y: auto; animation: fade .12s ease;
}
.combo-list li { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.combo-list li.active { background: var(--accent-soft); }
.combo-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-label mark { background: none; color: var(--accent-ink); font-weight: 700; }
.combo-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.combo-empty { padding: 10px 12px; font-size: 12.5px; color: var(--text-3); }
.prefill-note { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--accent-ink); font-weight: 500; }

/* Suggestion de date d'après n° de série */
.serial-hint { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.serial-hint .cands { display: flex; flex-wrap: wrap; gap: 6px; }

/* ----------------------------------------------------------------- Modales & toasts */
.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .2s var(--ease); border: 1px solid var(--border); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 16px 22px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 560px) {
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 120; display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; z-index: 200; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (max-width: 960px) { .toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; font-size: 13.5px; animation: pop .2s var(--ease); max-width: 420px; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.error svg { color: #E8968A; }
.toast.success svg { color: #96C49E; }

/* ----------------------------------------------------------------- États vides, chargement */
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 6px; }
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty p { color: var(--text-2); max-width: 420px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.center-screen { min-height: 60vh; display: grid; place-items: center; color: var(--text-3); }

/* Avatars */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: #fff; flex: none; background: var(--accent-grad); text-transform: uppercase; letter-spacing: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

/* ----------------------------------------------------------------- Authentification */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-side { background: var(--accent-grad); color: #fff; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side .brand { padding: 0; color: #fff; }
.auth-side .brand-mark { background: rgba(255,255,255,.16); }
.auth-side .brand-logo img { height: 60px; }
.auth-side h1 { font-size: 36px; line-height: 1.12; letter-spacing: -.03em; margin-top: auto; max-width: 460px; }
.auth-side p { color: rgba(255,255,255,.82); font-size: 15.5px; margin-top: 14px; max-width: 440px; }
.auth-features { display: grid; gap: 14px; margin-top: 34px; max-width: 440px; position: relative; z-index: 1; }
.auth-features div { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-features span { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: none; }
.auth-features svg { width: 18px; height: 18px; }
.auth-side .strings { position: absolute; right: -60px; top: 0; bottom: 0; width: 220px; opacity: .14; pointer-events: none; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 24px; letter-spacing: -.02em; }
.auth-card .lead { color: var(--text-2); margin: 6px 0 26px; }
.auth-foot { margin-top: 22px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 24px 30px; }
  .auth-side h1 { font-size: 24px; margin-top: 26px; }
  .auth-side p { font-size: 14px; }
  .auth-features { display: none; }
  .auth-main { padding: 28px 16px 40px; align-items: start; }
}

/* ----------------------------------------------------------------- Pédales */
.board-stage { background: var(--surface-2); border-radius: var(--radius-lg); padding: 16px 16px 34px; overflow: auto; border: 1px solid var(--border); }
.board {
  position: relative; margin: 0 auto; border-radius: 10px; touch-action: none; user-select: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(var(--rail) - 2px), rgba(255,255,255,.05) calc(var(--rail) - 2px) var(--rail)),
    var(--board-felt);
  box-shadow: inset 0 0 0 3px #45454d, 0 10px 30px rgba(0,0,0,.25);
}
.board .ruler { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font-size: 11px; color: var(--text-3); }
.pedal {
  position: absolute; border-radius: 6px; display: flex; flex-direction: column; justify-content: space-between; padding: 5px;
  color: #fff; font-size: 10px; font-weight: 650; line-height: 1.15; cursor: grab; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 3px 8px rgba(0,0,0,.4); transition: box-shadow .15s;
}
.pedal:active { cursor: grabbing; }
.pedal .knobs { display: flex; gap: 3px; justify-content: center; }
.pedal .knobs i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: inset 0 -1px 1px rgba(0,0,0,.3); }
.pedal .stomp { width: 12px; height: 12px; border-radius: 50%; background: #d4d4d8; margin: 0 auto; box-shadow: inset 0 -2px 2px rgba(0,0,0,.35); }
.pedal .label { text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.5); overflow: hidden; word-break: break-word; }
.pedal.selected { box-shadow: 0 0 0 2px var(--accent), 0 6px 14px rgba(0,0,0,.45); z-index: 5; }
.pedal.collide { box-shadow: 0 0 0 2px #ef4444, 0 3px 8px rgba(0,0,0,.4); }
.pedal.outside { opacity: .6; outline: 2px dashed #f59e0b; outline-offset: 1px; }
.pedals-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .pedals-layout { grid-template-columns: minmax(0, 1fr); } }
.palette-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.palette-item:last-child { border-bottom: 0; }
.swatch { width: 26px; height: 32px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row strong { font-variant-numeric: tabular-nums; }
.outputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.output { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); }
.output .head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.output .who { font-size: 12.5px; font-weight: 600; min-height: 18px; }
.output.empty-out { opacity: .55; }

/* Messagerie */
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; height: calc(100vh - 92px); min-height: 460px; }
.chat-list, .chat-thread { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-list-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.chat-convs { overflow-y: auto; flex: 1; padding: 6px; }
.chat-conv { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none !important; }
.chat-conv:hover { background: var(--surface-2); }
.chat-conv.active { background: var(--accent-soft); }
.chat-conv.unread .truncate:first-child { font-weight: 700; }
.count-pill { background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; flex: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-back { display: none; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.chat-empty { flex: 1; display: grid; place-items: center; }
.chat-day { text-align: center; margin: 14px 0 8px; }
.chat-day span { font-size: 11.5px; font-weight: 600; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); padding: 3px 10px; border-radius: 99px; }
.bubble-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.bubble-row.grouped { margin-top: 2px; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: min(560px, 78%); padding: 8px 12px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 10px; }
.bubble-row:not(.mine) .bubble { border-bottom-left-radius: 5px; }
.bubble-row.mine .bubble { background: var(--accent); color: var(--on-accent); border-color: transparent; border-bottom-right-radius: 5px; }
.bubble-row.grouped:not(.mine) .bubble { border-top-left-radius: 5px; }
.bubble-row.grouped.mine .bubble { border-top-right-radius: 5px; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bubble-time { font-size: 10.5px; opacity: .65; margin-left: auto; font-variant-numeric: tabular-nums; }
.bubble-del { opacity: 0; border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; }
.bubble-row:hover .bubble-del, .bubble-del:focus-visible { opacity: 1; }
.bubble-del:hover { color: var(--danger); background: var(--danger-soft); }
@media (hover: none) { .bubble-del { display: none; } }
.bubble-read { text-align: right; font-size: 11px; color: var(--text-3); margin-top: 3px; }
.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); position: relative; background: var(--surface); }
.chat-composer .textarea { min-height: 40px; max-height: 160px; resize: none; padding: 9px 12px; }
.chat-composer .btn { height: 40px; width: 40px; }
.chat-counter { position: absolute; right: 70px; top: -18px; }
@media (max-width: 960px) {
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar) - 120px - env(safe-area-inset-bottom)); margin: -4px 0 0; }
  .chat.has-thread .chat-list, .chat:not(.has-thread) .chat-thread { display: none; }
  .chat-back { display: inline-flex; }
}

/* Communautés */
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.community-card { display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s; }
.community-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.community-card .body { padding: 22px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.community-banner { position: relative; overflow: visible; }
.community-motif { position: absolute; right: 14px; top: 10px; width: 54px; height: 54px; color: rgba(255,255,255,.18); }
.community-initial { position: absolute; left: 16px; bottom: -18px; width: 40px; height: 40px; border-radius: 11px; background: var(--surface); color: var(--text); display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.community-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.feed { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.post { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.post-item { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.post-comments { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment-bubble { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; flex: 1; min-width: 0; }
@media (max-width: 560px) { .post-item .thumb { width: 84px !important; } }

/* Mes sons */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.preset-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none !important; min-height: 150px; transition: transform .2s var(--ease), box-shadow .2s; }
.preset-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.preset-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preset-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 550; }
.preset-chain span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.fav-btn { border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 6px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.fav-btn:hover { background: var(--surface-2); }
.fav-btn.on { color: #C79A4B; }
.fav-btn.on svg { fill: #C79A4B; }
.entry-card { overflow: hidden; }
.entry-card.off .controls { opacity: .45; }
.entry-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.entry-index { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.entry-name { height: 32px; font-weight: 650; }
.entry-notes { padding: 0 14px 12px; }
.entry-notes .input { height: 32px; font-size: 13px; border-style: dashed; }
.controls { padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 12px; }
.controls-edit { padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.knobs { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.knob { width: 78px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.knob svg { cursor: ns-resize; touch-action: none; outline: none; border-radius: 50%; }
.knob svg:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.knob.off svg { cursor: default; }
.knob-track { fill: none; stroke: var(--surface-3); stroke-width: 4; stroke-linecap: round; }
.knob-value { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.knob-cap { fill: var(--text); }
html[data-theme="dark"] .knob-cap { fill: var(--surface-3); stroke: var(--border-strong); }
.knob-pointer { stroke: var(--bg); stroke-width: 3; stroke-linecap: round; }
html[data-theme="dark"] .knob-pointer { stroke: var(--text); }
.knob-readout { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: -2px; }
.knob-label { font-size: 11.5px; color: var(--text-2); font-weight: 550; line-height: 1.2; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-control .knob-label { max-width: none; text-align: left; }
.led-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); user-select: none; }
.led-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.led-toggle .led { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.led-toggle input:checked + .led { background: #ef4444; box-shadow: 0 0 6px 1px rgba(239, 68, 68, .7); }
.led-toggle:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent-ink); cursor: pointer; font: inherit; text-decoration: underline; }

/* Module Assurance */
.usage-list { display: flex; flex-direction: column; }
.usage-row { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.usage-row:last-child { border-bottom: 0; }
.usage-row.on { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.usage-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.usage-detail { margin: 12px 0 0 46px; max-width: 380px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; margin-top: 4px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.notice-list { display: flex; flex-direction: column; }
.notice { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.notice:last-child { border-bottom: 0; }
.notice-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--info-soft); color: var(--info); display: grid; place-items: center; flex: none; }
.consent-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.consent-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.consent-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.feature-off { background: var(--surface-2); }
.feature-off h2 { color: var(--text-2); }
@media (max-width: 560px) { .usage-detail { margin-left: 0; } }


/* Utilitaires d'espacement */
.mt-0 { margin-top: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; display: flex; gap: 10px; align-items: center; text-decoration: none; }
.settings-nav a svg { width: 17px; height: 17px; }
.settings-nav a:hover { background: var(--surface); color: var(--text); }
@media (max-width: 860px) { .settings-layout { grid-template-columns: minmax(0, 1fr); } .settings-nav { display: none; } }
.palette-swatches { display: flex; gap: 4px; }
.palette-swatches i { width: 18px; height: 18px; border-radius: 5px; }
.theme-preview { height: 54px; border-radius: 8px; border: 1px solid var(--border); display: flex; overflow: hidden; margin-bottom: 10px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

@media print {
  .sidebar, .topbar, .bottom-nav, .toasts { display: none !important; }
  .main { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Notifications */
.notif { position: relative; }
.notif-btn { position: relative; }
.notif-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(400px, calc(100vw - 32px)); z-index: 50; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .15s var(--ease); }
.notif-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notif-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.notif-icon.danger { background: var(--danger-soft); color: var(--danger); }
.notif-icon.warning { background: var(--warning-soft); color: var(--warning); }
.notif-icon.success { background: var(--success-soft); color: var(--success); }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.notif-body { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-time { font-size: 11.5px; color: var(--text-3); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text-3); display: grid; justify-items: center; gap: 8px; }
@media (max-width: 560px) { .notif-panel { position: fixed; left: 16px; right: 16px; top: calc(var(--topbar) + 8px); width: auto; } }

/* Sections repliables */
.collapse-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px 4px 0; cursor: pointer; color: inherit; font: inherit; border-radius: 8px; }
.collapse-toggle:hover h2 { color: var(--accent-ink); }
.recent-strip { display: flex; flex-wrap: wrap; gap: 6px; cursor: pointer; }

/* ---------------------------------------------------------------- Modération & signalements */
.mb-4 { margin-bottom: 4px; } .mb-12 { margin-bottom: 12px; }
.report-btn { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 5px; border-radius: 6px; display: inline-grid; place-items: center; }
.report-btn:hover, .report-btn:focus-visible { color: var(--danger); background: var(--danger-soft); }
.bubble-report { order: 2; opacity: 0; }
.bubble-row:hover .bubble-report, .bubble-report:focus-visible { opacity: 1; }
@media (hover: none) { .bubble-report { opacity: .6; } }
.report-head { width: 34px; height: 34px; }
.bubble-hidden { font-style: italic; opacity: .8; background: var(--surface-2) !important; color: var(--text-2) !important; }
.bubble-hidden svg { align-self: center; }
.is-hidden { opacity: .8; }
.post.is-hidden { border-style: dashed; }
.comment.is-hidden .comment-bubble { border: 1px dashed var(--border-strong); }
.mod-banner { margin-bottom: 12px; }
.report-reasons { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.report-reason { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.report-reason > span { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.report-reason input { margin-top: 3px; accent-color: var(--danger); flex: none; }
.report-reason:hover { background: var(--surface-2); }
.report-reason.active { border-color: var(--danger); background: var(--danger-soft); }
.report-card { padding: 16px 18px; }
.report-head-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.report-snapshot { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--danger); border-radius: 8px; padding: 10px 12px; }
.report-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.report-people > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
@media (max-width: 640px) { .report-people { grid-template-columns: minmax(0, 1fr); } }
.mod-user { align-items: center; gap: 12px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.log-list { overflow: hidden; }
.log-entry { border-bottom: 1px solid var(--border); }
.log-entry:last-child { border-bottom: 0; }
.log-entry summary { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; font-size: 13.5px; min-width: 0; }
.log-entry pre { margin: 0; padding: 10px 14px 14px; background: var(--surface-2); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Pages légales */
.legal { max-width: 820px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal h3 { font-size: 15px; margin: 18px 0 6px; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
.legal ul { padding-left: 20px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0; }
.legal th, .legal td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--surface-2); }
.legal .todo { background: var(--warning-soft); color: var(--warning); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.legal-public { min-height: 100vh; background: var(--bg); padding: 32px 16px 48px; }
.legal-public .legal { margin: 0 auto; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.legal-links a { color: var(--text-3); }
.sidebar-foot .legal-links { padding: 8px 4px 0; }
.terms-banner { border-radius: 0; justify-content: center; }

@media (min-width: 640px) { .report-reasons { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- Charte « Littoral » : touches d'écume */
.auth-side { background: var(--accent-grad); }
.auth-side::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -60px; height: 220px; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 100%, rgba(183, 206, 206, .30) 0%, rgba(183, 206, 206, .10) 45%, transparent 70%); }
.kpi.hero::after { border-color: rgba(183, 206, 206, .16); }
.sidebar { background: var(--surface); }
.nav a.active { box-shadow: inset 3px 0 0 var(--horizon); }
html[data-theme="dark"] .nav a.active { box-shadow: inset 3px 0 0 var(--accent); }

/* Liens dans le texte : soulignés (le bleu horizon est proche du gris galet) */
.check a, .legal a, .alert a, .hint a, p a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 2px; font-weight: 550; }
html[data-theme="dark"]:not([data-palette="ecume"]):not([data-palette="galet"]):not([data-palette="sable"]) { --accent-grad: linear-gradient(135deg, #26323A 0%, #3A4C54 50%, #4F6E72 100%); }

/* ---------------------------------------------------------------- Bandeau « Nouvelle version » */
.update-banner { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 140; display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--galet); color: var(--sable); box-shadow: var(--shadow-lg); font-weight: 550; font-size: 14px;
  max-width: calc(100vw - 32px); animation: pop .25s var(--ease); }
.update-banner > svg { width: 18px; height: 18px; color: var(--sauge); flex: none; }
.update-reload { background: var(--sauge); color: #1f2a30; border: 0; font-weight: 650; }
.update-reload:hover { background: #c9dbdb; }
.update-close { border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.update-close:hover { opacity: 1; background: rgba(255,255,255,.1); }
html[data-theme="dark"] .update-banner { background: #2D3940; border: 1px solid var(--border-strong); }
@media (max-width: 860px) { .update-banner { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* ---------------------------------------------------------------- Installation de l'application */
.install-banner { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 130; display: flex; align-items: center; gap: 12px;
  width: min(520px, calc(100vw - 32px)); padding: 10px 8px 10px 10px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.install-text strong { font-size: 14px; }
.install-text span { font-size: 12.5px; color: var(--text-2); }
.install-close { border: 0; background: none; color: var(--text-2); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; flex: none; }
.install-close:hover { background: var(--surface-2); }
.install-steps { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
@media (max-width: 860px) { .install-banner { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* ---------------------------------------------------------------- Cotes de prix (administration) */
.price-table td { vertical-align: top; }
.price-table tr.selected td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.price-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin-top: 3px; }
.price-cell { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.price-warning { display: flex; gap: 5px; align-items: flex-start; color: var(--warning); margin-top: 4px; max-width: 420px; }
.price-warning svg { flex: none; margin-top: 2px; }
.error-text { color: var(--danger); font-weight: 600; }

/* ---------------------------------------------------------------- Statistiques (administration) */
.stats-page { --chart: var(--accent); }
.stats-page.refreshing .stats-section { opacity: .55; transition: opacity .2s; }
.stats-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.stats-toolbar > .xsmall { flex: 1; min-width: 200px; }
.stats-nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 8px 0 10px; margin-bottom: 8px; background: var(--bg); scrollbar-width: none; }
.stats-nav button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.stats-nav button:hover { color: var(--text); border-color: var(--border-strong); }
.stats-section { scroll-margin-top: 56px; margin-bottom: 32px; }
.stats-section-head { margin-bottom: 12px; }
.stats-section-head h2 { font-size: 18px; }
.stats-section-head p { margin-top: 2px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-tiles.small { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .stat-tiles.small { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stat-tiles, .stat-tiles.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-tile { padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--text-3); font-weight: 500; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
.chart-card { padding: 16px 18px 12px; min-width: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card header { margin-bottom: 12px; }
.chart-card h3 { font-size: 14.5px; }
.mini-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.chart-table { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.chart-table summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.chart-table .table-wrap { max-height: 280px; overflow: auto; margin-top: 8px; }
.chart-table .table th, .chart-table .table td { padding: 6px 10px; font-size: 12.5px; }

/* Série temporelle */
.tchart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 20px; column-gap: 8px; }
.tchart-y { grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; margin: -6px 0; }
.tchart-plot { position: relative; grid-column: 2; outline-offset: 4px; touch-action: pan-y; }
.tchart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.tchart-grid i { display: block; height: 1px; background: var(--border); }
.tchart-grid i:last-child { background: var(--border-strong); }
.tchart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.tchart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.tchart-bar { width: 100%; background: var(--chart); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .1s; }
.tchart-bars:hover .tchart-col:not(.on) .tchart-bar { opacity: .55; }
.tchart-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tchart-line polyline { stroke: var(--chart); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.tchart-dot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--chart); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.tchart-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-strong); pointer-events: none; }
.tchart-x { grid-column: 2; position: relative; font-size: 11px; color: var(--text-3); }
.tchart-x span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.tchart-x span:first-child { transform: none; left: 0 !important; }
.tchart-x span:last-child:not(:first-child) { transform: none; left: auto !important; right: 0; }
.chart-tip { position: absolute; top: -6px; transform: translate(10px, -100%); background: var(--text); color: var(--bg); border-radius: 8px; padding: 6px 9px; font-size: 12px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; z-index: 3; }
.chart-tip.left { transform: translate(calc(-100% - 10px), -100%); }
.chart-tip strong { font-size: 14px; }

/* Barres horizontales */
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.hbars-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbars-track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.hbars-bar { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }
.hbars-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
@media (max-width: 560px) { .hbars li { grid-template-columns: minmax(0, 1fr) auto; } .hbars-track { grid-column: 1 / -1; grid-row: 2; } }

/* Carte de chaleur et cohortes : une seule teinte, du clair au foncé */
.heatmap-grid { display: grid; gap: 2px; }
.heatmap-col { font-size: 10.5px; color: var(--text-3); text-align: left; white-space: nowrap; overflow: visible; }
.heatmap-row { font-size: 11.5px; color: var(--text-2); align-self: center; }
.heatmap-cell { aspect-ratio: 1.25; border-radius: 3px; background: color-mix(in srgb, var(--chart) var(--lvl, 0%), var(--surface-2)); }
.heatmap-cell:hover { box-shadow: 0 0 0 2px var(--text); }
.heatmap-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.heatmap-scale { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-3); }
.heatmap-scale i { width: 16px; height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--chart) var(--lvl), var(--surface-2)); }
.cohort-cell { background: color-mix(in srgb, var(--chart) var(--lvl, 0%), transparent); }
.cohort-table td.cohort-cell { font-weight: 600; }

/* ---------------------------------------------------------------- Import / export */
.import-drop { min-height: 150px; cursor: pointer; }
.import-columns td { vertical-align: middle; }
.import-columns .select { min-width: 190px; }
.import-preview td { vertical-align: top; }
.import-preview tr.row-error td, .import-preview tr.row-duplicate td { opacity: .6; }
.pill-stat { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.tag-status { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-stat.ok, .tag-status.ok { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.pill-stat.warning, .tag-status.warning { background: color-mix(in srgb, var(--warning) 20%, transparent); color: color-mix(in srgb, var(--warning) 70%, var(--text)); }
.pill-stat.duplicate, .tag-status.duplicate { background: var(--surface-3); color: var(--text-2); }
.pill-stat.error, .tag-status.error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
