/* ═══════════════════════════════════════════════════════════
   ABI TOOL — Design System v6  · Apple-inspired
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:        #f5f5f7;
  --surface:   #ffffff;
  --border:    #d2d2d7;
  --border2:   #b0b0b8;

  --text1:     #1d1d1f;
  --text2:     #3a3a3c;
  --text3:     #6e6e73;
  --text4:     #98989d;

  --blue:      #0071e3;
  --blue-l:    #e8f1fd;
  --blue-d:    #0051a8;
  --red:       #ff3b30;
  --red-l:     #fff0ef;
  --green:     #34c759;
  --green-l:   #e8faf0;
  --amber:     #ff9500;
  --amber-l:   #fff5e6;

  --sb-w:      250px;
  --top-h:     56px;
  --radius:    14px;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,.10), 0 16px 48px rgba(0,0,0,.08);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text1);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Material Symbols ───────────────────────────────────── */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* ════════════════════════════════════════════════════════
   SIDEBAR — fermée par défaut, s'ouvre au burger
════════════════════════════════════════════════════════ */
.sb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.32);
  backdrop-filter: blur(4px);
  z-index: 99;
}
body.sb-open .sb-overlay { display: block; }

.sidebar {
  width: var(--sb-w);
  min-height: 100vh;
  background: #2c2c2e;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
  transform: translateX(calc(-1 * var(--sb-w)));
  transition: transform .3s cubic-bezier(.25,.46,.45,.94);
}
body.sb-open .sidebar { transform: translateX(0); }

.sb-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sb-logo-icon {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-logo-text h2 { font-size: 14px; font-weight: 700; color: #f2f2f7; line-height: 1.2; }
.sb-logo-text p  { font-size: 10px; color: #8e8e93; margin-top: 1px; }

.sb-nav { padding: 10px 12px; flex: 1; }

.sb-group { margin-bottom: 6px; }
.sb-group-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: #636366;
  padding: 10px 8px 4px;
}

.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #8e8e93;
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  border: none; background: transparent; width: 100%; text-align: left;
}
.sb-item:hover { background: rgba(255,255,255,.06); color: #f2f2f7; }
.sb-item.active { background: rgba(0,113,227,.22); color: #0a84ff; }
.sb-icon { font-size: 17px; flex-shrink: 0; }

.sb-bottom {
  padding: 10px 12px 22px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sb-footer { font-size: 10px; color: #636366; padding: 8px 8px 0; }

/* ════════════════════════════════════════════════════════
   MAIN AREA
════════════════════════════════════════════════════════ */
.main {
  margin-left: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--top-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}

/* Topbar transparente sur la page d'accueil */
body.home-hero .topbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}
body.home-hero .topbar .burger-btn,
body.home-hero .topbar .tb-home-btn,
body.home-hero .topbar .tb-date {
  color: rgba(255,255,255,.85);
}
body.home-hero .topbar .burger-btn:hover {
  background: rgba(255,255,255,.15);
}
body.home-hero .topbar .tb-sep {
  background: rgba(255,255,255,.3);
}
.burger-btn {
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: background .15s;
  flex-shrink: 0;
}
.burger-btn:hover { background: var(--bg); }
.burger-btn .material-symbols-rounded { font-size: 22px; }
.tb-left { display: flex; align-items: center; gap: 10px; }
.tb-home-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text3); font-weight: 500;
  cursor: pointer; border: none; background: none;
  padding: 4px 8px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.tb-home-btn:hover { background: var(--bg); color: var(--blue); }
.tb-home-btn .material-symbols-rounded { font-size: 16px; }
.tb-sep { color: var(--text4); font-size: 13px; }
.tb-current { font-size: 13.5px; font-weight: 600; color: var(--text1); }
.tb-right { display: flex; align-items: center; gap: 12px; }
.tb-date { font-size: 12px; color: var(--text4); }

/* ── Page / Sections ────────────────────────────────────── */
.page { padding: 28px 28px 60px; }
.page-sec { display: none; }
.page-sec.active { display: block; }

/* ── Page Header ────────────────────────────────────────── */
.ph {
  margin-bottom: 24px;
}
.ph h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 26px; font-weight: 700;
  color: var(--text1); line-height: 1.2;
  letter-spacing: -.4px;
}
.ph p  { font-size: 13px; color: var(--text3); margin-top: 5px; }
.ph-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--blue);
  cursor: pointer; margin-bottom: 10px;
  transition: opacity .15s;
}
.ph-back:hover { opacity: .7; }

