@font-face { font-family: 'Clash Display'; src: url('fonts/ClashDisplay-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Clash Display'; src: url('fonts/ClashDisplay-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Clash Display'; src: url('fonts/ClashDisplay-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('fonts/DMSans-ext.woff2') format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; src: url('fonts/DMSans.woff2') format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Fonds et surfaces */
  --bg: #F2F2F0;
  --surface: #FFFFFF;
  --chip: #F5F5F3;            /* éléments posés dans un bloc blanc */
  --chip-2: #EBEBE8;          /* champs, pistes de barres, vignettes vides */
  --border: #E6E6E3;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.06), 0 16px 34px rgba(0,0,0,.10);
  /* Textes */
  --ink: #141414;
  --ink-2: #6B6B6B;
  --muted: #6B6B6B;
  --zero: #B5B5B5;            /* valeur nulle ou désactivée */
  /* Accent */
  --accent: #B85C5C;
  --accent-dark: #9C4B4B;
  --accent-soft: rgba(184, 92, 92, .10);
  /* Argent */
  --money: #1F9D55;
  --loss: #B42318;
  --amber: #B7791F;
  /* Rayons et polices */
  --r-block: 14px;
  --r-pill: 8px;
  --display: 'Clash Display', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Alias hérités, pour que tout le CSS existant suive les nouveaux tokens */
  --block: var(--surface);
  --pill: var(--chip);
  --brick: var(--accent);
  --brick-dark: var(--accent-dark);
  --green: var(--money);
  --green-a: #7EFF8B;
  --green-b: #4C9953;
  --line: var(--border);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.num, .count, .stat b, .kpi .num, .price-in input, td, th, .todo b, .grp-count, .hero-pct { font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brick); outline-offset: 2px; }
img { max-width: 100%; display: block; }

.shell { max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }

/* Navigation */
.nav { display: flex; gap: 8px; align-items: center; margin-bottom: 28px; position: relative; }
.nav-items { display: flex; gap: 8px; align-items: center; flex: 1; }
.nav-toggle { display: none; }
.nav .spacer { flex: 1; }
.nav-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border: 0; border-radius: var(--r-pill);
  background: var(--brick); color: #fff; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .01em; transition: background .15s; }
.nav-btn.icon-only { width: 36px; padding: 0; justify-content: center; }
.nav-btn.icon-only span { display: none; }   /* le libellé ne sert que dans le menu mobile */
.nav-btn:hover { background: var(--brick-dark); }
.nav-btn.active { background: var(--ink); }
.nav-btn svg { width: 18px; height: 18px; }

/* Titres */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; margin: 0; letter-spacing: -.01em; }
.subtitle { font-size: 17px; font-weight: 500; color: var(--ink-2); margin: 6px 0 0; }

/* Blocs */
.block { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--r-block); padding: 16px 18px 18px; margin-bottom: 14px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tag { display: inline-block; font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.35; color: var(--ink); letter-spacing: -.01em; }
.tag.sm { font-size: 15px; }
.link { background: none; border: 0; padding: 0; font-weight: 500; font-size: 14px; color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.link:hover { color: var(--accent); }
.link svg { width: 14px; height: 14px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--r-block); padding: 16px 18px; }
.kpi .num { font-family: var(--display); font-weight: 600; font-size: 76px; line-height: .95; margin: 14px 0 8px 6px; letter-spacing: -.02em; }
.kpi .num.green { color: var(--green); }
.kpi .foot { font-size: 13px; font-weight: 500; color: var(--ink-2); padding-left: 6px; }
.kpi.small .num { font-size: 44px; margin-top: 10px; }

.kpi.duo .duo-row { display: flex; gap: 18px; }
.kpi.duo .duo-lab { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-left: 4px; }
.kpi.duo .num { font-size: 50px; margin: 2px 0 6px 2px; }
.num.red { color: var(--loss); }
.seg.big button { height: 34px; padding: 0 14px; font-size: 14px; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.lg-ca { background: var(--green-b); } .lg-dep { background: #C87171; }
.duo-bars { display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.duo-bars i { width: 20px; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.duo-bars i.b-ca { background: linear-gradient(180deg, var(--green-a), var(--green-b)); }
.duo-bars i.b-dep { background: linear-gradient(180deg, #E0A0A0, #B45A5A); }
.red-b { background: linear-gradient(90deg, #E0A0A0, #B45A5A) !important; }
.exp-form { display: grid; grid-template-columns: 150px 1.6fr 150px 1fr 120px auto; gap: 8px; align-items: center; }
.exp-head { display: grid; grid-template-columns: 150px 1.6fr 150px 1fr 120px 32px; gap: 8px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 10px; }
.exp-row { display: grid; grid-template-columns: 150px 1.6fr 150px 1fr 120px 32px; gap: 8px; align-items: center; background: var(--chip); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.exp-row .input, .exp-row .select { background: var(--chip-2); width: 100%; max-width: none; }
.exp-form .input, .exp-form .select { background: var(--chip); width: 100%; max-width: none; }
.exp-link { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.stat-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { background: var(--pill); border-radius: var(--r-pill); padding: 7px 12px; display: flex; align-items: baseline; gap: 8px; }
.stat b { font-family: var(--display); font-weight: 600; font-size: 20px; }
.stat span { font-weight: 500; color: var(--ink-2); font-size: 13px; }

/* Pilules et lignes de vente */
.pill { background: var(--pill); border-radius: var(--r-pill); padding: 5px 11px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.sale-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sale-line .rule { flex: 1; height: 1px; background: var(--chip); min-width: 20px; }
.sale-line .price { color: var(--green); }
.plat { width: 28px; height: 28px; border-radius: 7px; display: inline-grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: 13px; flex: none; }
.status-ico { width: 28px; height: 28px; border-radius: 7px; background: var(--pill); display: inline-grid; place-items: center; flex: none; }
.status-ico svg { width: 17px; height: 17px; }
.st-vente { color: var(--brick); } .st-attente { color: var(--amber); } .st-envoye { color: var(--green); }

/* Progression */
.prog-row { display: grid; grid-template-columns: minmax(150px, max-content) 1fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.prog-row .name { background: none; border: 0; padding: 0; text-align: left; }
.prog-row .name .pill { display: inline-block; }
.bar { background: var(--chip); border-radius: var(--r-pill); height: 28px; padding: 5px; }
.bar i { display: block; height: 100%; background: var(--chip-2); border-radius: 5px; position: relative; overflow: hidden; }
.bar i b { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 5px; transition: width .4s; }
.bar i b.money { background: linear-gradient(90deg, #5BD37F, var(--money)); }
.count { font-weight: 500; } .count strong { font-weight: 700; }

/* Tuiles de carte */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.tile { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--r-block);
  padding: 8px 8px 10px; position: relative; text-align: left; display: flex; flex-direction: column; align-items: stretch; width: 100%;
  transition: transform .18s ease, box-shadow .18s ease; transform-style: preserve-3d; }
.tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px) scale(1.02); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile .thumb { width: 100%; border-radius: 10px; overflow: hidden; background: var(--chip-2); position: relative; }
.tile .thumb::before { content: ''; display: block; padding-top: 140%; }
.tile .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.noimg { position: absolute; inset: 0; background:
  linear-gradient(to top right, transparent calc(50% - 1px), #C9C9C6 50%, transparent calc(50% + 1px)),
  linear-gradient(to top left, transparent calc(50% - 1px), #C9C9C6 50%, transparent calc(50% + 1px)), var(--chip-2); }
.tile .team { position: absolute; top: 8px; left: 8px; }
.tile .badges { position: absolute; top: 46px; right: 11px; display: flex; gap: 4px; flex-direction: column; align-items: flex-end; }
.badge { background: var(--surface); border: 1px solid var(--ink); border-radius: 20px; font-size: 10px; font-weight: 600; padding: 1px 7px; }
.badge.qty { background: var(--ink); color: #fff; }
.t-info { padding: 9px 3px 1px; }
.t-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.t-top strong { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-qty { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 20px; padding: 1px 7px; flex: none; }
.t-sub { font-size: 11.5px; font-weight: 500; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.t-badge { font-size: 9.5px; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 2px 6px; }
.tile.missing .thumb { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* Barre d'outils */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar + .toolbar { margin-top: 8px; }
.input, .select { height: 34px; border: 0; border-radius: var(--r-pill); background: var(--chip); padding: 0 11px; font-size: 13px; font-weight: 500; }
.input.search { min-width: 200px; flex: 1; }
.select { padding-right: 8px; max-width: 220px; }
.chip { height: 30px; border-radius: 20px; border: 1.5px solid var(--ink); background: transparent; padding: 0 11px; font-size: 12.5px; font-weight: 600; }
.chip.on { background: var(--ink); color: #fff; }
.seg { display: inline-flex; background: var(--chip); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; min-width: 30px; border-radius: 6px; display: inline-grid; place-items: center; padding: 0 8px; font-weight: 600; font-size: 12.5px; }
.seg button.on { background: var(--ink); color: #fff; }
.seg svg { width: 16px; height: 16px; }
.btn { height: 36px; border: 0; border-radius: var(--r-pill); padding: 0 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.btn svg { width: 16px; height: 16px; }
.btn.brick { background: var(--brick); } .btn.brick:hover { background: var(--brick-dark); }
.btn.ghost { background: var(--chip); color: var(--ink); }
.btn.danger { background: var(--chip); color: var(--loss); }
.ftoggle { display: none; }
.btn:disabled { opacity: .45; cursor: default; }
.result-count { font-weight: 500; color: var(--ink-2); margin: 12px 2px 10px; }

/* Tableau */
.table-wrap { overflow-x: auto; background: var(--chip); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--chip); }
td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--chip); }
td .mini { width: 34px; height: 48px; border-radius: 4px; overflow: hidden; position: relative; background: var(--chip-2); flex: none; }
td .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flags { display: flex; gap: 4px; }
.flag { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; background: var(--chip-2); }
.flag.rc { background: #FDE8E8; color: #9B2C2C; } .flag.au { background: #E7F6EC; color: #1E6B35; } .flag.pa { background: #EAF0FB; color: #2B4C8C; }
.check { width: 20px; height: 20px; accent-color: var(--ink); cursor: pointer; }
.stepper { display: inline-flex; align-items: center; background: var(--chip-2); border-radius: 6px; }
.stepper button { border: 0; background: transparent; width: 26px; height: 26px; font-weight: 700; }
.stepper span { min-width: 22px; text-align: center; font-weight: 600; }

/* Modales */
.overlay { position: fixed; inset: 0; background: rgba(21,21,21,.45); display: grid; place-items: center; padding: 24px; z-index: 50; }
.modal { background: var(--bg); border-radius: 16px; width: min(860px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 22px; }
.modal.narrow { width: min(560px, 100%); }
.modal h2 { font-family: var(--display); font-weight: 600; font-size: 28px; margin: 0 0 4px; line-height: 1.1; }
.modal .sub { color: var(--ink-2); font-weight: 500; margin: 0 0 16px; }
.modal-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.drop { border-radius: 10px; background: var(--chip-2); position: relative; overflow: hidden; border: 2px dashed transparent; }
.drop::before { content: ''; display: block; padding-top: 140%; }
.drop.over { border-color: var(--brick); }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .input, .field .select { background: var(--chip); max-width: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal-foot .right { display: flex; gap: 8px; }
.info-list { background: var(--chip); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.info-list dt { color: var(--muted); font-weight: 500; } .info-list dd { margin: 0; font-weight: 600; }
.plat-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Ventes */
.sale-row { background: var(--chip); border-radius: 10px; padding: 10px; display: grid; grid-template-columns: 44px minmax(150px, 1.3fr) 96px 96px minmax(180px, 1.5fr) 140px 170px 32px; gap: 10px; align-items: center; margin-top: 8px; }
.sale-row .mini { width: 44px; height: 62px; border-radius: 5px; overflow: hidden; position: relative; background: var(--chip-2); }
.sale-row .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sale-row .title { font-weight: 700; font-size: 13.5px; } .sale-row .title small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.price-in { position: relative; } .price-in .input { width: 100%; padding-right: 24px; background: var(--chip-2); } .price-in::after { content: '€'; position: absolute; right: 10px; top: 8px; font-weight: 600; color: var(--muted); }
.sale-row .select { background: var(--chip-2); width: 100%; max-width: none; }
.sale-row .chip { height: 26px; font-size: 11.5px; padding: 0 9px; border-width: 1px; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--chip-2); color: var(--loss); }
.icon-btn svg { width: 17px; height: 17px; }
.sale-head { display: grid; grid-template-columns: 44px minmax(150px, 1.3fr) 96px 96px minmax(180px, 1.5fr) 140px 170px 32px; gap: 10px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 10px; }
.charts { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbar i { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--green-a), var(--green-b)); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.vbar small { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.vbar em { font-style: normal; font-size: 11px; font-weight: 700; }
.vbar em.neg { color: var(--loss); }
.hbar { display: grid; grid-template-columns: 110px 1fr 70px; gap: 8px; align-items: center; margin-top: 8px; }
.hbar .bar { height: 24px; padding: 4px; }
.hbar strong { text-align: right; }

.row-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.row-actions .see { color: var(--muted); }
tr.click:hover .row-actions .see { color: var(--ink); text-decoration: underline; }
.version-list { display: flex; flex-direction: column; gap: 8px; }
.version { display: flex; align-items: center; gap: 12px; background: var(--chip); border: 0; border-radius: 10px; padding: 8px 12px; text-align: left; font: inherit; }
.version:hover { outline: 2px solid var(--ink); }
.version .mini { width: 38px; height: 53px; border-radius: 5px; overflow: hidden; position: relative; background: var(--chip-2); flex: none; display: block; }
.version .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.version small { display: block; color: var(--muted); font-size: 12px; }
.empty { background: var(--chip); border-radius: 10px; padding: 28px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 6px 18px; }
.sections .prog-row { grid-template-columns: 1fr 110px 64px; margin-top: 4px; font-size: 12.5px; }
.sections .bar { height: 18px; padding: 3px; }
.sec-btn { background: none; border: 0; text-align: left; padding: 0; font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-btn.on { text-decoration: underline; }

.map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; }
.warn { background: #FFF4E5; color: #7A4B00; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 500; margin: 8px 0; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.set-card { cursor: pointer; }
.set-card:hover { outline: 2px solid var(--ink); }
.muted { color: var(--muted); }
.back { margin-bottom: 10px; }
.pager { display: flex; justify-content: center; margin-top: 14px; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: repeat(2, 1fr); }
  .modal-grid, .charts { grid-template-columns: 1fr; }
  .sale-row, .sale-head { grid-template-columns: 44px 1fr; }
  .sale-head { display: none; }
  .sale-row > :nth-child(n+3) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Regroupement par équipe */
tr.grp td { background: var(--bg); font-family: var(--display); font-weight: 600; font-size: 15px; padding: 10px; }
.grp-head { grid-column: 1 / -1; display: flex; align-items: center; font-family: var(--display); font-weight: 600; font-size: 17px; margin-top: 6px; }
.team-chip { background: var(--brick); color: #fff; border-radius: 5px; font-family: var(--body); font-size: 11px; font-weight: 700; padding: 2px 6px; margin-right: 8px; }
.grp-count { margin-left: 10px; font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--chip); border-radius: 6px; padding: 1px 8px; }

/* Accès téléphone */
.remote { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.qr { background: var(--surface); border-radius: 12px; padding: 8px; border: 1px solid var(--border); }
.qr svg { width: 100%; height: auto; display: block; }
.steps { margin: 0 0 10px; padding-left: 20px; } .steps li { margin-bottom: 6px; }
.offline { position: sticky; top: 0; z-index: 40; background: #7A4B00; color: #fff; font-weight: 600; font-size: 13px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); text-align: center; }
.login { max-width: 360px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 12px; }
.login .input { height: 48px; font-size: 22px; letter-spacing: .3em; text-align: center; }
.login .btn { height: 46px; justify-content: center; font-size: 15px; }
.login-err { color: var(--loss); font-weight: 600; min-height: 1.2em; margin: 0; }

/* Téléphone */
@media (max-width: 700px) {
  body { font-size: 15px; }
  .shell { padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(40px + env(safe-area-inset-bottom, 0px)); }
  .nav { gap: 6px; margin-bottom: 18px; }
  /* Menu déroulant : une seule barre, le reste se déplie */
  .nav-toggle { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--r-pill);
    font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--ink); }
  .nav-toggle .burger { display: grid; place-items: center; color: var(--accent); }
  .nav-toggle .burger svg { width: 22px; height: 22px; }
  .nav-current { display: inline-flex; align-items: center; gap: 8px; }
  .nav-current svg { width: 18px; height: 18px; color: var(--accent); }
  .nav-items { display: none; position: absolute; top: 54px; left: 0; right: 0; z-index: 60;
    flex-direction: column; align-items: stretch; gap: 6px; padding: 8px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-hover); border-radius: var(--r-block); }
  .nav.open .nav-items { display: flex; }
  .nav-items .spacer { display: none; }
  .nav-btn, .nav-btn.icon-only { width: 100%; height: 46px; justify-content: flex-start; padding: 0 14px; font-size: 15px; }
  .nav-btn span, .nav-btn.icon-only span { display: inline; }
  h1 { font-size: 32px; }
  .subtitle { font-size: 15px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .kpi:first-child { grid-column: 1 / -1; }
  .kpi { padding: 12px; }
  .kpi .num { font-size: 46px; margin: 10px 0 6px 2px; }
  .kpi .tag { font-size: 15px; }
  .kpi .foot { font-size: 11.5px; padding-left: 2px; }
  .block { padding: 12px; }
  .tag { font-size: 17px; }
  .sale-line { flex-wrap: wrap; } .sale-line .rule { display: none; }
  .prog-row { grid-template-columns: 1fr auto; }
  .prog-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .sections { grid-template-columns: 1fr; }
  .sections .prog-row { grid-template-columns: 1fr 90px 56px; }
  .sections .prog-row .bar { grid-column: auto; grid-row: auto; }
  .grid, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toolbar .select, .toolbar .input { flex: 1 1 45%; max-width: none; height: 40px; font-size: 14px; }
  .input.search { flex-basis: 100%; min-width: 0; }
  .chip { height: 34px; }
  .ftoggle { display: inline-flex; height: 40px; }
  .filters:not(.open) .toolbar > :not(.search):not(.ftoggle):not(.seg) { display: none; }
  .filters .toolbar:first-child .input.search { flex: 1 1 55%; }
  .page-head .btn, .page-head .toolbar { width: 100%; justify-content: center; }
  .overlay { padding: 0; align-items: end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .modal-grid { grid-template-columns: 1fr; }
  .drop { max-width: 230px; margin: 0 auto; width: 100%; }
  .drop-actions { justify-content: center; }
  .row2, .map-grid { grid-template-columns: 1fr; }
  .modal-foot, .modal-foot .right { flex-direction: column-reverse; width: 100%; }
  .modal-foot .btn { width: 100%; justify-content: center; height: 44px; }
  .field .input, .field .select { height: 42px; font-size: 16px; }
  .sale-row { grid-template-columns: 52px 1fr; }
  .sale-row > :nth-child(n+3) { grid-column: 1 / -1; }
  .sale-row .mini { width: 52px; height: 72px; }
  .sale-row .icon-btn { justify-self: end; }
  .exp-form, .exp-head, .exp-row { grid-template-columns: 1fr 1fr; }
  .exp-head { display: none; }
  .exp-row > :nth-child(2), .exp-form > :nth-child(2) { grid-column: 1 / -1; }
  .exp-form .btn { grid-column: 1 / -1; justify-content: center; height: 44px; }
  .exp-row .icon-btn { justify-self: end; }
  .kpi.duo .duo-row { gap: 12px; } .kpi.duo .num { font-size: 34px; }
  .seg.big { width: 100%; } .seg.big button { flex: 1; }
  .price-in .input { font-size: 16px; }
  .hbar { grid-template-columns: 90px 1fr 60px; }
  .seg { flex-wrap: wrap; }
  .remote { grid-template-columns: 1fr; }
  td, th { padding: 8px 6px; }
  .check { width: 24px; height: 24px; }
  .stepper button { width: 32px; height: 32px; }
}

/* Favoris */
.heart { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.92);
  display: grid; place-items: center; color: var(--muted); box-shadow: 0 1px 4px rgba(0,0,0,.15); cursor: pointer; }
.heart svg { width: 15px; height: 15px; fill: none; }
.heart.on { color: var(--brick); } .heart.on svg { fill: var(--brick); }
.heart:hover { color: var(--brick); }
.heart.inline, .heart.mini { position: static; box-shadow: none; background: none; display: inline-grid; vertical-align: middle; }
.heart.mini { width: 20px; height: 20px; margin-left: 6px; }
.heart.mini svg { width: 13px; height: 13px; }

/* Badges d'équipe */
/* Logo posé directement sur l'image, avec un léger contour blanc pour rester lisible */
.tile .team.with-logo, .team.with-logo { background: none; padding: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 0; overflow: visible; box-shadow: none; }
/* Contour net : 4 décalages sans flou, empilés pour couvrir aussi les diagonales */
.team.with-logo img { filter:
  drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff)
  drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff); }
.team.with-logo.fallback { border-radius: 50%; padding: 5px; box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 1px 3px rgba(0,0,0,.25); }
.team.with-logo.fallback svg { width: 100%; height: 100%; }
.team.inline-team.with-logo { width: 24px; height: 24px; padding: 2px; border-radius: 6px; }
.pc-info .team.with-logo, .team-row .team.with-logo { width: 30px; height: 30px; }
.team.with-logo img { width: 100%; height: 100%; object-fit: contain; }
.team.inline-team { position: static; display: inline-grid; place-items: center; vertical-align: middle; padding: 2px 5px; }

/* Recherche rapide */
.qsearch { position: relative; margin-bottom: 14px; }
.qsearch .input { width: 100%; height: 44px; padding-left: 40px; font-size: 15px; }
.qs-ico { position: absolute; left: 13px; top: 13px; color: var(--muted); }
.qs-ico svg { width: 18px; height: 18px; }
.qres { position: absolute; z-index: 20; top: 48px; left: 0; right: 0; background: var(--surface); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; }
.qr-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 12px; text-align: left; font: inherit; }
.qr-row:hover { background: var(--chip); }
.qr-row .mini { width: 30px; height: 42px; border-radius: 4px; overflow: hidden; position: relative; background: var(--chip-2); flex: none; }
.qr-row .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qr-row strong { display: block; font-size: 14px; } .qr-row small { color: var(--muted); }
.qr-row > span:nth-child(2) { flex: 1; min-width: 0; }
.qr-row .team { position: static; }
.qr-row.missing strong { font-weight: 600; color: var(--ink-2); }
.qr-empty { padding: 12px; color: var(--muted); }

/* À faire */
.todo { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--chip); border: 0; border-radius: 10px; padding: 10px 12px; margin-top: 8px; font: inherit; text-align: left; }
.todo:hover { outline: 2px solid var(--ink); }
.todo b { font-family: var(--display); font-size: 20px; }
.todo > span:nth-child(3) { flex: 1; }
.todo-ico { color: var(--brick); display: grid; place-items: center; } .todo-ico svg { width: 18px; height: 18px; }
.todo-go { color: var(--muted); } .todo-go svg { width: 15px; height: 15px; }

/* Mes joueurs */
.players { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.player-card { display: flex; gap: 10px; align-items: center; background: var(--chip); border: 0; border-radius: 10px; padding: 8px; font: inherit; text-align: left; }
.player-card:hover { outline: 2px solid var(--ink); }
.pc-thumb { width: 52px; height: 73px; border-radius: 6px; overflow: hidden; position: relative; background: var(--chip-2); flex: none; display: block; }
.pc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc-info { display: block; } .pc-info strong { display: block; font-size: 15px; } .pc-info small { color: var(--muted); }
.pc-info .team { position: static; display: inline-block; margin-bottom: 3px; }
.name-btn { border: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; font-weight: 600; font-size: 13px; }
.name-btn:hover { text-decoration: underline; }
.hbar strong { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

/* Wishlist */
.wish-row { display: grid; grid-template-columns: 28px minmax(160px, 1.6fr) 1fr 110px auto 32px; gap: 10px; align-items: center; background: var(--chip); border-radius: 10px; padding: 10px; margin-top: 8px; }
.wish-row.got { opacity: .6; }
.wish-ico { color: var(--brick); } .wish-row.got .wish-ico { color: var(--green); }
.wish-ico svg { width: 18px; height: 18px; }
.wish-row .title { font-weight: 700; font-size: 13.5px; } .wish-row .title small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.wish-row .input { background: var(--chip-2); width: 100%; max-width: none; }

/* Équipes (réglages) */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 14px; }
.team-row { display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 8px; padding: 6px 10px; }
.team-row .team { position: static; }
.team-row .t-name { flex: 1; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 700px) {
  .wish-row { grid-template-columns: 28px 1fr; }
  .wish-row > :nth-child(n+3) { grid-column: 2; }
  .players { grid-template-columns: 1fr; }
  .teams-grid { grid-template-columns: 1fr; }
  .heart { top: 12px; }
  .qres { top: 46px; }
}

/* Recto / verso */
.flip { perspective: 1200px; }
.flip-in { position: relative; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,.2,.2,1); }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.flip .drop { backface-visibility: hidden; }
.flip .face-back { position: absolute; inset: 0; transform: rotateY(180deg); }
.face-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(21,21,21,.75); color: #fff; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; }
.face-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--chip-2); color: var(--muted); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.face-dot.ok { background: var(--green); color: #fff; }

/* Scan mobile */
.big-btn { width: 100%; justify-content: center; height: 48px; font-size: 15px; margin-top: 10px; }
.face-seg { width: 100%; } .face-seg button { flex: 1; height: 42px; font-size: 15px; }
.canvas-wrap { position: relative; background: #1E1E1E; border-radius: 10px; padding: 2px; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.canvas-wrap canvas { display: block; border-radius: 8px; touch-action: none; max-width: 100%; }
.canvas-busy { position: absolute; inset: 0; background: rgba(21,21,21,.6); color: #fff; display: grid; place-items: center; font-weight: 600; }
.scan-preview { background: #1E1E1E; border-radius: 10px; padding: 10px; display: grid; place-items: center; }
.scan-preview img { max-height: 58vh; border-radius: 6px; }

/* Loupe de précision pendant le réglage des coins */
.canvas-wrap canvas.loupe[hidden], .loupe[hidden] { display: none; }   /* sinon la règle canvas display:block la garde visible */
.canvas-wrap canvas.loupe, .loupe { position: absolute; width: 150px; height: 150px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); pointer-events: none; z-index: 5; background: #1E1E1E; }


/* ---------- Bloc héros : progression de la collection principale ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: end;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--r-block); padding: 20px 22px; margin-bottom: 14px; }
.hero-label { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.hero-name { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.15; margin: 4px 0 0; }
.hero-sub { color: var(--ink-2); font-weight: 500; margin-top: 2px; }
.hero-pct { font-family: var(--display); font-weight: 600; font-size: 64px; line-height: .9; color: var(--accent); letter-spacing: -.02em; }
.hero-bar { grid-column: 1 / -1; height: 14px; border-radius: 999px; background: var(--chip-2); overflow: hidden; margin-top: 14px; }
.hero-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); width: 0; transition: width .6s cubic-bezier(.3,.8,.3,1); }
.hero.empty-hero .hero-pct { color: var(--zero); }
@media (max-width: 700px) {
  .hero { padding: 16px; }
  .hero-name { font-size: 20px; }
  .hero-pct { font-size: 44px; }
}
.t-badge.muted-badge { color: var(--zero); background: var(--chip-2); }
.version[disabled] { opacity: .45; }
.exp-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.exp-ico svg { width: 18px; height: 18px; }

/* Recherche par photo */
.sim-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
.sim-photo { background: var(--chip-2); border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.sim-photo img { max-height: 50vh; border-radius: 8px; }
.sim-score { position: absolute; bottom: 8px; right: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; border-radius: 20px; padding: 2px 9px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.vidx-bar { position: fixed; right: 16px; bottom: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 20px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); z-index: 45; overflow: hidden; }
.vidx-bar i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .3s; }
@media (max-width: 700px) { .sim-layout { grid-template-columns: 1fr; } .vidx-bar { left: 16px; right: 16px; text-align: center; } }

/* Mise à jour disponible */
.upd-pill { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 5px;
  padding: 11px 16px; text-align: left; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.upd-pill:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.upd-pill strong { font-size: 13.5px; display: block; }
.upd-pill small { color: var(--ink-2); font-size: 12px; }
.upd-notes { background: var(--chip); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.upd-notes strong { display: block; margin-bottom: 6px; }
.upd-notes ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-weight: 500; }
.upd-notes li { margin: 3px 0; }
.upd-bar { height: 8px; border-radius: 999px; background: var(--chip-2); overflow: hidden; }
.upd-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.upd-label { color: var(--ink-2); font-size: 12.5px; font-weight: 500; margin: 8px 0 0; }

/* Écran d'aide au premier import */
.guide-intro { margin: 0 0 18px; max-width: 760px; }
.guide-steps { display: flex; flex-direction: column; gap: 18px; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; }
.guide-step > div { flex: 1; }
.guide-step strong { display: block; font-size: 15px; margin-bottom: 2px; }
.guide-step p { color: var(--ink-2); font-weight: 500; margin: 0 0 10px; max-width: 700px; }
.guide-num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 22px; border-radius: 12px;
  border: 2px dashed var(--border); background: var(--chip); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 24px; height: 24px; color: var(--accent); flex: none; }
.dropzone small { display: block; color: var(--ink-2); font-size: 12.5px; }

/* Partage d'une carte */
.share-wrap { background: var(--chip-2); border-radius: 12px; padding: 12px; display: grid; place-items: center; min-height: 220px; }
.share-wrap img { max-height: 54vh; border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.share-loading { color: var(--ink-2); font-weight: 500; }

/* Prix eBay dans la fiche carte */
.price-box { background: var(--chip); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.price-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.price-main { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.1; display: flex; align-items: baseline; gap: 8px; }
.price-tag { font-family: var(--body); font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 2px 7px; }
.price-range { color: var(--ink-2); font-weight: 500; font-size: 12.5px; margin: 2px 0 0; }
.price-aff { color: var(--zero); font-size: 11px; margin: 10px 0 0; line-height: 1.35; }

/* Catalogue des checklists */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.cat-card { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--r-block); padding: 10px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; }
.cat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.cat-img { position: relative; border-radius: 10px; overflow: hidden; background: var(--chip-2); aspect-ratio: 16 / 9; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-flag { position: absolute; top: 8px; left: 8px; border-radius: 20px; font-size: 11px; font-weight: 700; padding: 2px 9px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.cat-flag.new { background: var(--brick); color: #fff; }
.cat-flag.upd { background: var(--amber); color: #fff; }
.cat-flag.done { background: var(--ink); color: #fff; }
.cat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 2px; }
.cat-info strong { font-family: var(--display); font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-info .muted { font-size: 12.5px; }
.cat-actions { display: flex; gap: 6px; margin-top: auto; }
.cat-actions .btn:first-child { flex: 1; justify-content: center; }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.cat-ask { text-align: center; margin: 22px 0 0; font-size: 13px; }
.cat-ask .link { font-size: 13px; color: var(--ink); text-decoration: underline; }

/* Version web : écran de connexion avec email et mot de passe */
.login-cloud { margin-top: 10vh; padding: 0 16px; }
.login-cloud .login-logo { height: 44px; width: auto; align-self: center; margin-bottom: 4px; }
.login-cloud .subtitle { text-align: center; margin: 0 0 4px; }
.login-cloud .input { font-size: 16px; letter-spacing: normal; text-align: left; padding: 0 14px; }
.login-info { color: var(--ink); font-weight: 500; margin: 0; }
.login-info:empty, .login-cloud .login-err:empty { display: none; }
.login-links { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 4px; }
