/* ═══════════════════════════════════════════════════════════
   COMPOSANTS — Design "Antigravity"
   Cartes en verre, boutons lumineux, micro-animations.
   ═══════════════════════════════════════════════════════════ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Chiffres alignés partout où on affiche des montants */
.stat-value, .kpi-value, .table td { font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════
   Cartes
   ═══════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.card-chantier {
  display: flex;
  align-items: center;
  gap: var(--gap);
  cursor: pointer;
}
.card-chantier:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.card-chantier:active { transform: scale(0.99); }

.status-bar {
  width: 4px;
  height: 44px;
  border-radius: 2px;
  flex-shrink: 0;
}
.status-bar.bleu { background: var(--accent); box-shadow: 0 0 8px var(--accent-light); }
.status-bar.vert { background: var(--success); }
.status-bar.orange { background: var(--warning); }
.status-bar.gris { background: var(--border-strong); }
.status-bar.rouge { background: var(--error); }

/* ═══════════════════════════════════════
   Boutons
   ═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-btn);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
}
.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--glow-accent);
}
.btn-primary:hover { filter: brightness(1.12); box-shadow: var(--glow-accent-lg); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.98); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-danger { background: var(--error); color: #fff; box-shadow: 0 4px 16px var(--error-light); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-full { width: 100%; }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--navbar-h) + 30px);
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 28px;
  border: none;
  box-shadow: var(--glow-accent-lg);
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.2s;
}
.fab:hover { transform: translateX(-50%) scale(1.06); }
.fab:active { transform: translateX(-50%) scale(0.94); }

/* ═══════════════════════════════════════
   Badges
   ═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.2px;
}
.badge-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success-light); }
.badge-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning-light); }
.badge-error { background: var(--error-light); color: var(--error); border: 1px solid var(--error-light); }
.badge-info { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-light); }

/* ═══════════════════════════════════════
   Inputs
   ═══════════════════════════════════════ */
.input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: var(--fs-base);
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-light), var(--glow-accent);
}
.input::placeholder { color: var(--text-secondary); opacity: 0.7; }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}

/* Toggle */
.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  appearance: none;
  background: var(--border-strong);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.toggle:checked { background: var(--accent-gradient); box-shadow: var(--glow-accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.toggle:checked::after { transform: translateX(20px); }

/* ═══════════════════════════════════════
   Toast
   ═══════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: calc(var(--navbar-h) + 88px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  animation: toast-in 0.35s var(--ease-spring);
  max-width: calc(100vw - 32px);
  text-align: center;
  line-height: 1.4;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

/* ═══════════════════════════════════════
   Modal
   ═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
.modal-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin-bottom: 14px;
}
/* Sur mobile : bottom-sheet plein écran, formulaires longs scrollables */
@media (max-width: 767px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100% !important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0));
    max-height: 92dvh;
  }
}

/* ═══════════════════════════════════════
   KPI cards
   ═══════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-lg) var(--pad);
  text-align: center;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.kpi-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.kpi-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: var(--fw-medium);
}

/* ═══════════════════════════════════════
   Chips filtre
   ═══════════════════════════════════════ */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  font-family: var(--font);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-accent);
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: var(--radius-btn);
}
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}
.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  filter: grayscale(0.25);
  animation: empty-float 3.5s ease-in-out infinite;
}
@keyframes empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty-state-text { font-size: var(--fs-lg); margin-bottom: 20px; line-height: 1.5; }

/* ═══════════════════════════════════════
   UI — Système de modals / formulaires
   ═══════════════════════════════════════ */
.ui-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.ui-overlay-in { opacity: 1; }
.ui-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s var(--ease-spring);
}
.ui-overlay-in .ui-modal { transform: translateY(0) scale(1); }
.ui-modal-sm { max-width: 400px; }
.ui-modal-md { max-width: 500px; }
.ui-modal-lg { max-width: 700px; }
.ui-modal-xl { max-width: 920px; }
.ui-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  flex-shrink: 0;
}
.ui-modal-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.2px;
}
.ui-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ui-modal-close:hover { background: var(--error-light); border-color: var(--error); color: var(--error); transform: rotate(90deg); }
.ui-modal-body {
  padding: 0 20px 6px;
  overflow-y: auto;
  flex: 1;
}
.ui-modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  flex-shrink: 0;
}

