/**
 * Jarvis CRM — ébauche UI (sans backend)
 * Design system : variables, composants, vues
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #0f1419;
  --bg-elevated: #1a2332;
  --surface: #243044;
  --surface-hover: #2d3d54;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.15);
  --accent-strong: #0ea5e9;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --sidebar-w: 220px;
  --header-h: 64px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ——— Layout app ——— */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand-logo {
  display: block;
  max-width: 90px;
  width: 100%;
  height: auto;
}

.sidebar-brand span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

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

.nav-section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.96rem;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-link .icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

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

.topbar-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.topbar-refresh-btn .topbar-refresh-icon {
  flex-shrink: 0;
}

.topbar-refresh-btn[aria-busy="true"] .topbar-refresh-icon {
  animation: topbar-refresh-spin 0.7s linear infinite;
}

@keyframes topbar-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
}

.content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ——— Login page ——— */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(56, 189, 248, 0.2), transparent),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background-clip: border-box;
  -webkit-background-clip: border-box;
  font-family: inherit;
  font-size: 0.95rem;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Chevron custom : décalé du bord droit pour respirer */
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
}

.select::-ms-expand {
  display: none;
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #0f1419;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-block {
  width: 100%;
}

/* ——— Cards & grids ——— */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

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

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

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ——— Carte « Rappels & suivi » (dashboard) ——— */
.reminders-list {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.75;
}

.reminders-list li {
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

.reminders-list li::marker {
  color: var(--accent);
}

.reminders-help-host {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.reminders-help-host.is-expanded {
  z-index: 60;
}

.reminders-help-btn {
  box-sizing: border-box;
  width: 1.375rem;
  height: 1.375rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.reminders-help-btn:hover,
.reminders-help-btn:focus-visible {
  opacity: 1;
  color: var(--text);
  border-color: var(--text-muted);
  outline: none;
}

.reminders-help-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.reminders-help-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  /* Largeur explicite : sinon le bloc absolu se cale sur le parent « ? » (~22px) et le texte se compresse. */
  width: min(26rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease,
    visibility 0.15s ease,
    transform 0.15s ease;
}

.reminders-help-host.is-expanded .reminders-help-panel {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Panneau d'aide « portalisé » vers <body> pour échapper au clipping de la carte (overflow + backdrop-filter). */
.reminders-help-panel--portaled {
  position: fixed;
  z-index: 9999;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.reminders-help-host.is-expanded .reminders-help-btn {
  opacity: 1;
  color: var(--text);
  border-color: var(--text-muted);
}

.stat-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

.stat-card .hint {
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 0.35rem;
}

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.2);
}

/* En-têtes triables (Contacts) */
.data-table th.th-sortable {
  padding: 0;
  vertical-align: middle;
}

.th-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}

.th-sort-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.th-sortable.is-sorted .th-sort-btn {
  color: var(--accent);
}

.sort-ind {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.95;
  min-width: 0.65rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: var(--surface);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-prospect {
  background: rgba(251, 191, 36, 0.2);
  color: var(--warning);
}

.badge-client {
  background: rgba(52, 211, 153, 0.2);
  color: var(--success);
}

.badge-rdv {
  background: var(--accent-dim);
  color: var(--accent);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}

.avatar-sm.avatar-lifecycle--contact {
  color: #a08775;
}

.avatar-sm.avatar-lifecycle--prospect {
  color: #5d7ba0;
}

.avatar-sm.avatar-lifecycle--client {
  color: #c9a45a;
}

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

/* ——— RDV list ——— */
.rdv-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  background: var(--surface);
  transition: border-color 0.15s;
}

@media (max-width: 640px) {
  .rdv-item {
    grid-template-columns: auto 1fr;
  }
  .rdv-item .rdv-actions {
    grid-column: 1 / -1;
  }
}

.rdv-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.rdv-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 3.5rem;
}

.rdv-time--stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 4.75rem;
}

