/* ==========================================================================
   Avenix Business Suite — Composants
   ========================================================================== */

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #fff;
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: var(--shadow-blue), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 14px 28px -12px rgba(37, 99, 235, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-secondary {
  color: var(--text-soft);
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

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

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn-soft {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: transparent;
}

.btn-soft:hover {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}

.btn-danger {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 10px 20px -10px rgba(220, 38, 38, 0.6);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger-soft {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: transparent;
}

.btn-success {
  color: #fff;
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 10px 20px -10px rgba(22, 163, 74, 0.5);
}

.btn-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  height: 46px;
  padding: 0 20px;
  font-size: 13.5px;
  border-radius: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn[disabled],
.btn.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

.btn.is-loading svg {
  animation: spin 0.8s linear infinite;
}

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header.no-border {
  border-bottom: 0;
  padding-bottom: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.card-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.card-body {
  padding: 20px;
}

.card-body.tight {
  padding: 14px;
}

.card-body.flush {
  padding: 0;
}

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card-hover {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  transition: gap var(--transition);
}

.card-link:hover {
  gap: 7px;
}

.card-link svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   Cartes statistiques
   -------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 17px 17px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.stat-card::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  right: -45px;
  top: -45px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: 0.55;
  pointer-events: none;
}

.stat-card.accent-green::after { background: var(--success-soft); }
.stat-card.accent-orange::after { background: var(--warning-soft); }
.stat-card.accent-red::after { background: var(--danger-soft); }
.stat-card.accent-violet::after { background: rgba(124, 58, 237, 0.1); }

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-card.accent-green .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card.accent-orange .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-card.accent-red .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat-card.accent-violet .stat-icon { background: rgba(124, 58, 237, 0.11); color: #7c3aed; }

.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.stat-value {
  margin-top: 4px;
  font-size: clamp(22px, 1.8vw, 27px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.15;
  color: var(--text);
}

.stat-value .unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
}

.stat-note {
  color: var(--muted);
  font-size: 10.5px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.trend svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}

.trend.down {
  background: var(--danger-soft);
  color: var(--danger);
}

.trend.neutral {
  background: var(--surface-3);
  color: var(--muted);
}

.stat-spark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 74px;
  height: 28px;
  opacity: 0.9;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Badges & statuts
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.55;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.75;
}

.badge.no-dot::before {
  display: none;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-violet { background: rgba(124, 58, 237, 0.11); color: #7c3aed; }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-neutral { background: var(--surface-3); color: var(--muted); }
.badge-dark { background: var(--navy); color: #dbeafe; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 550;
}

.chip svg {
  width: 12px;
  height: 12px;
}

.chip.blue { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.chip.green { background: var(--success-soft); border-color: transparent; color: var(--success); }
.chip.orange { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.chip.red { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */
.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 9px;
}

.avatar-lg {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  font-size: 13px;
}

.avatar-xl {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  font-size: 18px;
}

.avatar-ring {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border);
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -8px;
  border: 2px solid var(--surface);
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.avatar-status {
  position: relative;
}

.avatar-status::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--success);
  border: 2px solid var(--surface);
}

.avatar-status.away::after { background: var(--warning); }
.avatar-status.offline::after { background: var(--muted-2); }

/* --------------------------------------------------------------------------
   Tableaux
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  min-width: 760px;
  font-size: 12.5px;
}

.data-table th {
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.data-table th.sortable:hover {
  color: var(--text);
}

.data-table th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
  vertical-align: -1px;
}

.data-table th.sorted .sort-icon {
  opacity: 1;
  color: var(--primary);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-soft);
}

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

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

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

.data-table tbody tr.clickable-row {
  cursor: pointer;
}

.data-table tbody tr.clickable-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.data-table .cell-strong {
  color: var(--text);
  font-weight: 600;
}

.data-table .cell-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.data-table .cell-right {
  text-align: right;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.table-user-text {
  min-width: 0;
}

.table-user-name {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.table-user-sub {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.row-action {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}

.row-action:hover {
  background: var(--surface-3);
  color: var(--text);
}

.row-action.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.row-action svg {
  width: 15px;
  height: 15px;
}

.table-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.product-thumb {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background:
    var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.product-thumb svg {
  width: 18px;
  height: 18px;
}

.table-progress {
  width: 80px;
  height: 5px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.table-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

/* --------------------------------------------------------------------------
   Barre d'outils de tableau
   -------------------------------------------------------------------------- */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.search-field {
  position: relative;
  flex: 1 1 210px;
  max-width: 300px;
}

.search-field > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field input::placeholder {
  color: var(--muted-2);
}

.search-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.filter-select {
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 550;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.toolbar-spacer {
  flex: 1;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.segmented button svg {
  width: 13px;
  height: 13px;
}

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

.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field > label {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.form-field > label .required {
  color: var(--danger);
}

.form-hint {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

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

.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

.textarea {
  height: auto;
  min-height: 98px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.55;
}

.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-group .prefix {
  padding-left: 11px;
  color: var(--muted);
  font-size: 12px;
}

.input-group input {
  flex: 1;
  height: 38px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12.5px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.form-check input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.form-check-text {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.form-check-text small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: var(--border-strong);
  transition: background var(--transition);
}

.switch-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform var(--transition);
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-row-title {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.switch-row-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Onglets
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tab {
  position: relative;
  padding: 10px 14px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.22s ease both;
}

.pill-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.pill-tabs button {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.pill-tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* --------------------------------------------------------------------------
   Progression
   -------------------------------------------------------------------------- */
.progress {
  height: 7px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.8s var(--ease);
}

.progress-bar.green { background: #16a34a; }
.progress-bar.orange { background: #f59e0b; }
.progress-bar.red { background: #dc2626; }
.progress-bar.violet { background: #7c3aed; }

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-row .progress {
  flex: 1;
}

.progress-row .progress-value {
  width: 34px;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 650;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Listes, timelines, mini-statistiques
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 17px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-icon {
  position: relative;
  z-index: 1;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
}

.timeline-icon svg {
  width: 15px;
  height: 15px;
}

.timeline-icon.green { background: var(--success-soft); color: var(--success); }
.timeline-icon.orange { background: var(--warning-soft); color: var(--warning); }
.timeline-icon.red { background: var(--danger-soft); color: var(--danger); }
.timeline-icon.teal { background: rgba(13, 148, 136, 0.11); color: var(--teal); }
.timeline-icon.violet { background: rgba(124, 58, 237, 0.11); color: var(--violet); }

.timeline-body {
  min-width: 0;
  flex: 1;
  padding-top: 1px;
}

.timeline-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.timeline-text {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.timeline-date {
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.list-clean {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row-main {
  min-width: 0;
  flex: 1;
}

.list-row-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row-sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.list-row-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.mini-stat {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.mini-stat-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mini-stat-value {
  margin-top: 4px;
  color: var(--text);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.mini-stat-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition);
}

.alert-item:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.alert-item + .alert-item {
  margin-top: 8px;
}

.alert-item-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-item.warning .alert-item-icon { background: var(--warning-soft); color: var(--warning); }
.alert-item.info .alert-item-icon { background: var(--info-soft); color: var(--info); }
.alert-item.success .alert-item-icon { background: var(--success-soft); color: var(--success); }

.alert-item-icon svg {
  width: 16px;
  height: 16px;
}

.alert-item-body {
  min-width: 0;
  flex: 1;
}

.alert-item-title {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.alert-item-text {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Graphiques
   -------------------------------------------------------------------------- */
.chart-card .card-body {
  padding: 16px 18px 18px;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

.chart-container.sm { height: 220px; }
.chart-container.md { height: 260px; }
.chart-container.lg { height: 340px; }

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--primary);
}

.legend-dot.green { background: var(--success); }
.legend-dot.orange { background: var(--warning); }
.legend-dot.red { background: var(--danger); }
.legend-dot.violet { background: var(--violet); }
.legend-dot.gray { background: var(--muted-2); }

.chart-tooltip-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.chart-tooltip-note svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   Modales et panneaux latéraux
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 10, 20, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.18s ease both;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.24s var(--ease) both;
}

.modal.modal-lg {
  width: min(760px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}

.modal-header-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-header-icon.warning { background: var(--warning-soft); color: var(--warning); }
.modal-header-icon.success { background: var(--success-soft); color: var(--success); }

.modal-header-icon svg {
  width: 19px;
  height: 19px;
}

.modal-header-text {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.modal-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 15px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 20px 20px;
  flex-wrap: wrap;
}

.modal-footer .left {
  margin-right: auto;
}

/* Panneau latéral */
.side-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: flex-end;
  background: rgba(5, 10, 20, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease both;
}

.side-panel {
  width: min(500px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
  animation: slideInRight 0.3s var(--ease) both;
}

.side-panel.wide {
  width: min(620px, 100%);
}

.side-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.side-panel-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Notifications toast
   -------------------------------------------------------------------------- */
.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease) both;
}

.toast.leaving {
  animation: toastOut 0.22s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

.toast-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.toast.success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast.warning .toast-icon { background: var(--warning-soft); color: var(--warning); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }

.toast-icon svg {
  width: 15px;
  height: 15px;
}

.toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.toast-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.toast-message {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.toast-close {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.toast-close svg {
  width: 13px;
  height: 13px;
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary);
  animation: toastProgress 4s linear forwards;
}

.toast.success .toast-progress { background: var(--success); }
.toast.warning .toast-progress { background: var(--warning); }
.toast.error .toast-progress { background: var(--danger); }

/* --------------------------------------------------------------------------
   Menus déroulants
   -------------------------------------------------------------------------- */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 150;
  display: none;
  min-width: 220px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.16s var(--ease) both;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-menu.align-left {
  left: 0;
  right: auto;
}

.dropdown-label {
  padding: 7px 10px 5px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dropdown-item svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex-shrink: 0;
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger svg {
  color: var(--danger);
}

.dropdown-sep {
  height: 1px;
  margin: 5px 6px;
  background: var(--border);
}

/* --------------------------------------------------------------------------
   Palette de recherche globale
   -------------------------------------------------------------------------- */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 20px 20px;
  background: rgba(5, 10, 20, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.16s ease both;
}

.cmd-panel {
  width: min(640px, 100%);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s var(--ease) both;
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cmd-input-wrap > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  height: 28px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.cmd-input::placeholder {
  color: var(--muted-2);
}

.cmd-esc {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.cmd-results {
  max-height: min(58vh, 460px);
  overflow-y: auto;
  padding: 8px;
}

.cmd-group-label {
  padding: 8px 10px 4px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background var(--transition);
}

.cmd-item:hover,
.cmd-item.active {
  background: var(--surface-2);
}

.cmd-item-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--muted);
}

.cmd-item-icon svg {
  width: 15px;
  height: 15px;
}

.cmd-item-text {
  min-width: 0;
  flex: 1;
}

.cmd-item-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-item-sub {
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-item-type {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cmd-empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.cmd-empty svg {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  color: var(--muted-2);
}

.cmd-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9.5px;
}

.cmd-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   Assistant IA
   -------------------------------------------------------------------------- */
.assistant-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 180;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 16px 34px -12px rgba(37, 99, 235, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform var(--transition), box-shadow var(--transition);
}

.assistant-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 20px 40px -12px rgba(37, 99, 235, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.assistant-fab svg {
  width: 23px;
  height: 23px;
}

.assistant-fab::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #4ade80;
  border: 2px solid #2563eb;
}

.assistant-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 190;
  width: min(410px, calc(100vw - 32px));
  height: min(660px, calc(100vh - 44px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s var(--ease) both;
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  background:
    #1e3a8a;
  color: #fff;
  flex-shrink: 0;
}

.assistant-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #a78bfa;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.assistant-avatar svg {
  width: 18px;
  height: 18px;
}

.assistant-avatar::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #4ade80;
  border: 2px solid #1e3a8a;
}

.assistant-header-text {
  flex: 1;
  min-width: 0;
}

.assistant-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.assistant-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  color: #a5b4cf;
  font-size: 10px;
}

.assistant-status i {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: #4ade80;
}

.assistant-header-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  transition: background var(--transition);
}

.assistant-header-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.assistant-header-btn svg {
  width: 15px;
  height: 15px;
}

.assistant-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background:
    var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-day {
  align-self: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.assistant-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.55;
  animation: fadeUp 0.28s var(--ease) both;
}

.assistant-msg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
}

.assistant-msg.user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.6);
}

.assistant-msg strong {
  color: var(--text);
  font-weight: 650;
}

.assistant-msg.user strong {
  color: #fff;
}

.assistant-msg ul {
  margin: 6px 0 0;
  padding-left: 15px;
  list-style: disc;
}

.assistant-msg li {
  margin-bottom: 3px;
}

.assistant-msg .ai-kpi {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0;
}

.assistant-msg .ai-kpi strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.assistant-msg .ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 650;
}

.assistant-suggestions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.suggestion-chip {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 9.5px;
  font-weight: 550;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.suggestion-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.assistant-input {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.assistant-input textarea {
  flex: 1;
  min-height: 36px;
  max-height: 90px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.45;
  resize: none;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.assistant-input textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}

.assistant-send {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.6);
  transition: transform var(--transition);
}

.assistant-send:hover {
  transform: translateY(-1px);
}

.assistant-send svg {
  width: 16px;
  height: 16px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 0;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: var(--muted);
  animation: typingBounce 1.1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Kanban
   -------------------------------------------------------------------------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 13px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.kanban.cols-5 {
  grid-template-columns: repeat(5, minmax(240px, 1fr));
}

.kanban-col {
  min-height: 220px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition);
}

.kanban-col.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.kanban-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 4px 10px;
}

.kanban-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.kanban-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--muted-2);
}

.kanban-dot.blue { background: var(--primary); }
.kanban-dot.orange { background: var(--warning); }
.kanban-dot.violet { background: var(--violet); }
.kanban-dot.green { background: var(--success); }
.kanban-dot.red { background: var(--danger); }

.kanban-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.kanban-add {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}

.kanban-add:hover {
  background: var(--surface);
  color: var(--text);
}

.kanban-add svg {
  width: 14px;
  height: 14px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 54px;
}

.kanban-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: grab;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.kanban-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.kanban-card-title {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.4;
}

.kanban-card-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.kanban-card-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.kanban-card-date svg {
  width: 11px;
  height: 11px;
}

.priority {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.priority::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: currentColor;
}

.priority.critique { background: var(--danger-soft); color: var(--danger); }
.priority.haute { background: var(--warning-soft); color: var(--warning); }
.priority.moyenne { background: var(--info-soft); color: var(--info); }
.priority.basse { background: var(--surface-3); color: var(--muted); }

/* --------------------------------------------------------------------------
   État vide, pagination
   -------------------------------------------------------------------------- */
.empty-state {
  padding: 44px 20px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--muted);
}

.empty-icon svg {
  width: 22px;
  height: 22px;
}

.empty-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.empty-text {
  max-width: 320px;
  margin: 4px auto 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--muted);
  font-size: 10.5px;
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 3px;
}

.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
}

.page-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.45;
}

/* --------------------------------------------------------------------------
   Divers
   -------------------------------------------------------------------------- */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.notification-item:hover {
  background: var(--surface-2);
}

.notification-item.unread {
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
}

.notification-item.unread:hover {
  background: var(--primary-soft);
}

.notification-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.notification-icon.green { background: var(--success-soft); color: var(--success); }
.notification-icon.orange { background: var(--warning-soft); color: var(--warning); }
.notification-icon.red { background: var(--danger-soft); color: var(--danger); }
.notification-icon.violet { background: rgba(124, 58, 237, 0.11); color: var(--violet); }

.notification-icon svg {
  width: 17px;
  height: 17px;
}

.notification-body {
  min-width: 0;
  flex: 1;
}

.notification-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.notification-title .unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--primary);
  flex-shrink: 0;
}

.notification-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.detail-list {
  display: grid;
  gap: 0;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 11px;
}

.detail-value {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 18px;
}

.profile-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.profile-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.info-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 1px;
}

.info-banner.warning {
  border-color: color-mix(in srgb, var(--warning) 25%, var(--border));
  background: var(--warning-soft);
}

.info-banner.warning svg {
  color: var(--warning);
}

.info-banner.danger {
  border-color: color-mix(in srgb, var(--danger) 25%, var(--border));
  background: var(--danger-soft);
}

.info-banner.danger svg {
  color: var(--danger);
}

.code-block {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  overflow-x: auto;
}

.skeleton {
  background: var(--surface-2);
  background-size: 400px 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: 6px;
}