/* ════════════════════════════════════════════════════════
   ACCUEIL — Bandeau hero pleine largeur
════════════════════════════════════════════════════════ */
.home-banner {
  position: relative;
  /* Pleine largeur + remonte derrière la topbar */
  margin-left: -28px;
  margin-right: -28px;
  margin-top: calc(-28px - var(--top-h));
  margin-bottom: 28px;
  height: calc(340px + var(--top-h));
  overflow: hidden;
  background: url('../images/hero-banner.jpg') center 35% / cover no-repeat;
  background-color: #111111;
}
.home-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(0,0,0,.80) 0%,
    rgba(0,0,0,.50) 45%,
    rgba(0,0,0,.10) 100%
  );
}
.home-banner-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 44px 40px;
  /* Espace pour ne pas chevaucher le contenu topbar */
  padding-top: calc(var(--top-h) + 16px);
}
.home-banner-eyebrow {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 10px;
}
.home-banner-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 52px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -2px;
  line-height: 1;
}

/* ════════════════════════════════════════════════════════
   ACCUEIL — Bento Grid
════════════════════════════════════════════════════════ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
  padding: 8px 0 32px;
}

/* Cheers Hub : sous Trade Marketing, s'étale sur 2 cols pour remplir */
.bento-cheers {
  grid-column: span 2;
}


/* Hero cell spans 2 cols × 2 rows */
.bento-cell {
  position: relative;
  border-radius: 20px;
  padding: 28px 28px 24px;
  cursor: pointer;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform .2s, box-shadow .2s;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.bento-cell:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}

