/* ====== Chantier tortues — Version premium ====== */
.turtle-scene-card {
  margin-top: 16px; padding: 0 !important;
  overflow: hidden;
  background: transparent !important;
  box-shadow: none !important;
}
.turtle-scene-card h3 {
  padding: 14px 18px 0 18px !important;
}
.turtle-scene {
  position: relative; width: 100%; height: 340px;
  border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #1a237e 0%, #283593 25%, #3f51b5 40%, #7986cb 55%, #a5d6a7 55%, #66bb6a 75%, #43a047 100%);
}
#turtleCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.ts-overlay {
  position: relative; z-index: 2;
  height: 100%; display: flex; flex-direction: column;
}

/* ===== Étapes pipeline en haut ===== */
.ts-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 14px 20px 10px 20px;
}
.ts-step {
  display: flex; flex-direction: column; align-items: center;
  position: relative; min-width: 60px;
}
.ts-step-icon {
  font-size: 22px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  opacity: 0.5;
  transition: all 0.3s;
}
.ts-step-active .ts-step-icon { opacity: 1; }
.ts-step-current .ts-step-icon {
  opacity: 1; font-size: 28px;
  animation: tsCurrentBounce 1.2s ease-in-out infinite;
}
@keyframes tsCurrentBounce {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}
.ts-step-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: 2px solid rgba(255,255,255,0.5);
  margin: 4px 0;
  transition: all 0.3s;
}
.ts-step-active .ts-step-dot {
  background: #00e676;
  border-color: #00e676;
  box-shadow: 0 0 10px #00e676;
}
.ts-step-current .ts-step-dot {
  background: #ffab00;
  border-color: #ffab00;
  box-shadow: 0 0 14px #ffab00;
  animation: tsDotPulse 1.5s ease-in-out infinite;
}
@keyframes tsDotPulse {
  0%,100% { box-shadow: 0 0 8px #ffab00; transform: scale(1); }
  50%     { box-shadow: 0 0 20px #ffab00; transform: scale(1.3); }
}
.ts-step-name {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: rgba(255,255,255,0.5);
  font-family: 'Orbitron', sans-serif;
}
.ts-step-active .ts-step-name { color: rgba(255,255,255,0.9); }
.ts-step-current .ts-step-name { color: #ffab00; }

.ts-step-line {
  width: 50px; height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px; margin: 0 2px;
  margin-top: -18px;
}
.ts-line-done { background: #00e676; box-shadow: 0 0 6px rgba(0,230,118,0.4); }
.ts-line-progress {
  background: linear-gradient(90deg, #00e676 0%, #ffab00 50%, rgba(255,255,255,0.15) 100%);
  background-size: 200% 100%;
  animation: tsLineProgress 2s linear infinite;
}
@keyframes tsLineProgress {
  0% { background-position: 200% 0; }
  100% { background-position: 0 0; }
}

/* ===== Zone scène ===== */
.ts-scene {
  flex: 1; position: relative; overflow: hidden;
}
.ts-house-svg {
  position: absolute;
  width: 240px; height: auto;
  left: 50%; top: 50%;
  transform: translate(-50%, -55%);
  filter: drop-shadow(4px 8px 12px rgba(0,0,0,0.3));
}
.ts-pac-spin {
  animation: tsPacSpin 2s linear infinite;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes tsPacSpin {
  to { transform: rotate(360deg); }
}

/* ===== Tortues ouvrières ===== */
.ts-worker {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  z-index: 5;
}
.ts-w-body {
  font-size: 32px; line-height: 1;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.35));
}
.ts-w-tool {
  position: absolute; top: -6px; right: -12px;
  font-size: 16px;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
}
.ts-w-tag {
  font-size: 7px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: white;
  background: linear-gradient(135deg, #ff6d00, #ffab00);
  padding: 2px 8px; border-radius: 10px; margin-top: 2px;
  font-family: 'Orbitron', sans-serif;
  box-shadow: 0 2px 6px rgba(255,109,0,0.5);
  white-space: nowrap;
}
.ts-w-speech {
  position: absolute; top: -30px; left: 50%;
  transform: translateX(-50%);
  background: white; color: #1a237e;
  font-size: 9px; font-weight: 700;
  padding: 4px 12px; border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: tsSpeechPulse 3.5s ease-in-out infinite;
}
.ts-w-speech::after {
  content: ""; position: absolute; bottom: -5px; left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid white;
}
@keyframes tsSpeechPulse {
  0%,20% { opacity: 1; transform: translateX(-50%) translateY(0); }
  40%    { opacity: 0; transform: translateX(-50%) translateY(4px); }
  60%    { opacity: 0; }
  80%    { opacity: 1; transform: translateX(-50%) translateY(0); }
  100%   { opacity: 1; }
}
.ts-w-sub {
  position: absolute; top: -8px; left: 12px;
  font-size: 16px;
}

/* Positions + animations */
.ts-w1 { bottom: 22%; left: 5%; animation: tsBob 1.6s ease-in-out infinite; }
.ts-w1 .ts-w-tool { animation: tsPhoneShake 0.5s ease-in-out infinite; }
@keyframes tsPhoneShake { 0%,100%{transform:rotate(-8deg)} 50%{transform:rotate(8deg)} }
@keyframes tsBob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }

.ts-w2 { bottom: 22%; animation: tsWalk 14s ease-in-out infinite; }
.ts-w2 .ts-w-body { animation: tsWalkBob 0.45s ease-in-out infinite; }
@keyframes tsWalk {
  0%  {left:18%;transform:scaleX(1)}
  45% {left:58%;transform:scaleX(1)}
  50% {left:58%;transform:scaleX(-1)}
  95% {left:18%;transform:scaleX(-1)}
  100%{left:18%;transform:scaleX(1)}
}
@keyframes tsWalkBob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }

.ts-w3 { bottom: 54%; left: 42%; animation: tsBob 0.7s ease-in-out infinite; }
.ts-w3 .ts-w-body { font-size: 24px; }
.ts-w3 .ts-w-tool { animation: tsHammer 0.5s ease-in-out infinite; transform-origin: bottom center; }
@keyframes tsHammer { 0%,100%{transform:rotate(-20deg)} 50%{transform:rotate(30deg)} }

.ts-w4 { bottom: 24%; right: 12%; animation: tsBob 1.3s ease-in-out infinite; animation-delay: -0.5s; }
.ts-w4 .ts-w-tool { animation: tsWrench 1.8s linear infinite; }
@keyframes tsWrench { to{transform:rotate(360deg)} }

.ts-w5 {
  bottom: 4%; font-size: 34px;
  animation: tsTruck 18s linear infinite;
}
@keyframes tsTruck {
  0%{left:-10%;} 100%{left:110%;}
}

/* ===== Barre live en bas ===== */
.ts-live-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 18px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,171,0,0.3);
}
.ts-live-item {
  display: flex; align-items: baseline; gap: 4px;
}
.ts-live-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px; font-weight: 900;
  color: #ffab00;
  text-shadow: 0 0 10px rgba(255,171,0,0.6);
}
.ts-live-lab {
  font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.7);
  text-transform: uppercase; letter-spacing: 1px;
  font-family: 'Orbitron', sans-serif;
}
.ts-live-progress {
  flex: 1; display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.ts-live-prog-label {
  font-size: 8px; font-weight: 700; color: rgba(255,255,255,0.6);
  font-family: 'Orbitron', sans-serif; text-transform: uppercase;
  letter-spacing: 1px; white-space: nowrap;
}
.ts-live-prog-bar {
  flex: 1; height: 6px; background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden; min-width: 80px;
}
.ts-live-prog-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #ff6d00, #ffab00, #00e676);
  animation: tsProgAnim 10s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
@keyframes tsProgAnim {
  0%{width:15%} 30%{width:45%} 60%{width:72%} 85%{width:92%} 100%{width:15%}
}

@media (max-width: 900px) {
  .turtle-scene { height: 280px; }
  .ts-steps { padding: 8px 10px; gap: 0; }
  .ts-step-line { width: 30px; }
  .ts-live-bar { flex-wrap: wrap; gap: 8px; }
}

/* Fix espace blanc sous la scene tortues */
.turtle-scene-card {
  margin-bottom: 0 !important;
  border-radius: 14px 14px 0 0 !important;
}
.turtle-scene-card + .dashboard-grid {
  margin-top: 0 !important;
  padding-top: 16px;
}
/* Derniere grille dashboard — supprimer gaps blancs */
#sec-dashboard .dashboard-grid:last-child {
  margin-bottom: 0 !important;
}
#sec-dashboard .dashboard-grid:last-child .chart-card {
  margin-bottom: 0 !important;
}
#sec-dashboard .content {
  padding-bottom: 16px !important;
}
#sec-dashboard {
  padding-bottom: 0 !important;
}

