/* ============================================================================
   Kanexio Dashboard — layout + composants applicatifs
   ============================================================================ */

.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }

/* ---- Pull-to-refresh (tactile mobile + molette bureau) ---- */
.pull-refresh { position: fixed; top: -40px; left: 50%; margin-left: -17px; width: 34px; height: 34px;
  border-radius: 50%; background: var(--card); border: 1px solid var(--border-2); display: flex;
  align-items: center; justify-content: center; z-index: 80; opacity: 0; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.pull-refresh i { font-size: 17px; color: var(--muted); transition: color .15s; }
.pull-refresh.ready i { color: var(--cyan); }
.pull-refresh.spin i { animation: spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pull-refresh.spin i { animation: none; } }

/* ---- Sidebar ---- */
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 22px 16px; border-right: 1px solid var(--border); background: rgba(10,10,18,.6); backdrop-filter: blur(8px); }
.side .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.side .brand img { height: 26px; }
.side .brand .brand-meta { display: flex; align-items: center; gap: 8px; }
.side .brand .tag { font-family: var(--display); font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; padding: 3px 7px; border: 1px solid var(--border-2); border-radius: 999px; }
/* Marque cliente (tenant non-Kanexio, ex. PEBify) : logo plus large, mention
   "Dashboard" + crédit Kanexio empilés SOUS le logo plutôt qu'à côté. */
.side .brand.brand--stacked { flex-direction: column; align-items: flex-start; gap: 10px; }
.side .brand.brand--stacked img { height: 34px; }
.side .brand.brand--stacked .brand-meta { flex-direction: column; align-items: flex-start; gap: 5px; }
.side .brand .brand-credit { font-size: 10.5px; font-weight: 500; color: var(--faint); text-decoration: none; transition: color .14s; }
.side .brand .brand-credit:hover { color: var(--cyan); text-decoration: underline; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 14.5px; transition: background .14s, color .14s; }
.nav a i { font-size: 19px; }
.nav a:hover { background: var(--card-2); color: var(--text); }
.nav a.active { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(0,228,255,.18); }
.nav a.active i { color: var(--cyan); }
.nav a .nav-help { margin-left: auto; color: var(--faint); font-size: 13px; opacity: .78; }
.nav a:hover .nav-help, .nav a:focus-visible .nav-help { color: var(--cyan); opacity: 1; }
.nav a .nav-help + .navcount { margin-left: 0; }
.navcount { display: none; margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #FF5468; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.navcount.show { display: inline-block; }
.nav .sep { height: 1px; background: var(--border); margin: 12px 8px; }
.side .spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 11px; padding: 10px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); }
.userbox .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #04101F; font-family: var(--display); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.userbox .meta { min-width: 0; flex: 1; }
.userbox .meta b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .meta span { font-size: 11.5px; color: var(--faint); }
.userbox .logout { color: var(--faint); background: none; border: none; padding: 6px; border-radius: 8px; }
.userbox .logout:hover { color: var(--red); background: var(--card-2); }

/* ---- Main ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 30px 6px; }
.topbar h1 { font-size: 25px; }
.topbar .crumb { color: var(--faint); font-size: 13px; margin-bottom: 3px; font-weight: 500; }
.topbar .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-heading { min-width: 0; }
.page-title-row { display: flex; align-items: center; gap: 3px; }
.page-title-row h1 { min-width: 0; }
.page-help { flex: none; }
/* Logo client dans la topbar : redondant avec celui de la sidebar sur desktop
   (toujours visible), utile uniquement quand la sidebar passe hors-écran (mobile). */
.topbar-logo { display: none; height: 24px; width: auto; flex-shrink: 0; }
.menu-toggle { display: none; }
.view { padding: 18px 30px 40px; }
.hidden { display: none !important; }