.rdv-time-inner--stacked {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rdv-time-date {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0.92;
}

.rdv-time-hm {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Badge « prochains RDV » : jour autre qu’aujourd’hui → date seule */
.rdv-time--date-only {
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.25;
  min-width: 4.5rem;
  max-width: 7rem;
  white-space: normal;
  text-align: center;
}

.rdv-body h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.rdv-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ——— Monitoring charts placeholder ——— */
.chart-placeholder {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 1rem 0;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-radius: 4px 4px 0 0;
  opacity: 0.85;
  min-height: 20px;
  transition: opacity 0.15s;
}

.chart-bar:hover {
  opacity: 1;
}

.chart-placeholder--wide {
  min-height: 160px;
}

.chart-placeholder--wide .chart-bar {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(232, 212, 168, 0.95) 0%,
    rgba(212, 180, 130, 0.85) 25%,
    rgba(175, 209, 184, 0.8) 60%,
    rgba(123, 163, 196, 0.75) 100%
  );
  opacity: 1;
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.chart-placeholder--wide .chart-bar:hover {
  filter: brightness(1.08);
}

/* ——— Monitoring (Chart.js) ——— */
.monitoring-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  max-width: 52rem;
  line-height: 1.55;
}

.monitoring-chart-card {
  overflow: hidden;
}

.monitoring-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.monitoring-chart-head-text {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.monitoring-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  justify-content: flex-end;
}

.monitoring-granularity,
.monitoring-period {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.monitoring-period.is-hidden {
  display: none;
}

.monitoring-gran-btn,
.monitoring-period-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.monitoring-gran-btn:hover,
.monitoring-period-btn:hover {
  color: var(--text);
}

.monitoring-gran-btn.is-active,
.monitoring-period-btn.is-active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.monitoring-series-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.monitoring-series-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s, box-shadow 0.2s, transform 0.15s;
}

.monitoring-series-btn:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.monitoring-series-btn:not(.is-off) {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.monitoring-series-btn.is-off {
  opacity: 0.42;
  color: var(--text-muted);
}

.monitoring-series-btn.is-off .monitoring-series-dot {
  opacity: 0.5;
}

.monitoring-series-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.monitoring-chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 340px;
  max-height: 440px;
  margin: 0 -0.25rem;
  padding: 0.5rem 0.25rem 0.25rem;
  border-radius: var(--radius-sm);
}

.monitoring-chart-canvas-wrap canvas {
  max-height: 440px;
}

.monitoring-doughnut-wrap {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  min-height: 240px;
}

.monitoring-bullets {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.75;
}

.monitoring-bullets li {
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

.monitoring-bullets li::marker {
  color: var(--text-muted);
}

.monitoring-bullets strong {
  color: var(--text);
}

/* ——— Équipe (pilotage) ——— */
.team-roster {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-member {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.team-member:first-child {
  padding-top: 0;
}

.team-member:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.team-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.team-avatar--lead {
  color: #c9a45a;
  border-color: rgba(201, 164, 90, 0.45);
}

.team-avatar--senior {
  color: #afd1b8;
  border-color: rgba(123, 164, 133, 0.45);
}

.team-avatar--ops {
  color: #c8dcee;
  border-color: rgba(123, 163, 196, 0.45);
}

.team-avatar--junior {
  color: #d4baea;
  border-color: rgba(170, 134, 196, 0.45);
}

.team-member-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.team-member-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.team-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.team-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.team-status--available {
  color: #afd1b8;
  border-color: rgba(123, 164, 133, 0.4);
  background: rgba(123, 164, 133, 0.12);
}

.team-status--busy {
  color: #c8dcee;
  border-color: rgba(123, 163, 196, 0.4);
  background: rgba(123, 163, 196, 0.12);
}

.team-status--load {
  color: #e8b48c;
  border-color: rgba(212, 147, 126, 0.4);
  background: rgba(212, 147, 126, 0.12);
}

.team-status--training {
  color: #d4baea;
  border-color: rgba(170, 134, 196, 0.4);
  background: rgba(170, 134, 196, 0.12);
}

.team-bullets {
  margin: 1rem 0 0;
  padding-left: 1.35rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.75;
}

.team-bullets li {
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

.team-bullets li::marker {
  color: var(--text-muted);
}

.team-bullets strong {
  color: var(--text);
}

.team-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .team-member {
    grid-template-columns: 2.25rem 1fr;
    grid-template-rows: auto auto;
  }

  .team-avatar {
    grid-row: 1 / span 2;
    align-self: start;
  }

  .team-member-main {
    grid-column: 2;
    grid-row: 1;
  }

  .team-member .badge {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }
}

/* ——— Agenda ——— */
.agenda-toolbar {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.agenda-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  line-height: 1;
  color: var(--text);
}

.agenda-nav-btn:hover {
  color: var(--accent);
}

.agenda-nav-icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  flex-shrink: 0;
}

.toolbar-spacer {
  flex: 1;
  min-width: 0.5rem;
}

.agenda-period-title {
  color: var(--text);
  font-weight: 600;
  text-transform: capitalize;
  min-width: 11rem;
  margin: 0 0.25rem;
  text-align: center;
}

.agenda-view-switch {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.agenda-toolbar #btn-agenda-new-rdv,
.agenda-view-switch .btn {
  font-size: 0.9rem;
  font-weight: 600;
}

.agenda-view-switch .btn.is-active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}

.agenda-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.agenda-legend--footer {
  position: absolute !important;
  bottom: 0.5rem !important;
  right: 0.75rem !important;
  left: auto !important;
  top: auto !important;
  margin: 0 !important;
  gap: 0.75rem !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none;
}

.agenda-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.agenda-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.agenda-dot--pro {
  background: linear-gradient(135deg, #9bb8d4, #6c8eaa);
}

.agenda-dot--relationnel {
  background: linear-gradient(135deg, #afd1b8, #7ba485);
}

.agenda-dot--chez {
  background: linear-gradient(135deg, #d4baea, #a486c4);
}

.agenda-card {
  position: relative;
  overflow-x: auto;
}

.agenda-mount {
  min-height: 280px;
  margin-bottom: 1.75rem;
}

.agenda-footnote {
  margin-top: 0.75rem;
}

.form-group__label-like {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.ar-contact-picker {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ar-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 0;
}

.ar-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.35rem 0.25rem 0.55rem;
  font-size: 0.82rem;
  background: var(--accent-dim);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 100%;
}

.ar-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.ar-chip-remove:hover {
  color: var(--warning);
  background: rgba(0, 0, 0, 0.15);
}

.ar-contact-search-wrap {
  position: relative;
  z-index: 2;
}

.ar-contact-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.ar-contact-result-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1.35;
}

.ar-contact-result-item:hover,
.ar-contact-result-item:focus {
  background: var(--surface);
  outline: none;
}

.ar-contact-result-empty {
  padding: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.agenda-event-contacts {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.3;
}

.agenda-day-list__item .agenda-event-contacts {
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.agenda-month__slot .agenda-event-contacts {
  font-size: 0.62rem;
  margin-top: 0.1rem;
}

.agenda-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 0.5rem;
  min-height: 440px;
}

.agenda-day-view {
  min-height: 440px;
}

.agenda-day {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  font-size: 0.75rem;
  overflow: hidden;
}

.agenda-day strong {
  display: block;
  margin: 0 0 0.5rem;
  padding: 0.6rem 0.65rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agenda-day .agenda-slot {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.agenda-day .agenda-slot:last-child {
  margin-bottom: 0.5rem;
}

.agenda-slot {
  position: relative;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  line-height: 1.25;
  border-left: 0;
  cursor: pointer;
}

/* Liseré lumineux gauche : trait fin (1px) + dégradé de fonte vers la droite,
   couleur identique à la pastille correspondante de la légende. */
.agenda-slot--pro {
  background-color: rgba(123, 163, 196, 0.16);
  color: #c8dcee;
  box-shadow: inset 1px 0 0 0 rgba(155, 184, 212, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(155, 184, 212, 0.45) 0%,
    rgba(155, 184, 212, 0.22) 1%,
    rgba(155, 184, 212, 0.1) 3%,
    rgba(155, 184, 212, 0.04) 6%,
    transparent 10%
  );
}

.agenda-slot--relationnel {
  background-color: rgba(123, 164, 133, 0.18);
  color: #cfe2d4;
  box-shadow: inset 1px 0 0 0 rgba(175, 209, 184, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(175, 209, 184, 0.45) 0%,
    rgba(175, 209, 184, 0.22) 1%,
    rgba(175, 209, 184, 0.1) 3%,
    rgba(175, 209, 184, 0.04) 6%,
    transparent 10%
  );
}

.agenda-slot--chez {
  background-color: rgba(170, 134, 196, 0.18);
  color: #e3d0f0;
  box-shadow: inset 1px 0 0 0 rgba(212, 186, 234, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(212, 186, 234, 0.45) 0%,
    rgba(212, 186, 234, 0.22) 1%,
    rgba(212, 186, 234, 0.1) 3%,
    rgba(212, 186, 234, 0.04) 6%,
    transparent 10%
  );
}

.agenda-day-view__head {
  padding: 0.85rem 1rem;
  margin: -1px -1px 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.agenda-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.agenda-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.agenda-day-list__item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.agenda-day-list__time {
  font-weight: 600;
  margin-right: 0.35rem;
}

.agenda-day-list__notes {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.agenda-month {
  min-width: 520px;
}

.agenda-month__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 0.35rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.agenda-month__weekday {
  padding: 0.6rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.agenda-month__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.agenda-month__cell {
  background: var(--bg-elevated);
  min-height: 88px;
  padding: 0.35rem;
  font-size: 0.65rem;
}

.agenda-month__cell--outside {
  opacity: 0.45;
  background: var(--surface);
}

.agenda-month__cell-num {
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.agenda-month__slot {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ——— Contact detail tabs ——— */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  background: var(--surface);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tabs--nc {
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 0 0 0.75rem;
}

.tabs--nc .tab {
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
}

.nc-tab-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.4;
}

.td-inline-avancement {
  cursor: pointer;
  vertical-align: middle;
}

.td-inline-avancement .inline-av-select {
  min-width: 13rem;
  max-width: 100%;
  font-size: 0.85rem;
}

/* Parcours : palier d’avancement ; le liseré de ligne = couleur des initiales avatar */
.pipeline-lifecycle,
.pipeline-lifecycle-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  vertical-align: middle;
}

.pipeline-lifecycle--compact {
  gap: 0.35rem;
}

.pipeline-step-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  background: var(--surface, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  color: var(--text, #e2e8f0);
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  max-width: 14rem;
}

/* Pastilles par palier — palette « pierres précieuses » premium (champagne, corail, saphir, sarcelle, améthyste, vert chasseur). */
.pipeline-step-badge[data-step="c1"] {
  background: rgba(212, 180, 130, 0.16);
  border-color: rgba(212, 180, 130, 0.5);
  color: #e8d4a8;
}
.pipeline-step-badge[data-step="r0"] {
  background: rgba(212, 147, 126, 0.16);
  border-color: rgba(212, 147, 126, 0.5);
  color: #e8b8a3;
}
.pipeline-step-badge[data-step="r1"] {
  background: rgba(138, 165, 197, 0.16);
  border-color: rgba(138, 165, 197, 0.5);
  color: #b3c4dc;
}
.pipeline-step-badge[data-step="r2"] {
  background: rgba(90, 154, 175, 0.16);
  border-color: rgba(90, 154, 175, 0.5);
  color: #87bdcc;
}
.pipeline-step-badge[data-step="r3"] {
  background: rgba(156, 120, 158, 0.18);
  border-color: rgba(156, 120, 158, 0.55);
  color: #c4a8c7;
}
.pipeline-step-badge[data-step="r4"] {
  background: rgba(123, 164, 133, 0.18);
  border-color: rgba(123, 164, 133, 0.55);
  color: #afd1b8;
}
.pipeline-step-badge[data-step="conjoint"],
.pipeline-step-badge[data-step="ancien_client"],
.pipeline-step-badge[data-step="no_news"],
.pipeline-step-badge[data-step="consultant"],
.pipeline-step-badge[data-step="deja_conseille"] {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  color: var(--text-muted, #94a3b8);
}
.pipeline-step-badge[data-step="empty"] {
  background: var(--surface, rgba(255, 255, 255, 0.06));
  border-color: var(--border, rgba(255, 255, 255, 0.12));
  color: var(--text-muted, #94a3b8);
}

/* Indicateur lifecycle : trait fin lumineux à gauche (1px) qui s'estompe vers la droite. */
#contacts-table tbody tr.tr-lifecycle--contact td:first-child,
#contacts-table tbody tr.tr-lifecycle--prospect td:first-child,
#contacts-table tbody tr.tr-lifecycle--client td:first-child {
  position: relative;
}

#contacts-table tbody tr.tr-lifecycle--contact td:first-child {
  box-shadow: inset 1px 0 0 0 rgba(160, 135, 117, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(160, 135, 117, 0.55) 0%,
    rgba(160, 135, 117, 0.32) 0.5%,
    rgba(160, 135, 117, 0.18) 1.5%,
    rgba(160, 135, 117, 0.08) 3%,
    rgba(160, 135, 117, 0.03) 5%,
    transparent 8%
  );
}

#contacts-table tbody tr.tr-lifecycle--prospect td:first-child {
  box-shadow: inset 1px 0 0 0 rgba(93, 123, 160, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(93, 123, 160, 0.55) 0%,
    rgba(93, 123, 160, 0.32) 0.5%,
    rgba(93, 123, 160, 0.18) 1.5%,
    rgba(93, 123, 160, 0.08) 3%,
    rgba(93, 123, 160, 0.03) 5%,
    transparent 8%
  );
}

#contacts-table tbody tr.tr-lifecycle--client td:first-child {
  box-shadow: inset 1px 0 0 0 rgba(201, 164, 90, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(201, 164, 90, 0.55) 0%,
    rgba(201, 164, 90, 0.32) 0.5%,
    rgba(201, 164, 90, 0.18) 1.5%,
    rgba(201, 164, 90, 0.08) 3%,
    rgba(201, 164, 90, 0.03) 5%,
    transparent 8%
  );
}

/* Dernière ligne : arrondir les cellules d'extrémité pour que le liseré lifecycle
   et les surfaces internes épousent la courbe du wrapper. */
#contacts-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius);
}
#contacts-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius);
}

#view-contact-detail .cd-editable,
#view-contact-detail h2#cd-name.cd-editable,
#view-contact-detail #cd-avancement.cd-editable {
  cursor: text;
  border-radius: var(--radius-sm, 4px);
}

#view-contact-detail .cd-editable:hover {
  outline: 1px dashed var(--border, rgba(255, 255, 255, 0.2));
  outline-offset: 2px;
}

#view-contact-detail .cd-editing {
  outline: 1px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}

/* === Édition inline page détail solution (sd-editable + dynamic) ===
 * Style ultra-épuré : aucun encadré au hover, juste le curseur "text"
 * pour signaler l'éditabilité. Sur le titre, un petit crayon discret
 * apparaît au hover (en bas à droite du texte) et reste pendant l'édition.
 * À l'édition, l'input est rendu invisible et hérite de la typo du parent ;
 * seul le caret signale qu'on tape. */
#view-solution-detail .sd-editable,
#view-solution-detail .sd-editable-dynamic {
  cursor: text;
}

#view-solution-detail .sd-editable.sol-status-pill {
  cursor: pointer;
}

/* Crayon discret au hover (et pendant l'édition) sur le titre. Le pseudo
   est inline avec vertical-align négatif → tombe en bas à droite du texte
   sans décaler les éléments voisins. Couleur via currentColor + mask SVG
   pour qu'il s'adapte automatiquement au thème (clair/sombre). */
#view-solution-detail .sol-detail-title.sd-editable::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.5em;
  vertical-align: -0.05em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/></svg>") center/contain no-repeat;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

#view-solution-detail .sol-detail-title.sd-editable:hover::after {
  opacity: 0.4;
}

/* À l'édition, le crayon disparaît — le caret seul indique le mode. */
#view-solution-detail .sol-detail-title.sd-editing::after {
  display: none;
}

/* À l'édition : input/select/textarea sans cadre ni fond, hérite typo du parent.
   Évite la « double vignette » (input encadré dans un container encadré). */
#view-solution-detail .sd-editing .input,
#view-solution-detail .sd-editing .select,
#view-solution-detail .sd-editing .textarea {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  outline: none;
  width: 100%;
  font: inherit;
  color: var(--text-strong);
  -webkit-text-fill-color: var(--text-strong);
}

#view-solution-detail .sd-editing .input:focus,
#view-solution-detail .sd-editing .select:focus,
#view-solution-detail .sd-editing .textarea:focus {
  box-shadow: none;
  outline: none;
}

/* Bouton Supprimer en haut des fiches détail (solution / contact) */
.sd-delete-btn,
.cd-delete-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.sd-delete-btn:hover,
.cd-delete-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}

/* Onglet Options (fiche contact) — bloc « zone dangereuse » pour la suppression. */
.cd-options-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.06);
}
.cd-options-danger-text {
  min-width: 0;
}
.cd-options-danger-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fecaca;
}
.cd-options-danger-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Topbar — lien « ← Retour » qui n'apparaît qu'en fiche solution, à la
   place de l'éventuel titre (laissé vide pour ce view). */