/* Bottom sheet mobile */
@media (max-width: 767px) {
  .ui-overlay { align-items: flex-end; padding: 0; }
  .ui-modal {
    max-width: 100% !important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 92vh;
    transform: translateY(100%);
  }
  .ui-overlay-in .ui-modal { transform: translateY(0); }
  .ui-modal-actions { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0)); }
  /* Poignée de bottom-sheet */
  .ui-modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
    margin: 10px auto 0;
    flex-shrink: 0;
  }
}

/* ═══════════════════════════════════════
   Tabs (onglets soulignés)
   ═══════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--pad-lg);
  overflow-x: auto;
  /* Défilement possible mais sans barre visible */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 20px;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: var(--fw-semibold);
}
.tab-count {
  background: var(--accent-light);
  color: var(--accent);
  font-size: var(--fs-xs);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: var(--fw-semibold);
}
.tab.active .tab-count {
  background: var(--accent-gradient);
  color: #fff;
}

/* ═══════════════════════════════════════
   Section headers
   ═══════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--pad);
}
.section-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}
.section-link {
  font-size: var(--fs-sm);
  color: var(--accent);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  font-weight: var(--fw-medium);
  transition: opacity 0.15s, transform 0.15s;
}
.section-link:hover { opacity: 0.85; transform: translateX(2px); }

/* ═══════════════════════════════════════
   Welcome card (héro du dashboard)
   ═══════════════════════════════════════ */
.welcome-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-lg);
  margin-bottom: var(--pad-lg);
}
/* Halo dégradé discret dans le coin du héro */
.welcome-card::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -70px;
  width: 240px;
  height: 240px;
  background: var(--accent-gradient);
  opacity: 0.14;
  filter: blur(52px);
  border-radius: 50%;
  pointer-events: none;
}
.welcome-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.6px;
  margin-bottom: 4px;
  position: relative;
}
.welcome-sub {
  color: var(--text-secondary);
  font-size: var(--fs-base);
  position: relative;
}
.welcome-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-light);
  border: 1px solid var(--accent-light);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  position: relative;
  text-transform: capitalize;
}

/* ═══════════════════════════════════════
   Stat cards (KPI avec barre latérale)
   ═══════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--pad-lg);
  min-width: 0;
}
.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad) var(--pad-lg);
  border-left: 4px solid var(--accent);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
  min-width: 0;
}
/* Voile teinté qui suit la couleur de la barre latérale */
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--accent-light), transparent 55%);
  opacity: 0.85;
  pointer-events: none;
}
.stat-card.green::before { background: linear-gradient(120deg, var(--success-light), transparent 55%); }
.stat-card.red::before { background: linear-gradient(120deg, var(--error-light), transparent 55%); }
.stat-card.orange::before { background: linear-gradient(120deg, var(--warning-light), transparent 55%); }
.stat-card.purple::before { background: linear-gradient(120deg, rgba(139, 92, 246, 0.1), transparent 55%); }
.stat-card > * { position: relative; }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card.green { border-left-color: var(--success); }
.stat-card.red { border-left-color: var(--error); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.purple { border-left-color: var(--accent-2); }
.stat-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.stat-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
.stat-value.green { color: var(--success); }
.stat-value.red { color: var(--error); }
.stat-value.orange { color: var(--warning); }
.stat-value.purple { color: var(--accent-2); }
.stat-detail {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .stat-card { padding: var(--pad) var(--pad); }
  .stat-value { font-size: var(--fs-xl); }
}

/* ═══════════════════════════════════════
   Icône carrée dégradée (listes, en-têtes)
   ═══════════════════════════════════════ */
.icon-tile {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-icon);
  background: var(--accent-light);
  border: 1px solid var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   Tables
   ═══════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  border-bottom: 2px solid var(--border);
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--accent-light); }
.table-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: var(--fw-medium);
  border: none;
  background: none;
  font-family: var(--font);
  font-size: var(--fs-sm);
}
.table-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════
   Chantier header
   ═══════════════════════════════════════ */
.chantier-header {
  display: flex;
  align-items: center;
  gap: var(--pad);
  margin-bottom: var(--pad);
  flex-wrap: wrap;
}
.chantier-header-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-btn);
  background: var(--accent-light);
  border: 1px solid var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.chantier-header-info { flex: 1; min-width: 0; }
