:root {
  --bg: #0b0d10;
  --panel: #13171c;
  --panel-2: #1a1f26;
  --line: #252b33;
  --text: #e6e9ef;
  --muted: #8b95a3;
  --brand: #6aa6ff;
  --brand-2: #4a87e0;
  --good: #3ecf8e;
  --bad: #ff6b6b;
  --warn: #f5a623;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Inter", "Söhne", "Segoe UI", sans-serif; font-size: 14px; }

/* ── Topbar ── */
.topbar {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 20px; padding: 12px 20px;
  border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 32px; height: 32px; background: var(--brand); color: #0b0d10;
  border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: 1rem; flex-shrink: 0;
}
.brand h1 { margin: 0; font-size: 1rem; letter-spacing: .02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.tabs { display: flex; gap: 6px; justify-self: center; }
.tab { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; font-family: inherit; font-size: inherit; transition: all .12s; }
.tab.active { background: var(--panel-2); color: var(--text); border-color: var(--brand); }
.tab:hover:not(.active) { border-color: var(--muted); color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.mode-tag { font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .06em; }
.mode-tag.leadgen { background: rgba(245,166,35,.15); color: var(--warn); }
.mode-tag.ecom { background: rgba(62,207,142,.12); color: var(--good); }

/* ── Boutons ── */
button { font-family: inherit; font-size: inherit; }
.btn-primary { background: var(--brand); color: #0b0d10; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; transition: background .12s; display: flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: var(--brand-2); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-family: inherit; transition: border-color .12s; }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { font-size: .78rem; padding: 5px 10px; }
.hidden { display: none !important; }
.muted-text { color: var(--muted); font-size: .8rem; font-weight: 400; }

/* ── Filtres ── */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: end;
  padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 57px; z-index: 9;
}
.filters label { display: grid; gap: 3px; color: var(--muted); font-size: .72rem; }
.filters input, .filters select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 8px; min-width: 100px; font-family: inherit; font-size: inherit;
  transition: border-color .12s;
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--brand); }
select[multiple] { min-height: 34px; }

.btn-spin { display: inline-block; animation: spin .6s linear infinite; }

/* Notes collaboratives */
.notes-list { display: grid; gap: 8px; margin-bottom: 10px; }
.note-item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.note-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .72rem; color: var(--muted); }
.note-author { font-weight: 600; color: var(--text); }
.note-date { flex: 1; }
.note-delete { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 4px; }
.note-delete:hover { color: var(--bad); }
.note-text { font-size: .82rem; line-height: 1.5; }
.note-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.note-tag { background: var(--brand-dim, rgba(99,102,241,.15)); color: var(--brand); border-radius: 12px; padding: 2px 8px; font-size: .7rem; font-weight: 600; }
.notes-add { display: grid; gap: 6px; }
.notes-add textarea, .notes-add input { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: .82rem; resize: vertical; }
.notes-add textarea:focus, .notes-add input:focus { outline: none; border-color: var(--brand); }
.btn-sm { padding: 5px 14px; font-size: .78rem; }

/* Panneau filtres avancés */
.advanced-filters {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 10px 20px 14px;
}
.advanced-filters-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px;
}
.advanced-filters-grid label {
  display: grid; gap: 3px; color: var(--muted); font-size: .72rem;
}
.advanced-filters-grid input {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 8px; font-family: inherit; font-size: inherit;
  transition: border-color .12s;
}
.advanced-filters-grid input:focus { outline: none; border-color: var(--brand); }
#advancedToggleBtn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Main ── */
main { padding: 14px 20px; display: grid; gap: 12px; }
.view { display: none; gap: 12px; }
.view.active { display: grid; }

/* ── Skeleton cards ── */
.skeleton-wrap { pointer-events: none; }
.skeleton-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; height: 82px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 50%, var(--panel-2) 75%);
  background-size: 400px 100%; animation: shimmer 1.4s infinite; border-radius: 6px;
}