.topbar-back-link {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.topbar-back-link:hover {
  color: var(--text-strong);
  background: color-mix(in srgb, var(--text-strong) 6%, transparent);
  border-color: color-mix(in srgb, var(--text-strong) 10%, transparent);
}
body[data-current-view="solution-detail"] .topbar-back-link,
body[data-current-view="contact-detail"] .topbar-back-link {
  display: inline-flex;
}
body[data-current-view="solution-detail"] .topbar-title,
body[data-current-view="contact-detail"] .topbar-title {
  display: none !important;
}

/* Fiche solution : nom client cliquable (soulignement subtil au hover) */
.page-hero-meta-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.page-hero-meta-link[href]:hover {
  border-bottom-color: currentColor;
  cursor: pointer;
}

/* Lien « Supprimer » discret en bout de ligne dans la meta-row : gris souligné,
   poussé tout à droite via margin-left auto, avec un peu de margin-right pour
   ne pas être collé au bord du hero. Hover → rouge clair (rappel destructif). */
.sd-delete-link {
  margin-left: auto;
  margin-right: 6px;
  align-self: center;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.sd-delete-link:hover {
  color: #f87171;
}

/* === Tableau Solutions : pill statut cliquable + bouton supprimer === */
.sol-status-editable {
  cursor: pointer;
  position: relative;
}
.sol-status-editable:hover {
  outline: 1px dashed var(--border, rgba(255, 255, 255, 0.25));
  outline-offset: 2px;
}

.td-inline-sol-status {
  vertical-align: middle;
}
.td-inline-sol-status .select.select-inline-status {
  font-size: 0.78rem;
  padding: 0.2rem 0.35rem;
}

.th-sol-actions,
.td-sol-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

button.sol-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
button.sol-delete-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.field-value {
  font-size: 0.95rem;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

/* ——— Toolbar ——— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.search-input {
  max-width: 280px;
  flex: 1;
  min-width: 180px;
}

.toolbar-contacts {
  position: relative;
  z-index: 20;
}

.toolbar-spacer {
  flex: 1;
  min-width: 0;
}

@media (max-width: 720px) {
  .toolbar-spacer {
    display: none;
  }
}

/* ——— Filtres Contacts (menus personnalisés) ——— */
.filter-dd {
  position: relative;
  flex: 0 0 auto;
  min-width: 200px;
}

/*
 * Architecture des en-têtes de colonnes (Contacts).
 * Chaque th utilise une grille à 3 slots :
 *   [slot gauche : 1fr] [slot centre : auto = titre] [slot droit : 1fr = actions]
 * Avec `minmax(0, 1fr)` sur les slots latéraux, le titre est toujours visuellement centré
 * dans la cellule, le slot droit se remplit avec les filtres / boutons d'action.
 * `::before` matérialise le slot gauche (vide par défaut), pour qu'on n'ait pas à toucher
 * au HTML pour ré-équilibrer la grille.
 */
.th-cell-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  padding: 0;
  gap: 0.4rem;
  min-width: 0;
}

.th-cell-content::before {
  content: "";
  display: block;
}

.th-cell-content > .th-sort-btn {
  width: auto;
  justify-self: center;
  padding: 0.85rem 0.5rem;
  flex: 0 1 auto;
}

.th-cell-content > .th-icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
  flex-shrink: 0;
}

/* Variante historique : aujourd'hui équivalente à .th-icon-actions car le slot droit
   les place déjà au bord droit. Conservée pour ne rien casser sur les autres pages. */
.th-icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.th-icon-actions--end {
  margin-left: auto;
}

/* Variante « icône seule » des filtres (déposés dans les en-têtes du tableau Contacts). */
.filter-dd--icon {
  min-width: 0;
}


.filter-dd-trigger--icon {
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  opacity: 0.85;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.filter-dd-glyph {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}


/* Bouton « + Ajouter un contact » dans l'en-tête : pill encadrée, écartée des icônes filtres. */
.th-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.6rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.18));
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  color: var(--text, #e2e8f0);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.th-add-btn:hover,
.th-add-btn:focus-visible {
  border-color: var(--accent, #38bdf8);
  color: var(--accent, #38bdf8);
  outline: none;
}

.th-add-btn-plus {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.th-add-btn-label {
  white-space: nowrap;
}

.filter-dd-trigger--icon:hover,
.filter-dd-trigger--icon:focus-visible {
  opacity: 1;
  color: var(--text, #e2e8f0);
  outline: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.filter-dd--icon.is-open .filter-dd-trigger--icon,
.filter-dd--icon.is-active .filter-dd-trigger--icon {
  opacity: 1;
  color: var(--accent, #38bdf8);
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Popover de recherche : ancré au bord droit de la loupe, extension vers la gauche pour rester dans la colonne.
   Spécificité doublée (.filter-dd-panel.filter-dd-panel--search) pour gagner sur la règle .filter-dd-panel
   déclarée plus bas dans le fichier (sinon le cadre par défaut s'applique et on voit deux encadrés). */
.filter-dd-panel.filter-dd-panel--search {
  width: 18rem;
  max-width: calc(100vw - 2rem);
  padding: 0;
  left: auto;
  right: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.filter-dd-panel--search[hidden] {
  display: none !important;
}

.filter-dd-panel--search .input.search-input {
  width: 100%;
  margin: 0;
}

.filter-dd-panel--search .input.search-input:focus,
.filter-dd-panel--search .input.search-input:focus-visible {
  box-shadow: none;
  outline: none;
}

/* Panneaux des filtres « icône » : on dimensionne au contenu, ancrés à droite de l'icône. */
.filter-dd--icon:not(.filter-dd--search) .filter-dd-panel {
  left: auto;
  right: 0;
  min-width: 12rem;
  width: max-content;
  max-width: 90vw;
  text-transform: none;
  letter-spacing: 0;
}

.filter-dd--lifecycle {
  min-width: 10rem;
  max-width: 15rem;
}

/* Variante icône : pas de min/max-width hérités, le conteneur épouse la taille du glyphe. */
.filter-dd--lifecycle.filter-dd--icon,
.filter-dd--pipeline.filter-dd--icon {
  min-width: 0;
  max-width: none;
}

.filter-dd-panel--lifecycle {
  min-width: 12rem;
}

.filter-dd-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(36, 48, 68, 0.95), rgba(26, 35, 50, 0.98));
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.filter-dd-trigger:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.filter-dd.is-open .filter-dd-trigger {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 8px 28px rgba(0, 0, 0, 0.35);
}

.filter-dd-icon {
  opacity: 0.55;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.filter-dd-value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-dd-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  opacity: 0.75;
}

.filter-dd.is-open .filter-dd-chevron {
  transform: rotate(225deg);
  margin-top: 0.1rem;
  border-color: var(--accent);
}

.filter-dd-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 100;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 30, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(56, 189, 248, 0.08);
  animation: filterPanelIn 0.2s ease;
}

@keyframes filterPanelIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.filter-dd-label {
  padding: 0.5rem 0.75rem 0.2rem;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  list-style: none;
  pointer-events: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.filter-dd-panel--pipeline {
  min-width: 15.5rem;
  padding: 0.45rem;
  color-scheme: dark;
}

.filter-dd-panel--pipeline.filter-dd-panel--multi {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.filter-dd-multi-actions {
  list-style: none;
  margin: 0 0 0.45rem;
  padding: 0 0 0.5rem;
  border-bottom: 1px solid var(--border);
}

.filter-pipeline-reset {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-pipeline-reset:hover {
  background: var(--surface-hover);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--text);
}

.filter-pipeline-reset:active {
  transform: scale(0.99);
}

.filter-dd-group-block {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.filter-dd-group-block + .filter-dd-group-block {
  margin-top: 0.6rem;
}

/* Même esprit que les en-têtes .data-table th — pas de fond système clair (Windows) */
.filter-dd-panel--multi .filter-dd-group-head {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.22);
  background-image: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-dd-panel--multi .filter-dd-group-head:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.filter-dd-panel--multi .filter-dd-group-head[aria-pressed="true"] {
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--accent);
}

.filter-dd-panel--multi .filter-dd-group-head.is-partial {
  background-color: rgba(56, 189, 248, 0.06);
  color: var(--text-muted);
}

.filter-dd-group-title {
  flex: 1;
}

.filter-dd-group-sub {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0.25rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
}

.filter-dd-group-sub > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.filter-dd-group-sub > li::marker {
  content: none;
}

.filter-dd-check--sub {
  padding: 0.38rem 0.5rem 0.38rem 0.75rem;
  font-size: 0.8125rem;
}

.filter-dd-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.65rem 0.4rem 0.5rem;
  margin: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: background 0.12s, color 0.12s;
}

.filter-dd-check:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.filter-dd-check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.filter-dd-check:has(input:checked),
.filter-dd-check.is-checked {
  color: var(--text);
  font-weight: 500;
  background: rgba(56, 189, 248, 0.08);
}

.filter-dd-panel li {
  margin: 0;
  padding: 0;
}

.filter-dd-opt {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.5rem 0.65rem 0.5rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
}

.filter-dd-opt::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  transition: height 0.15s ease;
}

.filter-dd-opt:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.filter-dd-opt.is-active {
  color: var(--text);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
}

.filter-dd-opt.is-active::before {
  height: 60%;
}

.filter-dd-opt.is-active::after {
  content: "✓";
  margin-left: auto;
  padding-left: 0.5rem;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.contacts-sol-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contacts-sol-summary-item a {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.contacts-sol-summary-item a:hover {
  text-decoration: underline;
}

.contacts-sol-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
}

.contact-sol-counts {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.3;
}

.contact-sol-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.contact-sol-label {
  color: var(--text-muted);
  min-width: 2.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-sol-num {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Liste contacts : masquer toute colonne résiduelle AV/LMNP (cache navigateur / ancien app.js) */
#contacts-table tbody td.contact-solutions-cell {
  display: none !important;
}

.contacts-filter-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -0.35rem 0 0.85rem;
  letter-spacing: 0.02em;
}

.contacts-footnote {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  line-height: 1.45;
}

/* ——— Solutions (liste + détail type Notion) ——— */
#solutions-table tbody tr[data-solution-id] {
  cursor: pointer;
}

#solutions-table tbody tr[data-solution-id]:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Colonnes Client / Type / Produit / Statut : headers + cellules centrés.
   La colonne "Nom de la solution" (1re) reste alignée à gauche. */
#solutions-table th:nth-child(n+2),
#solutions-table td:nth-child(n+2) {
  text-align: center;
}

/* Marge gauche élargie sur la colonne "Nom de la solution" pour
   équilibrer visuellement avec l'espace à droite de la colonne Statut. */
#solutions-table th:first-child,
#solutions-table td:first-child {
  padding-left: 2rem;
}

.sol-table-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sol-client-cell {
  font-weight: 500;
}

.sol-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#solutions-table tbody tr[data-solution-id]:hover .sol-tag {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.sol-tag-placements {
  background: rgba(180, 83, 9, 0.28);
  color: #fdba74;
}

.sol-tag-immo {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}

.sol-tag-prod-av {
  background: rgba(22, 163, 74, 0.22);
  color: #86efac;
}

.sol-tag-prod-lmnp {
  background: rgba(30, 58, 138, 0.35);
  color: #a5b4fc;
}

.sol-tag-prod-muted {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

/* Tags spécifiques par code produit (catalogue solution_schemas) */
.sol-tag-prod-per {
  background: rgba(14, 165, 233, 0.22);
  color: #7dd3fc;
}
.sol-tag-prod-scpi {
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
}
.sol-tag-prod-capi {
  background: rgba(20, 184, 166, 0.22);
  color: #5eead4;
}
.sol-tag-prod-pee {
  background: rgba(234, 179, 8, 0.22);
  color: #fde68a;
}
.sol-tag-prod-fip {
  background: rgba(217, 70, 239, 0.22);
  color: #f0abfc;
}
.sol-tag-prod-g3f {
  background: rgba(192, 132, 252, 0.22);
  color: #e9d5ff;
}
.sol-tag-prod-fcpr {
  background: rgba(244, 114, 182, 0.22);
  color: #fbcfe8;
}
.sol-tag-prod-prevoyance {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
}
.sol-tag-prod-novaxia {
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
}
.sol-tag-prod-deficit {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}
.sol-tag-prod-denormandie {
  background: rgba(132, 204, 22, 0.22);
  color: #d9f99d;
}
.sol-tag-prod-lli {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}
.sol-tag-prod-nupro {
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
}
.sol-tag-prod-malraux {
  background: rgba(217, 119, 6, 0.22);
  color: #fdba74;
}
.sol-tag-prod-mh {
  background: rgba(180, 83, 9, 0.22);
  color: #fed7aa;
}
.sol-tag-prod-credit {
  background: rgba(225, 29, 72, 0.22);
  color: #fda4af;
}

/* Pastille de statut — design unique pour la liste ET la fiche solution
   (forme pill avec contour, sans pastille devant). */
.sol-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#solutions-table tbody tr[data-solution-id]:hover .sol-status-pill {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.sol-status-actif {
  background: rgba(37, 99, 235, 0.28);
  color: #93c5fd;
}

.sol-status-etude {
  background: rgba(234, 179, 8, 0.22);
  color: #fde047;
}

.sol-status-cours {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

/* Nouveaux statuts (Arrêté = rouge, Stand by = gris pause) */
.sol-status-arrete {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

.sol-status-pause {
  background: rgba(120, 113, 108, 0.28);
  color: #d6d3d1;
}

.sol-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.sol-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.sol-detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.sol-detail-client {
  text-align: right;
  min-width: 10rem;
}

.sol-detail-client .field-value {
  font-size: 1rem;
  font-weight: 600;
}

/* (Anciens .sol-status-badge / .sol-badge-* fusionnés avec .sol-status-pill
   ci-dessus — un seul design pour la liste ET la fiche solution.) */

.sol-detail-section {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sol-detail-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}

/* ——— Mobile ——— */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrap {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .overlay.show {
    display: block;
  }
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

/* ——— Boutons compacts ——— */
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.rdv-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
}

.rdv-actions .btn {
  white-space: nowrap;
}

.rdv-item--clickable .rdv-body {
  cursor: pointer;
}

.rdv-item--clickable .rdv-body:hover h4 {
  color: var(--accent);
}

/* ——— Modale récap RDV (centrée, fond flouté) ——— */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 20, 25, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

body[data-current-view="team"] .team-wip-backdrop {
  opacity: 1;
  visibility: visible;
}

body[data-current-view="team"] .team-wip-backdrop .drawer-panel {
  transform: scale(1);
  opacity: 1;
}

.drawer-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 760px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.22s ease;
}

.drawer-backdrop.is-open .drawer-panel {
  transform: scale(1);
  opacity: 1;
}

.drawer-panel.drawer-panel--form {
  max-width: 520px;
}

.drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.drawer-form .drawer-foot {
  flex-shrink: 0;
}

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

.drawer-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.drawer-head .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.drawer-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.recap-block {
  margin-bottom: 1.55rem;
}

.recap-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* En dark mode : titres en or chaud + body plus contrasté.
   Hiérarchie nette par taille + couleur, sans séparateur. */
html[data-theme="dark"] .recap-block h4 {
  color: var(--accent-bright);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.recap-block p,
.recap-block .recap-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 500;
  white-space: pre-wrap;
}
html[data-theme="dark"] .recap-block p,
html[data-theme="dark"] .recap-block .recap-text {
  color: var(--text-strong);
}

.recap-block a.zoom-link {
  word-break: break-all;
  font-size: 0.85rem;
}

/* Bouton "Rejoindre la visio" : style CTA propre.
   Pill arrondie + emoji vidéo, hover qui se réchauffe. */
.recap-block a.recap-visio-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 18px -10px rgba(56, 189, 248, 0.55);
}
.recap-block a.recap-visio-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(56, 189, 248, 0.7);
}
html[data-theme="dark"] .recap-block a.recap-visio-button {
  background: var(--accent-bright);
  color: #1a1310;
  box-shadow: 0 6px 18px -10px rgba(196, 187, 176, 0.45);
}
html[data-theme="dark"] .recap-block a.recap-visio-button:hover {
  background: color-mix(in srgb, var(--accent-bright) 85%, white);
  box-shadow: 0 10px 24px -12px rgba(196, 187, 176, 0.65);
}

.drawer-foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ——— Liste de tâches ——— */
.task-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

/* Tâche en retard : seule la date est mise en surbrillance (rouge). */
.task-row--overdue .task-due-value {
  color: #ef4444 !important;
}

.task-row:last-child {
  border-bottom: none;
}

.task-row--hidden {
  display: none !important;
}

.task-row--dragging {
  opacity: 0.5;
}

.task-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent-strong);
}

.task-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* Lignes tâches : intitulé | priorité | échéance (grille légère, pas tableau « SQL ») */
.task-row--layout {
  align-items: center;
}

.task-row-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
}

/*
 * Vue Tâches : grille (case | titre | P | date | ×). Relationnel seul : + colonne catégorie Feedback/Rappel.
 */
#view-tasks .sub-panel .task-list-header-row {
  display: grid;
  grid-template-columns:
    18px minmax(0, 1fr) minmax(0, 3.75rem) minmax(0, 9rem) minmax(0, 2rem);
  column-gap: 0.75rem;
  align-items: end;
  padding: 0 0 0.35rem;
  margin: 0 0 0.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#view-tasks .task-list-header-due {
  text-align: right;
  justify-self: stretch;
}