/* ---- KPI ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); position: relative; overflow: hidden; }
.kpi .lab { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .lab > i { font-size: 15px; color: var(--faint); }
.kpi .val { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.02em; margin-top: 8px; line-height: 1; }
.kpi .val.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi .val.danger { color: var(--red); }
.kpi .val.green { color: var(--green); }
.kpi .sub { color: var(--faint); font-size: 12px; margin-top: 6px; }

/* ---- Toolbar / filtres ---- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 17px; }
.search input { height: 42px; padding-left: 40px; }
.toolbar select.input { height: 42px; width: auto; min-width: 130px; }
.seg { display: inline-flex; background: var(--bg-elev); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { height: 34px; padding: 0 13px; border: none; background: none; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 13px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.seg button i { font-size: 16px; }
.seg button .seg-help { font-size: 12px; color: var(--faint); }
.seg button:hover .seg-help, .seg button:focus-visible .seg-help { color: var(--cyan); }

/* ---- Table ---- */
.tablecard { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.sorthead { display: inline-flex; align-items: center; gap: 3px; }
.sortbtn { appearance: none; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; padding: 2px; margin: -2px 0; border-radius: 5px; white-space: nowrap; }
.sortbtn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.018); }
.tbl .who b { font-weight: 600; display: block; }
.tbl .who span { color: var(--faint); font-size: 12.5px; }
.tbl .msg-prev { color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .when { color: var(--faint); font-size: 13px; white-space: nowrap; }
.miniav { width: 26px; height: 26px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border-2); display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; font-family: var(--display); color: var(--muted); }
.empty { padding: 64px 20px; text-align: center; color: var(--faint); }
.empty i { font-size: 34px; display: block; margin-bottom: 10px; opacity: .6; }

/* ── Inbox façon Gmail : sélection multiple + actions groupées ── */
.tbl-inbox .cbcol { width: 44px; padding-left: 14px; padding-right: 0; }
.tbl-inbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; vertical-align: middle; margin: 0; }
.tbl-inbox tbody tr.selected { background: rgba(28,115,255,.10); }
.tbl-inbox tbody tr.selected:hover { background: rgba(28,115,255,.15); }
/* Différenciation lu/non-lu (façon Gmail) : pastille + fond teinté + poids de police. */
.tbl-inbox tbody tr.unread { background: rgba(0,228,255,.04); }
.tbl-inbox tbody tr.unread:hover { background: rgba(0,228,255,.075); }
.tbl-inbox .who b.is-unread { font-weight: 800; color: var(--text); }
.tbl-inbox .who b:not(.is-unread) { font-weight: 500; color: var(--muted); }
.unreaddot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(0,228,255,.16); }
/* La sélection (checkbox) doit rester visuellement prioritaire sur la teinte "non-lu". */
.tbl-inbox tbody tr.selected.unread { background: rgba(28,115,255,.10); }
.tbl-inbox tbody tr.selected.unread:hover { background: rgba(28,115,255,.15); }
.bulkbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 16px; background: var(--grad-soft); border: 1px solid var(--border-2); border-radius: var(--radius-sm); animation: bulkin .14s ease; }
.bulkbar.hidden { display: none; }
.bulkcount { font-weight: 700; font-size: 14px; color: var(--text); }
.bulkactions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.btn-danger { color: #FFC2CA; border-color: rgba(255,84,104,.4) !important; }
.btn-danger:hover { background: rgba(255,84,104,.12); }
@keyframes bulkin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Référencement (Search Console) ── */
.gsc-meta { color: var(--faint); font-size: 13px; margin-left: auto; }
.gsc-kw b { font-weight: 600; }
.gsc-pos { display: inline-block; min-width: 38px; text-align: center; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.gsc-pos.top3 { color: var(--green); background: rgba(43,217,139,.12); }
.gsc-pos.top10 { color: var(--amber); background: rgba(255,176,46,.12); }
.gsc-pos.top20 { color: var(--muted); background: var(--card-2); }

/* ── Modale détail réservation ── */
.bkmodal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.55); }
.bkmodal.hidden { display: none; }
.bkcard { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; animation: bulkin .15s ease; }
.bkhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.bkhead h3 { font-size: 17px; margin: 0; font-family: var(--display); }
.bkhead .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.bkbody { padding: 16px 20px; }
.bkbody dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 14px; align-items: baseline; }
.bkbody dl.kv dt { color: var(--faint); white-space: nowrap; }
.bkbody dl.kv dd { margin: 0; text-align: right; }
.bkbody dl.kv dd.bkmsg { grid-column: 1 / -1; text-align: left; color: var(--muted); white-space: pre-wrap; margin-top: -4px; }
.bkfoot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* ── Raccourcis clavier : curseur (instantané) + aide ── */
.tbl-inbox tbody tr.cursor { box-shadow: inset 3px 0 0 var(--blue); }
.tbl-inbox tbody tr.cursor:not(.selected) { background: rgba(28,115,255,.06); }
.kbdhelp { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.5); }
.kbdhelp.hidden { display: none; }
.kbdcard { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; animation: kbdin .15s cubic-bezier(0.23, 1, 0.32, 1); }
.kbdhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.kbdcard h3 { font-size: 16px; margin: 0; font-family: var(--display); }
.kbdcard dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; margin: 0; font-size: 14px; align-items: center; }
.kbdcard dt { display: flex; gap: 5px; }
.kbdcard dd { margin: 0; color: var(--muted); }
kbd { display: inline-block; min-width: 22px; text-align: center; padding: 2px 7px; font-family: var(--display); font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--card-2); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; }
@keyframes kbdin { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kbdcard, .bkcard, .bulkbar { animation: none; } }