/* ── KPI Cards ── */
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card .k { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.card .v { font-size: 1.3rem; font-weight: 700; margin-top: 6px; }
.card .delta { font-size: .75rem; margin-top: 4px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* ── Panel ── */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2);
  flex-wrap: wrap; gap: 8px;
}
.panel-head h2 { margin: 0; font-size: .9rem; font-weight: 600; }
.panel-actions { display: flex; align-items: center; gap: 8px; }

/* ── Table ── */
.table-wrap { overflow: auto; }
.table-loading, .chart-loading, .grid-loading {
  padding: 24px; text-align: center; color: var(--muted); font-size: .85rem;
}
.table-more { padding: 10px 16px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: var(--panel-2); color: var(--muted); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.02); }
td.clickable { cursor: pointer; color: var(--brand); font-weight: 500; }
td.clickable:hover { text-decoration: underline; }
.sub-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.sub-table th, .sub-table td { padding: 6px 12px; border-bottom: 1px solid rgba(37,43,51,.7); white-space: nowrap; }
.sub-table th { color: var(--muted); background: transparent; font-size: .7rem; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* ── Status badges ── */
.status-pill { font-size: .68rem; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.status-pill.active { background: rgba(62,207,142,.15); color: var(--good); }
.status-pill.paused { background: rgba(139,149,163,.12); color: var(--muted); }
.status-pill.archived, .status-pill.deleted { background: rgba(255,107,107,.1); color: var(--bad); }

/* ── Breadcrumb ── */
.crumb { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.crumb .crumb-link { cursor: pointer; color: var(--brand); }
.crumb .crumb-link:hover { text-decoration: underline; }
.crumb .sep { color: var(--line); }

/* ── Chart ── */
.chart { padding: 12px 16px 16px; }
.chart svg { width: 100%; height: 200px; display: block; }
.chart-controls { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; }
.chart-controls label { display: flex; align-items: center; gap: 5px; cursor: pointer; color: var(--muted); }
.chart-controls label:has(input:checked) { color: var(--text); }

/* ── Grille créatives ── */
.creative-grid {
  display: grid; gap: 14px; padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.creative-card {
  background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .12s, transform .15s, box-shadow .15s;
  position: relative; display: flex; flex-direction: column;
}
.creative-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.creative-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(106,166,255,.25); }
.creative-card .select-check {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px;
  border-radius: 50%; background: rgba(0,0,0,.75); border: 2px solid rgba(255,255,255,.35);
  display: grid; place-items: center; font-size: 11px; z-index: 3;
  transition: all .12s; backdrop-filter: blur(4px);
}
.creative-card:hover .select-check { border-color: var(--brand); }
.creative-card.selected .select-check { background: var(--brand); border-color: var(--brand); color: #000; }

/* Thumb : vraie image ou vidéo */
.creative-thumb {
  aspect-ratio: 4 / 5; position: relative; overflow: hidden;
  background: var(--panel); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.creative-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .2s;
}
.creative-card:hover .creative-thumb img { transform: scale(1.03); }
.creative-thumb-empty { color: var(--muted); font-size: .72rem; opacity: .5; }
.creative-thumb-error { background: var(--panel-2); }
.creative-thumb-error::after { content: 'Image non dispo'; color: var(--muted); font-size: .65rem; position: absolute; }

/* Overlay stats au hover */
.creative-thumb .thumb-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
  opacity: 0; transition: opacity .18s; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px;
  pointer-events: none;
}
.creative-card:hover .thumb-overlay { opacity: 1; }
.thumb-overlay-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.thumb-overlay-stats .ts { font-size: .62rem; color: rgba(255,255,255,.65); }
.thumb-overlay-stats .tv { font-size: .78rem; font-weight: 700; color: #fff; }

/* Badge format (vidéo / image) */
.creative-thumb .fmt-badge {
  position: absolute; bottom: 8px; right: 8px; padding: 3px 8px; border-radius: 99px;
  font-size: .62rem; font-weight: 700; backdrop-filter: blur(8px); z-index: 2;
}
.fmt-badge.video { background: rgba(106,166,255,.9); color: #0b0d10; }
.fmt-badge.image { background: rgba(255,255,255,.15); color: var(--text); }

/* Play overlay pour vidéos */
.creative-thumb .play-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  pointer-events: none;
}
.play-btn {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px); border: 2px solid rgba(255,255,255,.5);
  display: grid; place-items: center; font-size: 16px; transition: transform .15s, background .15s;
}
.creative-card:hover .play-btn { background: var(--brand); border-color: var(--brand); transform: scale(1.12); }

/* Score badge */
.score-badge {
  position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: .68rem; font-weight: 800;
  backdrop-filter: blur(8px); z-index: 3;
}
.score-badge.high { background: rgba(62,207,142,.9); color: #0b0d10; }
.score-badge.mid { background: rgba(245,166,35,.9); color: #0b0d10; }
.score-badge.low { background: rgba(255,107,107,.8); color: #fff; }

/* Meta texte sous la thumb */
.creative-meta { padding: 8px 10px 4px; flex: 1; }
.creative-meta .name {
  font-weight: 600; font-size: .78rem; line-height: 1.35; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.creative-meta .primary-text {
  font-size: .7rem; color: var(--muted); margin-top: 4px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.creative-meta .label-chip { font-size: .62rem; padding: 2px 7px; border-radius: 99px; background: rgba(106,166,255,.1); color: var(--brand); margin-top: 5px; display: inline-block; }

/* Stats compactes */
.creative-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 6px 10px 9px; border-top: 1px solid var(--line); font-size: .68rem; }
.creative-stats .s { color: var(--muted); font-size: .6rem; }
.creative-stats .v { color: var(--text); font-weight: 700; }

.load-more-wrap { padding: 12px; text-align: center; }
.compare-badge { font-size: .78rem; color: var(--brand); font-weight: 600; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal.hidden { display: none; }
.modal-inner {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  max-width: 980px; width: 100%; max-height: 94vh; overflow: auto; position: relative;
  display: grid; grid-template-columns: 340px 1fr; gap: 0;
}
.modal-close { position: absolute; top: 12px; right: 14px; background: rgba(255,255,255,.08); border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; line-height: 1; z-index: 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; transition: background .12s; }
.modal-close:hover { background: rgba(255,255,255,.16); }
.modal-media {
  background: #000; display: flex; align-items: center; justify-content: center;
  min-height: 400px; border-radius: var(--radius) 0 0 var(--radius); overflow: hidden;
  position: relative;
}
.modal-media iframe, .modal-media img, .modal-media video {
  width: 100%; height: 100%; object-fit: contain; max-height: 70vh; border: 0;
}
.modal-content { padding: 24px; overflow: auto; display: grid; gap: 16px; align-content: start; }
.modal-title { font-size: 1rem; font-weight: 700; margin: 0; padding-right: 40px; line-height: 1.4; }
.modal-meta { color: var(--muted); font-size: .8rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-meta .dot { color: var(--line); }
.modal-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modal-kpi { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.modal-kpi .k { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.modal-kpi .v { font-size: 1.05rem; font-weight: 700; margin-top: 4px; }
.modal-section-title { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.modal-text { font-size: .82rem; color: var(--muted); line-height: 1.6; margin: 0; }
.modal-text strong { color: var(--text); }

/* Modal chart mini */
.modal-chart { height: 80px; }
.modal-chart svg { width: 100%; height: 80px; }

/* ── Comparateur ── */
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; }
.compare-col { display: grid; gap: 0; border-right: 1px solid var(--line); }
.compare-col:last-child { border-right: 0; }
.compare-col-media { aspect-ratio: 4/5; background: #000; display: grid; place-items: center; overflow: hidden; max-height: 320px; }
.compare-col-media iframe, .compare-col-media img { width: 100%; height: 100%; object-fit: contain; border: 0; }
.compare-col-info { padding: 14px; display: grid; gap: 10px; }
.compare-col-name { font-size: .82rem; font-weight: 600; line-height: 1.35; }
.compare-col-label { font-size: .7rem; color: var(--brand); }
.compare-kpis { display: grid; gap: 4px; }
.compare-kpi { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; padding: 4px 0; border-bottom: 1px solid var(--line); }
.compare-kpi:last-child { border-bottom: 0; }
.compare-kpi .ck { color: var(--muted); }
.compare-kpi .cv { font-weight: 600; }
.compare-kpi .cv.best { color: var(--good); }
.compare-kpi .cv.worst { color: var(--bad); }

/* ── Toasts ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: grid; gap: 8px; z-index: 100; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; font-size: .83rem; max-width: 340px;
  animation: toastIn .2s ease; display: flex; align-items: start; gap: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.toast.error { border-color: var(--bad); }
.toast.success { border-color: var(--good); }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 1rem; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Bench table ── */
.bench-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.bench-table th { background: var(--panel-2); color: var(--muted); font-weight: 600; padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--line); position: sticky; top: 0; }
.bench-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.bench-table tr:hover td { background: var(--panel-2); }
.bench-table .top-val { color: var(--good); font-weight: 700; }

/* ── Settings ── */
.settings-section { max-width: 680px; margin: 0 auto; padding: 24px; display: grid; gap: 28px; }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.settings-card h3 { margin: 0 0 16px; font-size: 1rem; }
.settings-card .hint { color: var(--muted); font-size: .78rem; margin-top: 6px; }
.token-form { display: flex; gap: 10px; align-items: flex-end; }
.token-form input { flex: 1; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 9px 12px; border-radius: 8px; font-family: inherit; font-size: .85rem; }
.token-form input:focus { outline: none; border-color: var(--brand); }
.users-table { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: 12px; }
.users-table th { color: var(--muted); font-weight: 600; padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.users-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.add-user-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.add-user-form input { flex: 1; min-width: 200px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; font-family: inherit; }
.add-user-form select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; font-family: inherit; }
.db-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.db-stat { background: var(--panel-2); border-radius: 8px; padding: 12px; }
.db-stat .k { color: var(--muted); font-size: .72rem; }
.db-stat .v { font-size: 1.2rem; font-weight: 700; margin-top: 2px; }

/* ── Misc ── */
.empty-state { color: var(--muted); text-align: center; padding: 48px 20px; font-size: .9rem; }
.empty-state .empty-icon { font-size: 2rem; margin-bottom: 12px; }

@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr; gap: 8px; }
  .tabs { justify-self: start; }
  .modal-inner { grid-template-columns: 1fr; }
  .modal-media { border-radius: 12px 12px 0 0; min-height: 260px; max-height: 50vw; }
}
@media (max-width: 600px) {
  .filters { flex-direction: column; }
  .creative-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ── Tab badge ── */
.tab-badge { font-size: .6rem; background: var(--brand); color: #0b0d10; border-radius: 99px; padding: 1px 6px; font-weight: 700; vertical-align: middle; margin-left: 4px; }

/* ── Veille ── */
.veille-search-panel { padding: 16px 20px; }
.veille-search-row { display: flex; flex-direction: column; gap: 12px; }
.veille-search-main { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.veille-search-controls { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.veille-label { display: grid; gap: 4px; font-size: .72rem; color: var(--muted); }
.veille-label input, .veille-label select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 7px 10px; border-radius: 8px; font-family: inherit; font-size: inherit;
  transition: border-color .12s;
}
.veille-label input:focus, .veille-label select:focus { outline: none; border-color: var(--brand); }
#veillePageInput { min-width: 340px; }
#veilleKeywordsInput { min-width: 200px; }
.veille-or { color: var(--muted); font-size: .78rem; align-self: center; padding-bottom: 2px; }

.veille-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: var(--panel); padding: 0 20px; }
.veille-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 16px; cursor: pointer; font-family: inherit; font-size: .85rem; font-weight: 500; transition: all .12s; margin-bottom: -1px; }
.veille-tab.active { color: var(--text); border-bottom-color: var(--brand); }
.veille-view { display: none; }
.veille-view.active { display: block; }

.veille-grid {
  display: grid; gap: 14px; padding: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.veille-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 10px;
  transition: border-color .12s, box-shadow .12s;
}
.veille-card:hover { border-color: rgba(106,166,255,.4); box-shadow: 0 2px 16px rgba(0,0,0,.3); }

.veille-card-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.veille-page-name { font-weight: 700; font-size: .85rem; color: var(--brand); }
.veille-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.veille-badge { font-size: .68rem; padding: 2px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.variant-badge { color: var(--warn); border-color: rgba(245,166,35,.3); background: rgba(245,166,35,.08); }

/* Longévité */
.veille-longevity { display: flex; align-items: center; gap: 8px; }
.lon-days { font-size: 1.1rem; font-weight: 800; min-width: 36px; }
.lon-bar { flex: 1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.lon-fill { height: 100%; border-radius: 99px; transition: width .3s; }
.lon-label { font-size: .68rem; color: var(--muted); flex-shrink: 0; }
.lon-high .lon-days { color: var(--good); }
.lon-high .lon-fill { background: var(--good); }
.lon-mid .lon-days { color: var(--warn); }
.lon-mid .lon-fill { background: var(--warn); }
.lon-low .lon-days { color: var(--muted); }
.lon-low .lon-fill { background: var(--muted); }

.veille-title { font-weight: 600; font-size: .85rem; line-height: 1.4; }
.veille-body { font-size: .8rem; color: var(--muted); line-height: 1.55; max-height: 96px; overflow: hidden; }

.veille-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.veille-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: .72rem; color: var(--muted); }
.veille-actions { display: flex; gap: 6px; align-items: center; }
.veille-btn-snap, .veille-btn-save, .veille-btn-unsave {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: .75rem; font-family: inherit;
  transition: all .12s;
}
.veille-btn-snap:hover { border-color: var(--brand); color: var(--brand); }
.veille-btn-save:hover, .veille-btn-save.saved { color: #ff6b9d; border-color: rgba(255,107,157,.4); background: rgba(255,107,157,.08); }
.veille-btn-unsave:hover { color: var(--bad); border-color: var(--bad); }

.veille-notes { font-size: .75rem; color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 6px 10px; border-left: 3px solid var(--brand); }

/* ── Bench grid (Atria-style) ── */
.bench-grid { display: grid; gap: 12px; padding: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bench-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; gap: 0; overflow: hidden; cursor: pointer; transition: border-color .12s; }
.bench-card:hover { border-color: var(--brand); }
.bench-card-thumb { width: 100px; flex-shrink: 0; background: var(--panel); position: relative; }
.bench-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bench-card-thumb-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-size: 1.5rem; min-height: 90px; }
.bench-card-body { padding: 10px 14px; flex: 1; display: grid; gap: 4px; }
.bench-card-label { font-weight: 700; font-size: .88rem; }
.bench-card-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 4px; }
.bench-card-stat .k { color: var(--muted); font-size: .62rem; }
.bench-card-stat .v { font-weight: 600; font-size: .82rem; }

/* ── Copy text button ── */
.btn-copy-text { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 5px; padding: 2px 6px; font-size: .65rem; cursor: pointer; transition: all .1s; margin-top: 4px; }
.btn-copy-text:hover { border-color: var(--brand); color: var(--brand); }

/* ── Login page ── */
.login-page { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 40px 36px; width: 100%; max-width: 380px; display: grid; gap: 6px;
}
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-subtitle { margin: 0 0 24px; color: var(--muted); font-size: .85rem; }
.login-note { margin: 16px 0 0; color: var(--muted); font-size: .75rem; text-align: center; }
.login-error { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.3); color: var(--bad); padding: 10px 14px; border-radius: 8px; font-size: .82rem; margin-bottom: 12px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 8px;
  padding: 11px 16px; font-size: .95rem; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: background .12s, box-shadow .12s;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
