/* =========================================================================
   Resellytics — système de design
   Noir profond, surfaces en couches, accent citron. Aucune ressource externe.
   ========================================================================= */

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07080a;
  --bg-2: #0b0d10;
  --panel: #101216;
  --panel-2: #15181d;
  --panel-3: #1b1f25;
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .11);
  --border-3: rgba(255, 255, 255, .18);
  --text: #f3f5f7;
  --text-2: #a7aeba;
  --text-3: #6d7482;
  --accent: #c6f64f;
  --accent-2: #dcff7a;
  --accent-ink: #0c1002;
  --accent-soft: rgba(198, 246, 79, .12);
  --accent-line: rgba(198, 246, 79, .45);
  --green: #3ddc84;
  --amber: #f7b955;
  --red: #ff6b6b;
  --blue: #74a9ff;
  --violet: #a68bff;
  --radius: 14px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .05);
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-feature-settings: "cv11", "ss01", "ss03";
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1000px 520px at 12% -12%, rgba(130, 100, 255, .11), transparent 62%),
    radial-gradient(800px 420px at 105% -5%, rgba(198, 246, 79, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.5;
}
/* grain très léger : donne de la matière aux grands aplats sombres */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
::selection { background: rgba(198, 246, 79, .3); color: #fff; }

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--panel-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.warn-text { color: var(--amber); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  font-weight: 550; font-size: 13.5px; letter-spacing: -.005em; white-space: nowrap; cursor: pointer;
  box-shadow: var(--highlight);
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
  text-decoration: none !important;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 24px -10px rgba(198, 246, 79, .55);
}
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.big { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.start { color: var(--green); border-color: rgba(61, 220, 132, .3); }
.btn.stop { color: var(--amber); border-color: rgba(247, 185, 85, .3); }
.btn.danger { color: var(--red); border-color: rgba(255, 107, 107, .3); }
.btn.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  background: none; border: 0; border-radius: 9px; color: var(--text-3); cursor: pointer; font-size: 15px;
  transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--border-3); background: var(--panel-3); }
  .btn.primary:hover { background: var(--accent-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 30px -10px rgba(198, 246, 79, .7); }
  .btn.ghost:hover { background: rgba(255, 255, 255, .04); }
  .btn.danger:hover { background: rgba(255, 107, 107, .08); }
  .icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
}

/* ---------- Pastilles & étiquettes ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap;
  background: rgba(255, 255, 255, .05); color: var(--text-2); border: 1px solid var(--border);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill.plain::before { display: none; }
.pill.green { color: var(--green); background: rgba(61, 220, 132, .08); border-color: rgba(61, 220, 132, .2); }
.pill.amber { color: var(--amber); background: rgba(247, 185, 85, .08); border-color: rgba(247, 185, 85, .2); }
.pill.red { color: var(--red); background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .2); }
.pill.blue { color: var(--blue); background: rgba(116, 169, 255, .08); border-color: rgba(116, 169, 255, .2); }
.pill.violet { color: var(--violet); background: rgba(166, 139, 255, .1); border-color: rgba(166, 139, 255, .22); }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255, 255, 255, .07); color: var(--text-2);
}
.tag.new { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px -4px rgba(198, 246, 79, .7); }
.tag.sent { background: rgba(116, 169, 255, .14); color: #a9c8ff; }
.tag.failed { background: rgba(255, 107, 107, .14); color: #ffa3a3; }
.tag.test { background: rgba(166, 139, 255, .15); color: #c7b6ff; }

/* ---------- Structure de l'application ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px 14px; border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 18, 22, .85), rgba(9, 10, 13, .9));
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, var(--accent-2), #8fd61c); color: var(--accent-ink);
  font-weight: 800; font-size: 17px; letter-spacing: -.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 18px -6px rgba(198, 246, 79, .6);
}
.brand-name { font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.brand-sub { color: var(--text-3); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px;
  border-radius: 10px; background: none; border: 0; color: var(--text-2); cursor: pointer;
  font-weight: 500; text-align: left; transition: background-color 150ms ease, color 150ms ease;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; opacity: .85; flex: none; }
.nav-item.active { background: rgba(255, 255, 255, .06); color: var(--text); box-shadow: var(--highlight); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-item.active svg { color: var(--accent); opacity: 1; }
@media (hover: hover) and (pointer: fine) { .nav-item:hover { background: rgba(255, 255, 255, .04); color: var(--text); } }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 750; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 700; background: linear-gradient(140deg, #2a2f3a, #1a1d24); border: 1px solid var(--border-2); }
.foot-text { min-width: 0; flex: 1; }
.foot-text > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px 2px; font-size: 12.5px; color: var(--text-2); }
.sidebar-foot .foot-text > div:first-child { font-weight: 500; font-size: 12.5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.live-dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(61, 220, 132, .14), 0 0 10px var(--green); }
.live-dot.off { background: var(--red); }

.main { padding: 30px 40px 80px; min-width: 0; max-width: 1560px; width: 100%; }
.page { display: none; }
.page.active { display: block; animation: pageIn 260ms var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Cartes ---------- */
.card {
  position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .008)), var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; min-width: 0;
  box-shadow: var(--highlight), 0 1px 2px rgba(0, 0, 0, .35);
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1180px) { .grid-2 { grid-template-columns: 1fr; } }
.alert { border-radius: var(--radius); padding: 13px 16px; margin-bottom: 18px; border: 1px solid; line-height: 1.5; }
.alert.warn { background: linear-gradient(90deg, rgba(247, 185, 85, .1), rgba(247, 185, 85, .03)); border-color: rgba(247, 185, 85, .28); color: #f9d08c; }
.alert a { color: inherit; text-decoration: underline; cursor: pointer; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi {
  position: relative; overflow: hidden; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .008)), var(--panel);
  border: 1px solid var(--border); box-shadow: var(--highlight);
}
.kpi::after { content: ""; position: absolute; inset: -40% -20% auto auto; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(198, 246, 79, .07), transparent 70%); pointer-events: none; }
.kpi-label { color: var(--text-3); font-size: 12px; font-weight: 550; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-sub { color: var(--text-2); font-size: 12px; margin-top: 4px; }

/* Tableaux */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; padding: 0 12px 10px; white-space: nowrap; }
.table td { padding: 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .table tbody tr:hover { background: rgba(255, 255, 255, .02); } }
.table td.num { font-variant-numeric: tabular-nums; text-align: right; }
.table .name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.empty { color: var(--text-2); text-align: center; padding: 34px 12px; }
.empty a { cursor: pointer; }