/* en-têtes de tableau triables */
.tbl th.sortable { cursor: pointer; user-select: none; transition: color .12s; white-space: nowrap; }
.tbl th.sortable:hover { color: var(--muted); }
.tbl th.sortable.sorted { color: var(--text); }
.tbl th.sortable:focus-visible { outline: none; color: var(--text); box-shadow: inset 0 -2px 0 var(--blue); }

/* ---- Kanban ---- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 270px; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.kcol h3 { font-size: 13px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); }
.kcol h3 .n { font-size: 12px; color: var(--faint); background: var(--card-2); padding: 1px 8px; border-radius: 999px; }
.kcard { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 9px; cursor: pointer; transition: border-color .14s, transform .12s; }
.kcard:hover { border-color: var(--border-2); transform: translateY(-1px); }
.kcard b { font-size: 14px; font-weight: 600; }
.kcard .em { color: var(--faint); font-size: 12.5px; margin: 3px 0 8px; }

/* ---- Drawer (détail) ---- */
.scrim { position: fixed; inset: 0; background: rgba(4,4,10,.6); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100dvh; width: 460px; max-width: 94vw; background: var(--bg-elev); border-left: 1px solid var(--border-2); box-shadow: -30px 0 80px -30px rgba(0,0,0,.8); transform: translateX(100%); visibility: hidden; transition: transform .26s cubic-bezier(.4,0,.2,1), visibility 0s .26s; z-index: 61; display: flex; flex-direction: column; }
.drawer.open { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.4,0,.2,1), visibility 0s; }
.drawer .dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 16px; border-bottom: 1px solid var(--border); }
.drawer .dhead h2 { font-size: 20px; }
.drawer .dhead .em { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.drawer .dbody { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 20px; }
.dsec h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 10px; font-family: var(--display); }
.contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.msgbox { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-size: 14px; color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { color: var(--muted); word-break: break-word; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; }
.note .nmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.note .nmeta b { font-size: 12.5px; font-weight: 600; }
.note .nmeta time { color: var(--faint); font-size: 11.5px; }
.note p { font-size: 13.5px; color: var(--text); white-space: pre-wrap; }
.note .del { color: var(--faint); background: none; border: none; padding: 2px 5px; border-radius: 6px; }
.note .del:hover { color: var(--red); }
.noteform { display: flex; gap: 8px; }
.noteform textarea { flex: 1; resize: vertical; min-height: 42px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border-2); color: var(--text); font-family: var(--body); font-size: 14px; }
.noteform textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }

