:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --sidebar: #031b44;
  --sidebar-hover: #052a5c;
  --sidebar-border: #0a3d7a;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0462fd;
  --accent-soft: #e8f1ff;
  --success: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 4px 24px rgb(3 27 68 / 8%);
  --shadow-sm: 0 1px 3px rgb(3 27 68 / 10%);
  font-family: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

.shell { display: flex; min-height: 100vh; }

/* ── Sidebar Yebela ── */
.sidebar {
  width: 268px;
  background: var(--sidebar);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: rgb(255 255 255 / 4%);
}

.sidebar-brand-text h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.sidebar-brand-text .brand-sub {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.sidebar-brand-text p {
  margin: 0.1rem 0 0;
  font-size: 0.58rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.nav { flex: 1; padding: 0.65rem 0.75rem; overflow-y: auto; }

.nav button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 0.62rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.15rem;
  transition: background 0.15s, color 0.15s;
}

.nav button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav button:hover { background: var(--sidebar-hover); color: #f1f5f9; }
.nav button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgb(4 98 253 / 35%);
}

.sidebar-help {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-help a {
  color: #93c5fd;
  text-decoration: none;
}

.sidebar-help a:hover { text-decoration: underline; }

.sidebar-user-meta span.role-label {
  font-size: 0.68rem;
  color: #64748b;
  text-transform: capitalize;
}

.sidebar-user-chevron {
  margin-left: auto;
  color: #64748b;
  font-size: 0.65rem;
}

.sidebar-foot {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.sidebar-user-meta strong {
  display: block;
  font-size: 0.78rem;
  color: #f1f5f9;
}

.sidebar-user-meta span {
  font-size: 0.68rem;
  color: #64748b;
}

/* ── Main ── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-head h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-meta {
  font-size: 0.78rem;
  color: var(--muted);
  background: #f8fafc;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.content { padding: 1.35rem 1.75rem 2.5rem; overflow: auto; }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 20%, #1e3a8a 0%, #0b1220 55%, #020617 100%);
}

.login-card {
  width: min(420px, 92vw);
  background: var(--surface);
  border-radius: 20px;
  padding: 2rem 2.25rem;
  box-shadow: 0 25px 60px rgb(0 0 0 / 35%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.login-brand img { width: 52px; height: 52px; object-fit: contain; }
.login-brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card p.sub { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.875rem; }

label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.875rem;
  margin-bottom: 0.85rem;
  background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 1rem;
  height: 1rem;
  padding: 0;
  margin-bottom: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

label.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  font-weight: 400;
  cursor: pointer;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: filter 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgb(37 99 235 / 30%);
}

.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.38rem 0.7rem; font-size: 0.75rem; }
.hidden { display: none !important; }

/* ── KPI cards (dashboard mockup) ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 1.35rem;
}

@media (max-width: 1400px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi, .kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 0.65rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.kpi-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.kpi-icon svg { width: 18px; height: 18px; }

.kpi .label, .kpi-card .label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 0.65rem;
}

.kpi .value, .kpi-card .value {
  font-size: 1.65rem;
  font-weight: 800;
  margin-top: 0.2rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi .hint, .kpi-card .hint {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.kpi-mini-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  margin-top: 0.65rem;
  padding-top: 0.35rem;
  border-top: 1px solid #f1f5f9;
}

.kpi-mini-spark span {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
}

.kpi-blue .kpi-icon { background: #dbeafe; color: #2563eb; }
.kpi-blue .kpi-mini-spark span { background: #93c5fd; }
.kpi-blue .value { color: #1d4ed8; }

.kpi-green .kpi-icon { background: #d1fae5; color: #059669; }
.kpi-green .kpi-mini-spark span { background: #6ee7b7; }
.kpi-green .value { color: #047857; }

.kpi-purple .kpi-icon { background: #ede9fe; color: #7c3aed; }
.kpi-purple .kpi-mini-spark span { background: #c4b5fd; }
.kpi-purple .value { color: #6d28d9; }

.kpi-orange .kpi-icon { background: #ffedd5; color: #ea580c; }
.kpi-orange .kpi-mini-spark span { background: #fdba74; }
.kpi-orange .value { color: #c2410c; }

.kpi-yellow .kpi-icon { background: #fef9c3; color: #ca8a04; }
.kpi-yellow .kpi-mini-spark span { background: #fde047; }
.kpi-yellow .value { color: #a16207; }

.kpi-indigo .kpi-icon { background: #e0e7ff; color: #4338ca; }
.kpi-indigo .kpi-mini-spark span { background: #a5b4fc; }
.kpi-indigo .value { color: #3730a3; }

/* ── Panels ── */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.panel-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.panel-foot-link {
  display: block;
  padding: 0.65rem 1.25rem;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid #f1f5f9;
}

.panel-foot-link:hover { text-decoration: underline; }
.panel-body { padding: 1rem 1.25rem 1.15rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; }
  .nav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Charts / bars ── */
.bar-row { margin-bottom: 0.75rem; }
.bar-row .row-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.bar-track {
  height: 9px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 99px;
}

.bar-fill.trend { background: linear-gradient(90deg, #059669, #34d399); }

.source-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.source-row .bar-wrap { flex: 1; min-width: 0; }

.source-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0e7ff, #dbeafe);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.trend-badge {
  color: #059669;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.35rem;
}

.spark { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 0.5rem; }

.spark span {
  flex: 1;
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  border-radius: 4px 4px 0 0;
  min-height: 6px;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.spark span:hover { opacity: 1; }

.spark-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ── Tables ── */
table.data { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
table.data th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.data td { padding: 0.6rem 0.45rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }

.badge { display: inline-block; padding: 0.18rem 0.5rem; border-radius: 99px; font-size: 0.65rem; font-weight: 600; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-muted { background: #f1f5f9; color: #475569; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.filters input, .filters select { width: auto; min-width: 140px; margin-bottom: 0; }

/* ——— Paramètres / ETL ——— */
.settings-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.settings-panel .panel-body { padding: 1.15rem 1.35rem 1.35rem; }

.settings-lead {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.55;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.field-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }

.field-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  background: #fff;
  margin-bottom: 0.75rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.85rem 0 1.1rem;
  font-size: 0.875rem;
  cursor: pointer;
  width: 100%;
}

.checkbox-row input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.checkbox-row > span {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.etl-dates { margin-bottom: 0.25rem; }
.etl-dates .field-input { margin-bottom: 0; }

.etl-doc-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

@media (max-width: 960px) {
  .etl-doc-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .etl-doc-cards { grid-template-columns: 1fr; }
}

.etl-doc-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  font-size: inherit;
}

.etl-doc-card:hover { border-color: #cbd5e1; }

.etl-doc-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.etl-doc-card-check {
  display: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  line-height: 1.15rem;
  text-align: center;
  margin-bottom: 0.15rem;
}

.etl-doc-card.active .etl-doc-card-check { display: inline-block; }

.etl-doc-card strong { font-size: 0.82rem; color: #0f172a; }

.etl-doc-card-sub {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.35;
}

.etl-search-wrap { position: relative; margin-bottom: 0.65rem; }

.etl-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.55;
}

.etl-search-input { padding-left: 2.25rem !important; margin-bottom: 0 !important; }

.etl-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.85rem; }

.etl-chip {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.etl-chip:hover { background: #f8fafc; }

.etl-chip-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.etl-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
}

.etl-source-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}
.etl-source-table thead { position: sticky; top: 0; background: #f8fafc; z-index: 1; }
.etl-source-row.hidden { display: none; }

.etl-source-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.etl-source-url {
  font-size: 0.68rem;
  color: var(--muted);
  word-break: break-all;
}

.badge-type {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 6px;
  padding: 0.22rem 0.5rem;
  font-size: 0.65rem;
}

.etl-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.etl-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.etl-status-ok { color: #059669; }
.etl-status-ok .dot { background: #10b981; }

.etl-status-warn { color: #d97706; }
.etl-status-warn .dot { background: #f59e0b; }

.etl-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.etl-table-foot-actions { display: flex; gap: 0.85rem; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover { color: #003dcc; }

.etl-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn-etl-run {
  min-width: 180px;
  padding: 0.65rem 1.35rem;
  font-size: 0.9rem;
}

.settings-panel .panel-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: flex-start;
}

.settings-panel .panel-head h3 {
  flex: 1;
}

.panel-head-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.checkbox-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

.etl-info-box {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.55;
}

.etl-info-box .info-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  color: var(--accent);
}

.etl-info-box p { margin: 0; }
.etl-info-box a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.etl-preview {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 0.82rem;
}

.dashboard-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.empty { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.875rem; }
.err { color: var(--danger); font-size: 0.8rem; margin-top: 0.5rem; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #0f172a;
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  font-size: 0.82rem;
  z-index: 100;
  box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
}

.text-muted { color: var(--muted); }

/* ── Tableau de bord analytique ── */
.analytics-page { position: relative; }
.analytics-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgb(245 247 250 / 85%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius);
}
.analytics-filters-row { margin-bottom: 1rem; }
.analytics-filters {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
}
.analytics-filters button {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0.45rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
}
.analytics-filters button.on { background: var(--sidebar); color: #fff; }
.analytics-filters .custom {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.4rem;
  border-left: 1px solid var(--border);
  margin-left: 0.15rem;
}
.analytics-filters input[type="date"] {
  font-family: inherit;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.4rem;
  color: var(--muted);
}
.analytics-date-sep { color: var(--muted); font-size: 0.7rem; }
.privacy-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: #8792a6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  margin-bottom: 1.25rem;
  width: fit-content;
  max-width: 100%;
}
.privacy-note svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--success); }
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}
.analytics-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.analytics-kpi .lbl { font-size: 0.72rem; color: #8792a6; font-weight: 600; margin-bottom: 0.5rem; }
.analytics-kpi .val { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
.analytics-kpi .delta { font-size: 0.72rem; font-weight: 600; margin-top: 0.35rem; display: flex; align-items: center; gap: 0.25rem; }
.analytics-kpi .delta.up { color: var(--success); }
.analytics-kpi .delta.down { color: var(--danger); }
.analytics-kpi.accent { background: var(--sidebar); border-color: var(--sidebar); }
.analytics-kpi.accent .lbl { color: #93aedd; }
.analytics-kpi.accent .val { color: #fff; }
.analytics-grid-2 { grid-template-columns: 1.4fr 1fr; }
.analytics-grid-2b { grid-template-columns: 1fr 1fr; }
.analytics-rank-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0;
  font-size: 0.78rem;
}
.analytics-rank-row .name { width: 150px; flex-shrink: 0; }
.analytics-rank-row .bar-wrap { flex: 1; background: #eef1f6; border-radius: 5px; height: 8px; overflow: hidden; }
.analytics-rank-row .bar { height: 100%; background: var(--accent); border-radius: 5px; }
.analytics-rank-row .count { width: 34px; text-align: right; color: #8792a6; font-size: 0.72rem; }
.cloud { display: flex; flex-wrap: wrap; gap: 0.65rem 0.875rem; align-items: center; padding: 0.35rem 0; }
.analytics-trend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.55rem 0.75rem;
  background: #eef1f6;
  border-radius: 9px;
  margin-bottom: 0.5rem;
}
.analytics-trend-item .tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #e7f8f1;
  color: var(--success);
}
.analytics-donut-wrap { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.analytics-legend { flex: 1; min-width: 120px; }
.analytics-legend-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}
.analytics-legend-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.analytics-legend-val { color: #8792a6; margin-left: auto; }
.analytics-svg { max-height: 230px; }
.analytics-empty { color: var(--muted); font-size: 0.8rem; margin: 0; }
.analytics-special {
  background: linear-gradient(135deg, var(--sidebar) 0%, #0a2a5e 100%);
  border-radius: 14px;
  padding: 1.35rem 1.5rem 0.5rem;
  margin: 1.75rem 0 1.5rem;
  color: #fff;
}
.analytics-special .special-head { margin-bottom: 0.75rem; }
.analytics-special .tag-strat {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgb(255 255 255 / 14%);
  color: #bfd2ff;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}
.analytics-special h2 { font-size: 1.1rem; margin: 0.35rem 0 0.15rem; color: #fff; }
.analytics-special .sub { font-size: 0.78rem; color: #aec2f0; margin: 0; }
.opp-table { background: var(--surface); border-radius: 10px; overflow: hidden; color: var(--text); }
.analytics-opp-table .q-txt { max-width: 270px; }
.analytics-opp-table .kw {
  display: inline-block;
  background: #eef1f6;
  color: var(--muted);
  font-size: 0.66rem;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  margin: 0 0.25rem 0.25rem 0;
}
.badge-prio {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 7px;
}
.badge-prio.haute { background: #fceaea; color: var(--danger); }
.badge-prio.moyenne { background: #fdf3e3; color: var(--warn); }
.badge-prio.basse { background: #eef0f4; color: #6b7690; }
.status-opp {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 7px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.status-opp.nouveau { background: #f1ebfc; color: #7c3aed; }
.status-opp.encours { background: #fdf3e3; color: var(--warn); }
.status-opp.enrichi { background: #e4eeff; color: var(--accent); }
.status-opp.resolu { background: #e7f8f1; color: var(--success); }
.status-hint { font-size: 0.62rem; color: #aec2f0; margin-top: 0.65rem; padding: 0 0.15rem 0.75rem; }
@media (max-width: 1100px) {
  .analytics-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid-2, .analytics-grid-2b { grid-template-columns: 1fr; }
}