#view-tasks .sub-panel .task-row--layout {
  display: grid;
  grid-template-columns:
    18px minmax(0, 1fr) minmax(0, 3.75rem) minmax(0, 9rem) minmax(0, 2rem);
  column-gap: 0.75rem;
  row-gap: 0;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#view-tasks .tab-panel[data-panel="relationnel"] .sub-panel .task-list-header-row,
#view-tasks .tab-panel[data-panel="relationnel"] .sub-panel .task-row--layout {
  grid-template-columns:
    18px 6.1rem minmax(0, 1fr) minmax(0, 3.75rem) minmax(0, 9rem) minmax(0, 2rem);
  column-gap: 0.42rem;
}

#view-tasks .sub-panel .task-row--layout .task-row-fields {
  display: contents;
}

#view-tasks .sub-panel .task-row--layout .task-main,
#view-tasks .sub-panel .task-row--layout .task-col--title {
  min-width: 0;
}

#view-tasks .task-col--priority {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

#view-tasks .task-col--due .task-due-combo {
  width: 100%;
  max-width: none;
}

#view-tasks .task-row-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.tasks-inline-new-actions-slot {
  display: block;
  width: 100%;
  min-height: 1px;
  pointer-events: none;
}

#view-tasks .sub-panel .task-row--layout .tasks-inline-new-cb-slot {
  justify-self: start;
}

.task-col--title {
  min-width: 0;
}

/* Priorité (pills modernes) */
.task-col--priority .task-priority-pills {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
  padding: 0.1rem;
  gap: 0.1rem;
}

.task-col--priority .task-priority-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text, #e2e8f0);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
}

.task-col--priority .task-priority-pill.is-active {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.25);
}

.task-col--priority .task-priority-pill[data-priority="P1"].is-active {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.35);
}

.task-col--priority .task-priority-pill[data-priority="P2"].is-active {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.32);
}

.task-col--priority .task-priority-pill[data-priority="P3"].is-active {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28);
}

.task-col--priority .task-priority-pill:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

/* Filtre priorité (multi-sélection) au-dessus de chaque sous-volet */
.task-priority-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0.2rem 0 0.55rem;
}

.task-priority-filter-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.task-priority-filter-pills {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
  padding: 0.1rem;
  gap: 0.1rem;
}

.task-priority-filter-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text, #e2e8f0);
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
}

.task-priority-filter-pill.is-active[data-priority="P1"] {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.42);
}

.task-priority-filter-pill.is-active[data-priority="P2"] {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.35);
}

.task-priority-filter-pill.is-active[data-priority="P3"] {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.35);
}

.task-priority-filter-pill:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

/* « ? » Tâches : même ligne que Afficher · P1 P2 P3 */
.task-priority-filter-help {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}

/* Bouton « + Nouvelle tâche » : reprend le style de "+ Ajouter un contact"
   (.btn-sidebar-active). Pas de surcharge ici — la classe applique son rendu
   métallique nativement. flex-shrink garde la pastille intacte dans la barre. */
.sub-panel-add-task-btn {
  flex-shrink: 0;
}

/* La ligne d'ajout inline reste cachée tant que l'utilisateur n'a pas cliqué sur « + ». */
#view-tasks .sub-panel .tasks-inline-new-row {
  display: none;
}

#view-tasks .sub-panel.is-adding-task .tasks-inline-new-row {
  display: grid;
}

/*
 * Bulle d’aide : le bloc absolu ne doit pas prendre le « ? » comme référence (sinon max-width:100%
 * du .reminders-help-panel le tasse à ~22px). Ancrage sur toute la ligne = largeur de la vignette.
 */
#view-tasks .task-priority-filter {
  position: relative;
  z-index: 2;
}

#view-tasks .task-priority-filter-help {
  position: static;
}

#view-tasks .task-priority-filter .reminders-help-panel--tasks-unified {
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  top: calc(100% + 8px);
  z-index: 50;
}

.reminders-help-panel--tasks-unified {
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.reminders-help-panel--tasks-unified p {
  margin: 0 0 0.75rem;
}

.reminders-help-panel--tasks-unified p:last-child {
  margin-bottom: 0;
}

#view-tasks .tasks-card.card {
  overflow: visible;
}

/* Priorité en ligne : badge seul, menu P1/P2/P3 au clic */
.task-priority-row-badge {
  margin: 0;
  font: inherit;
  font-weight: 750;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.5);
  color: #e2e8f0;
  cursor: pointer;
  min-width: 2.4rem;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

.task-priority-row-badge[data-priority="P1"] {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.task-priority-row-badge[data-priority="P2"] {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fef3c7;
}

.task-priority-row-badge[data-priority="P3"] {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.32);
  color: #e2e8f0;
}

.task-priority-row-badge:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

.task-pri-row-pop {
  position: fixed;
  z-index: 10052;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 10px;
  background: rgba(12, 18, 32, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.task-pri-row-opt {
  margin: 0;
  width: 100%;
  text-align: center;
  font: inherit;
  font-weight: 750;
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.35);
  color: #e2e8f0;
  cursor: pointer;
}

.task-pri-row-opt.is-current {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.15);
}

.task-pri-row-opt:hover {
  background: rgba(59, 130, 246, 0.12);
}

/* Échéance : contrôle + calendrier flottant */
.task-col--due,
.task-due-combo,
.task-add-due-host,
.task-inline-new-due-host {
  min-width: 0;
  max-width: 100%;
}

.task-col--due {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.task-due-combo {
  width: 100%;
  max-width: 9rem;
}

.task-due-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.3rem;
  text-align: left;
  border-radius: 8px;
  padding: 0.28rem 0.4rem;
  color: #e2e8f0;
  background: linear-gradient(
      rgba(15, 23, 42, 0.7),
      rgba(15, 23, 42, 0.7)
    )
    padding-box,
    linear-gradient(120deg, rgba(45, 212, 191, 0.55), rgba(139, 92, 246, 0.55)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.task-due-trigger:hover {
  filter: brightness(1.04);
}

.task-due-icon {
  display: inline-flex;
  color: #cbd5e1;
}

.task-due-value {
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  min-width: 0;
}

.task-due-chevron {
  color: #94a3b8;
  font-size: 0.65rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Calendrier */
.task-cal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
}

.task-cal-pop {
  position: fixed;
  z-index: 10051;
  width: 300px;
  max-width: calc(100vw - 20px);
  display: none;
  border-radius: 14px;
  padding: 0.7rem 0.75rem 0.65rem;
  color: #e2e8f0;
  background: rgba(12, 18, 32, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.task-cal-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.task-cal-title {
  text-align: center;
  font-weight: 800;
  font-size: 0.88rem;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.task-cal-nav {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.task-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: #94a3b8;
  font-size: 0.7rem;
  text-transform: uppercase;
  margin: 0.2rem 0 0.2rem;
}

.task-cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem 0.1rem;
  margin: 0.1rem 0 0.45rem;
}

.task-cal-day {
  position: relative;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(2, 6, 23, 0.15);
  color: #e2e8f0;
  cursor: pointer;
  padding: 0;
}

.task-cal-day--muted {
  color: #64748b;
  background: rgba(2, 6, 23, 0.08);
}

.task-cal-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.35);
}

.task-cal-day.is-selected {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.28), rgba(59, 130, 246, 0.2));
  border-color: rgba(59, 130, 246, 0.5);
  color: #f8fafc;
}

.task-cal-daynum {
  display: block;
  padding-top: 0.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.task-cal-dot {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 999px;
  background: #2dd4bf;
}

.task-cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.task-cal-foot .btn {
  font-size: 0.8rem;
  border-radius: 10px;
}

.task-cal-foot-r {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
}

/* legacy .task-priority-select removed (now pills) */

/* Grille = .task-row-fields (même gabarit que les lignes de tâches). */
.task-inline-new-grid {
  width: 100%;
  font-size: 0.84rem;
  padding-block: 0;
  color: var(--text-muted);
  opacity: 0;
  transition:
    background-color 0.15s ease,
    opacity 0.15s ease,
    transform 0.1s ease;
}

.tasks-inline-new-cb-slot {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  align-self: center;
  pointer-events: none;
}

#view-tasks .tasks-inline-new-row.task-row--layout {
  padding-block: 0.42rem;
}

