/* ═══════════════════════════════════════════════════════════════════════════
   admin-charts-v9.css — Monitoring & Telemetrie premium dashboards
   Style cible: Grafana / Vercel / DataDog. Glass cards, SVG charts, dense.
   Branding: rouge Suisse #DC2626, fonts Inter / Instrument Serif / JetBrains Mono.
   Scope: classes prefixees .mon-* et .tel-* + .chart-v9-*. Zero conflit.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --mon-bg: rgba(15, 23, 42, 0.65);
  --mon-bg-deeper: rgba(10, 15, 30, 0.78);
  --mon-border: rgba(255, 255, 255, 0.08);
  --mon-border-hover: rgba(220, 38, 38, 0.35);
  --mon-text: #f1f5f9;
  --mon-text-dim: rgba(241, 245, 249, 0.65);
  --mon-text-muted: rgba(241, 245, 249, 0.42);
  --mon-accent: #DC2626;
  --mon-accent-soft: rgba(220, 38, 38, 0.14);
  --mon-accent-glow: rgba(220, 38, 38, 0.45);
  --mon-success: #10b981;
  --mon-success-soft: rgba(16, 185, 129, 0.15);
  --mon-warn: #f59e0b;
  --mon-warn-soft: rgba(245, 158, 11, 0.15);
  --mon-danger: #ef4444;
  --mon-danger-soft: rgba(239, 68, 68, 0.15);
  --mon-grid: rgba(255, 255, 255, 0.06);
  --mon-grid-strong: rgba(255, 255, 255, 0.12);
  --mon-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --mon-serif: 'Instrument Serif', 'Times New Roman', serif;
  --mon-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── PAGE WRAPPER ─────────────────────────────────────────────────────── */
.mon-wrap, .tel-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--mon-sans);
  color: var(--mon-text);
}

/* ─── PAGE HEADER ──────────────────────────────────────────────────────── */
.mon-pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(15, 23, 42, 0.55));
  border: 1px solid var(--mon-border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}
.mon-pagehead::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(800px 200px at 0% 0%, rgba(220, 38, 38, 0.18), transparent 60%);
  pointer-events: none;
}
.mon-pagehead-title {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.mon-pagehead-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.25), rgba(220, 38, 38, 0.08));
  border: 1px solid var(--mon-border-hover);
  display: grid;
  place-items: center;
  color: var(--mon-accent);
  font-size: 18px;
  box-shadow: 0 4px 18px var(--mon-accent-glow);
}
.mon-pagehead h1 {
  margin: 0;
  font-family: var(--mon-serif);
  font-weight: 400;
  font-size: 1.85rem;
  letter-spacing: -0.5px;
  line-height: 1.05;
}
.mon-pagehead-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--mon-text-dim);
  letter-spacing: 0.2px;
}
.mon-pagehead-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
}

/* ─── REFRESH BUTTON ───────────────────────────────────────────────────── */
.mon-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--mon-border-hover);
  background: linear-gradient(135deg, var(--mon-accent), #b91c1c);
  color: white;
  font-family: var(--mon-sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 20px var(--mon-accent-glow);
}
.mon-refresh:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--mon-accent-glow);
}
.mon-refresh:active { transform: translateY(0); }
.mon-refresh.is-loading i { animation: mon-spin 0.7s linear infinite; }
@keyframes mon-spin { to { transform: rotate(360deg); } }

.mon-range {
  display: inline-flex;
  background: var(--mon-bg-deeper);
  border: 1px solid var(--mon-border);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}
.mon-range button {
  background: transparent;
  border: none;
  color: var(--mon-text-dim);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: background 0.15s, color 0.15s;
}
.mon-range button:hover { color: var(--mon-text); }
.mon-range button.is-active {
  background: var(--mon-accent-soft);
  color: var(--mon-accent);
}

.mon-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--mon-success);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.mon-live-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mon-success);
  box-shadow: 0 0 10px var(--mon-success);
  animation: mon-pulse 2s ease-in-out infinite;
}
@keyframes mon-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ─── STAT CARDS GRID ─────────────────────────────────────────────────── */
.mon-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1080px) {
  .mon-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .mon-stats-grid { grid-template-columns: 1fr; }
}

.mon-stat {
  position: relative;
  padding: 18px 20px 16px;
  background: var(--mon-bg);
  border: 1px solid var(--mon-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.mon-stat:hover {
  border-color: var(--mon-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}
.mon-stat::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mon-accent), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.mon-stat:hover::after { opacity: 1; }

.mon-stat-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.mon-stat-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mon-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mon-stat-label i {
  color: var(--mon-accent);
  font-size: 0.72rem;
}
.mon-stat-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--mon-grid);
  color: var(--mon-text-dim);
}
.mon-stat-badge.is-success { background: var(--mon-success-soft); color: var(--mon-success); }
.mon-stat-badge.is-warn { background: var(--mon-warn-soft); color: var(--mon-warn); }
.mon-stat-badge.is-danger { background: var(--mon-danger-soft); color: var(--mon-danger); }
.mon-stat-badge.is-accent { background: var(--mon-accent-soft); color: var(--mon-accent); }

.mon-stat-value {
  margin-top: 12px;
  font-family: var(--mon-serif);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: -1.4px;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.78) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mon-stat-value.is-accent {
  background: linear-gradient(180deg, #fee2e2 0%, var(--mon-accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mon-stat-value.is-success { color: var(--mon-success); background: none; -webkit-background-clip: initial; }
.mon-stat-value.is-warn { color: var(--mon-warn); background: none; -webkit-background-clip: initial; }
.mon-stat-value.is-danger { color: var(--mon-danger); background: none; -webkit-background-clip: initial; }

.mon-stat-unit {
  font-family: var(--mon-mono);
  font-size: 0.85rem;
  color: var(--mon-text-muted);
  font-weight: 500;
  margin-left: 4px;
  letter-spacing: 0;
}
.mon-stat-foot {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--mon-text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mon-stat-foot .delta-up { color: var(--mon-success); }
.mon-stat-foot .delta-down { color: var(--mon-danger); }
.mon-stat-foot .delta-flat { color: var(--mon-text-muted); }

.mon-spark {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  pointer-events: none;
  opacity: 0.85;
}

/* ─── CARD CONTAINER ──────────────────────────────────────────────────── */
.mon-card {
  background: var(--mon-bg);
  border: 1px solid var(--mon-border);
  border-radius: 18px;
  padding: 20px 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
}
.mon-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.mon-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mon-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mon-text);
  letter-spacing: -0.1px;
  margin: 0;
}
.mon-card-title i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--mon-accent-soft);
  color: var(--mon-accent);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}
.mon-card-sub {
  font-size: 0.74rem;
  color: var(--mon-text-muted);
  font-weight: 500;
}
.mon-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── 2-COL LAYOUT ───────────────────────────────────────────────────── */
.mon-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.mon-grid-50 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 980px) {
  .mon-grid-2, .mon-grid-50 { grid-template-columns: 1fr; }
}

/* ─── SERVICES LIST ──────────────────────────────────────────────────── */
.mon-svc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mon-svc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--mon-bg-deeper);
  border: 1px solid var(--mon-border);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.mon-svc:hover { border-color: var(--mon-grid-strong); }
.mon-svc-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mon-svc-status.is-up {
  background: var(--mon-success);
  box-shadow: 0 0 12px var(--mon-success);
}
.mon-svc-status.is-warn {
  background: var(--mon-warn);
  box-shadow: 0 0 12px var(--mon-warn);
  animation: mon-pulse 1.5s ease-in-out infinite;
}
.mon-svc-status.is-down {
  background: var(--mon-danger);
  box-shadow: 0 0 14px var(--mon-danger);
  animation: mon-pulse 1.2s ease-in-out infinite;
}
.mon-svc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--mon-grid);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--mon-text-dim);
  flex-shrink: 0;
}
.mon-svc-body { flex: 1; min-width: 0; }
.mon-svc-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--mon-text);
  letter-spacing: -0.1px;
}
.mon-svc-meta {
  font-size: 0.72rem;
  color: var(--mon-text-muted);
  font-family: var(--mon-mono);
  margin-top: 2px;
}
.mon-svc-pill {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}
.mon-svc-pill.is-up { background: var(--mon-success-soft); color: var(--mon-success); }
.mon-svc-pill.is-warn { background: var(--mon-warn-soft); color: var(--mon-warn); }
.mon-svc-pill.is-down { background: var(--mon-danger-soft); color: var(--mon-danger); }