/* Barres de santé des IP */
.net-row { padding: 12px 0; border-top: 1px solid var(--border); }
.net-row:first-child { border-top: 0; padding-top: 0; }
.net-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; display: flex; }
.bar span { height: 100%; transition: width 400ms var(--ease-out); }
.bar .ok { background: linear-gradient(90deg, #2fbf6f, var(--green)); }
.bar .pause { background: var(--amber); }
.bar .bench { background: var(--red); }
.net-legend { display: flex; gap: 14px; color: var(--text-3); font-size: 12px; margin-top: 7px; flex-wrap: wrap; }

/* ---------- Fil d'actualité ---------- */
.feed-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bot-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.bot-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 11px;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--text-2); border-radius: 999px;
  cursor: pointer; font-weight: 550; box-shadow: var(--highlight);
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
}
.bot-tab:active { transform: scale(.97); }
.bot-tab.active { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) { .bot-tab:hover { color: var(--text); border-color: var(--border-3); } }
.bot-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.bot-tab .dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.bot-tab .count { min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: rgba(255, 255, 255, .07); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.bot-tab.active .count { background: var(--accent); color: var(--accent-ink); }
.feed-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.live-bar {
  display: inline-flex; align-items: center; gap: 10px; height: 32px; padding: 0 14px 0 12px; margin-bottom: 18px;
  border-radius: 999px; border: 1px solid rgba(61, 220, 132, .2); background: rgba(61, 220, 132, .06);
  color: var(--text-2); font-size: 12.5px;
}
.live-bar.off { border-color: var(--border); background: rgba(255, 255, 255, .03); }
.live-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s ease-out infinite; }
.live-bar.off .live-pulse { background: var(--text-3); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); } 70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.feed.big { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1280px) { .feed.big { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1060px) { .feed.big { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .feed.big { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.feed-item {
  position: relative; display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border);
  box-shadow: var(--highlight), 0 1px 2px rgba(0, 0, 0, .4);
  transition: transform 220ms var(--ease-out), border-color 180ms ease, box-shadow 220ms ease;
}
.feed-item:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) {
  .feed-item:hover { transform: translateY(-3px); border-color: var(--border-3); box-shadow: var(--highlight), 0 18px 40px -16px rgba(0, 0, 0, .8); }
  .feed-item:hover .feed-img img { transform: scale(1.035); }
}
.feed-item.is-new { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), 0 14px 40px -18px rgba(198, 246, 79, .5); }
.feed-enter { animation: feedIn 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes feedIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.feed-img { position: relative; aspect-ratio: 3 / 4; background: var(--panel-3); overflow: hidden; }
.feed-img.broken img { display: none; }
.feed-img.broken::before { content: "Photo indisponible"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.feed-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 500ms var(--ease-out); }
.feed-img::after { content: ""; position: absolute; inset: auto 0 0; height: 46%; background: linear-gradient(180deg, transparent, rgba(5, 6, 8, .82)); pointer-events: none; }
.feed-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 1; }
.photo-count { position: absolute; top: 10px; right: 10px; z-index: 1; height: 22px; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; border-radius: 7px; background: rgba(8, 9, 12, .7); backdrop-filter: blur(6px); font-size: 11px; font-weight: 600; color: var(--text); }
.feed-price {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.feed-price b {
  display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-weight: 750; font-size: 15px; letter-spacing: -.02em; box-shadow: 0 8px 20px -8px rgba(198, 246, 79, .7);
}
.feed-price small {
  max-width: 100%; padding: 3px 7px; border-radius: 7px; background: rgba(8, 9, 12, .78); backdrop-filter: blur(6px);
  color: #e9f7c8; font-size: 11px; font-weight: 600; line-height: 1.3; letter-spacing: 0;
}
.feed-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.feed-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.feed-chips { display: flex; gap: 5px; flex-wrap: wrap; min-height: 22px; }
.chip-mini { height: 22px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 7px; font-size: 11.5px; font-weight: 550; color: var(--text-2); background: rgba(255, 255, 255, .05); border: 1px solid var(--border); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip-mini.size { color: var(--text); background: rgba(255, 255, 255, .08); }
.feed-foot { display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 11.5px; padding-top: 8px; border-top: 1px solid var(--border); }
.feed-foot span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.feed-foot span:last-child { white-space: nowrap; flex: none; }
.feed-foot b { color: var(--text-2); font-weight: 600; }
.feed-more { display: flex; justify-content: center; margin-top: 22px; }

/* ---------- Cartes de bots ---------- */
.bot-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.bot-card {
  display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .008)), var(--panel);
  border: 1px solid var(--border); box-shadow: var(--highlight);
}
.bot-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bot-card-head h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.02em; }
.bot-meta { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13px; margin: 0; }
.bot-meta dt { color: var(--text-3); }
.bot-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bot-stat { padding: 10px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); min-width: 0; }
.bot-stat b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bot-stat span { display: block; color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-error { color: #ffb0b0; font-size: 12.5px; background: rgba(255, 107, 107, .07); border: 1px solid rgba(255, 107, 107, .18); border-radius: 10px; padding: 9px 11px; line-height: 1.45; }
.bot-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.search-list { display: flex; flex-wrap: wrap; gap: 6px; }
.proxy-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.form input:not([type=checkbox]), .form select, select, input[type=search], .cell-input {
  height: 38px; padding: 0 12px; border-radius: var(--radius-sm); min-width: 0; width: 100%;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--border-2); color: var(--text);
  outline: none; transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a7aeba' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input[type=search] { width: auto; min-width: 240px; }
.feed-filters select, .card-head select, .actions select { width: auto; min-width: 210px; }
/* Menus déroulants : fond opaque sombre, y compris la liste qui s'ouvre (sinon blanc sur blanc sous Windows) */
select, .form select, .cell-input:is(select) { background-color: #13161a; color-scheme: dark; }
select option, select optgroup { background-color: #15181d; color: #f3f5f7; }
select option:checked { background-color: #2a3020; color: #dcff7a; }
.btn svg { width: 15px; height: 15px; flex: none; }
.form input:focus, .form select:focus, select:focus, input[type=search]:focus, .cell-input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px rgba(198, 246, 79, .1); background-color: rgba(255, 255, 255, .045); }
input::placeholder { color: var(--text-3); }
.form-foot, .inline-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.inline-actions { justify-content: flex-start; }
.input-row { display: flex; gap: 8px; }
.hint { font-size: 12px; color: var(--text-3); margin: 0; font-weight: 400; line-height: 1.5; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.bullets, .steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; color: var(--text-2); }
.bullets b, .steps b { color: var(--text); }

.toggles { display: flex; flex-direction: column; gap: 12px; }
.toggle { flex-direction: row !important; align-items: center; gap: 11px !important; color: var(--text) !important; font-size: 13.5px !important; font-weight: 500 !important; cursor: pointer; }
.toggle em { color: var(--text-3); font-style: normal; font-size: 12px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { width: 36px; height: 21px; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--border-2); position: relative; flex: none; transition: background-color 180ms ease, border-color 180ms ease; }
.toggle span::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #d6dae1; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform 220ms var(--ease-out), background-color 180ms ease; }
.toggle input:checked + span { background: var(--accent); border-color: transparent; }
.toggle input:checked + span::after { transform: translateX(15px); background: var(--accent-ink); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.chips-label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 550; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); }
.seg-item { border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 8px; color: var(--text-2); cursor: pointer; font-weight: 550; transition: background-color 150ms ease, color 150ms ease; }
.seg-item.active { background: var(--panel-3); color: var(--text); box-shadow: var(--highlight), 0 1px 3px rgba(0, 0, 0, .4); }
.chat-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.chat-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; }

/* ---------- Panneaux latéraux ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(3, 4, 6, .55); backdrop-filter: blur(3px); animation: fadeIn 200ms ease-out; }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 30; width: min(700px, calc(100vw - 20px));
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 30%), #0d0f13;
  border: 1px solid var(--border-2); box-shadow: var(--shadow-lg);
  animation: drawerIn 380ms var(--ease-drawer);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot { display: flex; gap: 8px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--border); background: rgba(0, 0, 0, .2); }
.section { display: flex; flex-direction: column; gap: 13px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: 0; margin-bottom: 0; }
.section h3 { margin: 0; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.section-head { display: flex; justify-content: space-between; align-items: center; }
.search-block { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-bottom: 12px; border-radius: 12px; background: rgba(255, 255, 255, .02); border: 1px solid var(--border-2); }
.search-head { display: flex; gap: 8px; align-items: center; }
.search-label { font-weight: 650; }
.tg-fields { display: flex; flex-direction: column; gap: 12px; transition: opacity 180ms ease; }
.tg-fields.disabled { opacity: .4; pointer-events: none; }

/* Journal */
.logs { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; line-height: 1.6; background: #08090b; }
.log-line { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 1px 0; }
.log-line time { color: var(--text-3); }
.log-line.warn span { color: #f9d08c; }
.log-line.error span { color: #ffa3a3; }
.log-line.post span { color: var(--accent); }
.log-line.filter span { color: #5e6573; }
.log-line.debug span { color: var(--text-3); white-space: pre-wrap; }
.lane-table td, .lane-table th { font-size: 12.5px; }

/* ---------- Détail d'une annonce (fenêtre deux colonnes) ---------- */
.item-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 28px; }
.im-panel {
  width: min(1180px, 100%); height: min(780px, calc(100vh - 56px));
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 440px);
  border-radius: 22px; overflow: hidden; background: #0d0f13; border: 1px solid var(--border-2);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .03);
  animation: modalIn 260ms var(--ease-out);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }

.im-gallery { position: relative; display: flex; flex-direction: column; min-height: 0; background: #050607; border-right: 1px solid var(--border); }
.im-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; }
.im-backdrop { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(36px) saturate(1.2); opacity: .35; transform: scale(1.05); pointer-events: none; }
.im-photo { position: relative; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; animation: fadeIn 220ms ease-out; }
.im-nophoto { color: var(--text-3); }
.im-counter { position: absolute; top: 16px; left: 16px; z-index: 2; height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 8px; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; background: rgba(8, 9, 12, .72); backdrop-filter: blur(8px); border: 1px solid var(--border-2); }
.im-arrow {
  position: absolute; top: calc(50% - 46px); z-index: 2; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border-2); background: rgba(14, 16, 20, .72); backdrop-filter: blur(10px);
  color: var(--text); cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease, opacity 150ms ease;
}
.im-arrow svg { width: 20px; height: 20px; }
.im-arrow.prev { left: 16px; }
.im-arrow.next { right: 16px; }
.im-arrow:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .im-arrow:hover { background: rgba(30, 34, 42, .9); } }
.im-thumbs { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; border-top: 1px solid var(--border); background: #08090b; scrollbar-width: thin; }
.item-modal.single .im-arrow, .item-modal.single .im-thumbs, .item-modal.single .im-counter { display: none; }
.thumb { flex: none; width: 58px; height: 72px; padding: 0; border-radius: 9px; overflow: hidden; cursor: pointer; background: none; border: 2px solid transparent; opacity: .55; transition: opacity 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out); }
.thumb:active { transform: scale(.95); }
.thumb.on { border-color: var(--accent); opacity: 1; }
@media (hover: hover) and (pointer: fine) { .thumb:hover { opacity: .9; } }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.im-info { position: relative; display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow-y: auto; padding: 28px 28px 30px; }
.im-close { position: absolute; top: 16px; right: 16px; }
.im-kicker { display: flex; align-items: center; gap: 8px; padding-right: 40px; color: var(--text-3); font-size: 12.5px; font-weight: 550; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; }
.im-title { margin: -6px 0 0; font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; }
.im-price { display: flex; flex-direction: column; gap: 2px; }
.im-price b { font-size: 38px; line-height: 1; font-weight: 780; letter-spacing: -.045em; color: var(--accent); font-variant-numeric: tabular-nums; }
.im-price span { color: var(--text-3); font-size: 12.5px; margin-top: 6px; }
.im-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.im-chips .chip-mini { height: 28px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.im-cta { width: 100%; }
.im-seller { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.im-seller b { display: block; font-size: 14px; }
.im-seller small { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.stars { position: relative; display: inline-block; width: 70px; height: 13px; background: linear-gradient(90deg, var(--amber) var(--score), rgba(255, 255, 255, .15) var(--score)); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 13'%3E%3Cg fill='%23000'%3E%3Cpath id='s' d='M6.5 0l1.9 4.1 4.4.5-3.3 3 .9 4.4-3.9-2.2-3.9 2.2.9-4.4-3.3-3 4.4-.5z'/%3E%3Cuse href='%23s' x='14'/%3E%3Cuse href='%23s' x='28'/%3E%3Cuse href='%23s' x='42'/%3E%3Cuse href='%23s' x='56'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 13'%3E%3Cg fill='%23000'%3E%3Cpath id='s' d='M6.5 0l1.9 4.1 4.4.5-3.3 3 .9 4.4-3.9-2.2-3.9 2.2.9-4.4-3.3-3 4.4-.5z'/%3E%3Cuse href='%23s' x='14'/%3E%3Cuse href='%23s' x='28'/%3E%3Cuse href='%23s' x='42'/%3E%3Cuse href='%23s' x='56'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.im-details { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.im-details dt { color: var(--text-3); }
.im-details dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.im-desc h3 { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.im-desc p { margin: 0; white-space: pre-wrap; line-height: 1.65; color: var(--text-2); }
.im-desc:empty { display: none; }

@media (max-width: 860px) {
  .im-close { position: fixed; top: 12px; right: 12px; z-index: 3; background: rgba(8, 9, 12, .72); backdrop-filter: blur(8px); border: 1px solid var(--border-2); color: var(--text); }
  .im-kicker { padding-right: 0; }
  .item-modal { padding: 0; }
  .im-panel { width: 100%; height: 100%; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: 52vh minmax(0, 1fr); }
  .im-gallery { border-right: 0; border-bottom: 1px solid var(--border); }
  .im-thumbs { display: none; }
  .im-info { padding: 22px 18px 28px; }
}

/* ---------- Constructeur de recherche (calqué sur Vinted) ---------- */
.sb { gap: 16px; }
.sb.sb-invalid { border-color: rgba(247, 185, 85, .35); }
.sb-field { display: flex; flex-direction: column; gap: 8px; position: relative; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.sb-label { display: flex; align-items: baseline; gap: 8px; }
.sb-label em { font-style: normal; color: var(--accent); font-weight: 600; font-size: 11.5px; }
.sb-input-icon { position: relative; display: block; }
.sb-input-icon svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.sb-input-icon input { padding-left: 36px !important; }
.sb-picker {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: #13161a; color: var(--text-2);
  font-weight: 550; text-align: left; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease;
}
.sb-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-picker svg { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.sb-picker.set { color: var(--text); border-color: var(--accent-line); background: rgba(198, 246, 79, .05); }
@media (hover: hover) and (pointer: fine) { .sb-picker:hover { border-color: var(--border-3); } }
.sb-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border-radius: 14px; background: #15181d; border: 1px solid var(--border-2); box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .8);
  animation: popIn 160ms var(--ease-out); transform-origin: top center;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.sb-pop input[type=search] { width: 100%; min-width: 0; }
.sb-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 12px; padding: 0 2px; }
.sb-crumb { border: 0; background: none; color: var(--text-2); padding: 3px 6px; border-radius: 6px; cursor: pointer; font-weight: 550; }
.sb-crumb:last-child { color: var(--text); }
@media (hover: hover) and (pointer: fine) { .sb-crumb:hover { background: rgba(255, 255, 255, .05); color: var(--text); } }
.sb-sep { color: var(--text-3); }
.sb-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sb-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 38px; padding: 7px 10px;
  border: 0; border-radius: 9px; background: none; color: var(--text); text-align: left; cursor: pointer; transition: background-color 120ms ease;
}
.sb-opt span { display: flex; flex-direction: column; min-width: 0; }
.sb-opt b { font-weight: 550; font-size: 13.5px; }
.sb-opt small { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-opt i { display: inline-flex; align-items: center; gap: 4px; font-style: normal; color: var(--text-3); font-size: 11.5px; }
.sb-opt i svg { width: 15px; height: 15px; }
.sb-opt.on { background: var(--accent-soft); color: var(--accent); }
.sb-opt-all b { color: var(--text-2); }
@media (hover: hover) and (pointer: fine) { .sb-opt:hover { background: rgba(255, 255, 255, .05); } .sb-opt.on:hover { background: var(--accent-soft); } }
.sb-empty { padding: 12px 10px; color: var(--text-3); font-size: 12.5px; }
.sb-combo { position: relative; }
.sb-combo input[type=search] { width: 100%; min-width: 0; }
.sb-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; padding: 6px; border-radius: 12px; background: #15181d; border: 1px solid var(--border-2); box-shadow: 0 20px 44px -12px rgba(0, 0, 0, .8); margin: 0; }
.sb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-tags:empty { display: none; }
.sb-tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 11px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font-size: 12.5px; font-weight: 600; }
.sb-tag button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(198, 246, 79, .15); color: var(--accent); cursor: pointer; font-size: 10px; padding: 0; }
.sb-sizes { display: flex; flex-direction: column; gap: 12px; }
.sb-size-group { display: flex; flex-direction: column; gap: 7px; }
.sb-size-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.sb-chip { height: 30px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-2); background: rgba(255, 255, 255, .02); color: var(--text-2); font-size: 12.5px; font-weight: 550; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 160ms var(--ease-out); }
.sb-chip:active { transform: scale(.96); }
.sb-chip.on { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
@media (hover: hover) and (pointer: fine) { .sb-chip:not(.on):hover { border-color: var(--border-3); color: var(--text); } }
.sb-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.sb-color { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border-2); background: rgba(255, 255, 255, .02); color: var(--text-2); font-size: 12.5px; font-weight: 550; cursor: pointer; text-align: left; transition: border-color 120ms ease, color 120ms ease, transform 160ms var(--ease-out); }
.sb-color:active { transform: scale(.97); }
.sb-color i { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.sb-color.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.sb-adv summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.sb-adv[open] summary { margin-bottom: 10px; }
.sb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.sb-summary { color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.sb-invalid .sb-summary { color: var(--amber); }
.sb-foot .btn { flex: none; }

/* ---------- Fiche utilisateur (admin) ---------- */
.drawer.wide { width: min(1000px, calc(100vw - 20px)); }
.ud-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ud-head h2 { margin: 0 0 3px; }
.ud-head .muted { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ud-tabs { margin: 14px 22px 0; align-self: flex-start; }
.ud-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-bottom: 12px; border-radius: 14px; background: rgba(255, 255, 255, .025); border: 1px solid var(--border); }
.ud-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ud-card-head b { font-size: 15px; letter-spacing: -.01em; }
.ud-key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ud-key code { flex: 1; min-width: 0; padding: 7px 10px; overflow-wrap: anywhere; }
.ud-key code.revealed { color: var(--accent); border-color: var(--accent-line); }
.search-list a.pill { text-decoration: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-3); text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .link-btn:hover { color: var(--accent); text-decoration-color: var(--accent); } }
.item-modal { z-index: 40; }

/* Tutoriel */
.tuto summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.tuto summary::-webkit-details-marker { display: none; }
.tuto summary h2 { margin: 0; font-size: 15px; }
.tuto[open] summary { margin-bottom: 16px; }
.tuto-steps { counter-reset: step; list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.tuto-steps > li { counter-increment: step; position: relative; padding: 14px 16px 14px 56px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--border); }
.tuto-steps > li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 750; font-size: 13px; }
.tuto-steps h3 { margin: 2px 0 6px; font-size: 14px; letter-spacing: -.01em; }
.tuto-steps p { margin: 0 0 4px; line-height: 1.55; color: var(--text-2); }
.advice { margin: 8px 0 2px; padding: 8px 11px; border-radius: 9px; font-size: 12.5px; line-height: 1.45; color: var(--text-2); background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.advice.ok { color: #a9ecc5; background: rgba(61, 220, 132, .06); border-color: rgba(61, 220, 132, .2); }
.rm-head { display: flex; align-items: center; gap: 10px; }
.rm-head .rm-gauge { padding-top: 0; }
.kstat { display: grid; gap: 6px; margin-top: 10px; }
.kstat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding: 8px 11px; border-radius: 9px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--border); font-size: 13px; }
.kstat-row span { color: var(--text-3); }
.kstat-row b { font-weight: 600; color: var(--text); text-align: right; }
.kstat-row.ok b { color: var(--green); }
.kstat-row.warn { border-color: rgba(247, 185, 85, .35); }
.kstat-row.warn b { color: var(--amber); }
.kstat-row.bad { border-color: rgba(255, 107, 107, .4); background: rgba(255, 107, 107, .06); }
.kstat-row.bad b { color: var(--red); }
.kstat-row[title] { cursor: help; }
.advice.bad { color: #ffb0b0; background: rgba(255, 107, 107, .07); border-color: rgba(255, 107, 107, .3); }
.advice.warn b, .advice.bad b { color: inherit; }
.advice.plan { color: var(--text-2); background: rgba(116, 169, 255, .06); border-color: rgba(116, 169, 255, .2); }
.advice b { color: var(--text); }
.usage { margin: 10px 0 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255, 255, 255, .025); font-size: 12.5px; color: var(--text-2); }
.usage b { color: var(--text); }
.usage-top { display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 7px; }
.usage-when { margin-top: 6px; }
.usage.warn { border-color: rgba(247, 185, 85, .35); background: rgba(247, 185, 85, .06); }
.usage.bad { border-color: rgba(255, 107, 107, .4); background: rgba(255, 107, 107, .07); }
.usage.bad .usage-when, .usage.bad .usage-when b { color: #ffb0b0; }
.usage-mini { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.usage-mini.warn { color: var(--amber); }
.usage-mini.bad { color: var(--red); }
.advice.warn { color: #f9d08c; background: rgba(247, 185, 85, .07); border-color: rgba(247, 185, 85, .25); }
.empty-key { text-align: center; padding: 36px 20px; }
.empty-key h2 { margin: 0 0 6px; font-size: 17px; }
.empty-key p { margin: 0 0 16px; }
.ip-info summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.ip-info summary::-webkit-details-marker { display: none; }
.ip-info summary h2 { margin: 0; font-size: 15px; }
.ip-info[open] summary { margin-bottom: 12px; }
.ip-info[open] summary .muted { display: none; }
.key-intro { margin: 0 0 14px; }
.key-form { margin-top: 10px; gap: 12px; }
.key-form .btn { width: 100%; }
.tuto-tip { margin-top: 10px; padding: 11px 13px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text-2); font-size: 13px; line-height: 1.55; }
.tuto-tip b { color: var(--text); }
.tuto-tip p { margin: 0; }
.tuto-tip p + p { margin-top: 6px; }
.tuto-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.tuto-shots figure { margin: 0; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; }
.tuto-shots img { width: 100%; display: block; }

/* Administration */
.admin-table td { white-space: nowrap; }
.admin-table td .muted.small { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.cell-input { width: 130px; height: 32px; }
.cell-input[type=number] { width: 92px; }

/* Notifications */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  max-width: 420px; padding: 12px 15px 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.45;
  background: rgba(24, 27, 33, .92); backdrop-filter: blur(12px); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: flex-start; animation: toastIn 300ms var(--ease-out);
}
.toast::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.toast.error::before { background: var(--red); box-shadow: 0 0 10px var(--red); }
.toast.success::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Connexion / inscription ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 52px; border-right: 1px solid var(--border);
  background: radial-gradient(700px 400px at 20% 0%, rgba(198, 246, 79, .12), transparent 60%), radial-gradient(600px 500px at 100% 100%, rgba(130, 100, 255, .14), transparent 60%), #08090c;
}
.auth-side h2 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; letter-spacing: -.04em; margin: 0 0 16px; max-width: 520px; }
.auth-side p { color: var(--text-2); font-size: 15.5px; line-height: 1.6; max-width: 460px; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: var(--text-2); }
.auth-points li span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); flex: none; font-size: 14px; }
.auth-side .auth-quote { color: var(--text-3); font-size: 12.5px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 22px; }
.login-card h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.035em; margin: 0; }
.login-card .sub { color: var(--text-2); margin: 6px 0 0; }
.auth-tabs { display: flex; }
.auth-tabs .seg-item { flex: 1; }
.login-card .btn.primary { height: 44px; font-size: 14.5px; }
.login-error { margin: 0; padding: 11px 13px; border-radius: 10px; font-size: 13px; color: #ffb0b0; background: rgba(255, 107, 107, .08); border: 1px solid rgba(255, 107, 107, .2); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 900px) { .auth-page { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- Responsive app ---------- */
@media (max-width: 960px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .bot-cards { grid-template-columns: 1fr; }
}

/* ---------- Boutons : variantes ---------- */
.btn.locked { color: var(--text-2); border-style: dashed; border-color: var(--border-3); background: transparent; box-shadow: none; }
.btn.locked svg { width: 13px; height: 13px; color: var(--amber); }
.btn.danger-solid { background: var(--red); color: #1a0505; border-color: transparent; font-weight: 650; }
.btn .svg, .btn.small svg { width: 14px; height: 14px; }
.push-right { margin-left: auto; }
@media (hover: hover) and (pointer: fine) {
  .btn.locked:hover { color: var(--text); background: rgba(247, 185, 85, .06); border-color: rgba(247, 185, 85, .4); }
  .btn.danger-solid:hover { background: #ff8585; }
}

/* ---------- Menu « ⋯ » ---------- */
.kebab { width: 30px; height: 30px; color: var(--text-2); border: 1px solid transparent; }
.kebab svg { width: 16px; height: 16px; }
.kebab.open { background: rgba(255, 255, 255, .07); color: var(--text); border-color: var(--border-2); }
.cell-menu { width: 44px; text-align: right; padding-left: 4px !important; padding-right: 6px !important; }
.menu-pop {
  position: fixed; z-index: 60; min-width: 230px; max-width: 300px; padding: 6px;
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px;
  box-shadow: var(--highlight), 0 20px 50px -12px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .4);
  animation: menuIn 160ms var(--ease-out);
}
@keyframes menuIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-item:focus-visible { outline: none; background: rgba(255, 255, 255, .07); }
.menu-item.danger { color: var(--red); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--border); }
@media (hover: hover) and (pointer: fine) {
  .menu-item:hover { background: rgba(255, 255, 255, .06); }
  .menu-item.danger:hover { background: rgba(255, 107, 107, .1); }
}

/* ---------- Fenêtre d'alerte ---------- */
.dialog-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(3, 4, 6, .62); backdrop-filter: blur(4px); animation: fadeIn 180ms ease-out; }
.dialog {
  width: min(460px, 100%); padding: 26px 24px 20px; border-radius: 18px; background: var(--panel);
  border: 1px solid var(--border-2); box-shadow: var(--highlight), 0 30px 80px -20px rgba(0, 0, 0, .9);
  animation: dialogIn 260ms var(--ease-out);
}
@keyframes dialogIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.dialog-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 20px; margin-bottom: 14px;
  color: var(--amber); background: rgba(247, 185, 85, .1); border: 1px solid rgba(247, 185, 85, .25); }
.dialog-icon.danger { color: var(--red); background: rgba(255, 107, 107, .1); border-color: rgba(255, 107, 107, .25); }
.dialog h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.02em; line-height: 1.35; }
.dialog p { margin: 0 0 10px; color: var(--text-2); line-height: 1.55; font-size: 14px; }
.dialog p.muted { color: var(--text-3); font-size: 13px; }
.dialog-list { margin: 0 0 10px; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Rythme de surveillance ---------- */
.field-label { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; color: var(--text-2); font-size: 13px; font-weight: 550; }
.rate-field { display: flex; flex-direction: column; gap: 10px; }
.rate-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .rate-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rate-card {
  display: flex; flex-direction: column; gap: 6px; padding: 11px 11px 10px; border-radius: 12px; text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); font: inherit;
  transition: border-color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
}
.rate-card:active:not([disabled]) { transform: scale(.98); }
.rate-card.active { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-line); }
.rate-card[disabled] { opacity: .5; cursor: not-allowed; }
.rc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.rc-top b { font-size: 13.5px; font-weight: 650; }
.rc-sec { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate-card.active .rc-sec { color: var(--accent); }
.rc-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.4; min-height: 32px; }
.rc-desc svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 4px; color: var(--amber); }
.rc-risk { display: flex; align-items: center; gap: 3px; margin-top: auto; }
.rc-risk i { width: 14px; height: 4px; border-radius: 99px; background: var(--panel-3); }
.rc-risk em { font-style: normal; font-size: 10.5px; color: var(--text-3); margin-left: 4px; white-space: nowrap; }
.rc-risk.lvl-1 i:nth-child(-n+1) { background: var(--green); }
.rc-risk.lvl-2 i:nth-child(-n+2) { background: var(--amber); }
.rc-risk.lvl-3 i:nth-child(-n+3) { background: var(--red); }
.rc-risk.muted-risk em { margin-left: 0; }
@media (hover: hover) and (pointer: fine) { .rate-card:not([disabled]):not(.active):hover { border-color: var(--border-3); background: var(--panel-3); } }
.rate-custom { max-width: 260px; }
.rate-meter { display: block; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.rate-meter b { color: var(--text); font-weight: 600; }
.rate-meter .muted { color: var(--text-3); margin-top: 2px; }
.rm-gauge { display: flex; gap: 3px; padding-top: 6px; flex: none; }
.rm-gauge i { width: 16px; height: 5px; border-radius: 99px; background: var(--panel-3); }
.rm-gauge.lvl-1 i:nth-child(-n+1) { background: var(--green); }
.rm-gauge.lvl-2 i:nth-child(-n+2) { background: var(--amber); }
.rm-gauge.lvl-3 i:nth-child(-n+3) { background: var(--red); }
.toggle-help { align-items: flex-start !important; }
.toggle-help > span { margin-top: 1px; }
.toggle-help .hint { margin-top: 3px; font-weight: 400; }

/* ---------- Tutoriel : menu Webshare ---------- */
.ws-menu {
  width: 260px; margin-top: 12px; padding: 8px; border-radius: 12px; background: #fff; color: #1d2330;
  font-size: 13.5px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .7); border: 1px solid rgba(255, 255, 255, .2);
}
.ws-group { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: #eef8f3; color: #11865b; font-weight: 600; }
.ws-ico { position: relative; width: 16px; height: 16px; flex: none; }
.ws-ico i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #1d2330; }
.ws-ico i:nth-child(1) { left: 5px; top: 0; } .ws-ico i:nth-child(2) { left: 0; bottom: 0; } .ws-ico i:nth-child(3) { right: 0; bottom: 0; }
.ws-new { margin-left: auto; padding: 1px 7px; border-radius: 6px; background: #dbeafe; color: #2563eb; font-size: 10.5px; font-weight: 700; }
.ws-chev { width: 15px; height: 15px; fill: none; stroke: #11865b; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ws-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 30px; color: #3b4352; }
.ws-item::before { content: ""; position: absolute; left: 16px; width: 5px; height: 5px; border-radius: 50%; background: #c9ced6; }
.ws-item.on { font-weight: 700; color: #111827; background: rgba(198, 246, 79, .35); border-radius: 8px; box-shadow: inset 0 0 0 2px #8fbf1f; }
.ws-item.on::before { background: #11865b; }
.ws-here { margin-left: auto; font-size: 11px; font-weight: 700; color: #3c5a00; }

/* ---------- Navigation : état du monitoring ---------- */
.nav-status { margin-left: auto; min-width: 9px; height: 9px; border-radius: 99px; background: var(--text-3); display: grid; place-items: center; font-size: 10.5px; font-weight: 750; color: #1a0505; }
.nav-status.s-ok { background: var(--green); box-shadow: 0 0 10px rgba(61, 220, 132, .7); }
.nav-status.s-warn { background: var(--amber); box-shadow: 0 0 10px rgba(247, 185, 85, .6); }
.nav-status.s-fail { background: var(--red); box-shadow: 0 0 12px rgba(255, 107, 107, .8); min-width: 18px; height: 18px; padding: 0 5px; }
.nav-status.s-pending { background: var(--blue); }

/* ---------- Monitoring ---------- */
.mh { display: flex; align-items: center; gap: 18px; padding: 20px 22px; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid; }
.mh.s-ok { border-color: rgba(61, 220, 132, .25); background: linear-gradient(100deg, rgba(61, 220, 132, .1), rgba(61, 220, 132, .02) 60%); --tone: var(--green); }
.mh.s-warn { border-color: rgba(247, 185, 85, .28); background: linear-gradient(100deg, rgba(247, 185, 85, .1), rgba(247, 185, 85, .02) 60%); --tone: var(--amber); }
.mh.s-fail { border-color: rgba(255, 107, 107, .35); background: linear-gradient(100deg, rgba(255, 107, 107, .13), rgba(255, 107, 107, .02) 60%); --tone: var(--red); }
.mh.s-pending { border-color: rgba(116, 169, 255, .25); background: linear-gradient(100deg, rgba(116, 169, 255, .1), transparent 60%); --tone: var(--blue); }
.mh-pulse { position: relative; width: 14px; height: 14px; flex: none; }
.mh-pulse span, .mh-pulse::after { position: absolute; inset: 0; border-radius: 50%; background: var(--tone); }
.mh-pulse::after { content: ""; animation: mhPulse 2.2s var(--ease-out) infinite; }
@keyframes mhPulse { from { transform: scale(1); opacity: .6; } to { transform: scale(3); opacity: 0; } }
.mh-text { flex: 1; min-width: 0; }
.mh-text h2 { margin: 0 0 3px; font-size: 19px; letter-spacing: -.02em; }
.mh-text p { margin: 0; color: var(--text-2); font-size: 13px; }
.mh-text b { color: var(--text); font-weight: 600; }
.mh-score { text-align: right; flex: none; }
.mh-score b { font-size: 30px; font-weight: 750; letter-spacing: -.04em; color: var(--tone); font-variant-numeric: tabular-nums; }
.mh-score span { color: var(--text-3); font-size: 13px; margin-left: 4px; }

.mon-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; align-items: start; }
@media (max-width: 1100px) { .mon-checks { grid-template-columns: 1fr; } }
.mon-check { border-radius: 13px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--highlight); overflow: hidden; }
.mon-check.s-fail { border-color: rgba(255, 107, 107, .4); background: linear-gradient(180deg, rgba(255, 107, 107, .06), var(--panel) 70%); }
.mon-check.s-warn { border-color: rgba(247, 185, 85, .3); }
.mc-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 15px 9px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-3); }
.s-ok > .mc-head .mc-dot { background: var(--green); box-shadow: 0 0 9px rgba(61, 220, 132, .7); }
.s-warn > .mc-head .mc-dot { background: var(--amber); box-shadow: 0 0 9px rgba(247, 185, 85, .7); }
.s-fail > .mc-head .mc-dot { background: var(--red); box-shadow: 0 0 10px rgba(255, 107, 107, .9); }
.s-pending > .mc-head .mc-dot { background: var(--blue); }
.mc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-label { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.mc-alert { font-size: 10.5px; font-weight: 700; color: var(--red); background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .25); padding: 1px 6px; border-radius: 6px; }
.mc-msg { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-check.open .mc-msg { white-space: normal; }
.mc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.mc-status { font-size: 12px; font-weight: 650; color: var(--text-2); }
.s-ok > .mc-head .mc-status { color: var(--green); }
.s-warn > .mc-head .mc-status { color: var(--amber); }
.s-fail > .mc-head .mc-status { color: var(--red); }
.mc-time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.mc-strip { display: flex; gap: 2px; padding: 0 15px 12px 36px; }
.mc-strip i { flex: 1; height: 14px; border-radius: 2px; background: rgba(255, 255, 255, .04); }
.mc-strip i.s-ok { background: rgba(61, 220, 132, .55); }
.mc-strip i.s-warn { background: rgba(247, 185, 85, .75); }
.mc-strip i.s-fail { background: var(--red); }
.mc-strip i.s-skip { background: rgba(255, 255, 255, .1); }
.mc-details { list-style: none; margin: 0; padding: 10px 15px 4px 36px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 5px; }
.mc-details li { position: relative; padding-left: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.mc-details li::before { content: "·"; position: absolute; left: 3px; color: var(--text-3); }
.mc-details li.good::before { content: "✓"; color: var(--green); left: 0; }
.mc-details li.bad { color: #ffb0b0; }
.mc-details li.bad::before { content: "✗"; color: var(--red); left: 0; }
.mc-details li.warn { color: #f9d08c; }
.mc-details li.warn::before { content: "!"; color: var(--amber); left: 3px; font-weight: 800; }
.mc-foot { padding: 8px 15px 12px 36px; font-size: 11.5px; color: var(--text-3); }
@media (hover: hover) and (pointer: fine) { .mc-head:hover .mc-label { color: var(--accent); } }

.sup-table td { vertical-align: top; }
.sup-table .num { white-space: nowrap; }
.pill-row { display: flex; gap: 5px; flex-wrap: wrap; }
.cell-error { margin-top: 5px; max-width: 320px; font-size: 11.5px; color: #ffb0b0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-fail > td:first-child, .row-warn > td:first-child { position: relative; }
.row-fail > td:first-child::before, .row-warn > td:first-child::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--amber); }
.row-fail > td:first-child::before { background: var(--red); box-shadow: 0 0 8px rgba(255, 107, 107, .6); }
.key-code { display: inline-block; max-width: 220px; padding: 4px 8px; margin-right: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: 12px; }
.key-code.revealed { max-width: 360px; white-space: normal; overflow-wrap: anywhere; color: var(--accent); }
.key-health { min-width: 180px; }
.key-health .bar { margin-bottom: 6px; }

.mon-events { display: flex; flex-direction: column; max-height: 460px; overflow-y: auto; margin: -4px -6px; padding: 0 6px; }
.mon-event { display: grid; grid-template-columns: 92px auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.mon-event:first-child { border-top: 0; }
.mon-event time { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; white-space: nowrap; }
.me-msg { color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; }
.me-msg summary { cursor: pointer; color: var(--text-3); font-size: 12px; margin-top: 3px; }
.me-msg pre { margin: 6px 0 0; padding: 9px 10px; border-radius: 8px; background: rgba(0, 0, 0, .3); font-size: 11.5px; white-space: pre-wrap; color: var(--text-2); max-height: 220px; overflow: auto; }
.mon-mails { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.mon-mails h3 { margin: 0 0 10px; font-size: 13.5px; }
.mon-mail { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; }
.mm-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.mon-mail time { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.mm-err { grid-column: 1 / -1; color: #ffb0b0; font-size: 11.5px; }

/* ---------- Fiche annonce : visionneuse avec zoom ---------- */
.im-panel { position: relative; }
.im-close {
  position: absolute; top: 14px; right: 14px; z-index: 6; width: 42px; height: 42px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(10, 11, 14, .82); backdrop-filter: blur(10px);
  color: #fff; cursor: pointer; box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .8); transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.im-close svg { width: 20px; height: 20px; }
.im-close:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .im-close:hover { background: rgba(40, 44, 54, .95); } }
.im-info { padding-top: 26px; }
.im-kicker, .im-title { padding-right: 52px; }
.im-stage { display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-in; background: #050607; }
.item-modal.zoomed .im-stage { cursor: grab; }
.item-modal.zoomed .im-stage.dragging { cursor: grabbing; }
.im-stage .im-photo {
  position: absolute; top: 0; left: 0; width: auto; height: auto; max-width: none; max-height: none; object-fit: fill;
  transform-origin: 0 0; will-change: transform; opacity: 0; animation: none; -webkit-user-drag: none;
}
.im-stage.loaded .im-photo { opacity: 1; transition: opacity 200ms ease-out; }
.im-loader { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--accent); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.im-stage.loaded .im-loader, .im-stage.failed .im-loader { display: none; }
.im-failed { display: none; position: absolute; inset: 0; place-items: center; padding: 20px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.im-stage.failed .im-failed { display: grid; }
.im-stage .im-nophoto { position: absolute; inset: 0; display: grid; place-items: center; }
.im-zoombar {
  position: absolute; left: 50%; bottom: 96px; z-index: 3; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 12px; background: rgba(10, 11, 14, .8); backdrop-filter: blur(10px); border: 1px solid var(--border-2);
}
.item-modal.single .im-zoombar { bottom: 16px; }
.im-zbtn { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--text); cursor: pointer; }
.im-zbtn svg { width: 18px; height: 18px; }
.im-zbtn:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .im-zbtn:hover { background: rgba(255, 255, 255, .08); } }
.im-zlevel { min-width: 52px; text-align: center; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-2); }
.im-zhint {
  position: absolute; left: 50%; top: 16px; z-index: 3; transform: translateX(-50%); padding: 6px 12px; border-radius: 99px; white-space: nowrap;
  background: rgba(10, 11, 14, .78); backdrop-filter: blur(8px); border: 1px solid var(--border-2); font-size: 12px; color: var(--text-2);
  pointer-events: none; transition: opacity 300ms ease;
}
.im-zhint.gone { opacity: 0; }
.item-modal.zoomed .im-arrow { opacity: 0; pointer-events: none; }
.im-price .im-allin { color: var(--text); font-size: 14px; margin-top: 8px; }
.im-price .im-allin strong { color: var(--accent); font-weight: 700; }
/* Plein écran : la photo occupe tout l'écran */
.item-modal.full .im-panel { width: 100vw; height: 100vh; height: 100dvh; max-width: none; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: 1fr; }
.item-modal.full .im-info { display: none; }
.item-modal.full .im-gallery { border: 0; }
.item-modal.full { padding: 0; }

/* ---------- Recherches du bot : cartes + détail ---------- */
.section-count { color: var(--accent); margin-left: 4px; }
.search-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .search-overview { grid-template-columns: 1fr; } }
.search-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 124px; padding: 14px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); font: inherit; box-shadow: var(--highlight);
  transition: border-color 150ms ease, transform 160ms var(--ease-out), background-color 150ms ease;
}
.search-card:active { transform: scale(.985); }
.search-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-card.invalid { border-color: rgba(247, 185, 85, .35); }
.sc-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sc-head b { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-num { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; background: rgba(255, 255, 255, .07); font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.sc-summary { margin: 0; flex: 1; color: var(--text-2); font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-link { font-size: 12px; font-weight: 600; color: var(--accent); }
.sc-link.muted { color: var(--amber); font-weight: 500; }
.sc-actions { display: flex; gap: 2px; }
.sc-actions .icon-btn { width: 32px; height: 32px; }
.sc-actions .icon-btn svg { width: 16px; height: 16px; }
.sc-actions .icon-btn.danger { color: var(--text-3); }
.search-card.add { align-items: center; justify-content: center; gap: 4px; border-style: dashed; background: transparent; color: var(--text-2); }
.sc-plus { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 500; margin-bottom: 4px; }
@media (hover: hover) and (pointer: fine) {
  .search-card:hover { border-color: var(--border-3); background: var(--panel-3); }
  .search-card.add:hover { border-color: var(--accent-line); color: var(--text); background: rgba(198, 246, 79, .04); }
  .sc-actions .icon-btn.danger:hover { color: var(--red); background: rgba(255, 107, 107, .1); }
}
#searches .search-block { display: none; margin-bottom: 0; }
#searches .search-block .search-head [data-action=remove-search] { display: none; }
.search-detail-bar, .search-detail-foot { display: none; }
#bot-form.searching > .section:not(#searches-section) { display: none; }
#bot-form.searching #searches-section > .section-head,
#bot-form.searching #searches-section > .hint,
#bot-form.searching .search-overview { display: none; }
#bot-form.searching #searches .search-block.active { display: flex; animation: pageIn 220ms var(--ease-out); }
#bot-form.searching .search-detail-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -22px; z-index: 4;
  margin: -22px -22px 4px; padding: 12px 22px; background: rgba(13, 15, 19, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.search-detail-bar .btn svg { width: 15px; height: 15px; }
#bot-form.searching .search-detail-foot { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---------- Barre du haut + menu coulissant (téléphone, tablette) ---------- */
.topbar, .nav-backdrop { display: none; }
@media (max-width: 960px) {
  .app { display: block; }
  .topbar {
    position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px;
    height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
    background: rgba(9, 10, 13, .88); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--border);
  }
  .topbar .brand { padding: 0; gap: 9px; }
  .topbar .brand-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
  .topbar-menu { position: relative; width: 44px; height: 44px; color: var(--text); }
  .topbar-menu svg { width: 22px; height: 22px; }
  .topbar-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
  .topbar-page { margin-left: auto; color: var(--text-2); font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar {
    position: fixed; z-index: 45; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: #0b0d10; border-right: 1px solid var(--border-2); box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .8);
    transform: translateX(-104%); transition: transform 320ms var(--ease-drawer); overflow-y: auto;
  }
  body.nav-open .sidebar { transform: none; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(3, 4, 6, .6); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity 250ms ease; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .nav { flex-direction: column; flex-wrap: nowrap; }
  .nav-item { height: 46px; font-size: 15px; }
  .nav-item.active::before { display: block; }
  .main { padding: 18px max(16px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
}

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  .page-head { align-items: flex-start; margin-bottom: 16px; gap: 12px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { font-size: 13.5px; }
  .page-head .actions { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 23px; }
  .card { padding: 16px; border-radius: 14px; }
  .feed-toolbar { flex-direction: column; align-items: stretch; }
  .bot-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
  .bot-tabs::-webkit-scrollbar { display: none; }
  .bot-tab { flex: none; }
  .feed-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .feed-filters select, .feed-filters input { width: 100%; min-width: 0; }
  .live-bar { max-width: 100%; height: auto; min-height: 32px; padding: 6px 12px; line-height: 1.35; }
  .feed-body { padding: 10px 10px 11px; gap: 7px; }
  .feed-title { font-size: 13px; }
  .feed-foot { flex-direction: column; gap: 2px; font-size: 11px; }
  .feed-price { left: 8px; right: 8px; bottom: 8px; }
  .feed-price b { height: 26px; font-size: 14px; padding: 0 9px; }
  .feed-price small { font-size: 10.5px; }
  .card-head .actions, .card-head .actions > * { width: 100%; }
  .card-head .actions input, .card-head .actions select, .actions select { min-width: 0; width: 100%; }
  .seg { width: 100%; overflow-x: auto; }
  .seg-item { flex: 1; white-space: nowrap; padding: 0 10px; }
  .bot-cards { grid-template-columns: 1fr; }
  .bot-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bot-actions .btn { flex: 1 1 auto; }
  .push-right { margin-left: 0; }
  .proxy-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tuto-steps li { padding: 14px 14px 14px 50px; }
  .ws-menu { width: 100%; max-width: 280px; }
  .mh { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .mh-text h2 { font-size: 17px; }
  .mh-score { width: 100%; text-align: left; }
  .mon-event { grid-template-columns: 1fr; gap: 4px; }
  .mon-event .pill { justify-self: start; }
  .dialog { padding: 22px 18px 16px; }
  .dialog-actions .btn { flex: 1 1 100%; }
  /* tiroirs plein écran */
  .drawer, .drawer.wide { top: 0; right: 0; bottom: 0; left: 0; width: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
  .drawer-head { padding: 14px 16px; }
  .drawer-body { padding: 18px 16px; }
  .drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  #bot-form.searching .search-detail-bar { top: -18px; margin: -18px -16px 4px; padding: 10px 16px; }
  #search-detail-pos { display: none; }
  .rate-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toggle-help .hint { font-size: 12px; }
  /* tableaux : une carte par ligne */
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { position: relative; padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); }
  .table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: right; white-space: normal; min-height: 30px; }
  .table.stack td::before { content: attr(data-label); flex: none; color: var(--text-3); font-size: 12px; text-align: left; }
  .table.stack td[data-label=""]::before { display: none; }
  .table.stack td:first-child { display: block; text-align: left; padding: 0 44px 6px 0; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  .table.stack td:first-child::before { display: none; }
  .table.stack td.cell-menu { position: absolute; top: 8px; right: 6px; width: auto; min-height: 0; padding: 0 !important; }
  .table.stack td.cell-menu::before { display: none; }
  .table.stack td.empty { display: block; text-align: center; }
  .table.stack td.empty::before { display: none; }
  .table.stack .pill-row { justify-content: flex-end; }
  .table.stack .cell-error { max-width: 60vw; }
  .table.stack .key-health { min-width: 0; flex-direction: column; align-items: flex-end; }
  .table.stack .key-health .bar { width: 140px; }
  .table.stack td .cell-input { width: 120px; }
  .admin-table td .muted.small { max-width: none; }
  .row-fail > td:first-child::before, .row-warn > td:first-child::before { display: none; }
  .table.stack tr.row-fail { border-color: rgba(255, 107, 107, .4); }
  .table.stack tr.row-warn { border-color: rgba(247, 185, 85, .35); }
  .table-wrap { margin: 0; padding: 0; overflow: visible; }
  .key-code, .key-code.revealed { max-width: 50vw; }
}
@media (max-width: 380px) {
  .feed.big { gap: 8px; }
  .feed-filters { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 8px; }
  .kpi-value { font-size: 21px; }
}

/* ---------- Fiche annonce sur téléphone / tablette ---------- */
@media (max-width: 860px) {
  .im-panel { grid-template-rows: min(62vh, 560px) minmax(0, 1fr); grid-template-rows: min(62dvh, 560px) minmax(0, 1fr); height: 100vh; height: 100dvh; }
  .im-close { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; }
  .im-kicker, .im-title { padding-right: 0; }
  .im-thumbs { display: none; }
  .im-zoombar { bottom: 14px; }
  .im-counter { top: calc(14px + env(safe-area-inset-top)); left: 14px; }
  .im-arrow { width: 40px; height: 40px; top: calc(50% - 20px); }
  .im-arrow.prev { left: 10px; }
  .im-arrow.next { right: 10px; }
  .im-zhint { top: auto; bottom: 64px; font-size: 11.5px; }
  .im-info { padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); }
  .im-price b { font-size: 32px; }
  .item-modal.full .im-panel { grid-template-rows: 1fr; }
}
@media (hover: none) and (pointer: coarse) {
  .im-arrow { display: none; }  /* sur écran tactile : on balaie la photo */
}

/* ---------- Écrans tactiles ---------- */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }  /* iOS n'agrandit plus la page quand on touche un champ */
  .btn.small { height: 36px; }
  .icon-btn { width: 40px; height: 40px; }
  .kebab { width: 38px; height: 38px; }
  .menu-item { padding: 12px 12px; font-size: 15px; }
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }

/* ---------- Jamais de défilement horizontal (iOS ne peut plus « dézoomer » la page) ---------- */
html { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .live-pulse, .mh-pulse::after, .im-loader { animation: none !important; }
  .sidebar { transition: none !important; }
}