/* ---- Analytics ---- */
.charts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 22px; }
.charts > .card { min-width: 0; }
.chartcard { padding: 18px 20px; }
.chartcard > div[style*="position:relative"] { min-width: 0; max-width: 100%; overflow: hidden; }
.chartcard canvas { max-width: 100% !important; }
.chartcard h3 { font-size: 15px; margin-bottom: 4px; }
.chartcard .cap { color: var(--faint); font-size: 12.5px; margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- Tunnel de réservation PEBify (GA4, lecture seule) ---- */
.booking-funnel {
  position: relative;
  min-width: 0;
  margin-bottom: 22px;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% -20%, rgba(0,228,255,.10), transparent 38%),
    linear-gradient(145deg, rgba(28,115,255,.055), transparent 44%),
    var(--card);
  border: 1px solid var(--border);
}
.booking-funnel::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue) 56%, transparent);
  opacity: .75;
}
.booking-funnel__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.booking-funnel__eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.booking-funnel__head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.1;
  letter-spacing: -.025em;
}
.booking-funnel__intro {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}
.booking-funnel__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.booking-funnel__refresh:disabled { cursor: wait; opacity: .62; }
.booking-funnel__body { min-width: 0; }
.booking-funnel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(43,217,139,.18);
  border-radius: 10px;
  background: rgba(43,217,139,.055);
}
.booking-funnel__summary-label {
  color: var(--muted);
  font-size: 12.5px;
}
.booking-funnel__summary strong {
  color: var(--green);
  font-family: var(--display);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.booking-funnel__stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.booking-funnel__stage {
  position: relative;
  display: flex;
  gap: 11px;
  min-width: 0;
  min-height: 126px;
  padding: 15px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(255,255,255,.025), transparent 55%), var(--bg-elev);
}
.booking-funnel__stage:not(:last-child)::after {
  content: '';
  position: absolute;
  z-index: 1;
  top: 31px;
  right: -11px;
  width: 11px;
  height: 1px;
  background: linear-gradient(90deg, var(--border-2), var(--cyan));
}
.booking-funnel__step {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(0,228,255,.26);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(0,228,255,.065);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
}
.booking-funnel__stage-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.booking-funnel__stage-label {
  min-height: 32px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}