/* ─── CHART (SVG) ─────────────────────────────────────────────────────── */
.chart-v9 {
  width: 100%;
  height: 260px;
  display: block;
}
.chart-v9-tall { height: 320px; }
.chart-v9-short { height: 160px; }
.chart-v9 .grid-line {
  stroke: var(--mon-grid);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.chart-v9 .grid-axis {
  stroke: var(--mon-grid-strong);
  stroke-width: 1;
}
.chart-v9 .axis-label {
  fill: var(--mon-text-muted);
  font-family: var(--mon-mono);
  font-size: 10px;
  font-weight: 500;
}
.chart-v9 .line-primary {
  fill: none;
  stroke: var(--mon-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px var(--mon-accent-glow));
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: mon-draw 1.4s ease-out forwards;
}
.chart-v9 .line-success { stroke: var(--mon-success); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-v9 .line-warn { stroke: var(--mon-warn); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 3; }
.chart-v9 .line-soft { stroke: rgba(255,255,255,0.25); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 4; }
.chart-v9 .area-primary {
  fill: url(#mon-area-grad);
  opacity: 0;
  animation: mon-fade 1.6s ease-out 0.4s forwards;
}
@keyframes mon-draw { to { stroke-dashoffset: 0; } }
@keyframes mon-fade { to { opacity: 1; } }
.chart-v9 .bar { transition: opacity 0.15s; }
.chart-v9 .bar:hover { opacity: 0.78; }
.chart-v9 .bar-primary { fill: var(--mon-accent); }
.chart-v9 .bar-success { fill: var(--mon-success); }
.chart-v9 .bar-warn { fill: var(--mon-warn); }
.chart-v9 .bar-danger { fill: var(--mon-danger); }
.chart-v9 .dot-primary { fill: var(--mon-accent); }
.chart-v9 .dot-success { fill: var(--mon-success); }
.chart-v9 .dot-danger { fill: var(--mon-danger); }

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--mon-text-dim);
  margin-top: 8px;
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend-swatch {
  width: 12px; height: 3px; border-radius: 2px;
}

/* ─── HEATMAP (telemetry versions) ────────────────────────────────────── */
.mon-heat {
  display: grid;
  gap: 3px;
  font-family: var(--mon-mono);
}
.mon-heat-row {
  display: grid;
  grid-template-columns: 90px repeat(24, 1fr);
  gap: 3px;
  align-items: center;
}
.mon-heat-row-label {
  font-size: 0.72rem;
  color: var(--mon-text-dim);
  text-align: right;
  padding-right: 6px;
}
.mon-heat-cell {
  aspect-ratio: 1;
  min-height: 14px;
  border-radius: 3px;
  background: var(--mon-grid);
  transition: transform 0.12s, box-shadow 0.15s;
  cursor: pointer;
}
.mon-heat-cell:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 1px var(--mon-accent), 0 0 10px var(--mon-accent-glow);
  z-index: 2;
  position: relative;
}
.mon-heat-axis {
  display: grid;
  grid-template-columns: 90px repeat(24, 1fr);
  gap: 3px;
  font-size: 0.62rem;
  color: var(--mon-text-muted);
  margin-top: 6px;
  font-family: var(--mon-mono);
}
.mon-heat-axis div { text-align: center; }
.mon-heat-axis-spacer { grid-column: 1; }

/* ─── TABLE PREMIUM ───────────────────────────────────────────────────── */
.mon-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}
.mon-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mon-text-muted);
  background: var(--mon-grid);
  border-bottom: 1px solid var(--mon-border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mon-table thead th:first-child { border-top-left-radius: 10px; }
.mon-table thead th:last-child { border-top-right-radius: 10px; }
.mon-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--mon-border);
  color: var(--mon-text);
  vertical-align: middle;
}
.mon-table tbody tr {
  transition: background 0.15s;
}
.mon-table tbody tr:hover {
  background: var(--mon-accent-soft);
}
.mon-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--mon-accent); }
.mon-table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--mon-border);
  background: var(--mon-bg-deeper);
  max-height: 460px;
}
.mon-table .mono { font-family: var(--mon-mono); font-size: 0.78rem; }
.mon-table .dim { color: var(--mon-text-dim); }
.mon-table .tag-cmd {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--mon-grid);
  color: var(--mon-text);
  font-family: var(--mon-mono);
  font-size: 0.74rem;
  font-weight: 600;
}

/* ─── PROGRESS BAR (ranking) ─────────────────────────────────────────── */
.mon-rank {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mon-rank-row {
  display: grid;
  grid-template-columns: 22px minmax(120px, 180px) 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  transition: background 0.15s;
}
.mon-rank-row:hover { background: var(--mon-accent-soft); }
.mon-rank-pos {
  font-family: var(--mon-mono);
  font-size: 0.72rem;
  color: var(--mon-text-muted);
  font-weight: 700;
}
.mon-rank-row:nth-child(1) .mon-rank-pos,
.mon-rank-row:nth-child(2) .mon-rank-pos,
.mon-rank-row:nth-child(3) .mon-rank-pos { color: var(--mon-accent); }
.mon-rank-label {
  font-family: var(--mon-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mon-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mon-rank-track {
  height: 8px;
  border-radius: 4px;
  background: var(--mon-grid);
  overflow: hidden;
  position: relative;
}
.mon-rank-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.5), var(--mon-accent));
  border-radius: 4px;
  transform-origin: left;
  animation: mon-bar-grow 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  box-shadow: 0 0 10px var(--mon-accent-glow);
}
@keyframes mon-bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.mon-rank-val {
  font-family: var(--mon-mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
  color: var(--mon-text);
}
.mon-rank-delta {
  font-family: var(--mon-mono);
  font-size: 0.7rem;
  margin-top: 2px;
  text-align: right;
}

/* ─── STATUS BADGES ──────────────────────────────────────────────────── */
.mon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.mon-badge.ok { background: var(--mon-success-soft); color: var(--mon-success); }
.mon-badge.warn { background: var(--mon-warn-soft); color: var(--mon-warn); }
.mon-badge.down { background: var(--mon-danger-soft); color: var(--mon-danger); }
.mon-badge.info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.mon-badge.accent { background: var(--mon-accent-soft); color: var(--mon-accent); }
.mon-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.mon-badge.down .dot,
.mon-badge.warn .dot { animation: mon-pulse 1.4s ease-in-out infinite; }

/* ─── EMPTY STATE ────────────────────────────────────────────────────── */
.mon-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
  color: var(--mon-text-muted);
}
.mon-empty i {
  font-size: 2rem;
  color: var(--mon-text-muted);
  opacity: 0.55;
}
.mon-empty p { margin: 0; font-size: 0.86rem; }

/* ─── TIMELINE (activations) ────────────────────────────────────────── */
.mon-timeline {
  position: relative;
  padding: 18px 6px 26px;
  border-radius: 12px;
  background: var(--mon-bg-deeper);
  border: 1px solid var(--mon-border);
  overflow-x: auto;
}
.mon-timeline-track {
  position: relative;
  height: 56px;
  min-width: 720px;
}
.mon-timeline-baseline {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--mon-grid-strong);
  transform: translateY(-50%);
}
.mon-timeline-dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s;
}
.mon-timeline-dot:hover {
  transform: translate(-50%, -50%) scale(1.6);
  z-index: 2;
}
.mon-timeline-dot.is-success { background: var(--mon-success); box-shadow: 0 0 10px var(--mon-success); }
.mon-timeline-dot.is-fail { background: var(--mon-danger); box-shadow: 0 0 10px var(--mon-danger); }
.mon-timeline-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--mon-mono);
  font-size: 0.66rem;
  color: var(--mon-text-muted);
  margin-top: 8px;
}

/* ─── PIE CHART (SVG) ────────────────────────────────────────────────── */
.mon-pie-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.mon-pie-chart { width: 180px; height: 180px; flex-shrink: 0; }
.mon-pie-chart circle.bg { fill: none; stroke: var(--mon-grid); stroke-width: 22; }
.mon-pie-chart circle.seg {
  fill: none;
  stroke-width: 22;
  stroke-linecap: butt;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dasharray 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mon-pie-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}
.mon-pie-leg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--mon-bg-deeper);
}
.mon-pie-leg-sw {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.mon-pie-leg-name { flex: 1; color: var(--mon-text); font-weight: 500; }
.mon-pie-leg-val { font-family: var(--mon-mono); font-weight: 700; color: var(--mon-text-dim); }

/* ─── ONLINE NOW PANEL ──────────────────────────────────────────────── */
.mon-online-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--mon-bg-deeper);
  border: 1px solid var(--mon-border);
  border-radius: 10px;
  margin-bottom: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.mon-online-row:hover { border-color: var(--mon-border-hover); transform: translateX(2px); }