.chantier-header-name {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chantier-header-meta {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chantier-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Range slider */
input[type=range] { accent-color: var(--accent); height: 24px; }

/* ═══════════════════════════════════════
   Scrollbar custom
   ═══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ═══════════════════════════════════════
   Selection
   ═══════════════════════════════════════ */
::selection { background: var(--accent-light); color: var(--accent); }

/* ═══════════════════════════════════════
   Mobile — confort tactile & lisibilité
   ═══════════════════════════════════════ */
@media (max-width: 767px) {
  /* Champs à 16px : en dessous, Safari iOS et Samsung Internet zooment au focus */
  .input, select.input, textarea.input { font-size: 16px; }

  /* Chips filtres : défilement fluide au doigt, sans barre de scroll visible */
  .chips {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
    padding-left: var(--pad);
    padding-right: var(--pad);
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { padding: 7px 14px; }

  /* Boutons et onglets plus compacts, cible tactile ≥ 40px conservée */
  .btn { padding: 10px 16px; min-height: 40px; }
  .tab { padding: 10px 14px; }

  /* En-têtes de section : titre + bouton passent à la ligne au lieu de s'écraser */
  .section-header { flex-wrap: wrap; gap: 8px; }

  /* Tableaux resserrés */
  .table th { padding: 8px 8px; }
  .table td { padding: 10px 8px; }

  /* Panneau notifications : jamais plus large que l'écran */
  #notificationsPanel { max-width: calc(100vw - 24px) !important; }

  /* Empty states moins hauts */
  .empty-state { padding: 36px 16px; }
  .empty-state-icon { font-size: 44px; margin-bottom: 12px; }
}

/* Écrans tactiles : pas d'effets hover fantômes qui « collent » après un tap */
@media (hover: none) {
  .card-chantier:hover, .stat-card:hover, .kpi:hover, .btn-primary:hover { transform: none; }
  .btn:active { transform: scale(0.97); }
  .chip:active { border-color: var(--accent); color: var(--accent); }
}

/* Confort : moins d'animations si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@keyframes ui-hourglass {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

@media (max-width: 760px) {
  .mkv2-output-row {
    grid-template-columns: 1fr !important;
  }
  .mkv2-output-row .topbar-btn {
    justify-self: end;
  }
}

.mkv2-tabs { display:flex; gap:6px; overflow-x:auto; padding:2px 0 8px; border-bottom:1px solid var(--border); }
.mkv2-tab { min-width:125px; padding:8px 11px; border:1px solid var(--border); border-radius:9px 9px 0 0; background:var(--bg); color:var(--text); cursor:pointer; text-align:left; }
.mkv2-tab small { display:block; color:var(--text-secondary); margin-top:2px; font-size:10px; }
.mkv2-tab.active { border-color:var(--accent); background:var(--accent-light); color:var(--accent); }
.mkv2-tab-add { min-width:auto; border-style:dashed; }
.mkv2-tab-actions { display:flex; gap:6px; justify-content:flex-end; margin:8px 0 12px; }
.mkv2-variant-head { display:grid; grid-template-columns:2fr 1fr; gap:10px; }
.mkv2-default-line { display:flex; gap:7px; align-items:center; padding:8px 10px; border-radius:8px; background:var(--bg); margin:2px 0 10px; font-size:var(--fs-sm); }
.mkv2-advanced { border:1px solid var(--border); border-radius:8px; padding:9px 11px; margin-bottom:12px; }
.mkv2-advanced summary { cursor:pointer; font-weight:600; font-size:var(--fs-sm); }
.mkv2-composition-title { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:12px 0 7px; }
.mkv2-output-labels { display:grid; grid-template-columns:minmax(190px,2fr) minmax(170px,1.6fr) 86px 125px 34px; gap:7px; padding:0 9px 4px; font-size:10px; color:var(--text-secondary); text-transform:uppercase; }
@media (max-width:760px) {
  .mkv2-variant-head { grid-template-columns:1fr; }
  .mkv2-output-labels { display:none; }
  .mkv2-composition-title { align-items:flex-start; flex-direction:column; }
}