.booking-funnel__count {
  margin-top: 8px;
  color: var(--text);
  font-family: var(--display);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.booking-funnel__stage:last-child .booking-funnel__count { color: var(--green); }
.booking-funnel__rate {
  margin-top: 7px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.35;
}
.booking-funnel__diagnostics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.booking-funnel__context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 10px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 12px;
}
.booking-funnel__context-group {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255,255,255,.012);
}
.booking-funnel__context-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--display);
  font-weight: 600;
}
.booking-funnel__context-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.booking-funnel__context-items > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
}
.booking-funnel__context i { color: var(--cyan); }
.booking-funnel__context strong { color: var(--muted); font-variant-numeric: tabular-nums; }
.booking-funnel__diagnostics span,
.booking-funnel__quiet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.018);
  font-size: 12px;
}
.booking-funnel__diagnostics i { color: var(--amber); }
.booking-funnel__diagnostics strong { color: var(--text); font-variant-numeric: tabular-nums; }
.booking-funnel__quiet { margin-top: 12px; color: var(--green); border-color: rgba(43,217,139,.16); }
.booking-funnel__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 11.5px;
}
.booking-funnel__meta span { display: inline-flex; align-items: center; gap: 5px; }
.booking-funnel__meta i { color: var(--muted); font-size: 13px; }
.booking-funnel__message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 118px;
  padding: 24px;
  border: 1px dashed var(--border-2);
  border-radius: 12px;
  background: rgba(255,255,255,.012);
}
.booking-funnel__message > i { margin-top: 1px; color: var(--faint); font-size: 23px; }
.booking-funnel__message--error > i { color: var(--amber); }
.booking-funnel__message strong { display: block; margin-bottom: 4px; font-family: var(--display); font-size: 14px; }
.booking-funnel__message p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.booking-funnel__loading {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.booking-funnel__loading .skel { display: block; min-height: 126px; }

/* ---- Statistiques ---- */
#view-statistics { min-width: 0; }
.st-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; margin-bottom: 16px; }
.st-range { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.st-range button { flex: 0 0 auto; }
.st-custom { flex: 0 1 auto; flex-wrap: wrap; }
.st-range-error { flex: 1 0 100%; margin: 0; color: var(--red); font-size: 12px; line-height: 1.4; }
.st-sourcebar { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.st-source, .st-freshness { display: inline-flex; align-items: center; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 11.5px; font-family: var(--display); font-weight: 600; white-space: nowrap; }
.st-source { gap: 6px; }
.st-source i { flex: 0 0 auto; color: var(--cyan); font-size: 14px; }
.st-source span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.st-freshness { color: var(--faint); font-variant-numeric: tabular-nums; }
.st-refresh { flex: 0 0 auto; width: 34px; height: 34px; }

.st-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; margin-bottom: 16px; }
.st-kpi { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 142px; padding: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(28,115,255,.075), transparent 45%), var(--card); box-shadow: var(--shadow); }
.st-kpi::after { content: ''; position: absolute; right: -28px; bottom: -46px; width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle, rgba(23,211,220,.085), transparent 68%); pointer-events: none; }
.st-kpi-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 11px; font-family: var(--display); font-weight: 700; letter-spacing: .045em; line-height: 1.3; text-transform: uppercase; }
.st-kpi-label > i { flex: 0 0 auto; color: var(--cyan); font-size: 15px; }
.st-kpi-label span { min-width: 0; white-space: normal; }
.st-kpi-value { position: relative; z-index: 1; display: block; min-width: 0; margin-top: 12px; overflow: hidden; color: var(--text); font-family: var(--display); font-size: clamp(27px, 2.1vw, 38px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.st-kpi-sub { position: relative; z-index: 1; display: block; min-width: 0; margin-top: auto; padding-top: 10px; color: var(--faint); font-size: 11.5px; line-height: 1.35; white-space: normal; }

.st-panel { min-width: 0; overflow: hidden; }
.st-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-width: 0; padding: 18px 20px 14px; }
.st-panel-head > div { min-width: 0; }
.st-panel-head h3 { min-width: 0; margin: 0 0 4px; font-size: 15px; line-height: 1.35; }
.st-panel-cap { color: var(--faint); font-size: 12.5px; line-height: 1.45; }
.st-panel-meta { flex: 0 0 auto; max-width: 50%; overflow: hidden; color: var(--muted); font-size: 11.5px; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.45; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.st-chart-wrap { position: relative; min-width: 0; width: 100%; height: 320px; padding: 0 18px; overflow: hidden; }
.st-chart-wrap canvas { display: block; max-width: 100% !important; max-height: 100% !important; }
.st-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; min-width: 0; padding: 12px 20px 17px; color: var(--muted); font-size: 12px; }
.st-legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.st-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.st-dot-blue { background: var(--blue); }
.st-dot-cyan { background: var(--cyan); }
.st-dot-violet { background: #8B7CFF; }
.st-chart-access { padding: 0 20px 18px; }
.st-chart-access > .btn { margin-top: 1px; }
.st-chart-access .st-tablewrap { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; }
.st-chart-table { min-width: 520px; }

.st-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; min-width: 0; margin-top: 16px; }
.st-dimension { min-height: 286px; }
.st-tablewrap { min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior: contain; }
.st-table { width: 100%; min-width: 0; table-layout: fixed; }
.st-table th, .st-table td { padding-left: 16px; padding-right: 16px; }
.st-table th:first-child, .st-table td:first-child { width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-table th:not(:first-child), .st-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
.st-num { text-align: right; }
.st-placeholder td { height: 116px; color: var(--faint); text-align: center; white-space: normal !important; }
.st-keywords { margin-top: 16px; }
.st-keyword-table { min-width: 640px; }
.st-keyword-table th:first-child, .st-keyword-table td:first-child { width: 44%; }
.st-keyword-table tbody tr { cursor: default; }

/* ---- Misc ---- */
.bl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.bl-row:last-child { border-bottom: none; }
.bl-row code { font-family: var(--body); font-size: 14px; }
.row-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.loading { display: grid; place-items: center; min-height: 60dvh; color: var(--faint); }
.spin { width: 30px; height: 30px; border: 3px solid var(--border-2); border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  /* visibility (pas juste transform) : garantit qu'aucun fragment du panneau
     fermé (ex. le badge "Dashboard") ne puisse rester peint à l'écran sur les
     navigateurs mobiles ; le délai de transition évite de couper l'anim d'ouverture/fermeture. */
  .side { position: fixed; left: 0; top: 0; z-index: 70; width: 248px; transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility 0s .2s; }
  .side.open { transform: none; visibility: visible; transition: transform .2s, visibility 0s; }
  .charts { grid-template-columns: 1fr; }
  .view, .topbar { padding-left: 18px; padding-right: 18px; }
  .topbar { flex-wrap: wrap; align-items: flex-start; }
  .topbar .left { width: 100%; }
  /* Liste/Pipeline reste disponible sur mobile, sur une seconde ligne plutôt
     que d'être supprimé avec toute la fonctionnalité. */
  #topActions { display: flex; width: 100%; }
  #topActions.hidden { display: none !important; }
  #topActions .seg { width: 100%; }
  #topActions .seg button { flex: 1 1 50%; justify-content: center; }
  .menu-toggle { display: inline-flex; }
  .topbar-logo { display: block; }
  .tablecard { overflow-x: auto; }
  .tbl { min-width: 600px; }
  .st-dimensions { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .booking-funnel__stages,
  .booking-funnel__loading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-funnel__stage:not(:last-child)::after { display: none; }
}

@media (min-width: 2200px) {
  .st-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Vue d'ensemble Sites (portefeuille multi-sites) ── */
.sites-portfolio { padding: 18px 20px; margin-bottom: 16px; }
.sites-portfolio h3 { font-size: 15px; margin-bottom: 4px; }
.sites-portfolio .cap { color: var(--faint); font-size: 12.5px; margin-bottom: 14px; }

.delta { font-size: 11.5px; font-weight: 700; font-family: var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.kpi .sub .delta { font-size: 12px; }

.sitegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.sitecard { display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 42%), var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .18s ease, border-color .18s ease; }
.sitecard:hover { transform: translateY(-2px); border-color: var(--border-2); }
.sc-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.sc-ico { position: relative; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; border: 1px solid var(--border-2); background: var(--card-2); display: grid; place-items: center; overflow: hidden; }
.sc-ico img { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; }
.sc-mono { font-family: var(--display); font-weight: 800; font-size: 15px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sc-ident { min-width: 0; flex: 1; }
.sc-ident h3 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-ident a { display: inline-flex; align-items: center; gap: 3px; color: var(--faint); font-size: 12.5px; transition: color .14s; }
.sc-ident a:hover { color: var(--cyan); }
.sc-ident a i { font-size: 13px; }
.sc-ring { --v: 0; position: relative; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--cyan) calc(var(--v) * 3.6deg), var(--card-2) 0); display: grid; place-items: center; flex-shrink: 0; }
.sc-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.sc-ring b { position: relative; font-family: var(--display); font-size: 14px; font-weight: 700; }
.sc-spark { height: 60px; padding: 0 2px; }
.sc-spark svg { width: 100%; height: 100%; display: block; }
.sc-spark-empty { height: 100%; display: grid; place-items: center; color: var(--faint); font-size: 12px; padding: 0 16px; text-align: center; }
.sc-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sc-metrics .m { background: var(--card); padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sc-metrics .m span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-family: var(--display); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-metrics .m b { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--border-2); font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip i { font-size: 13px; color: var(--faint); }
.chip b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.sc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px 11px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.sc-srcs { display: flex; gap: 11px; }
.sc-src { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; font-family: var(--display); color: var(--faint); cursor: default; }
.sc-src i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sc-src.ok i { background: var(--green); box-shadow: 0 0 6px rgba(43,217,139,.7); }
.sc-src.ko i { background: var(--red); box-shadow: 0 0 6px rgba(255,84,104,.7); }
.sc-src.ko { color: var(--red); }
.sc-detail { border-top: 1px solid var(--border); background: var(--bg-elev); }
.sd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px 18px; padding: 14px 18px; }
.sd-stat span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-family: var(--display); font-weight: 600; margin-bottom: 2px; }
.sd-stat b { font-family: var(--display); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-detail .tbl th, .sc-detail .tbl td { padding: 9px 16px; font-size: 13px; }
.sc-detail .tbl td:last-child { white-space: nowrap; }
.sc-detail .tbl tbody tr { cursor: default; }
.sd-note { padding: 10px 18px 14px; color: var(--faint); font-size: 12px; }

#sitesOverview .tablecard { overflow-x: auto; }
.tbl-sites tbody tr { cursor: default; }
.tbl-sites tbody tr.site-row { cursor: pointer; }
.tbl-sites tbody tr.site-row:focus-visible { outline: none; box-shadow: inset 3px 0 0 var(--blue); }
.tbl-sites td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-sites .who-flex { display: flex; align-items: center; gap: 8px; }
.rowchev { color: var(--faint); display: inline-grid; place-items: center; width: 24px; flex-shrink: 0; }
.sc-detail { white-space: normal; cursor: default; }

/* Info-bulles « i » : icône déclencheuse + boîte globale en position fixed
   (jamais rognée par les overflow des cartes / tableaux / KPIs). */
.info { appearance: none; display: inline-flex; align-items: center; margin-left: 5px; padding: 0; border: 0; background: transparent; color: var(--faint); font: inherit; line-height: 1; cursor: help; vertical-align: middle; touch-action: manipulation; }
.info:hover, .info:focus-visible { color: var(--cyan); }
.info:focus-visible { outline: none; border-radius: 50%; box-shadow: var(--ring); }
.info i { font-size: 13px; }
.chip[data-tip], .sc-src[data-tip], .sc-ring[data-tip] { cursor: help; }
.tipbox { position: fixed; z-index: 100; max-width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto; overscroll-behavior: contain; background: #1D1D2B; color: var(--text); border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 11px; font-size: 12.5px; font-weight: 500; line-height: 1.5; font-family: var(--body); text-transform: none; letter-spacing: normal; box-shadow: 0 14px 40px -12px rgba(0,0,0,.7); pointer-events: auto; user-select: text; }

/* Chips Semrush cliquables + modale détail (listes backlinks / domaines / mots-clés) */
button.chip { font-family: var(--body); }
.chip-btn { cursor: pointer; transition: border-color .14s, background .14s, color .14s; }
.chip-btn:hover { border-color: rgba(28,115,255,.55); background: rgba(28,115,255,.10); color: var(--text); }
.chip-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.sd-chips { border-bottom: 1px solid var(--border); }
.sicard { max-width: 840px; }
.sicard .bkhead h3 { display: flex; align-items: center; gap: 9px; }
.sicard .bkhead h3 i { color: var(--cyan); font-size: 19px; }
.sibody { max-height: 62vh; overflow: auto; }
.sibody .tbl th { position: sticky; top: 0; z-index: 1; }
.sibody .tbl tbody tr { cursor: default; }
.sibody .empty { padding: 44px 20px; }
.sifoot { display: flex; align-items: center; gap: 7px; justify-content: flex-start; color: var(--faint); font-size: 12px; }
.si-url { display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; color: var(--muted); }
.si-url:hover { color: var(--cyan); }
.si-text { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Période personnalisée (dates du / au + Appliquer) */
.customrange { display: flex; align-items: center; gap: 8px; }
.customrange .input { width: auto; height: 42px; color-scheme: dark; }
.customrange .arrow { color: var(--faint); }

/* Skeleton loading (shimmer) */
.skel { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.045) 50%, transparent 70%); animation: shine 1.4s infinite; }
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-card { height: 300px; }
.spin-ico { display: inline-block; animation: spin .8s linear infinite; }

@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } .sitecard { transition: none; } .sitecard:hover { transform: none; } .spin-ico { animation: none; } }
@media (max-width: 640px) {
  .sitegrid { grid-template-columns: 1fr; }
  .sc-metrics { grid-template-columns: repeat(2, 1fr); }
  .resarange, .sitesrange, .gscrange, .st-range {
    display: flex; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; scrollbar-width: none; touch-action: pan-x;
  }
  .resarange::-webkit-scrollbar, .sitesrange::-webkit-scrollbar, .gscrange::-webkit-scrollbar, .st-range::-webkit-scrollbar { display: none; }
  .resarange button, .sitesrange button, .gscrange button, .st-range button { flex: 0 0 auto; scroll-snap-align: start; }
  .resabasis { display: flex; width: 100%; min-width: 0; }
  .resabasis button { flex: 1 1 50%; justify-content: center; min-width: 0; white-space: normal; text-align: center; }
  .customrange { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); width: 100%; min-width: 0; }
  .customrange .input { width: 100%; min-width: 0; }
  .customrange .btn { grid-column: 1 / -1; width: 100%; }
  .customrange .st-range-error { grid-column: 1 / -1; }
  .st-toolbar { align-items: stretch; }
  .st-range { order: 1; }
  .st-custom { order: 2; }
  .st-sourcebar { order: 3; width: 100%; margin-left: 0; }
  .st-source { flex: 1 1 auto; }
  .st-freshness { flex: 0 1 auto; }
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-panel-head { flex-direction: column; gap: 6px; }
  .st-panel-meta { max-width: 100%; text-align: left; }
  .st-chart-wrap { height: 250px; padding-left: 10px; padding-right: 10px; }
  .booking-funnel { padding: 18px 16px; }
  .booking-funnel__head { flex-direction: column; gap: 14px; }
  .booking-funnel__actions { width: 100%; }
  .booking-funnel__range { flex: 1 1 auto; }
  .booking-funnel__range button { flex: 1 1 33.333%; justify-content: center; }
  .booking-funnel__summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .booking-funnel__stages,
  .booking-funnel__loading { grid-template-columns: 1fr; }
  .booking-funnel__stage { min-height: 0; }
  .booking-funnel__stage-label { min-height: 0; }
  .booking-funnel__stage:not(:last-child)::after {
    display: block;
    top: auto;
    right: auto;
    bottom: -11px;
    left: 26px;
    width: 1px;
    height: 11px;
    background: linear-gradient(180deg, var(--border-2), var(--cyan));
  }
  .booking-funnel__loading .skel { min-height: 84px; }
  .booking-funnel__context { grid-template-columns: 1fr; }
  .booking-funnel__meta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
  .st-kpis { grid-template-columns: 1fr; }
  .st-kpi { min-height: 132px; }
  .st-sourcebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .st-source { max-width: 100%; height: auto; min-height: 36px; padding-top: 7px; padding-bottom: 7px; white-space: normal; line-height: 1.35; }
  .st-source span { overflow: visible; text-overflow: clip; }
  .st-freshness { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .st-refresh { grid-column: 2; grid-row: 1; }
  .st-panel-head { padding-left: 16px; padding-right: 16px; }
  .st-legend { padding-left: 16px; padding-right: 16px; }
  .st-chart-access { padding-left: 16px; padding-right: 16px; }
  .viewtabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .viewtabs button { min-width: 0; padding-left: 6px; padding-right: 6px; justify-content: center; }
}

@media (max-width: 360px) {
  .topbar-logo { display: none; }
  .menu-toggle { flex: none; }
  .page-heading { overflow: hidden; }
  .page-title-row h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .viewtabs { min-width: 0; }
}

@media (pointer: coarse) {
  .info { position: relative; min-width: 24px; min-height: 24px; justify-content: center; margin: -4px -4px -4px 0; }
  .info::before { content: ''; position: absolute; width: 44px; height: 44px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
}

/* ── Réponse email (vertical artisan) ── */
.reply-status { display: flex; align-items: center; gap: 8px; color: #2BD98B; font-size: 13.5px; margin-bottom: 10px; }
.reply-status.muted { color: var(--muted); }
.reply-meta { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.reply-meta b { color: var(--text); }
.reply-form { display: flex; flex-direction: column; gap: 10px; }
.reply-tplrow { display: flex; gap: 8px; align-items: center; }
.reply-tplrow select { flex: 1; }
.reply-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reply-form textarea.input { resize: vertical; font-family: inherit; line-height: 1.5; min-height: 120px; }