/* ===== Bureau cards enrichies ===== */
.bureau-row-card {
  background: linear-gradient(135deg, #ffffff, #fafbff);
  border-radius: 10px; padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid rgba(26,35,126,0.06);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.bureau-row-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26,35,126,0.12);
  border-color: rgba(255,171,0,0.3);
}
.brc-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 8px;
}
.brc-name {
  font-size: 13px; font-weight: 700; color: #1a237e;
}
.brc-count {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px; font-weight: 800; color: #ff6d00;
}
.brc-bar-track {
  width: 100%; height: 6px;
  background: #eef0ff; border-radius: 3px;
  overflow: hidden; margin-bottom: 8px;
}
.brc-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #1a237e, #3949ab, #2979ff);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.brc-stats {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.brc-tag {
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  white-space: nowrap;
}
.brc-tag-ca { background: #fff3e0; color: #e65100; }
.brc-tag-chaud { background: #ffebee; color: #c62828; }
.brc-tag-rdv { background: #e8f5e9; color: #2e7d32; }
.brc-tag-chantier { background: #e3f2fd; color: #1565c0; }

/* ===== Activite recente enrichie ===== */
.recent-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(26,35,126,0.05);
  transition: all 0.2s;
}
.recent-row:last-child { border-bottom: none; }
.recent-row:hover {
  background: rgba(255,171,0,0.04);
  padding-left: 4px;
}
.recent-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex: 0 0 28px;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.recent-content { flex: 1; min-width: 0; }
.recent-text {
  font-size: 12px; font-weight: 500; color: #333;
  line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.recent-time {
  font-size: 10px; color: #999; margin-top: 2px;
  font-family: monospace;
}