.task-inline-new-title {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.1rem 0;
  outline: none;
}

/* Aligné visuellement sur .task-priority-row-badge */
.task-inline-new-priority {
  margin: 0;
  font: inherit;
  font-weight: 750;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.16));
  background: rgba(15, 23, 42, 0.5);
  color: var(--text, #e2e8f0);
  cursor: pointer;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

.task-inline-new-grid--rel {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.task-inline-rel-type {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.task-inline-rel-pill {
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
  font: inherit;
}

.task-inline-rel-pill.is-active {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.16);
  color: #f8fafc;
}

/* Relationnel : tâches | feedbacks */
.sub-panel-stack--rel-single {
  max-width: 100%;
}

.rel-twin-colwrap {
  margin-top: 0.45rem;
}

.rel-twin-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.rel-twin-pairs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rel-twin-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
}

.rel-twin-pair__main,
.rel-twin-pair__fb {
  min-width: 0;
}

.rel-twin-fb-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  color: #64748b;
  font-size: 1.1rem;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.2);
}

.rel-twin-orphan-list {
  margin-bottom: 0.75rem;
}

.rel-twin-orphan-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.rel-twin-orphan-pair__note {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
  align-self: center;
}

.task-main--rel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.task-rel-type-pill {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.task-rel-type-pill--appel {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}

.task-rel-type-pill--visu {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
}

.task-rel-type-pill--feedback {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.task-rel-type-pill--rappel {
  color: #243447;
  background: linear-gradient(120deg, #e6eef8 0%, #b8cbe3 45%, #5f7a96 100%);
  border-color: color-mix(in srgb, #5f7a96 40%, #b8cbe3);
}

html[data-theme="dark"] .task-rel-type-pill--rappel {
  color: #e4eef8;
  background: linear-gradient(
    120deg,
    rgba(198, 214, 236, 0.28) 0%,
    rgba(130, 158, 196, 0.22) 48%,
    rgba(36, 58, 88, 0.62) 100%
  );
  border-color: rgba(140, 170, 210, 0.4);
}

/* Pills famille pour Pro et Perso (utilisées dans « Tâches précédentes ») */
.task-cat-pill--pro {
  color: #fcd9a3;
  background: rgba(217, 119, 6, 0.16);
  border-color: rgba(217, 119, 6, 0.45);
}

html[data-theme="light"] .task-cat-pill--pro {
  color: #92400e;
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.42);
}

.task-cat-pill--perso {
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.4);
}

html[data-theme="light"] .task-cat-pill--perso {
  color: #5b21b6;
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.4);
}

/* Lignes « Tâches précédentes » : contrôles inertes (lecture seule) */
.tasks-previous-mirror-row .task-priority-row-badge,
.tasks-previous-mirror-row .task-due-trigger,
.tasks-previous-mirror-row .task-due-combo {
  pointer-events: none;
  cursor: default;
}

.task-row--rel-fbrow .task-row-fields--rel-fb {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.task-meta--rel-fb {
  font-size: 0.72rem;
  color: #94a3b8;
  font-style: italic;
}

@media (max-width: 640px) {
  #view-tasks .sub-panel .task-list-header-row {
    display: none;
  }

  #view-tasks .sub-panel .task-row--layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  #view-tasks .sub-panel .task-row--layout .task-row-fields {
    display: grid;
    grid-template-columns: 1fr;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.5rem 0.85rem;
  }

  #view-tasks .task-row-fields,
  .task-row-fields,
  .task-inline-new-grid,
  .task-inline-new-grid--rel {
    grid-template-columns: 1fr;
  }

  .rel-twin-pair,
  .rel-twin-orphan-pair,
  .rel-twin-head {
    grid-template-columns: 1fr;
  }

  .task-due-combo {
    max-width: none;
  }
}

.task-row-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.task-row:hover .task-row-actions {
  opacity: 1;
}

.task-delete-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 4px;
}

.task-delete-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #e5e7eb;
}

.task-title-input-inline {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
  outline: none;
  width: 100%;
}

.task-row--editing .task-pill {
  display: none;
}

.task-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.task-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

#view-tasks .task-meta {
  display: none;
}

/* Onglet Solutions de la fiche contact : masquer les phrases d’intro */
#view-contact-detail #cd-sol-intro {
  display: none;
}

#view-contact-detail .cd-sol-panels .sub-panel-hint {
  display: none;
}

.task-pill {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  margin-left: 0.35rem;
}

.task-pill-rel {
  background: rgba(52, 211, 153, 0.18);
  color: var(--success);
}

.task-pill-pro {
  background: rgba(96, 165, 250, 0.22);
  color: #93c5fd;
}

.task-pill-global {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.task-pill-equipe {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

.tasks-page-intro {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
  max-width: 52rem;
  line-height: 1.55;
}

.tasks-card {
  padding: 0;
  overflow: hidden;
}

.tasks-card > .tab-panel {
  padding: 1.25rem 1.35rem 1.5rem;
}

.tasks-primary-seg {
  padding: 1rem 1.35rem 0;
}

.tasks-primary-seg--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.tasks-primary-seg--row .tasks-main-tabs {
  flex: 1 1 200px;
  min-width: min(100%, 200px);
}

.tasks-new-open {
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}

.tasks-inline-new-row {
  opacity: 0.7;
  transition:
    background-color 0.15s ease,
    opacity 0.15s ease,
    transform 0.1s ease;
}

.tasks-inline-new-row:hover {
  background-color: rgba(148, 163, 184, 0.08);
  opacity: 1;
  transform: translateY(-1px);
}

.task-main--inline-new {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  padding-block: 0.35rem;
  opacity: 0;
}

.task-inline-new-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
  line-height: 1;
}

.task-inline-new-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.1rem 0;
  outline: none;
}

#view-tasks .sub-panel:hover .task-inline-new-grid {
  opacity: 1;
}

.task-new-panel {
  max-width: 440px;
}

.task-new-body .tasks-add-type-block {
  margin-bottom: 1.1rem;
}

.task-new-field-label {
  display: block;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.task-new-title-input {
  width: 100%;
  margin-top: 0.45rem;
  box-sizing: border-box;
}

.task-new-body .task-add-priority-select,
.task-new-body .task-add-due-host {
  width: 100%;
  margin-top: 0.45rem;
  box-sizing: border-box;
}

.tasks-add-type-block {
  margin-bottom: 0.75rem;
}

.tasks-add-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.tasks-add-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tasks-add-type-pill {
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.tasks-add-type-pill:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.07);
}

.tasks-add-type-pill.is-active {
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(165, 180, 252, 0.45);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.15);
}

.tasks-card .tasks-main-tabs {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 4px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}

.tasks-card .tasks-main-tabs .tab {
  flex: 1;
  margin: 0;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  background: transparent;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tasks-card .tasks-main-tabs .tab:hover {
  color: var(--text);
}

.tasks-card .tasks-main-tabs .tab.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.tasks-intro {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.55;
  max-width: none;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.tasks-previous-card {
  margin-top: 1.25rem;
  padding: 0;
  overflow: hidden;
}

.tasks-previous-header {
  width: 100%;
  padding: 0.9rem 1.35rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
}

.tasks-previous-header .card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.tasks-previous-chevron {
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid rgba(148, 163, 184, 0.9);
  border-bottom: 2px solid rgba(148, 163, 184, 0.9);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.tasks-previous-card--collapsed .tasks-previous-chevron {
  transform: rotate(-135deg);
}

.tasks-previous-body {
  padding: 0.75rem 1.35rem 1.3rem;
}

.tasks-previous-intro {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tasks-previous-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 0.5rem 0 0;
}

.tasks-previous-card--collapsed .tasks-previous-body {
  display: none;
}

.tasks-previous-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tasks-previous-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.tasks-previous-item:last-child {
  border-bottom: none;
}

.tasks-previous-item-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.tasks-previous-title-done {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  color: var(--text-muted);
}

.tasks-previous-mirror-row {
  padding: 0.65rem 0;
  border-bottom: none;
}

.tasks-previous-item .tasks-previous-mirror-row {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.tasks-previous-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.45;
}

.tasks-previous-restore {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

/* Sous-volets (pills) */
.sub-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sub-tabs::-webkit-scrollbar {
  display: none;
}

.sub-tab {
  flex: 0 0 auto;
  padding: 0.45rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.sub-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sub-tab.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.sub-tabs--pro .sub-tab.active {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.1);
  color: #bfdbfe;
}

.sub-panel-stack {
  min-height: 120px;
}

.sub-panel {
  display: none;
  animation: fadeIn 0.22s ease;
}

.sub-panel.active {
  display: block;
}

.sub-panel-hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ——— Maquette cockpit invitations (événements) ——— */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cockpit-mock-banner {
  margin: 0 0 1.25rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(212, 180, 130, 0.5);
  background: rgba(212, 180, 130, 0.08);
  color: #e8d4a8;
}

.cockpit-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cockpit-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.cockpit-event-select {
  min-width: 280px;
  max-width: 100%;
}

/* Toolbar Événements : tous les contrôles alignés sur la même hauteur. */
.cockpit-event-toolbar {
  align-items: center;
}
.cockpit-event-toolbar .cockpit-event-select {
  width: 380px;
  flex: 0 0 380px;
  height: 40px;
  padding-right: 2.25rem;
}
.cockpit-event-toolbar .btn {
  height: 40px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .cockpit-event-toolbar .cockpit-event-select {
    width: 100%;
    flex: 1 1 100%;
  }
}

.cockpit-kpi-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1200px) {
  .cockpit-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cockpit-kpi-row {
    grid-template-columns: 1fr;
  }
}

.cockpit-kpi-sub {
  font-size: 0.85em;
  font-weight: 500;
  color: var(--text-muted);
}

.cockpit-snake-card,
.cockpit-flow-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius, 12px);
  background: radial-gradient(100% 120% at 50% -30%, rgba(123, 163, 196, 0.1), transparent 55%),
    var(--card-bg, rgba(30, 41, 59, 0.45));
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.cockpit-flow-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.cockpit-flow-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cockpit-flow-sub {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 52ch;
}

.cockpit-flow-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  margin-top: 0.65rem;
  align-items: center;
}

.cockpit-flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.cockpit-flow-chip-num {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.cockpit-flow-chip--dim {
  color: var(--text-muted);
  font-weight: 500;
  border-style: dashed;
  opacity: 0.95;
}

.cockpit-flow-chip--ok {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.cockpit-flow-chip--active {
  background: rgba(123, 163, 196, 0.16);
  border-color: rgba(123, 163, 196, 0.42);
  color: #c8dcee;
  max-width: 100%;
}

button.cockpit-flow-chip.cockpit-flow-chip--link {
  font: inherit;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  border-style: dashed;
}

.cockpit-snake-mount,
.cockpit-flow-mount {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 1.25rem;
}

.cockpit-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cockpit-flow-panel {
  border-radius: 14px;
  padding: 1rem 0.85rem 1.05rem;
  border: 1px solid transparent;
}

.cockpit-flow-panel--pre {
  background: linear-gradient(165deg, rgba(123, 163, 196, 0.1) 0%, rgba(15, 23, 42, 0.35) 100%);
  border-color: rgba(123, 163, 196, 0.22);
}

.cockpit-flow-panel--post {
  margin-top: 0.35rem;
  background: linear-gradient(165deg, rgba(212, 180, 130, 0.09) 0%, rgba(15, 23, 42, 0.35) 100%);
  border-color: rgba(212, 180, 130, 0.26);
}

.cockpit-flow-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0 0.35rem;
}

.cockpit-flow-panel-meta {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.cockpit-flow-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 6px;
}

.cockpit-flow-badge--pre {
  background: rgba(123, 163, 196, 0.2);
  color: #c8dcee;
  border: 1px solid rgba(123, 163, 196, 0.42);
}

.cockpit-flow-badge--post {
  background: rgba(212, 180, 130, 0.18);
  color: #e8d4a8;
  border: 1px solid rgba(212, 180, 130, 0.45);
}

.cockpit-flow-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.55rem 0.5rem;
}

.cockpit-flow-bridge-line {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.45), transparent);
}