.mon-online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.mon-online-dot.acad { background: var(--mon-success); color: var(--mon-success); }
.mon-online-dot.web { background: var(--mon-accent); color: var(--mon-accent); }
.mon-online-body { flex: 1; min-width: 0; }
.mon-online-name {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--mon-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mon-online-meta {
  font-size: 0.7rem;
  color: var(--mon-text-muted);
  font-family: var(--mon-mono);
  margin-top: 2px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mon-online-ago {
  font-size: 0.68rem;
  color: var(--mon-text-muted);
  font-family: var(--mon-mono);
  flex-shrink: 0;
}

/* ─── LOG ROW (errors / activity) ───────────────────────────────────── */
.mon-log-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-family: var(--mon-mono);
}
.mon-log-level.error { background: var(--mon-danger-soft); color: var(--mon-danger); }
.mon-log-level.warn { background: var(--mon-warn-soft); color: var(--mon-warn); }
.mon-log-level.info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

/* ─── FADE ANIM ──────────────────────────────────────────────────────── */
.mon-fade-in {
  animation: mon-fadein 0.45s ease-out both;
}
@keyframes mon-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.mon-stagger > * { animation: mon-fadein 0.45s ease-out both; }
.mon-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.mon-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.mon-stagger > *:nth-child(3) { animation-delay: 0.12s; }
.mon-stagger > *:nth-child(4) { animation-delay: 0.16s; }
.mon-stagger > *:nth-child(5) { animation-delay: 0.20s; }
.mon-stagger > *:nth-child(6) { animation-delay: 0.24s; }
.mon-stagger > *:nth-child(7) { animation-delay: 0.28s; }

/* ─── RESPONSIVE OVERRIDES ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .mon-pagehead h1 { font-size: 1.45rem; }
  .mon-stat-value { font-size: 2.05rem; }
  .mon-rank-row { grid-template-columns: 18px 1fr 80px; }
  .mon-rank-row .mon-rank-track { display: none; }
  .mon-heat-row { grid-template-columns: 70px repeat(12, 1fr); }
  .mon-heat-axis { grid-template-columns: 70px repeat(12, 1fr); }
}


/* light-theme override block (auto-generated) */
[data-theme="light"] {
    --mon-bg: rgba(255, 254, 248, 0.85);
    --mon-bg-deeper: rgba(255, 254, 248, 0.95);
    --mon-border: rgba(20, 18, 12, 0.10);
    --mon-border-hover: rgba(220, 38, 38, 0.40);
    --mon-text: #1A1A1F;
    --mon-text-dim: rgba(26, 26, 31, 0.65);
    --mon-text-muted: rgba(26, 26, 31, 0.42);
    --mon-accent-soft: rgba(220, 38, 38, 0.12);
    --mon-accent-glow: rgba(220, 38, 38, 0.35);
    --mon-success-soft: rgba(16, 185, 129, 0.14);
    --mon-warn-soft: rgba(245, 158, 11, 0.14);
    --mon-danger-soft: rgba(239, 68, 68, 0.14);
    --mon-grid: rgba(20, 18, 12, 0.08);
    --mon-grid-strong: rgba(20, 18, 12, 0.16);
}


/* ═════════════════════════════════════════════════════════════════════════
   light-theme hardcoded overrides
   Badges info/success colorés sémantiques → GARDER tels quels.
   ═════════════════════════════════════════════════════════════════════════ */

[data-theme="light"] .mon-stat:hover {
    box-shadow: 0 14px 40px rgba(120, 80, 40, 0.18);
}

/* ═══════════════════════════════════════════════════════════════════════════
   scroll-x guard 2026-05-03
   Cause root: .mon-timeline-track { min-width: 720px } (ligne 730) — légitime
   pour un graph timeline. Le wrapper .mon-timeline-wrap a déjà overflow-x:auto.
   .mon-pie-legend a min-width:180px — peut écraser sur très petit. On rend
   tout containment-safe.
   ═══════════════════════════════════════════════════════════════════════════ */
.mon-wrap,
.mon-card,
.mon-card-body,
.mon-grid-2,
.mon-grid-50,
.mon-pagehead,
.mon-stats-grid,
.mon-stat-card,
.mon-pie-wrap,
.mon-table-wrap,
.mon-timeline-wrap {
    max-width: 100%;
    min-width: 0;
}
.mon-card { overflow: hidden; }
.mon-timeline-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Pie legend : sur très petit on autorise wrap et on retire min-width fixe. */
@media (max-width: 480px) {
    .mon-pie-legend { min-width: 0 !important; flex-basis: 100% !important; }
    .mon-pie-chart { width: 140px !important; height: 140px !important; }
}

/* SVG charts responsive */
.mon-card svg { max-width: 100%; height: auto; }

/* Tables monitoring : si rendues inline app.js sans wrapper natif. */
.mon-table { min-width: 0; max-width: 100%; }
.mon-table td, .mon-table th { word-break: break-word; }

/* Stats values potentiellement longues (uptime, dates) */
.mon-stat-value,
.mon-stat-label { max-width: 100%; word-break: break-word; }

/* ═══════════════════════════════════════════════════════════════════════════
   design refresh 2026-05-03 — Hero, gauges, mini-bars, logfeed, funnel,
   refined charts. Idempotent: marker below prevents double-append.
   /* design refresh 2026-05-03 */
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── HERO BIG NUMBER ──────────────────────────────────────────────── */
.mon-hero {
    display: grid;
    grid-template-columns: 1.1fr 1px 1.4fr;
    gap: 28px;
    padding: 32px 36px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(220,38,38,0.06) 0%, var(--mon-bg-deeper) 60%);
    border: 1px solid var(--mon-border);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.mon-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(220,38,38,0.18) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0.7;
}
.mon-hero-main { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.mon-hero-status { display: flex; align-items: center; gap: 10px; }
.mon-hero-status-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    color: var(--mon-text-dim);
}
.mon-hero-dot {
    width: 12px; height: 12px; border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.mon-hero-dot.is-up {
    background: var(--mon-success);
    box-shadow: 0 0 0 4px rgba(16,185,129,0.18), 0 0 18px rgba(16,185,129,0.55);
    animation: monHeroPulse 2.2s ease-in-out infinite;
}
.mon-hero-dot.is-down {
    background: var(--mon-danger);
    box-shadow: 0 0 0 4px rgba(239,68,68,0.18), 0 0 18px rgba(239,68,68,0.55);
    animation: monHeroPulse 1.2s ease-in-out infinite;
}
@keyframes monHeroPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.18); opacity: 0.78; }
}
.mon-hero-value {
    font-family: var(--mon-serif);
    font-style: italic;
    font-size: clamp(3.6rem, 8vw, 5.8rem);
    line-height: 0.95;
    color: var(--mon-text);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--mon-text) 0%, rgba(220,38,38,0.85) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-feature-settings: 'lnum' 1;
}
.mon-hero-value-pct {
    font-size: 0.42em;
    font-style: normal;
    color: var(--mon-text-dim);
    margin-left: 8px;
    -webkit-text-fill-color: var(--mon-text-dim);
    font-family: var(--mon-sans);
    font-weight: 500;
    letter-spacing: 0;
}
.mon-hero-sub {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 700;
    color: var(--mon-text-muted);
}
.mon-hero-divider {
    background: linear-gradient(180deg, transparent, var(--mon-border), transparent);
    align-self: stretch;
}
.mon-hero-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}
.mon-hero-side-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mon-hero-side-cell {
    padding: 8px 14px;
    border-left: 2px solid var(--mon-border);
    transition: border-color 0.18s;
}
.mon-hero-side-cell:hover { border-left-color: var(--mon-accent); }
.mon-hero-side-num {
    font-family: var(--mon-serif);
    font-style: italic;
    font-size: 2.1rem;
    line-height: 1;
    color: var(--mon-text);
    letter-spacing: -0.01em;
}
.mon-hero-side-num.accent { color: var(--mon-accent); }
.mon-hero-side-num.success { color: var(--mon-success); }
.mon-hero-side-num.danger { color: var(--mon-danger); }
.mon-hero-side-unit {
    font-size: 0.45em;
    margin-left: 4px;
    color: var(--mon-text-muted);
    font-family: var(--mon-mono);
    font-style: normal;
}
.mon-hero-side-lbl {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    color: var(--mon-text-muted);
    margin-top: 6px;
}

/* ─── MINI BAR (compact horizontal progress) ──────────────────────── */
.mon-mini-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.mon-mini-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── GAUGE BLOCK (cards body) ────────────────────────────────────── */
.mon-gauge-wrap { display: flex; flex-direction: column; gap: 16px; padding-top: 6px; }
.mon-gauge-row {}
.mon-gauge-head { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 8px; align-items: baseline; }
.mon-gauge-label { color: var(--mon-text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; }
.mon-gauge-val { color: var(--mon-text); font-size: 0.74rem; }
.mon-gauge-track { height: 12px; background: rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; position: relative; }
.mon-gauge-track::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 50%, transparent);
    pointer-events: none;
}
.mon-gauge-fill { height: 100%; border-radius: 6px; transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1); }