.bento-hero {
  grid-column: span 2;
  grid-row: span 2;
  background: #1a1a1a;
  color: #fff;
  min-height: 300px;
}
.bento-hero .bento-label { font-size: 28px; font-weight: 700; color: #fff; }
.bento-hero .bento-desc  { font-size: 13px; color: rgba(255,255,255,.55); margin-top: 4px; }

.bento-accent-blue {
  background: #0f2d4a; /* bleu nuit profond */
  color: #fff;
}
.bento-accent-blue .bento-label { color: #fff; }
.bento-accent-blue .bento-desc  { color: rgba(255,255,255,.5); }
.bento-accent-blue .bento-icon-bg { color: rgba(255,255,255,.12); }

.bento-accent-warm {
  background: #1e3a2f; /* vert forêt profond */
  color: #fff;
}
.bento-accent-warm .bento-label { color: #fff; }
.bento-accent-warm .bento-desc  { color: rgba(255,255,255,.5); }
.bento-accent-warm .bento-icon-bg { color: rgba(255,255,255,.12); }

.bento-ext {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.bento-ext .bento-label { color: var(--text1); }
.bento-ext .bento-desc  { color: var(--text3); }
.bento-ext .bento-icon-bg { color: rgba(0,0,0,.06); }

.bento-label {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
  position: relative;
  z-index: 1;
}
.bento-desc {
  font-size: 12px;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}
.bento-icon-bg {
  position: absolute;
  bottom: -10px;
  right: -10px;
  font-size: 100px !important;
  opacity: 1;
  pointer-events: none;
  font-variation-settings: 'FILL' 1;
  line-height: 1;
}
.bento-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 20px !important;
  color: rgba(255,255,255,.6);
  transition: transform .2s;
  z-index: 1;
}
.bento-cell:hover .bento-arrow { transform: translate(3px,-3px); }

.bento-ext-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  z-index: 1;
}

/* ════════════════════════════════════════════════════════
   ACCUEIL — Hero (legacy, kept for structure)
════════════════════════════════════════════════════════ */
.hero-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 36px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.hero-tag { display: none; }
.hero-content h1 {
  font-size: 28px; font-weight: 700; color: var(--text1);
  letter-spacing: -.5px; margin-bottom: 6px;
}
.hero-content p { font-size: 13.5px; color: var(--text3); max-width: 380px; line-height: 1.6; }
.hero-illo { font-size: 56px; line-height: 1; opacity: .85; }

/* ════════════════════════════════════════════════════════
   SALES SUB-BENTO (page Sales Hub)
════════════════════════════════════════════════════════ */
.sales-bento {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
}
.bento-sales-capex     { background: #18181b; }
.bento-sales-gratuit   { background: #0f2d4a; }
.bento-sales-litigieux { background: #2e1010; }
.bento-sales-pd        { background: #062926; }

.bento-sales-capex .bento-label,
.bento-sales-gratuit .bento-label,
.bento-sales-litigieux .bento-label,
.bento-sales-pd .bento-label { color: #fff; }

.bento-sales-capex .bento-desc,
.bento-sales-gratuit .bento-desc,
.bento-sales-litigieux .bento-desc,
.bento-sales-pd .bento-desc { color: rgba(255,255,255,.5); }

.bento-sales-capex .bento-icon-bg,
.bento-sales-gratuit .bento-icon-bg,
.bento-sales-litigieux .bento-icon-bg,
.bento-sales-pd .bento-icon-bg { color: rgba(255,255,255,.1); }

/* ════════════════════════════════════════════════════════
   TILES GRID
════════════════════════════════════════════════════════ */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 14px;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.tile {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  text-decoration: none;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.tile-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tile-body { flex: 1; }
.tile-label { font-size: 15px; font-weight: 700; color: var(--text1); }
.tile-desc  { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.tile-arrow { color: var(--text4); font-size: 18px; transition: transform .18s; }
.tile:hover .tile-arrow { transform: translateX(4px); color: var(--blue); }

/* ── Shortcuts ──────────────────────────────────────────── */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.shortcut {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  transition: box-shadow .15s, border-color .15s;
  text-align: center;
}
.shortcut:hover { box-shadow: var(--shadow); border-color: var(--blue); color: var(--blue); }
.shortcut-ico { font-size: 26px; }

/* ════════════════════════════════════════════════════════
   CARDS (formulaires)
════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
  overflow: hidden;
}
.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Bleed jusqu'aux bords de la carte */
  margin: -22px -24px 20px;
  padding: 14px 24px;
  background: #18181b;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.card-title {
  display: flex; align-items: center; gap: 9px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 13px; font-weight: 600;
  color: #f4f4f5;
  letter-spacing: .01em;
}
.card-ico {
  font-size: 17px;
  color: rgba(255,255,255,.55) !important;
  font-variation-settings: 'FILL' 1;
}

/* ── Form Grid ──────────────────────────────────────────── */
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 18px;
}
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg.s2 { grid-column: span 2; }
.fg.s3 { grid-column: span 3; }

label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .02em;
}
input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text1);
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
input[readonly] {
  background: #f8fafc;
  color: var(--text3);
  cursor: default;
}
input[readonly]:focus { border-color: var(--border2); box-shadow: none; }
select { cursor: pointer; }

/* ════════════════════════════════════════════════════════
   PRODUCT TABLE
════════════════════════════════════════════════════════ */
.tbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tsearch {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.tsearch input {
  padding-left: 34px;
  font-size: 12.5px;
}
.tfbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  font-size: 12px; font-weight: 600; color: var(--text2);
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.tfbtn:hover, .tfbtn.on { border-color: var(--blue); color: var(--blue); }
.ttotals {
  display: flex; gap: 14px;
  font-size: 12px; color: var(--text3);
}
.ttotals strong { color: var(--text1); }

.tbl-wrap {
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
thead th {
  background: #f8fafc;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody tr.hidden-row { display: none; }
td {
  padding: 7px 12px;
  color: var(--text2);
}
td input[type="number"],
td input[type="text"],
td select {
  height: 32px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 6px;
  width: 100%;
}

/* ── PDV table ──────────────────────────────────────────── */
.pdv-wrap { overflow-x: auto; margin-bottom: 12px; }
.pdv-wrap table { min-width: 540px; }
.btn-addrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: 12.5px; font-weight: 600;
  color: var(--blue);
  background: var(--blue-l);
  border: 1.5px dashed #93c5fd;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.btn-addrow:hover { background: #bfdbfe; }

.del-row {
  background: none; border: none; cursor: pointer;
  color: var(--text4); padding: 4px;
  border-radius: 4px; font-size: 14px; line-height: 1;
}
.del-row:hover { color: var(--red); }

/* ════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════ */
.actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px;
  font-size: 13px; font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .18s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-d), var(--blue));
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af, var(--blue-d));
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text2);
  border: 1.5px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ════════════════════════════════════════════════════════
   BADGES
════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-amber { background: rgba(251,191,36,.18); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.badge-red   { background: rgba(248,113,113,.18); color: #f87171; border: 1px solid rgba(248,113,113,.3); }
.badge-cyan  { background: rgba(103,232,249,.18); color: #67e8f9; border: 1px solid rgba(103,232,249,.3); }

/* ── Note ───────────────────────────────────────────────── */
.note {
  background: var(--blue-l);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #1e40af;
  margin-bottom: 14px;
}

/* ════════════════════════════════════════════════════════
   COMING SOON
════════════════════════════════════════════════════════ */
.coming-soon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: var(--shadow);
}
.coming-soon-card h3 {
  font-size: 20px; font-weight: 800; color: var(--text1);
  margin: 14px 0 6px;
}
.coming-soon-card p { font-size: 13px; color: var(--text3); margin-bottom: 28px; }
.cs-tiles {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.cs-tile {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 500; color: var(--text2);
}

/* ════════════════════════════════════════════════════════
   ADMIN
════════════════════════════════════════════════════════ */
.atabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.atab {
  padding: 9px 20px;
  font-size: 13px; font-weight: 600; color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
}
.atab.on { color: var(--blue); border-bottom-color: var(--blue); }
.atab:hover:not(.on) { color: var(--text2); }
.apanel { display: none; }
.apanel.on { display: block; }

.admin-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-tbl thead th {
  background: #f8fafc;
  padding: 9px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.admin-tbl tbody tr { border-bottom: 1px solid var(--border); }
.admin-tbl tbody tr:last-child { border-bottom: none; }
.admin-tbl td {
  padding: 8px 14px;
  color: var(--text2);
}
.admin-tbl td[contenteditable="true"] { cursor: text; outline: none; }
.admin-tbl td[contenteditable="true"]:focus {
  background: var(--blue-l);
  box-shadow: inset 0 0 0 2px var(--blue);
  border-radius: 4px;
}

/* ════════════════════════════════════════════════════════
   TOAST
════════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text1);
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s, opacity .3s;
  z-index: 9999;
  white-space: nowrap;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ════════════════════════════════════════════════════════
   BRAND GRID (Fiches Produits / Trade Marketing)
════════════════════════════════════════════════════════ */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}
.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  text-align: center;
}
.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.brand-logo-wrap {
  width: 130px; height: 86px;
  display: flex; align-items: center; justify-content: center;
}
.brand-logo-wrap img {
  max-width: 130px; max-height: 86px;
  object-fit: contain;
}
.brand-name {
  font-size: 13px; font-weight: 600; color: var(--text1);
  letter-spacing: -.1px;
}
.brand-sub {
  font-size: 11px; color: var(--text4); margin-top: -10px;
}

/* Tuiles accueil — Apple style : icône sur fond neutre */
.home-icon-wrap {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* Grilles accueil centrées */
.home-main-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  justify-content: center;
}
.home-shortcut-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 170px));
  justify-content: center;
}
.home-shortcut-grid .home-icon-wrap { width: 52px; height: 52px; border-radius: 14px; }
.brand-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 2px dashed var(--border2);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  line-height: 1.8;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ── PDF Grid ───────────────────────────────────────────── */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.pdf-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.pdf-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Zone thumbnail — carrée grâce à aspect-ratio */
.pdf-thumb {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.pdf-img-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdf-thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.pdf-thumb-fallback .material-symbols-rounded {
  font-size: 64px; color: #dc2626;
  font-variation-settings: 'FILL' 1;
}

/* Étiquette au survol */
.pdf-hover-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  padding: 28px 10px 10px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 2;
  line-height: 1.3;
}
.pdf-thumb:hover .pdf-hover-label {
  opacity: 1;
  transform: translateY(0);
}

/* Infos sous la vignette */
.pdf-info {
  padding: 10px 13px 8px;
  display: flex; flex-direction: column;
}
.pdf-title {
  font-size: 12.5px; font-weight: 600; color: var(--text1); line-height: 1.4;
  /* Pas de clamp — on affiche tout le texte */
  word-break: break-word;
}
.pdf-meta { display: none; }
.pdf-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 48px;
  text-align: center; color: var(--text3); font-size: 13px; line-height: 1.8;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* Boutons action */
.pdf-actions {
  display: flex;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.pdf-act-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 10px 6px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text3);
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.pdf-act-btn:first-child { border-right: 1px solid var(--border); }
.pdf-act-btn:hover { background: var(--bg); color: var(--blue); }
.pdf-act-dl:hover { color: var(--green); }

/* ── PDF Modal ──────────────────────────────────────────── */
.pdf-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 24px;
}
.pdf-modal-overlay.open { display: flex; }
.pdf-modal-box {
  background: var(--surface);
  border-radius: 16px;
  width: 100%; max-width: 900px; height: 85vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.pdf-modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pdf-modal-close {
  background: none; border: none; cursor: pointer; color: var(--text3);
  display: flex; align-items: center; padding: 4px;
  border-radius: 6px; transition: background .15s;
}
.pdf-modal-close:hover { background: var(--bg); color: var(--text1); }

/* ════════════════════════════════════════════════════════
   PRINT
════════════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .actions, .tb-right { display: none !important; }
  .main { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE — Tablette & Mobile
════════════════════════════════════════════════════════ */

/* ── Tablette (≤ 900px) ─────────────────────────────── */
@media (max-width: 900px) {
  .page { padding: 20px 20px 60px; }
  .tiles-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-banner { padding: 24px 28px; }
  .hero-content h1 { font-size: 22px; }
  .brand-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .pdf-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .home-main-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 190px));
    justify-content: center;
  }
  .home-shortcut-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 150px));
    justify-content: center;
  }
  /* Bandeau tablette */
  .home-banner { height: calc(260px + var(--top-h)); margin-left: -20px; margin-right: -20px; margin-top: calc(-20px - var(--top-h)); }
  .home-banner-title { font-size: 38px; }
  .home-banner-content { padding: 0 32px 32px; padding-top: calc(var(--top-h) + 16px); }

  /* Bento tablette : 2 colonnes */
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-hero {
    grid-column: span 2;
    min-height: 200px;
  }
}