.cockpit-flow-bridge-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
}

.cockpit-flow-nodes--pre {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
}

.cockpit-flow-nodes--post {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cockpit-flow-nodes--post .cockpit-flow-node {
  flex: 1 1 120px;
  max-width: 200px;
}

@media (max-width: 720px) {
  .cockpit-flow-nodes--pre {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cockpit-flow-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 104px;
  padding: 0.55rem 0.3rem 0.45rem;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease;
  outline: none;
}

.cockpit-flow-node-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at 50% 0%, rgba(123, 163, 196, 0.4), transparent 65%);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cockpit-flow-node--post .cockpit-flow-node-glow {
  background: radial-gradient(circle at 50% 0%, rgba(212, 180, 130, 0.38), transparent 65%);
}

.cockpit-flow-node:hover .cockpit-flow-node-glow {
  opacity: 0.55;
}

.cockpit-flow-node:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.cockpit-flow-node--pre:hover {
  border-color: rgba(123, 163, 196, 0.55);
}

.cockpit-flow-node--post:hover {
  border-color: rgba(212, 180, 130, 0.55);
}

.cockpit-flow-node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cockpit-flow-node-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.cockpit-flow-node-step-num {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.cockpit-flow-node-abbr {
  margin-top: 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.cockpit-flow-node-count-pill {
  margin-top: 0.4rem;
  min-width: 1.85rem;
  padding: 0.18rem 0.42rem;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.cockpit-flow-node--pre .cockpit-flow-node-count-pill {
  background: rgba(123, 163, 196, 0.18);
  color: #c8dcee;
}

.cockpit-flow-node--post .cockpit-flow-node-count-pill {
  background: rgba(212, 180, 130, 0.18);
  color: #e8d4a8;
}

.cockpit-flow-node--selected {
  border-color: rgba(123, 163, 196, 0.85);
  box-shadow: 0 0 0 2px rgba(123, 163, 196, 0.38), 0 14px 40px rgba(0, 0, 0, 0.42);
}

.cockpit-flow-node--post.cockpit-flow-node--selected {
  border-color: rgba(212, 180, 130, 0.85);
  box-shadow: 0 0 0 2px rgba(212, 180, 130, 0.38), 0 14px 40px rgba(0, 0, 0, 0.42);
}

.cockpit-snake-done {
  color: #34d399;
}

.cockpit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
}

.cockpit-search-bar-card {
  padding: 0.1rem 0.6rem;
}

.cockpit-search-bar-card .cockpit-search {
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
}

.cockpit-search-bar-card .cockpit-table-edit-all-btn {
  padding: 0.15rem 0.65rem;
  font-size: 0.8rem;
  min-height: 0;
}

.cockpit-search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.cockpit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.cockpit-table-card {
  padding: 0;
  overflow: hidden;
}

.cockpit-table-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cockpit-table-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.cockpit-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.cockpit-table {
  font-size: 0.8rem;
  white-space: nowrap;
}

.cockpit-table th,
.cockpit-table td {
  padding: 0.45rem 0.5rem;
  vertical-align: middle;
}

.cockpit-table select.cockpit-invitation-select {
  max-width: 7.5rem;
  min-width: 3.5rem;
  font-size: 0.78rem;
  padding: 0.18rem 0.35rem;
}

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

.cockpit-invite-actions,
.cockpit-invite-actions-th {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

.cockpit-invite-actions-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

button.cockpit-invite-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  margin: 0;
  border: none;
  border-radius: var(--radius, 6px);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

button.cockpit-invite-remove-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

.cockpit-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

.cockpit-sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg-elevated);
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.2);
}

.cockpit-sticky2 {
  position: sticky;
  left: 4.5rem;
  z-index: 3;
  background: var(--bg-elevated);
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .cockpit-sticky2 {
    left: 3.75rem;
  }
}

.cockpit-faux-link {
  color: var(--accent);
  cursor: default;
  pointer-events: none;
  text-decoration: none;
}

.cockpit-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.cockpit-pill--yes {
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.cockpit-pill--no {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.cockpit-lvl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}

.cockpit-lvl--hi {
  background: rgba(52, 211, 153, 0.25);
  color: #a7f3d0;
}

.cockpit-lvl--mid {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

.cockpit-lvl--lo {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

.cockpit-cell {
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 6px;
}

.cockpit-cell--ok {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.cockpit-cell--no {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.cockpit-cell--maybe {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}

.cockpit-cell--muted {
  color: var(--text-muted);
  font-weight: 400;
}

.cockpit-result {
  white-space: normal;
  max-width: 10rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* Pipeline : bouton synthèse + pastilles (remplace o / n dans la grille) */
.cockpit-col-pipeline {
  min-width: 220px;
  max-width: 280px;
  vertical-align: middle;
}

.cockpit-pipeline-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  text-align: left;
  font: inherit;
  color: inherit;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cockpit-pipeline-trigger:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.cockpit-pipeline-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Vue tableau complète : une colonne par étape pipeline (clic = cycle tri-state) */
.cockpit-col-step {
  width: 1%;
  min-width: 3.25rem;
  text-align: center;
  vertical-align: middle;
}

.cockpit-table thead th.cockpit-col-step {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

button.cockpit-table-step-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

button.cockpit-table-step-toggle:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
}

button.cockpit-table-step-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button.cockpit-table-step-toggle .cockpit-dot {
  width: 14px;
  height: 14px;
}

/* Bouton "Tout éditer" — état actif marqué visuellement */
.cockpit-table-edit-all-btn.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--accent);
}

/* Paramètres — card unique "Imports" avec 2 sous-sections numérotées */
.settings-imports-section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.settings-imports-section.settings-imports-section--last {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.settings-imports-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.cockpit-pipeline-dots {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

.cockpit-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cockpit-dot--done {
  background: linear-gradient(145deg, #34d399, #059669);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
}

.cockpit-dot--no {
  background: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.25);
}

.cockpit-dot--pause {
  background: linear-gradient(145deg, #f87171, #dc2626);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.3);
}

.cockpit-dot--maybe {
  background: linear-gradient(145deg, #fbbf24, #d97706);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
}

.cockpit-dot--todo {
  background: transparent;
  border: 2px solid rgba(148, 163, 184, 0.45);
}

.cockpit-dot--na {
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  opacity: 0.75;
}

.cockpit-pipeline-text {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.cockpit-pipeline-text strong {
  color: var(--text);
  font-weight: 700;
}

.cockpit-pipeline-cta {
  color: var(--accent);
  font-weight: 500;
}

.cockpit-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cockpit-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.cockpit-step-item:last-child {
  border-bottom: none;
}

.cockpit-step-icon-wrap {
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.cockpit-step-icon.cockpit-dot {
  width: 12px;
  height: 12px;
  display: block;
}

.cockpit-step-main {
  flex: 1;
  min-width: 0;
}

.cockpit-step-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.cockpit-step-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.cockpit-step-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cockpit-step-badge--done {
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.cockpit-step-badge--no {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.cockpit-step-badge--neutral {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.cockpit-step-badge--pause {
  background: rgba(248, 113, 113, 0.22);
  color: #fecaca;
}

.cockpit-step-badge--maybe {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

.cockpit-step-badge--todo {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.cockpit-step-badge--na {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.cockpit-step-list--toggle .cockpit-step-item--toggle {
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.cockpit-step-list--toggle .cockpit-step-item--toggle:last-child {
  border-bottom: none;
}

.cockpit-step-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 0.9rem 0.25rem;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cockpit-step-toggle:hover {
  background: rgba(148, 163, 184, 0.06);
}

.cockpit-step-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cockpit-step-toggle--neutral {
  border-color: rgba(148, 163, 184, 0.25);
}

.cockpit-step-toggle--yes {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.45);
}

.cockpit-step-toggle--pause {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
}

.cockpit-drawer-footnote {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

/* Modale pipeline : tout le reste est flouté / masqué — seule la carte compte */
.cockpit-pipeline-modal-backdrop {
  z-index: 500 !important;
  background: rgba(4, 6, 10, 0.93) !important;
  backdrop-filter: blur(32px) saturate(0.88) !important;
  -webkit-backdrop-filter: blur(32px) saturate(0.88) !important;
}

.cockpit-pipeline-modal-backdrop .cockpit-pipeline-card {
  max-width: min(760px, calc(100vw - 2rem));
  width: 100%;
  max-height: min(92vh, 940px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 28px 72px rgba(0, 0, 0, 0.78),
    0 0 100px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.cockpit-pipeline-card-head {
  padding: 1.75rem 1.75rem 1.35rem !important;
  align-items: flex-start !important;
}

.cockpit-pipeline-card-head-text {
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem;
}

.cockpit-pipeline-modal-backdrop #cockpit-pipeline-title {
  margin: 0;
  font-size: clamp(1.5rem, 4.2vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text);
}

.cockpit-pipeline-card-sub {
  margin: 0.75rem 0 0;
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cockpit-pipeline-card-body {
  padding: 1.35rem 1.75rem 1.75rem !important;
}

.cockpit-pipeline-card-foot {
  padding: 1.1rem 1.75rem 1.65rem !important;
}

.cockpit-pipeline-close-btn {
  width: 44px;
  height: 44px;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.cockpit-pipeline-btn-close {
  min-width: 8rem;
  padding: 0.65rem 1.35rem;
  font-size: 1rem;
}

.cockpit-pipeline-card .cockpit-step-list--modal .cockpit-step-item {
  padding: 1.2rem 0;
  gap: 1.05rem;
  align-items: flex-start;
}

.cockpit-pipeline-card .cockpit-step-list--modal .cockpit-step-label {
  font-size: 1.06rem;
  margin-bottom: 0.35rem;
}

.cockpit-pipeline-card .cockpit-step-list--modal .cockpit-step-detail {
  font-size: 0.98rem;
  line-height: 1.5;
}

.cockpit-pipeline-card .cockpit-step-list--modal .cockpit-step-icon.cockpit-dot {
  width: 16px;
  height: 16px;
}

.cockpit-pipeline-card .cockpit-step-list--modal .cockpit-step-badge {
  font-size: 0.8rem;
  padding: 0.38rem 0.7rem;
  margin-top: 0.15rem;
}

/* Modale tableau pipeline (sous le détail par contact) */
#cockpit-invitation-table-backdrop.cockpit-pipeline-modal-backdrop {
  z-index: 490 !important;
}

#cockpit-pipeline-backdrop.cockpit-pipeline-modal-backdrop {
  z-index: 560 !important;
}

.cockpit-invitation-table-backdrop .cockpit-invitation-table-panel {
  max-width: min(1180px, calc(100vw - 2rem));
  width: 100%;
  max-height: min(94vh, 980px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 28px 72px rgba(0, 0, 0, 0.78),
    0 0 100px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cockpit-invitation-table-head {
  padding: 1.35rem 1.5rem 1rem !important;
  align-items: flex-start !important;
  flex-shrink: 0;
}

.cockpit-invitation-table-head-text {
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem;
}

.cockpit-invitation-table-backdrop #cockpit-invitation-table-title {
  margin: 0;
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cockpit-invitation-table-sub {
  margin: 0.45rem 0 0;
  line-height: 1.45;
}

.cockpit-invitation-table-body {
  padding: 1rem 1.25rem 1.25rem !important;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.cockpit-invitation-table-body > .cockpit-search-bar-card {
  margin-top: 0 !important;
}

.cockpit-invitation-table-foot {
  padding: 1rem 1.5rem 1.35rem !important;
  flex-shrink: 0;
}

.cockpit-insights-card {
  padding: 1.1rem 1.25rem 1.15rem;
}

.cockpit-insights-card > .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.85rem;
}

.cockpit-insights-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .cockpit-insights-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cockpit-insights-row {
    grid-template-columns: 1fr;
  }
}

.cockpit-insight-stat .value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Intérêts patrimoniaux (multi cases, fiche + formulaire) */
.interets-pat-form-grid,
.interets-pat-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  align-items: start;
  max-width: 28rem;
}
.interets-pat-cb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* =====================================================================
   Monitoring v2 polish — KPI premium + chart head + doughnut + insights
   ===================================================================== */

/* ——— KPI strip premium ——— */
/* 4 colonnes spécifiquement pour Monitoring (les autres pages avec
   .bento-grid--strip restent en 3 cols). Sélecteur à 3 classes pour
   battre `.bento-grid.bento-grid--strip` de bento-clone.css qui est
   chargé après app.css (même spécificité sinon → ordre de chargement). */
.bento-grid.bento-grid--strip.mon-kpi-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .bento-grid.bento-grid--strip.mon-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .bento-grid.bento-grid--strip.mon-kpi-strip {
    grid-template-columns: 1fr;
  }
}

.mon-kpi-strip .mon-kpi-card {
  min-height: 84px;
  gap: 4px;
  padding: 10px 12px 8px;
  position: relative;
  overflow: hidden;
}

/* Tinting par card : pseudo ::after qui peint le trait lumineux 1.5px à
   gauche + halo horizontal court, comme les cartes "lecture rapide".
   On passe par un pseudo plutôt que box-shadow + background-image car le
   bento (chargé après) impose un `background: ... !important` qui écrase
   sinon. La couleur est passée via une CSS variable par data-mon-kpi. */
.bento-grid.mon-kpi-strip .mon-kpi-card[data-mon-kpi="rdv"] {
  --mon-tint-rgb: 20, 184, 166;
}
.bento-grid.mon-kpi-strip .mon-kpi-card[data-mon-kpi="contacts"] {
  --mon-tint-rgb: 160, 135, 117;
}
.bento-grid.mon-kpi-strip .mon-kpi-card[data-mon-kpi="prospects"] {
  --mon-tint-rgb: 93, 123, 160;
}
.bento-grid.mon-kpi-strip .mon-kpi-card[data-mon-kpi="clients-month"] {
  --mon-tint-rgb: 201, 164, 90;
}

.bento-grid.mon-kpi-strip .mon-kpi-card[data-mon-kpi]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  /* border-left épouse le border-radius hérité de la card → la ligne suit
     la courbe des coins arrondis (top-left + bottom-left). Halo plus
     subtle, transparent dès 30% pour rester fin. */
  border-left: 1px solid rgba(var(--mon-tint-rgb), 0.85);
  background: linear-gradient(
    to right,
    rgba(var(--mon-tint-rgb), 0.14) 0,
    rgba(var(--mon-tint-rgb), 0.05) 14%,
    rgba(var(--mon-tint-rgb), 0.02) 24%,
    transparent 32%
  );
}

.mon-kpi-card .mon-kpi-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mon-kpi-card .mon-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

.mon-kpi-card .mon-kpi-head .label {
  margin: 0;
}

.mon-kpi-card .mon-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.mon-kpi-card .mon-kpi-value-row .value {
  margin: 0;
  line-height: 1;
}

.mon-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.18);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.mon-kpi-trend[data-trend="positive"] {
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.28);
}

.mon-kpi-trend[data-trend="negative"] {
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.28);
}

.mon-kpi-trend[data-trend="neutral"] {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.2);
}

.mon-kpi-spark {
  position: relative;
  width: 108px;
  max-width: 50%;
  height: 28px;
  margin: 4px 0 0 auto;
  align-self: flex-end;
}

.mon-kpi-spark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mon-kpi-spark .mon-spark-fill {
  opacity: 0.22;
}

.mon-kpi-spark .mon-spark-line {
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mon-kpi-spark .mon-spark-dot {
  filter: drop-shadow(0 0 5px currentColor);
}

.mon-kpi-card .mon-kpi-footer {
  margin-top: auto;
  margin-left: auto;
  width: max-content;
  justify-self: end;
  text-align: right;
  padding-right: 4px;
}

@media (max-width: 720px) {
  .mon-kpi-strip .mon-kpi-card {
    min-height: 86px;
  }
  .mon-kpi-spark {
    width: 84px;
    height: 22px;
  }
}

/* ——— Chart head v2 ——— */
.mon-chart-card-v2 {
  padding: 22px 24px 20px;
}

.mon-chart-head-v2 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mon-chart-head-text {
  min-width: 0;
}

.mon-chart-head-text .card-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.mon-chart-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.mon-chart-controls-v2 {
  gap: 8px;
}

.mon-series-toggles-v2 {
  margin-bottom: 14px;
  padding: 4px 0 2px;
}

/* ——— Secondary grid (doughnut + insights) ——— */
.mon-secondary-grid {
  margin-top: 1.25rem;
  align-items: stretch;
}

.mon-secondary-grid > .card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mon-card-foot {
  margin: 14px 0 0;
}

/* ——— Doughnut enrichi ——— */
.mon-doughnut-card {
  padding: 22px 24px 20px;
}

.mon-doughnut-grid {
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 6px;
}

.mon-doughnut-canvas-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 230px;
  margin: 0;
}

.mon-doughnut-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.mon-doughnut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  text-align: center;
}

.mon-doughnut-center-value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.mon-doughnut-center-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.mon-doughnut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.mon-leg-item {
  display: grid;
  grid-template-columns: 10px 1fr 56px 44px;
  align-items: center;
  gap: 12px;
  cursor: default;
  transition: opacity 0.18s ease;
}

.mon-leg-item.is-dimmed {
  opacity: 0.35;
}

.mon-leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mon-leg-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mon-leg-label {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mon-leg-value {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.mon-leg-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  width: 100%;
}

.mon-leg-bar-fill {
  height: 100%;
  border-radius: inherit;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mon-leg-pct {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 1100px) {
  .mon-doughnut-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: center;
  }
  .mon-doughnut-legend {
    width: 100%;
    max-width: 360px;
  }
}

@media (max-width: 540px) {
  .mon-leg-item {
    grid-template-columns: 10px 1fr 40px;
  }
  .mon-leg-bar {
    display: none;
  }
}

/* ——— Insights cards ——— */
.mon-insights-card {
  padding: 22px 24px 20px;
}

.mon-insights-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mon-insight-card {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 10px;
  transition: filter 0.18s ease;
  /* Pattern repris du tableau contacts : trait lumineux gauche + halo court */
  box-shadow: inset 1px 0 0 0 rgba(148, 163, 184, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(148, 163, 184, 0.32) 0%,
    rgba(148, 163, 184, 0.18) 2%,
    rgba(148, 163, 184, 0.08) 6%,
    rgba(148, 163, 184, 0.03) 12%,
    transparent 22%
  );
}

.mon-insight-card:hover {
  filter: brightness(1.08);
}

.mon-insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}

.mon-insight-icon svg {
  display: block;
}

.mon-insight-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mon-insight-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mon-insight-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.mon-insight-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

/* Variants : une seule couleur par case (trait + halo + icône + tag tous de la même teinte) */
.mon-insight-card--positive {
  box-shadow: inset 1px 0 0 0 rgba(52, 211, 153, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(52, 211, 153, 0.32) 0%,
    rgba(52, 211, 153, 0.18) 2%,
    rgba(52, 211, 153, 0.08) 6%,
    rgba(52, 211, 153, 0.03) 12%,
    transparent 22%
  );
}
.mon-insight-card--positive .mon-insight-icon,
.mon-insight-card--positive .mon-insight-tag {
  background: rgba(52, 211, 153, 0.16);
  color: var(--success);
}

.mon-insight-card--alert {
  box-shadow: inset 1px 0 0 0 rgba(251, 191, 36, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(251, 191, 36, 0.32) 0%,
    rgba(251, 191, 36, 0.18) 2%,
    rgba(251, 191, 36, 0.08) 6%,
    rgba(251, 191, 36, 0.03) 12%,
    transparent 22%
  );
}
.mon-insight-card--alert .mon-insight-icon,
.mon-insight-card--alert .mon-insight-tag {
  background: rgba(251, 191, 36, 0.16);
  color: var(--warning);
}

.mon-insight-card--negative {
  box-shadow: inset 1px 0 0 0 rgba(248, 113, 113, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(248, 113, 113, 0.32) 0%,
    rgba(248, 113, 113, 0.18) 2%,
    rgba(248, 113, 113, 0.08) 6%,
    rgba(248, 113, 113, 0.03) 12%,
    transparent 22%
  );
}
.mon-insight-card--negative .mon-insight-icon,
.mon-insight-card--negative .mon-insight-tag {
  background: rgba(248, 113, 113, 0.16);
  color: var(--danger);
}

.mon-insight-card--neutral {
  box-shadow: inset 1px 0 0 0 rgba(56, 189, 248, 0.95);
  background-image: linear-gradient(
    to right,
    rgba(56, 189, 248, 0.32) 0%,
    rgba(56, 189, 248, 0.18) 2%,
    rgba(56, 189, 248, 0.08) 6%,
    rgba(56, 189, 248, 0.03) 12%,
    transparent 22%
  );
}
.mon-insight-card--neutral .mon-insight-icon,
.mon-insight-card--neutral .mon-insight-tag {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent);
}

/* Light theme overrides — palette taupe chaude cohérente avec le mode sombre */
html[data-theme="light"] .mon-kpi-card .mon-kpi-icon {
  background: rgba(68, 64, 60, 0.1);
  color: var(--accent-strong);
}

html[data-theme="light"] .mon-kpi-trend {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .mon-leg-bar {
  background: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .mon-insight-card {
  border-color: rgba(15, 23, 42, 0.08);
}

/* =====================================================================
 * Sélecteur outil visio (Paramètres > carte "Outil de visioconférence")
 * ===================================================================== */
.visio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.visio-save-btn {
  margin-left: 0.25rem;
}

.visio-save-btn[hidden] {
  display: none;
}

.visio-radiogroup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.visio-radio-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.visio-radio-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.visio-radio-card input[type="radio"] {
  accent-color: var(--accent);
  margin: 0;
}

.visio-radio-card:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.visio-radio-card[aria-disabled="true"],
.visio-radio-card.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.visio-radio-card[aria-disabled="true"]:hover,
.visio-radio-card.is-disabled:hover {
  border-color: var(--border);
  background: var(--surface);
}

.visio-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.visio-label {
  font-weight: 600;
  font-size: 0.95rem;
}

/* =====================================================================
 * Tickets / Support
 * ===================================================================== */
.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ticket-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.ticket-card:hover {
  border-color: var(--accent);
  border-left-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.ticket-card-prio-bloquant { border-left-color: var(--danger); }
.ticket-card-prio-important { border-left-color: var(--warning); }
.ticket-card-prio-pas_urgent { border-left-color: rgba(148, 163, 184, 0.5); }

.ticket-card-main {
  flex: 1;
  min-width: 0;
}

.ticket-card-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ticket-card-meta-sep {
  color: rgba(148, 163, 184, 0.5);
  padding: 0 0.25rem;
}

.ticket-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.ticket-badge-status-open { background: rgba(56, 189, 248, 0.15); color: var(--accent); border-color: rgba(56, 189, 248, 0.4); }
.ticket-badge-status-in_progress { background: rgba(251, 191, 36, 0.15); color: var(--warning); border-color: rgba(251, 191, 36, 0.4); }
.ticket-badge-status-resolved { background: rgba(52, 211, 153, 0.15); color: var(--success); border-color: rgba(52, 211, 153, 0.4); }
.ticket-badge-status-closed { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); border-color: rgba(148, 163, 184, 0.4); }

.ticket-badge-priority-bloquant { background: rgba(248, 113, 113, 0.15); color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.ticket-badge-priority-important { background: rgba(251, 191, 36, 0.15); color: var(--warning); border-color: rgba(251, 191, 36, 0.4); }
.ticket-badge-priority-pas_urgent { background: rgba(148, 163, 184, 0.10); color: var(--text-muted); border-color: rgba(148, 163, 184, 0.30); }

.ticket-badge-category {
  background: rgba(148, 163, 184, 0.10);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.30);
}

.ticket-thread-msg {
  padding: 1rem 1.125rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  border-left: 4px solid var(--text-muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
}

.ticket-thread-msg-user {
  border-left-color: rgba(148, 163, 184, 0.7);
  background: var(--surface);
}

.ticket-thread-msg-admin {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0.06));
  border-color: rgba(56, 189, 248, 0.3);
  border-left-color: var(--accent);
  margin-left: 1rem;
}

.ticket-role-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.ticket-role-badge-admin {
  background: var(--accent);
  color: #0f1419;
}

.ticket-role-badge-user {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.ticket-thread-msg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ticket-thread-msg-author {
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ticket-thread-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.ticket-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ticket-attachment-thumb {
  position: relative;
  display: inline-block;
  max-width: 180px;
  max-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}

.ticket-attachment-thumb img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
}

.ticket-attachment-thumb-pending {
  border-style: dashed;
  border-color: var(--accent);
}

.ticket-attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 20, 25, 0.85);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
  z-index: 2;
}

.ticket-attachment-remove:hover {
  background: var(--danger);
}

/* ============================================================
   App loader — splash plein écran + barre de progression top.
   Affichés en bootstrap (avant app.js) et indépendants de la
   route active : mêmes éléments sur toutes les pages.
   ============================================================ */

.app-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.app-progress.is-active {
  opacity: 1;
}

.app-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--app-progress-value, 0));
  background: linear-gradient(90deg, var(--accent-strong, #0ea5e9), var(--accent, #38bdf8));
  box-shadow: 0 0 8px var(--accent, #38bdf8);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0f1419);
  opacity: 1;
  transition: opacity 0.36s ease;
}

.app-splash--hidden {
  opacity: 0;
  pointer-events: none;
}

.app-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.app-splash-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  opacity: 0.95;
  animation: app-splash-pulse 1.8s ease-in-out infinite;
}

.app-splash-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border, rgba(255, 255, 255, 0.12));
  border-top-color: var(--accent, #38bdf8);
  animation: app-splash-spin 0.85s linear infinite;
}

.app-splash-label {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
}

@keyframes app-splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes app-splash-pulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50%      { opacity: 0.72; transform: scale(0.96); }
}

@media (prefers-reduced-motion: reduce) {
  .app-splash-logo,
  .app-splash-spinner { animation: none; }
  .app-progress-bar { transition: none; }
  .app-splash { transition: none; }
}

/* =====================================================================
 * Paramètres — refonte UI (save bar, swatches couleurs, dropzone, callouts)
 * ===================================================================== */

/* Espacement vertical entre les cards de la page paramètres */
.card-spaced {
  margin-top: 1.25rem;
}

.card-title--lead {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.card-intro {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* Status de sauvegarde global (caché par défaut) */
.settings-save-status {
  margin: 0 0 1rem;
  display: none;
}

.settings-save-status.is-visible {
  display: block;
}

/* Form group ajustements */
.form-group--last { margin-bottom: 0; }
.form-group--tight { margin-bottom: 0.75rem; }
.form-group--full { grid-column: 1 / -1; }

/* Rangée d'actions (boutons + statut) */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.actions-row--spaced {
  margin-top: 1rem;
}

/* Statut d'intégration (LED néon + nom du service)
   Hauteur calée sur celle des .btn voisins (~40px) pour un alignement parfait. */
.integration-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 40px;
  padding: 0 1.1rem 0 0.9rem;
  box-sizing: border-box;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}

.integration-status-label {
  line-height: 1;
}

.integration-status-row {
  margin-bottom: 1rem;
}

/* LED néon */
.led-indicator {
  flex-shrink: 0;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.15);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.led-indicator--on {
  background: #34d399;
  box-shadow:
    0 0 0 2px rgba(52, 211, 153, 0.25),
    0 0 8px rgba(52, 211, 153, 0.7),
    0 0 16px rgba(52, 211, 153, 0.5),
    inset 0 0 3px rgba(255, 255, 255, 0.7);
  animation: led-pulse-green 2.4s ease-in-out infinite;
}

.led-indicator--off {
  background: #f87171;
  box-shadow:
    0 0 0 2px rgba(248, 113, 113, 0.25),
    0 0 8px rgba(248, 113, 113, 0.7),
    0 0 16px rgba(248, 113, 113, 0.45),
    inset 0 0 3px rgba(255, 255, 255, 0.55);
  animation: led-pulse-red 2.4s ease-in-out infinite;
}

@keyframes led-pulse-green {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(52, 211, 153, 0.25),
      0 0 8px rgba(52, 211, 153, 0.7),
      0 0 16px rgba(52, 211, 153, 0.5),
      inset 0 0 3px rgba(255, 255, 255, 0.7);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(52, 211, 153, 0.3),
      0 0 12px rgba(52, 211, 153, 0.85),
      0 0 22px rgba(52, 211, 153, 0.6),
      inset 0 0 3px rgba(255, 255, 255, 0.85);
  }
}

@keyframes led-pulse-red {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(248, 113, 113, 0.25),
      0 0 8px rgba(248, 113, 113, 0.7),
      0 0 16px rgba(248, 113, 113, 0.45),
      inset 0 0 3px rgba(255, 255, 255, 0.55);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(248, 113, 113, 0.3),
      0 0 12px rgba(248, 113, 113, 0.85),
      0 0 22px rgba(248, 113, 113, 0.55),
      inset 0 0 3px rgba(255, 255, 255, 0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .led-indicator--on,
  .led-indicator--off { animation: none; }
}

/* Corps des cards d'intégration : par défaut flex inline */
.integration-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Aligne la hauteur des boutons (même les .btn-sm) sur la pill .integration-status à 40px */
.integration-body .btn,
.integration-body .btn-sm {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

/* Les .meta vides entre la pill et le bouton ne doivent pas créer de gap supplémentaire */
.integration-body > .meta:empty { display: none; }

.integration-body[hidden] {
  display: none;
}

/* Variante en bloc (formulaire Zoom) */
.integration-body--block {
  display: block;
}

.integration-body--block[hidden] {
  display: none;
}

/* Couleurs Google Calendar — pastille à gauche du select */
.color-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.color-swatch {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.color-select .select {
  flex: 1;
  min-width: 0;
}

/* Titres R0…R4 — 5 colonnes alignées sur une seule ligne, badge à gauche de l'input */
.r-level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.r-level-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.r-level-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.r-level-field .input {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 900px) {
  .r-level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .r-level-grid { grid-template-columns: 1fr; }
}

.r-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.r-level-badge--won {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.r-level-hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.settings-updated-at {
  margin: 1rem 0 0;
  font-size: 0.78rem;
}

.settings-updated-at:empty {
  display: none;
}

/* Callouts (info / warning) */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 0 0 1.25rem;
}

.callout p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.callout-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-serif, Georgia, serif;
}

.callout--warning {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.35);
}

.callout--warning .callout-icon {
  background: var(--warning);
  color: #0f1419;
}

.callout--info {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.callout--info .callout-icon {
  background: var(--accent);
  color: #0f1419;
}

/* Toast : message éphémère affiché en haut à droite (remplace window.alert
   pour les erreurs d'édition de fiches). Apparaît, disparaît tout seul après
   5s. Cliquable pour le fermer plus tôt. */
.app-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 2rem));
  cursor: pointer;
  white-space: pre-line;
}
.app-toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.app-toast--error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
}
.app-toast--info {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}
.app-toast--success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.35);
}

/* GCal — étape de saisie du code */
.gcal-code-step {
  width: 100%;
  margin-top: 1rem;
}

/* Imports — bloc par fichier (numérotés) */
.import-block {
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.import-block:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.import-block-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.import-step {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

.import-block-title {
  flex: 1;
  min-width: 0;
}

.import-title {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.import-subtitle {
  margin: 0;
  font-size: 0.82rem;
}

.import-status {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
}

.import-status[hidden] {
  display: none;
}

/* Tableau de résolution des lignes problématiques (import contacts CSV) */
#settings-contacts-import-issues {
  margin-top: 0.75rem;
}

.import-issues-panel {
  margin-top: 0.75rem;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.import-issues-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.import-issues-table th,
.import-issues-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.import-issues-table th {
  position: sticky;
  top: 0;
  background: var(--surface-alt, #f8fafc);
  font-weight: 600;
  color: var(--text-muted, #475569);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.import-issues-table tbody tr:last-child td {
  border-bottom: none;
}

.import-issues-table td.import-issues-reason {
  color: var(--text-muted, #475569);
  font-size: 0.8rem;
  max-width: 280px;
}

.import-issues-table .import-issues-input {
  width: 100%;
  min-width: 140px;
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.import-issues-table .import-issues-input:disabled {
  background: var(--surface-alt, #f1f5f9);
  color: var(--text-muted, #94a3b8);
}

.import-issues-table .import-issues-action-cell {
  white-space: nowrap;
}

.import-issues-table .import-issues-feedback {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted, #475569);
}

.import-issues-table .import-issues-feedback.is-error {
  color: var(--danger, #b91c1c);
}

.import-issues-table .import-issues-feedback.is-success {
  color: var(--success, #047857);
}

/* Dropzone (drag & drop CSV) */
.dropzone {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.dropzone-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
}

.dropzone-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dropzone-text strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.dropzone-text .meta {
  font-size: 0.8rem;
  line-height: 1.4;
}

.dropzone-btn {
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

/* Save bar sticky (dirty state) — style callout warning ambré subtil */
.settings-savebar {
  position: sticky;
  bottom: 1rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.40);
  border-radius: var(--radius);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(251, 191, 36, 0.15);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  z-index: 30;
  animation: settings-savebar-rise 0.24s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.settings-savebar[hidden] {
  display: none;
}

.settings-savebar-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.settings-savebar-dot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--warning);
  color: #0f1419;
  animation: settings-savebar-pulse 1.8s ease-in-out infinite;
}
.settings-savebar-dot::before {
  content: "!";
  font-family: ui-serif, Georgia, serif;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
}

.settings-savebar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes settings-savebar-rise {
  0%   { opacity: 0; transform: translateY(16px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes settings-savebar-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}

@media (max-width: 640px) {
  .settings-savebar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .settings-savebar-actions {
    justify-content: center;
  }
  .dropzone {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .dropzone-btn {
    align-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-savebar { animation: none; }
  .settings-savebar-dot { animation: none; }
}

/* Light theme adjustments */
html[data-theme="light"] .callout {
  background: var(--surface);
}

html[data-theme="light"] .callout--warning {
  background: rgba(251, 191, 36, 0.12);
}

html[data-theme="light"] .callout--info {
  background: rgba(56, 189, 248, 0.1);
}

html[data-theme="light"] .dropzone {
  background: var(--surface);
}

html[data-theme="light"] .settings-savebar {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.10),
    0 0 0 1px rgba(217, 119, 6, 0.15);
}