/* ─── MINI TILES (3 small KPI tiles) ──────────────────────────────── */
.mon-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.mon-mini-tile {
    padding: 10px 12px;
    background: rgba(15,23,42,0.78);
    border: 1px solid var(--mon-border);
    border-radius: 10px;
    transition: border-color 0.18s, transform 0.18s;
}
.mon-mini-tile:hover { border-color: var(--mon-border-hover); transform: translateY(-1px); }
.mon-mini-tile.warn { border-color: rgba(245,158,11,0.35); }
.mon-mini-tile-lbl {
    color: var(--mon-text-muted);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 700;
}
.mon-mini-tile-num {
    font-family: var(--mon-serif);
    font-style: italic;
    font-size: 1.45rem;
    color: var(--mon-text);
    margin-top: 4px;
    line-height: 1;
}
.mon-mini-tile.warn .mon-mini-tile-num { color: var(--mon-danger); }

/* ─── PULSE DOT (live indicator inline) ───────────────────────────── */
.mon-pulse-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--mon-accent);
    margin-left: 8px;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.18);
    animation: monPulseLive 1.4s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes monPulseLive {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(220,38,38,0.18); }
    50%      { transform: scale(1.3); box-shadow: 0 0 0 6px rgba(220,38,38,0.05); }
}

/* ─── LIVE PILL UP/DOWN states ────────────────────────────────────── */
.mon-live-pill.is-up {
    background: rgba(16,185,129,0.12);
    color: var(--mon-success);
    border-color: rgba(16,185,129,0.35);
}
.mon-live-pill.is-up .dot { background: var(--mon-success); box-shadow: 0 0 8px rgba(16,185,129,0.7); }
.mon-live-pill.is-down {
    background: rgba(239,68,68,0.12);
    color: var(--mon-danger);
    border-color: rgba(239,68,68,0.35);
}
.mon-live-pill.is-down .dot { background: var(--mon-danger); box-shadow: 0 0 8px rgba(239,68,68,0.7); }

/* ─── LOG FEED (Datadog-style live log row) ───────────────────────── */
.mon-logfeed { display: flex; flex-direction: column; gap: 0; max-height: 480px; overflow-y: auto; margin: -4px -8px; padding: 4px 8px; }
.mon-logfeed::-webkit-scrollbar { width: 8px; }
.mon-logfeed::-webkit-scrollbar-track { background: transparent; }
.mon-logfeed::-webkit-scrollbar-thumb { background: var(--mon-border); border-radius: 4px; }
.mon-logfeed-row {
    display: grid;
    grid-template-columns: 60px 80px 1fr 110px;
    gap: 12px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.78rem;
    transition: background 0.12s;
    border-left: 3px solid transparent;
}
.mon-logfeed-row:hover { background: rgba(255,255,255,0.025); }
.mon-logfeed-error { border-left-color: var(--mon-danger); }
.mon-logfeed-warn  { border-left-color: var(--mon-warn); }
.mon-logfeed-info  { border-left-color: rgba(96,165,250,0.6); }
.mon-logfeed-lvl {
    font-family: var(--mon-mono);
    font-size: 0.62rem;
    font-weight: 700;
    text-align: center;
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.08em;
}
.mon-logfeed-lvl-error { background: rgba(239,68,68,0.18); color: var(--mon-danger); }
.mon-logfeed-lvl-warn  { background: rgba(245,158,11,0.18); color: var(--mon-warn); }
.mon-logfeed-lvl-info  { background: rgba(96,165,250,0.16); color: #93c5fd; }
.mon-logfeed-ts { color: var(--mon-text-muted); font-size: 0.7rem; }
.mon-logfeed-msg { color: var(--mon-text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-logfeed-user { color: var(--mon-text-muted); font-size: 0.72rem; }
.mon-logfeed-ip { text-align: right; font-size: 0.7rem; }
@media (max-width: 768px) {
    .mon-logfeed-row { grid-template-columns: 50px 1fr; }
    .mon-logfeed-ts, .mon-logfeed-ip { display: none; }
}

/* ─── FUNNEL (acquisition steps) ──────────────────────────────────── */
.mon-funnel { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.mon-funnel-step { position: relative; }
.mon-funnel-step-bar {
    width: var(--w);
    height: 56px;
    background: linear-gradient(90deg, rgba(220,38,38,0.15), rgba(220,38,38,0.32));
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: 10px;
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}
.mon-funnel-step-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 50%, transparent);
    animation: monFunnelShine 3s ease-in-out infinite;
}
@keyframes monFunnelShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.mon-funnel-step.is-discovery .mon-funnel-step-bar {
    background: linear-gradient(90deg, rgba(96,165,250,0.18), rgba(96,165,250,0.35));
    border-color: rgba(96,165,250,0.4);
}
.mon-funnel-step.is-paid .mon-funnel-step-bar {
    background: linear-gradient(90deg, rgba(16,185,129,0.22), rgba(16,185,129,0.45));
    border-color: rgba(16,185,129,0.5);
}
.mon-funnel-step-info {
    position: absolute;
    top: 0; bottom: 0;
    left: 16px;
    right: 16px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: center;
    pointer-events: none;
}
.mon-funnel-step-label {
    font-weight: 600;
    color: var(--mon-text);
    font-size: 0.85rem;
}
.mon-funnel-step-num {
    font-family: var(--mon-serif);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--mon-text);
    line-height: 1;
}
.mon-funnel-step-pct {
    font-family: var(--mon-mono);
    font-size: 0.85rem;
    color: var(--mon-text-dim);
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* ─── ONLINE blocks refined ───────────────────────────────────────── */
.mon-online-block { display: flex; flex-direction: column; gap: 6px; }
.mon-online-section-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.16em; font-weight: 700;
    color: var(--mon-text-dim);
    margin: 12px 0 4px;
}
.mon-online-section-head:first-child { margin-top: 0; }
.mon-online-section-head i { color: var(--mon-accent); font-size: 0.78rem; }
.mon-online-empty { color: var(--mon-text-muted); font-size: 0.78rem; padding: 6px 0; }

/* ─── HEATMAP polish (structure already exists) ───────────────────── */
.mon-heat { display: flex; flex-direction: column; gap: 3px; }
.mon-heat-row { display: grid; grid-template-columns: 90px repeat(14, 1fr); gap: 3px; align-items: center; }
.mon-heat-row-label { font-size: 0.72rem; color: var(--mon-text-dim); padding-right: 8px; font-family: var(--mon-mono); }
.mon-heat-cell { aspect-ratio: 1.1 / 1; min-height: 22px; border-radius: 4px; transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; }
.mon-heat-cell:hover { transform: scale(1.18); box-shadow: 0 0 0 1px var(--mon-accent), 0 4px 12px rgba(220,38,38,0.4); z-index: 1; position: relative; }
.mon-heat-axis { display: grid; grid-template-columns: 90px repeat(14, 1fr); gap: 3px; margin-top: 6px; font-size: 0.62rem; color: var(--mon-text-muted); font-family: var(--mon-mono); text-align: center; }
.mon-heat-axis-spacer {}

/* ─── PIE/DONUT refined ────────────────────────────────────────────── */
.mon-pie-wrap { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 8px; }
.mon-pie-chart { width: 180px; height: 180px; flex-shrink: 0; }
.mon-pie-chart .seg { transition: opacity 0.15s, stroke-width 0.15s; cursor: pointer; }
.mon-pie-chart .seg:hover { opacity: 0.85; stroke-width: 24; }
.mon-pie-legend { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.mon-pie-leg-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; transition: background 0.12s; }
.mon-pie-leg-row:hover { background: rgba(255,255,255,0.04); }
.mon-pie-leg-sw { width: 12px; height: 12px; border-radius: 3px; }
.mon-pie-leg-name { font-size: 0.78rem; color: var(--mon-text-dim); }
.mon-pie-leg-val { font-family: var(--mon-mono); font-size: 0.72rem; color: var(--mon-text); font-weight: 600; }

/* ─── CHART-V9 polishing ──────────────────────────────────────────── */
.chart-v9 { width: 100%; height: 240px; max-width: 100%; display: block; margin-top: 6px; }
.chart-v9 .grid-line { stroke: rgba(255,255,255,0.04); stroke-width: 1; stroke-dasharray: 2 4; }
.chart-v9 .grid-axis { stroke: rgba(255,255,255,0.12); stroke-width: 1; }
.chart-v9 .axis-label { font-family: var(--mon-mono); font-size: 9px; fill: var(--mon-text-muted); letter-spacing: 0.05em; }
.chart-v9 .line-primary { stroke: var(--mon-accent); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 4px rgba(220,38,38,0.45)); }
.chart-v9 .line-warn { stroke: var(--mon-warn); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chart-v9 .line-soft { stroke: rgba(255,255,255,0.32); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 4; }
.chart-v9 .bar { transition: opacity 0.18s; }
.chart-v9 .bar:hover { opacity: 0.78; }
.chart-v9 .bar-primary { fill: var(--mon-accent); }
.chart-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--mon-text-dim); font-weight: 600; }
.chart-legend-swatch { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }

