/* ============================================================
   GESTIVA · Module Production & Fabrication — production.css
   Design System Gestiva (global.css & macros.html)
   ============================================================ */

/* ── Bouton Actualiser dans la barre de filtre ── */
.ui-filter-refresh {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: var(--surface, #ffffff);
  color: var(--txt-muted, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ui-filter-refresh:hover {
  background: var(--surface-alt, #f8fafc);
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.ui-filter-refresh:active {
  transform: scale(0.95);
}

.ui-filter-refresh:hover i {
  transition: transform 0.3s ease;
  transform: rotate(90deg);
}

/* Ligne de composant dynamique dans la modale BOM */
.bom-component-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 40px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border-light, #f1f5f9);
  border-radius: var(--radius-sm, 6px);
  margin-bottom: 8px;
}

.bom-component-row select,
.bom-component-row input {
  height: 34px;
}

/* Cycle d'atelier / Carte explicative */
.prod-workflow-box {
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 8px);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prod-workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.prod-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.prod-step-content strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--txt, #0f172a);
  margin-bottom: 2px;
}

.prod-step-content div {
  font-size: 12.5px;
  color: var(--txt-muted, #64748b);
  line-height: 1.4;
}

/* Tableau de bord statuts */
.prod-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 10px;
  text-align: center;
  padding: 12px 0;
}

.prod-stat-pill {
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  padding: 12px 8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.prod-stat-num {
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 800;
  color: var(--txt, #0f172a);
  line-height: 1.15;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.prod-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--txt-muted, #64748b);
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* ── Grilles analytiques du Dashboard Production ── */
.prod-analytics-grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
}

.prod-analytics-grid-equal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

@media (max-width: 1150px) {
  .prod-analytics-grid-2col,
  .prod-analytics-grid-equal {
    grid-template-columns: 1fr;
  }
}

/* ── Barres comparatives Produit / BOM ── */
.prod-bar-group {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.prod-bar-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.prod-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.prod-dual-bar-row {
  display: grid;
  grid-template-columns: minmax(95px, auto) 1fr minmax(75px, auto);
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.prod-bar-pill-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.prod-bar-track {
  width: 100%;
  height: 9px;
  background: var(--surface-alt, #f1f5f9);
  border-radius: 999px;
  overflow: hidden;
}

.prod-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.prod-bar-blue {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.prod-bar-green {
  background: linear-gradient(90deg, #10b981, #059669);
}

/* ── Graphique en Disque (SVG Donut) ── */
.prod-donut-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prod-donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  font-size: 13px;
}

.prod-donut-legend-item:last-child {
  border-bottom: none;
}

.prod-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Postes de travail & Qualité ── */
.prod-ws-item {
  padding: 12px 14px;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-alt, #f8fafc);
  margin-bottom: 10px;
  min-width: 0;
  overflow-wrap: break-word;
}

.prod-ws-item:last-child {
  margin-bottom: 0;
}

.prod-qc-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.prod-qc-stat-box {
  padding: 12px 10px;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--border-light, #e2e8f0);
  text-align: center;
  overflow-wrap: anywhere;
}