/* ── Mobile (≤ 600px) ───────────────────────────────── */
@media (max-width: 600px) {
  :root { --top-h: 52px; }

  .page { padding: 16px 14px 60px; }

  /* Topbar plus compact */
  .topbar { padding: 0 12px; }
  .tb-home-btn span:last-child { display: none; } /* cacher "Accueil" texte, garder icône */
  .tb-date { display: none; }

  /* Hero simplifié */
  .hero-banner { padding: 20px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero-content h1 { font-size: 20px; }
  .hero-content p { font-size: 12.5px; }
  .hero-illo { display: none; }

  /* Tuiles accueil : 2 colonnes centrées */
  .home-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: unset;
  }
  .home-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: unset;
  }
  .home-icon-wrap { width: 56px; height: 56px; border-radius: 14px; }
  .home-shortcut-grid .home-icon-wrap { width: 44px; height: 44px; border-radius: 11px; }

  /* Bandeau mobile */
  .home-banner { height: calc(200px + var(--top-h)); margin-left: -14px; margin-right: -14px; margin-top: calc(-16px - var(--top-h)); }
  .home-banner-content { padding: 0 20px 24px; padding-top: calc(var(--top-h) + 8px); }
  .home-banner-title { font-size: 30px; letter-spacing: -1px; }
  .home-banner-eyebrow { display: none; }

  /* Bento mobile : 1 colonne */
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .bento-hero {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 160px;
  }
  .bento-hero .bento-label { font-size: 22px; }
  .bento-cell { min-height: 130px; padding: 20px; }
  .bento-icon-bg { font-size: 70px !important; }

  /* Sales bento : colonne unique sur mobile */
  .sales-bento { grid-template-columns: 1fr; }
  .sales-bento .bento-cell { min-height: 130px; }
  /* Sales tiles : colonne unique */
  .tiles-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Formulaires */
  .fgrid { grid-template-columns: 1fr; }
  .fg.s2, .fg.s3 { grid-column: span 1; }
  .card { padding: 16px; }
  .card-hd { flex-wrap: wrap; gap: 8px; }

  /* Grilles produits / PDF */
  .brand-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pdf-grid   { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Section labels */
  .section-label { font-size: 10px; }

  /* Modal PDF : plein écran sur mobile */
  .pdf-modal-box {
    width: 100%; height: 100%;
    max-width: 100%; max-height: 100%;
    border-radius: 0;
  }
}