/* ─── RANK rows refined ────────────────────────────────────────────── */
.mon-rank { display: flex; flex-direction: column; gap: 4px; }
.mon-rank-row {
    display: grid;
    grid-template-columns: 38px 1fr 1.6fr 70px;
    gap: 12px;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    transition: background 0.12s;
    opacity: 0;
    animation: monRankIn 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes monRankIn { to { opacity: 1; } }
.mon-rank-row:hover { background: rgba(255,255,255,0.03); }
.mon-rank-pos { font-family: var(--mon-mono); color: var(--mon-text-muted); font-size: 0.72rem; font-weight: 700; }
.mon-rank-label { font-family: var(--mon-mono); font-size: 0.78rem; color: var(--mon-text); font-weight: 600; letter-spacing: 0.02em; }
.mon-rank-track { height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.mon-rank-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(220,38,38,0.5), var(--mon-accent));
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(220,38,38,0.35);
    width: 0;
    animation: monRankFill 0.9s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes monRankFill { to { width: var(--w, 100%); } }
.mon-rank-val { font-family: var(--mon-mono); font-size: 0.78rem; color: var(--mon-text); text-align: right; font-weight: 600; }

/* ─── RESPONSIVE: hero collapses on mobile ────────────────────────── */
@media (max-width: 980px) {
    .mon-hero { grid-template-columns: 1fr; gap: 18px; padding: 24px; }
    .mon-hero-divider { display: none; }
    .mon-hero-side-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .mon-hero { padding: 20px; }
    .mon-hero-value { font-size: 3rem; }
    .mon-hero-side-row { grid-template-columns: repeat(2, 1fr); }
    .mon-hero-side-num { font-size: 1.6rem; }
    .mon-mini-grid { grid-template-columns: 1fr; }
    .mon-funnel-step-info { grid-template-columns: 1fr auto; }
    .mon-funnel-step-pct { display: none; }
}

/* ─── LIGHT THEME OVERRIDES ───────────────────────────────────────── */
[data-theme="light"] .mon-hero {
    background: linear-gradient(135deg, rgba(220,38,38,0.05) 0%, #FFFEF8 60%);
    border-color: rgba(20,18,12,0.10);
}
[data-theme="light"] .mon-hero::before { background: radial-gradient(circle, rgba(220,38,38,0.10) 0%, transparent 60%); }
[data-theme="light"] .mon-hero-status-label { color: #6F6E6A; }
[data-theme="light"] .mon-hero-value {
    background: linear-gradient(135deg, #1A1A1F 0%, rgba(220,38,38,0.95) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="light"] .mon-hero-value-pct { color: #6F6E6A; -webkit-text-fill-color: #6F6E6A; }
[data-theme="light"] .mon-hero-sub { color: #6F6E6A; }
[data-theme="light"] .mon-hero-side-cell { border-left-color: rgba(20,18,12,0.10); }
[data-theme="light"] .mon-hero-side-num { color: #1A1A1F; }
[data-theme="light"] .mon-hero-side-num.accent { color: #DC2626; }
[data-theme="light"] .mon-hero-side-num.success { color: #059669; }
[data-theme="light"] .mon-hero-side-num.danger { color: #DC2626; }
[data-theme="light"] .mon-hero-side-lbl { color: #6F6E6A; }
[data-theme="light"] .mon-hero-side-unit { color: #6F6E6A; }
[data-theme="light"] .mon-hero-divider { background: linear-gradient(180deg, transparent, rgba(20,18,12,0.10), transparent); }

[data-theme="light"] .mon-mini-tile { background: #FFFEF8; border-color: rgba(20,18,12,0.10); }
[data-theme="light"] .mon-mini-tile-lbl { color: #6F6E6A; }
[data-theme="light"] .mon-mini-tile-num { color: #1A1A1F; }
[data-theme="light"] .mon-mini-tile.warn .mon-mini-tile-num { color: #991B1B; }
[data-theme="light"] .mon-mini-tile.warn { border-color: rgba(245,158,11,0.45); }

[data-theme="light"] .mon-mini-bar { background: rgba(20,18,12,0.06); }
[data-theme="light"] .mon-gauge-track { background: rgba(20,18,12,0.06); }
[data-theme="light"] .mon-gauge-label { color: #6F6E6A; }
[data-theme="light"] .mon-gauge-val { color: #1A1A1F; }

[data-theme="light"] .mon-logfeed-row { border-bottom-color: rgba(20,18,12,0.04); }
[data-theme="light"] .mon-logfeed-row:hover { background: rgba(20,18,12,0.025); }
[data-theme="light"] .mon-logfeed-msg { color: #3B3B3D; }
[data-theme="light"] .mon-logfeed-user { color: #6F6E6A; }
[data-theme="light"] .mon-logfeed-ts { color: #6F6E6A; }
[data-theme="light"] .mon-logfeed-lvl-info { background: rgba(96,165,250,0.18); color: #1d4ed8; }

[data-theme="light"] .mon-funnel-step-label { color: #1A1A1F; }
[data-theme="light"] .mon-funnel-step-num { color: #1A1A1F; }
[data-theme="light"] .mon-funnel-step-pct { color: #3B3B3D; }
[data-theme="light"] .mon-funnel-step-bar {
    background: linear-gradient(90deg, rgba(220,38,38,0.10), rgba(220,38,38,0.25));
    border-color: rgba(220,38,38,0.32);
}
[data-theme="light"] .mon-funnel-step.is-discovery .mon-funnel-step-bar {
    background: linear-gradient(90deg, rgba(96,165,250,0.14), rgba(96,165,250,0.30));
    border-color: rgba(96,165,250,0.40);
}
[data-theme="light"] .mon-funnel-step.is-paid .mon-funnel-step-bar {
    background: linear-gradient(90deg, rgba(16,185,129,0.16), rgba(16,185,129,0.35));
    border-color: rgba(16,185,129,0.45);
}

[data-theme="light"] .mon-online-section-head { color: #3B3B3D; }
[data-theme="light"] .mon-online-empty { color: #6F6E6A; }

[data-theme="light"] .mon-pie-leg-row:hover { background: rgba(20,18,12,0.04); }
[data-theme="light"] .mon-pie-leg-name { color: #3B3B3D; }
[data-theme="light"] .mon-pie-leg-val { color: #1A1A1F; }
[data-theme="light"] .mon-pie-chart circle[stroke="rgba(255,255,255,0.06)"] { stroke: rgba(20,18,12,0.08); }

[data-theme="light"] .chart-v9 .grid-line { stroke: rgba(20,18,12,0.05); }
[data-theme="light"] .chart-v9 .grid-axis { stroke: rgba(20,18,12,0.18); }
[data-theme="light"] .chart-v9 .axis-label { fill: #6F6E6A; }
[data-theme="light"] .chart-v9 .line-soft { stroke: rgba(20,18,12,0.32); }
[data-theme="light"] .chart-legend-item { color: #3B3B3D; }

[data-theme="light"] .mon-rank-pos { color: #6F6E6A; }
[data-theme="light"] .mon-rank-label { color: #1A1A1F; }
[data-theme="light"] .mon-rank-val { color: #1A1A1F; }
[data-theme="light"] .mon-rank-track { background: rgba(20,18,12,0.06); }

[data-theme="light"] .mon-heat-row-label { color: #3B3B3D; }
[data-theme="light"] .mon-heat-axis { color: #6F6E6A; }

/* Containment safety nets */
.mon-hero, .mon-hero-main, .mon-hero-side, .mon-hero-side-row, .mon-funnel, .mon-funnel-step, .mon-mini-grid, .mon-gauge-wrap, .mon-logfeed { max-width: 100%; min-width: 0; }
.mon-hero-value, .mon-hero-side-num, .mon-mini-tile-num, .mon-funnel-step-num { word-break: break-word; }

/* ═══════════════════════════════════════════════════════════════
   VISITEURS — admin tab (added 2026-05-06)
   ═══════════════════════════════════════════════════════════════ */

.mon-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1024px) { .mon-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .mon-grid-4 { grid-template-columns: 1fr; } }

.mon-stat {
  background: var(--mon-bg-deeper);
  border: 1px solid var(--mon-border);
  border-radius: 12px;
  padding: 16px 18px;
}
.mon-stat__label { font-size: 0.72rem; color: var(--mon-text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.mon-stat__value { font-size: 1.7rem; font-weight: 700; color: var(--mon-text); margin-top: 4px; font-family: var(--mon-mono); }
.mon-stat__sub { font-size: 0.72rem; color: var(--mon-text-muted); margin-top: 4px; }

.mon-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--mon-text-dim); cursor: pointer; user-select: none; }
.mon-toggle input { accent-color: #DC2626; }

.mon-pagehead-sub { font-size: 0.78rem; color: var(--mon-text-muted); margin: 4px 0 0; }

.mon-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; padding: 10px 14px; }
.mon-dl dt { font-size: 0.72rem; color: var(--mon-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; align-self: center; }
.mon-dl dd { margin: 0; font-size: 0.85rem; color: var(--mon-text); word-break: break-word; }
.mon-dl dd a { color: var(--mon-accent); text-decoration: none; }
.mon-dl dd a:hover { text-decoration: underline; }

/* Drawer */
.mon-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 1500; backdrop-filter: blur(2px);
  animation: monDrawerFade 0.18s ease;
}
.mon-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(900px, 95vw);
  background: var(--mon-bg, #0F1116);
  border-left: 1px solid var(--mon-border);
  z-index: 1600;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.mon-drawer.is-open { transform: translateX(0); }
.mon-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--mon-border);
  flex-shrink: 0;
}
.mon-drawer-close {
  background: transparent; border: 1px solid var(--mon-border);
  color: var(--mon-text); width: 36px; height: 36px; border-radius: 8px;
  cursor: pointer; transition: all 0.15s;
}
.mon-drawer-close:hover { background: var(--mon-bg-deeper); border-color: var(--mon-border-hover); }
.mon-drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
body.mon-drawer-open { overflow: hidden; }

/* Timeline pageviews (différent de mon-timeline existante qui est horizontale) */
.mon-timeline {
  list-style: none; padding: 14px 18px; margin: 0;
  position: relative;
}
.mon-timeline::before {
  content: ""; position: absolute; left: 28px; top: 20px; bottom: 20px;
  width: 2px; background: var(--mon-border);
}
.mon-timeline-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 8px 0;
  position: relative;
}
.mon-timeline-num {
  flex-shrink: 0; width: 30px; height: 30px;
  background: var(--mon-bg-deeper); border: 2px solid var(--mon-border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: var(--mon-text-muted);
  font-family: var(--mon-mono);
  position: relative; z-index: 1;
}
.mon-timeline-item.is-active .mon-timeline-num { background: rgba(220,38,38,0.15); border-color: #DC2626; color: #DC2626; }
.mon-timeline-body { flex: 1; min-width: 0; padding-bottom: 8px; }
.mon-timeline-title { font-weight: 600; font-size: 0.88rem; }
.mon-timeline-title a { color: var(--mon-text); text-decoration: none; }
.mon-timeline-title a:hover { color: var(--mon-accent); text-decoration: underline; }

@keyframes monDrawerFade { from { opacity: 0; } to { opacity: 1; } }

/* Mobile drawer plein écran */
@media (max-width: 640px) {
  .mon-drawer { width: 100vw; }
  .mon-dl { grid-template-columns: 1fr; gap: 4px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Activités du jour (Telemetry) + Visiteurs (added 2026-05-07)
   ═══════════════════════════════════════════════════════════════ */

/* Card-head : wrap titre + sub + actions sur mobile */
@media (max-width: 720px) {
  .mon-card-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .mon-card-sub {
    width: 100%;
    font-size: 0.7rem;
    line-height: 1.4;
  }
  .mon-card-title { font-size: 1rem; }
}

/* Pagehead-actions : full width + buttons en row sur mobile */
@media (max-width: 720px) {
  .mon-pagehead {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .mon-pagehead-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .mon-pagehead-actions .mon-btn,
  .mon-pagehead-actions .mon-refresh {
    flex: 1 1 auto;
    min-height: 40px;
    justify-content: center;
  }
}

/* Online block (Activités du jour + En ligne maintenant) */
@media (max-width: 560px) {
  .mon-online-block { gap: 4px; }
  .mon-online-row {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .mon-online-name { font-size: 0.82rem; }
  .mon-online-meta { font-size: 0.66rem; }
  .mon-online-ago {
    font-size: 0.65rem;
    margin-left: auto;
  }
  .mon-online-section-head {
    font-size: 0.78rem;
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* Toggle "Inclure les bots" : full width sur très petit */
@media (max-width: 480px) {
  .mon-toggle {
    width: 100%;
    padding: 8px 12px;
    background: var(--mon-bg-deeper);
    border: 1px solid var(--mon-border);
    border-radius: 8px;
    justify-content: flex-start;
  }
}

/* Stats KPI (mon-grid-4) — déjà responsive 1024 → 2 cols, 560 → 1 col.
   Ajustement valeur pour ne pas overflow. */
@media (max-width: 560px) {
  .mon-stat { padding: 12px 14px; }
  .mon-stat__value { font-size: 1.3rem; }
  .mon-stat__label { font-size: 0.66rem; }
  .mon-stat__sub { font-size: 0.66rem; }
}

/* Visiteurs table — toolbar (search + select) en column sur mobile */
@media (max-width: 720px) {
  .tel-wrap .mon-card-head > div[style*="display:flex"] {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }
  #vis-search,
  #vis-device {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
}

/* Visiteurs table → cards stackées sur mobile (transformation magique
   sans data-label : tr devient card, td devient block ligne) */
@media (max-width: 760px) {
  /* Cible UNIQUEMENT la table sessions visiteurs (a-t-elle un wrapper ? on cible
     toutes les .mon-table dans .tel-wrap qui ont onclick visitorDetail) */
  .tel-wrap .mon-table-wrap { overflow-x: visible; }
  .tel-wrap .mon-table,
  .tel-wrap .mon-table thead,
  .tel-wrap .mon-table tbody,
  .tel-wrap .mon-table tr,
  .tel-wrap .mon-table td,
  .tel-wrap .mon-table th {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .tel-wrap .mon-table thead {
    /* Cache l'en-tête : les valeurs sont assez auto-explicatives en card */
    position: absolute; left: -9999px; top: -9999px;
  }
  .tel-wrap .mon-table tbody tr {
    background: var(--mon-bg-deeper);
    border: 1px solid var(--mon-border);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
  }
  .tel-wrap .mon-table tbody tr:hover {
    transform: none;
    background: var(--mon-bg-deeper);
  }
  .tel-wrap .mon-table tbody tr:hover td:first-child {
    box-shadow: none;
  }
  .tel-wrap .mon-table tbody td {
    border: none;
    border-bottom: 1px dashed var(--mon-border);
    padding: 6px 0;
    font-size: 0.82rem;
  }
  .tel-wrap .mon-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .tel-wrap .mon-table tbody td:first-child {
    padding-top: 0;
    font-weight: 600;
  }
  /* Ago / temps en flex inline avec icone */
  .tel-wrap .mon-table .mon-mini-bar { display: none; }
}

/* Drawer Visiteurs : grids internes en 1 colonne sur petit écran */
@media (max-width: 760px) {
  .mon-drawer .mon-grid-2,
  .mon-drawer .mon-grid-50 {
    grid-template-columns: 1fr;
  }
  .mon-drawer-head {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .mon-drawer-head h2 {
    font-size: 1.05rem;
    flex: 1;
    min-width: 0;
    word-break: break-word;
  }
  .mon-drawer-body { padding: 14px 16px; }
}

/* Drawer table "Autres sessions" : transformation cards aussi */
@media (max-width: 640px) {
  .mon-drawer .mon-table,
  .mon-drawer .mon-table thead,
  .mon-drawer .mon-table tbody,
  .mon-drawer .mon-table tr,
  .mon-drawer .mon-table td,
  .mon-drawer .mon-table th {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .mon-drawer .mon-table thead {
    position: absolute; left: -9999px; top: -9999px;
  }
  .mon-drawer .mon-table tbody tr {
    background: var(--mon-bg-deeper);
    border: 1px solid var(--mon-border);
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
  }
  .mon-drawer .mon-table tbody td {
    border: none;
    padding: 4px 0;
    font-size: 0.8rem;
  }
  .mon-drawer .mon-table tbody td:first-child {
    font-weight: 600;
    padding-top: 0;
  }
}

/* Timeline pageviews dans drawer : compact mobile */
@media (max-width: 640px) {
  .mon-timeline { padding: 10px 12px; }
  .mon-timeline::before { left: 22px; }
  .mon-timeline-num {
    width: 26px; height: 26px;
    font-size: 0.62rem;
  }
  .mon-timeline-title { font-size: 0.82rem; }
  .mon-timeline-body { padding-bottom: 4px; }
  .mon-timeline-body > div[style*="display:flex"] {
    flex-direction: column !important;
    gap: 2px !important;
  }
}

/* Refresh button : icône seule sur très petit */
@media (max-width: 480px) {
  #vis-refresh-btn { padding: 8px 12px; }
  #vis-refresh-btn span { display: none; }
}

/* Card-head : la rangée filtres dans visitors page (search + select) */
@media (max-width: 720px) {
  .tel-wrap .mon-card-head {
    align-items: stretch;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE PRO v2 — Telemetry "Activités du jour" + Visiteurs
   Added 2026-05-07 (cache-bust v=9)
   ─── Stratégie : touch targets >=44px, bottom-sheet drawer < 768px,
       card-stack avancé sessions, density adaptée, skeleton loaders,
       focus-visible AA WCAG 2.2, hover/active distincts mobile.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. SHARED PRIMITIVES (mon-skel, mon-press, focus AA) ─── */

/* Skeleton loader réutilisable pour empty/loading states */
@keyframes mon-skel-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.mon-skel,
.mon-skel-row,
.mon-skel-card {
  background: linear-gradient(
    90deg,
    var(--mon-bg-deeper) 0%,
    var(--mon-grid) 50%,
    var(--mon-bg-deeper) 100%
  );
  background-size: 200% 100%;
  animation: mon-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.mon-skel-row { height: 14px; margin: 6px 0; }
.mon-skel-card { height: 70px; margin-bottom: 10px; border-radius: 12px; }

/* Focus-visible AA WCAG 2.2 (focus ring 2px contrast) */
.tel-wrap button:focus-visible,
.tel-wrap input:focus-visible,
.tel-wrap select:focus-visible,
.tel-wrap a:focus-visible,
.tel-wrap [role="button"]:focus-visible,
.mon-drawer button:focus-visible,
.mon-drawer input:focus-visible,
.mon-drawer select:focus-visible,
.mon-drawer a:focus-visible,
.mon-drawer [role="button"]:focus-visible,
.mon-online-row:focus-visible,
.mon-pagehead-actions .mon-toggle:focus-within {
  outline: 2px solid #DC2626;
  outline-offset: 2px;
  border-radius: 8px;
}

/* Active-press feedback mobile (remplace hover qui sticky sur tactile) */
@media (hover: none) and (pointer: coarse) {
  .mon-online-row:hover { transform: none; border-color: var(--mon-border); }
  .tel-wrap .mon-btn:hover,
  .tel-wrap .mon-refresh:hover { transform: none; }

  .mon-online-row:active {
    transform: scale(0.98);
    background: var(--mon-grid);
    transition: transform 0.08s ease, background 0.08s ease;
  }
  .tel-wrap .mon-btn:active,
  .tel-wrap .mon-refresh:active {
    transform: scale(0.96);
    transition: transform 0.08s ease;
  }
  .tel-wrap .mon-table tbody tr:active {
    transform: scale(0.99);
    background: var(--mon-grid) !important;
    transition: transform 0.1s ease, background 0.1s ease;
  }
}

/* ─── 2. ACTIVITÉS DU JOUR — layout vertical pro mobile ─── */
@media (max-width: 720px) {
  .tel-wrap .mon-card-head {
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
  }
  .tel-wrap .mon-card-head .mon-card-sub {
    width: 100%;
    order: 3;
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--mon-text-muted);
  }
  .tel-wrap .mon-card-actions { width: 100%; order: 4; }

  .mon-online-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-wrap: nowrap;
  }
  .mon-online-section-head .mon-badge {
    margin-left: auto;
    font-size: 0.66rem;
    padding: 2px 7px;
  }

  /* row : layout grid 3 colonnes (dot|body|ago) avec wrap propre */
  .mon-online-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    padding: 10px 12px;
    min-height: 52px;
    align-items: center;
    border-radius: 10px;
  }
  .mon-online-row > .mon-online-dot,
  .mon-online-row > i {
    grid-row: 1 / span 2;
    grid-column: 1;
    align-self: center;
  }
  .mon-online-row > .mon-online-body {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
  }
  .mon-online-row > .mon-online-ago {
    grid-row: 1;
    grid-column: 3;
    align-self: center;
    margin-left: 0;
    font-size: 0.66rem;
    white-space: nowrap;
    color: var(--mon-text-muted);
    background: var(--mon-grid);
    padding: 3px 7px;
    border-radius: 6px;
  }
  .mon-online-row .mon-online-body .mon-online-meta {
    font-size: 0.7rem;
    color: var(--mon-text-muted);
    word-break: break-word;
    line-height: 1.3;
  }
  .mon-online-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Très petit mobile (<= 380px) : ago tombe sur ligne 3 si meta longue */
@media (max-width: 380px) {
  .mon-online-row {
    grid-template-rows: auto auto auto;
  }
  .mon-online-row > .mon-online-ago {
    grid-row: 3;
    grid-column: 2 / span 2;
    margin-top: 2px;
    align-self: start;
    justify-self: start;
  }
}

/* ─── 3. PAGEHEAD ACTIONS — toggle + refresh row mobile ─── */
@media (max-width: 720px) {
  .tel-wrap .mon-pagehead {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .tel-wrap .mon-pagehead-title { width: 100%; }
  .tel-wrap .mon-pagehead-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }
  .tel-wrap .mon-pagehead-actions .mon-toggle {
    flex: 0 1 auto;
    margin: 0;
    padding: 10px 12px;
    background: var(--mon-bg-deeper);
    border: 1px solid var(--mon-border);
    border-radius: 10px;
    min-height: 44px;
    font-size: 0.78rem;
  }
  .tel-wrap .mon-pagehead-actions .mon-btn,
  .tel-wrap .mon-pagehead-actions .mon-refresh {
    flex: 0 0 auto;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .tel-wrap .mon-pagehead-actions { grid-template-columns: 1fr 1fr; }
  .tel-wrap .mon-pagehead-actions .mon-toggle { grid-column: 1 / -1; }
  .tel-wrap .mon-pagehead-actions .mon-btn,
  .tel-wrap .mon-pagehead-actions .mon-refresh { width: 100%; }
}

/* ─── 4. STATS KPI — densité adaptée ─── */
@media (max-width: 560px) {
  .tel-wrap .mon-grid-4 { gap: 8px; }
  .tel-wrap .mon-stat {
    padding: 12px 14px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
  }
  .tel-wrap .mon-stat__label {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
  }
  .tel-wrap .mon-stat__value {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-size: 1.45rem;
    line-height: 1.1;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .tel-wrap .mon-stat__sub {
    grid-column: 1;
    grid-row: 2;
    font-size: 0.66rem;
  }
}

/* ─── 5. FILTRES TOOLBAR (search + select) mobile compact ─── */
@media (max-width: 720px) {
  .tel-wrap .mon-card-head > div[style*="display:flex"] {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .tel-wrap #vis-search,
  .tel-wrap #vis-device {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 10px !important;
  }
  .tel-wrap #vis-search::placeholder { font-size: 0.8rem; }
}

/* ─── 6. CARD-STACK PRO — table sessions transformée en cards ─── */
@media (max-width: 760px) {
  .tel-wrap .mon-table-wrap { overflow-x: visible; }
  .tel-wrap .mon-card .mon-table,
  .tel-wrap .mon-card .mon-table thead,
  .tel-wrap .mon-card .mon-table tbody,
  .tel-wrap .mon-card .mon-table tr,
  .tel-wrap .mon-card .mon-table td,
  .tel-wrap .mon-card .mon-table th {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .tel-wrap .mon-card .mon-table thead {
    position: absolute;
    left: -9999px; top: -9999px;
  }
  .tel-wrap .mon-card .mon-table tbody tr {
    background: var(--mon-bg-deeper);
    border: 1px solid var(--mon-border);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 14px;
    transition: border-color 0.15s ease, transform 0.1s ease;
    position: relative;
    cursor: pointer;
    min-height: 44px;
  }
  /* Indicateur "tap me" subtil */
  .tel-wrap .mon-card .mon-table tbody tr::after {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 14px; right: 14px;
    color: var(--mon-text-muted);
    font-size: 0.7rem;
    opacity: 0.5;
  }
  .tel-wrap .mon-card .mon-table tbody tr:hover {
    transform: none;
    background: var(--mon-bg-deeper);
    border-color: var(--mon-border-hover);
  }
  .tel-wrap .mon-card .mon-table tbody tr:hover td:first-child { box-shadow: none; }
  .tel-wrap .mon-card .mon-table tbody td {
    border: none;
    padding: 0;
    font-size: 0.82rem;
  }

  /* Ligne 1 (Visiteur) — gros header card */
  .tel-wrap .mon-card .mon-table tbody td:first-child {
    padding: 0 28px 10px 0;
    border-bottom: 1px solid var(--mon-border);
    margin-bottom: 10px;
  }
  .tel-wrap .mon-card .mon-table tbody td:first-child > div {
    gap: 12px !important;
  }
  .tel-wrap .mon-card .mon-table tbody td:first-child span[style*="font-size:1.3rem"] {
    font-size: 1.7rem !important;
  }
  .tel-wrap .mon-card .mon-table tbody td:first-child > div > div {
    flex: 1;
    min-width: 0;
  }
  .tel-wrap .mon-card .mon-table tbody td:first-child > div > div > div:first-child {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .tel-wrap .mon-card .mon-table tbody td:first-child .dim {
    font-size: 0.72rem !important;
    margin-top: 2px;
    word-break: break-word;
    white-space: normal;
  }

  /* Ligne 2 (Device / Browser) */
  .tel-wrap .mon-card .mon-table tbody td:nth-child(2) {
    padding: 0 0 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 0.75rem;
    color: var(--mon-text-dim);
  }
  .tel-wrap .mon-card .mon-table tbody td:nth-child(2) > div {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
  }

  /* Footer stats card — pages / temps / source en row avec icônes */
  .tel-wrap .mon-card .mon-table tbody td:nth-child(3),
  .tel-wrap .mon-card .mon-table tbody td:nth-child(4),
  .tel-wrap .mon-card .mon-table tbody td:nth-child(6) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto !important;
    padding: 0 14px 0 0;
    font-size: 0.75rem;
    color: var(--mon-text);
    vertical-align: top;
  }
  .tel-wrap .mon-card .mon-table tbody td:nth-child(3)::before {
    content: "\f15c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--mon-text-muted);
    font-size: 0.78rem;
  }
  .tel-wrap .mon-card .mon-table tbody td:nth-child(4)::before {
    content: "\f017";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--mon-text-muted);
    font-size: 0.78rem;
  }
  .tel-wrap .mon-card .mon-table tbody td:nth-child(6)::before {
    content: "\f1da";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--mon-text-muted);
    font-size: 0.78rem;
  }
  /* Source : full width sous footer */
  .tel-wrap .mon-card .mon-table tbody td:nth-child(5) {
    display: block;
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--mon-grid);
    border-radius: 8px;
    font-size: 0.72rem;
  }
  .tel-wrap .mon-card .mon-table tbody td:nth-child(5)::before {
    content: "\f0c1";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--mon-text-muted);
    margin-right: 6px;
  }
  .tel-wrap .mon-card .mon-table tbody td:nth-child(5) > div {
    display: inline;
  }
  .tel-wrap .mon-card .mon-table tbody td:nth-child(5) .dim {
    display: block;
    margin-top: 2px;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-all !important;
  }

  /* Mini-bar caché (relique de design desktop) */
  .tel-wrap .mon-table .mon-mini-bar { display: none; }
}

/* ─── 7. DRAWER → BOTTOM-SHEET MOBILE ─── */
@media (max-width: 768px) {
  .mon-drawer {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    max-height: 92vh;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--mon-border);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(.2,.7,.3,1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  }
  .mon-drawer.is-open { transform: translateY(0); }

  /* Drag handle visuel */
  .mon-drawer::before {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    background: var(--mon-text-muted);
    opacity: 0.35;
    border-radius: 999px;
    margin: 8px auto 4px;
    flex-shrink: 0;
  }

  .mon-drawer-head {
    padding: 8px 16px 14px;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid var(--mon-border);
  }
  .mon-drawer-head h2 {
    font-size: 1.05rem;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.3;
  }
  .mon-drawer-head .dim { font-size: 0.7rem !important; }

  .mon-drawer-close {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
  }

  .mon-drawer-body {
    padding: 14px 16px 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Body lock complet (background fixe, scroll position préservée par JS) */
  body.mon-drawer-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* Drawer grids → 1 col + dl readable */
@media (max-width: 768px) {
  .mon-drawer .mon-grid-2,
  .mon-drawer .mon-grid-50 { grid-template-columns: 1fr; gap: 10px; }
  .mon-drawer .mon-card { border-radius: 12px; }
  .mon-drawer .mon-dl {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 14px;
  }
  .mon-drawer .mon-dl dt {
    font-size: 0.66rem;
    margin-top: 6px;
    margin-bottom: 0;
  }
  .mon-drawer .mon-dl dt:first-of-type { margin-top: 0; }
  .mon-drawer .mon-dl dd {
    font-size: 0.85rem;
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--mon-border);
  }
  .mon-drawer .mon-dl dd:last-child { border-bottom: none; }
}

/* Drawer "Autres sessions" → cards */
@media (max-width: 640px) {
  .mon-drawer .mon-card .mon-table,
  .mon-drawer .mon-card .mon-table thead,
  .mon-drawer .mon-card .mon-table tbody,
  .mon-drawer .mon-card .mon-table tr,
  .mon-drawer .mon-card .mon-table td,
  .mon-drawer .mon-card .mon-table th {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .mon-drawer .mon-card .mon-table thead { position: absolute; left: -9999px; top: -9999px; }
  .mon-drawer .mon-card .mon-table tbody tr {
    background: var(--mon-bg-deeper);
    border: 1px solid var(--mon-border);
    border-radius: 12px;
    margin-bottom: 8px;
    padding: 12px 14px;
    min-height: 44px;
    cursor: pointer;
  }
  .mon-drawer .mon-card .mon-table tbody td {
    border: none;
    padding: 3px 0;
    font-size: 0.8rem;
  }
  .mon-drawer .mon-card .mon-table tbody td:first-child {
    font-weight: 700;
    font-size: 0.9rem;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--mon-border);
    margin-bottom: 6px;
  }
  /* Footer stats inline */
  .mon-drawer .mon-card .mon-table tbody td:nth-child(2),
  .mon-drawer .mon-card .mon-table tbody td:nth-child(3),
  .mon-drawer .mon-card .mon-table tbody td:nth-child(5) {
    display: inline-block;
    width: auto !important;
    margin-right: 12px;
    font-size: 0.72rem;
    color: var(--mon-text-dim);
  }
  .mon-drawer .mon-card .mon-table tbody td:nth-child(4) {
    display: block;
    margin-top: 6px;
    font-size: 0.7rem;
    word-break: break-all;
    white-space: normal !important;
    max-width: 100% !important;
  }
}

/* Timeline pageviews compact mobile */
@media (max-width: 640px) {
  .mon-drawer .mon-timeline { padding: 10px 8px; }
  .mon-drawer .mon-timeline::before { left: 22px; }
  .mon-timeline-item { padding: 6px 0; gap: 10px; }
  .mon-timeline-num {
    width: 26px; height: 26px;
    font-size: 0.62rem;
  }
  .mon-timeline-title { font-size: 0.85rem; line-height: 1.3; }
  .mon-timeline-body { padding-bottom: 4px; }
  .mon-timeline-body > div[style*="display:flex"] {
    flex-direction: column !important;
    gap: 2px !important;
    font-size: 0.7rem !important;
  }
  .mon-timeline-body > div[style*="display:flex"] span { display: inline-flex; gap: 4px; align-items: center; }
}

/* ─── 8. REFRESH BUTTON micro states ─── */
@media (max-width: 480px) {
  .tel-wrap #vis-refresh-btn {
    padding: 10px 14px;
    min-width: 44px;
  }
  .tel-wrap #vis-refresh-btn span:not(.sr-only) { display: none; }
}
.tel-wrap #vis-refresh-btn.is-loading i { animation: mon-spin 0.7s linear infinite; }
@keyframes mon-spin { to { transform: rotate(360deg); } }

/* ─── 9. REDUCED MOTION (a11y) ─── */
@media (prefers-reduced-motion: reduce) {
  .mon-skel,
  .mon-skel-row,
  .mon-skel-card,
  .tel-wrap #vis-refresh-btn.is-loading i,
  .mon-drawer,
  .mon-drawer-overlay,
  .mon-online-row,
  .tel-wrap .mon-table tbody tr,
  .tel-wrap .mon-btn,
  .tel-wrap .mon-refresh {
    animation: none !important;
    transition: none !important;
  }
}

/* ─── 10. LIGHT THEME — adjust contrast pour ago badge / footer ─── */
[data-theme="light"] .mon-online-row > .mon-online-ago {
  background: rgba(20, 18, 12, 0.06);
  color: #4a4a4a;
}
[data-theme="light"] .tel-wrap .mon-card .mon-table tbody td:nth-child(5) {
  background: rgba(20, 18, 12, 0.04);
}

/* ─── 11. SAFE-AREA iPhone notch + home indicator ─── */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .mon-drawer-body {
      padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    .mon-drawer { padding-bottom: env(safe-area-inset-bottom); }
  }
}

/* ─── 12. DRAWER OVERLAY tap-to-close + fade ─── */
@media (max-width: 768px) {
  .mon-drawer-overlay {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
}

/* ─── 13. NO-DATA empty state amélioré ─── */
.mon-online-empty {
  text-align: center;
  padding: 18px 12px;
  color: var(--mon-text-muted);
  font-size: 0.8rem;
  border: 1px dashed var(--mon-border);
  border-radius: 10px;
  background: transparent;
}
@media (max-width: 560px) {
  .mon-online-empty { padding: 14px 10px; font-size: 0.75rem; }
}

/* ─── 14. TABLE empty colspan center mobile ─── */
@media (max-width: 760px) {
  .tel-wrap .mon-card .mon-table tbody tr td[colspan] {
    display: block;
    text-align: center;
    padding: 24px 12px !important;
    border: 1px dashed var(--mon-border);
    border-radius: 12px;
    background: var(--mon-bg-deeper);
  }
  .tel-wrap .mon-card .mon-table tbody tr td[colspan]::before { content: none; }
}

/* ─── 15. FILTRES card-head visiteurs : titre + filters layout pro ─── */
@media (max-width: 720px) {
  .tel-wrap .mon-card-head .mon-card-title {
    font-size: 0.95rem;
  }
}

/* ─── 16. SCROLL momentum dans drawer body iOS ─── */
.mon-drawer-body { -webkit-overflow-scrolling: touch; }
