/* Estilos personalizados */
:root {
  /* Theme accent (user-selectable) */
  --accent-color: #a91918;
  --accent-hover: #8b1517;
  --accent2-color: #e74c3c; /* gradient secondary */
  --accent-light: rgba(169, 25, 24, 0.12);
  --accent-lighter: rgba(169, 25, 24, 0.06);
  --accent-a10: rgba(169, 25, 24, 0.10);
  --accent-a20: rgba(169, 25, 24, 0.20);
  --accent-a35: rgba(169, 25, 24, 0.35);
  --accent-a50: rgba(169, 25, 24, 0.50);
  /* Theme surfaces and background (derived from accent) */
  --bg-color: #f7f7f7;
  --on-bg-color: #1d1d1b;
  --surface-color: #fafafa;
  --on-surface-color: #1d1d1b;
  --border-color: #e5e5e5;
  --on-accent-color: #ffffff;
  /* Legacy tokens still used across the CSS (kept for compatibility) */
  --primary-color: #1d1d1b;
  --secondary-color: #f1f1f1;
}
.collapse:not(.show) {
  display: none;
}

.collapse.show {
  display: block;
}

.accordion-collapse {
  background-color: #fff;
}

/* Correção do problema do background dos modals */
.modal-backdrop {
  opacity: 0.5 !important;
}

/* Estilos da tela de Login */
.login-card {
  max-width: 450px;
  width: 100%;
  transition: all 0.3s ease;
}

.login-header {
  background-color: var(--surface-color);
  color: var(--on-surface-color) !important;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.user-nav {
  background-color: var(--surface-color) !important;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid var(--accent-hover);
}
.user-nav, .user-nav * { color: var(--on-surface-color) !important; }

.login-input {
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

body {
  background: var(--bg-color);
  min-height: 100vh;
  color: var(--on-bg-color);
}

.login-btn {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  padding: 0.6rem 1.25rem;
  font-weight: 500;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.15);
}

.login-btn:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.accent-color {
  color: var(--accent-color);
}

.signup-section {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  overflow: hidden;
}

.signup-toggle {
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid var(--accent-color) !important;
  transition: all 0.3s ease;
  outline: none;
  text-decoration: none;
  border-radius: 0;
}

.signup-toggle:hover {
  background-color: #f1f1f1 !important;
}

.signup-toggle:focus {
  box-shadow: none;
}

.signup-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.signup-collapse.show {
  max-height: 300px;
}

.signup-icon {
  transition: transform 0.35s ease;
}

.signup-icon.rotate {
  transform: rotate(180deg);
}

.logout-btn { border: 1px solid var(--border-color); color: var(--on-surface-color); background: transparent; transition: all 0.15s ease; font-weight: 500; padding: 0.375rem 0.75rem; white-space: nowrap; font-size: 0.875rem; }
.logout-btn:hover { background-color: var(--accent-light); color: var(--on-surface-color); border-color: var(--accent-color); }
.user-nav {
  background-color: var(--surface-color) !important;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--accent-color);
}

.user-info-container {
  white-space: nowrap;
  overflow: hidden;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #fff;
}

.user-name { font-size: 1rem; color: var(--on-surface-color) !important; font-weight: 600; }

.account-meta-badge,
.account-super-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.account-meta-badge {
  background: var(--accent-a10) !important;
  border: 1px solid var(--accent-a20) !important;
  color: var(--accent-color) !important;
}

.account-super-meta-badge {
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #4c51bf !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.account-meta-badge .meta-crown,
.account-super-meta-badge .meta-crown {
  font-size: 0.75rem;
  line-height: 1;
  color: inherit !important;
}

.account-meta-badge .meta-label,
.account-super-meta-badge .meta-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

.account-meta-badge .meta-count,
.account-super-meta-badge .meta-count {
  line-height: 1;
  color: inherit !important;
}

.account-meta-badge.meta-badge-active,
.account-super-meta-badge.meta-badge-active {
  position: relative;
  overflow: hidden;
}

.account-meta-badge.meta-badge-active::after,
.account-super-meta-badge.meta-badge-active::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
  animation: metaBadgeShine 2.5s ease-in-out infinite;
  pointer-events: none;
}

.meta-badge-locked {
  opacity: 0.7;
  filter: saturate(0.85);
}

@keyframes metaBadgeShine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(30deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(30deg); }
}

.meta-glow {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  padding: 0 0.1rem;
  border-radius: 0.25rem;
  color: var(--accent-color) !important;
  overflow: hidden;
}

.meta-glow::after {
  content: '';
  position: absolute;
  top: -25%;
  left: -130%;
  width: 80%;
  height: 150%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: skewX(-20deg);
  animation: metaNameShine 2.8s ease-in-out infinite;
  pointer-events: none;
}

#account-avatar.meta-avatar-glow {
  border: 2px solid var(--accent-color) !important;
}

#account-avatar-fallback.meta-avatar-glow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--accent-color) !important;
  padding: 2px;
  width: 28px;
  height: 28px;
  line-height: 1;
}

#account-avatar-fallback.meta-avatar-glow::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-a20);
  pointer-events: none;
  z-index: -1;
}

@keyframes metaNameShine {
  0% { left: -140%; opacity: 0; }
  40% { opacity: 1; }
  55% { left: 120%; opacity: 0.85; }
  100% { left: 120%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .meta-glow::after,
  .account-meta-badge.meta-badge-active::after {
    animation: none !important;
  }
}

.user-id-badge {
  background-color: #fff;
  color: var(--on-surface-color);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-block;
}

.day-badge {
  background-color: var(--accent-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-block;
}

/* Sempre manter o badge do dia (topo) legível: fundo branco e texto preto */
#current-day.day-badge {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 1px solid var(--border-color) !important;
}

.day-badge.weekend {
  background-color: #6c757d;
  color: white;
}

.logout-btn {
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.15s ease;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  white-space: nowrap;
  font-size: 0.875rem;
}

.logout-btn:hover { background-color: #fff; color: var(--surface-color); border-color: #fff; }

/* Theme button and palette */
.theme-btn { border-color: var(--border-color) !important; color: var(--on-surface-color) !important; background: transparent; }
.theme-btn:hover { background-color: var(--accent-light); border-color: var(--accent-color) !important; }

.theme-palette { position:absolute; top:40px; right:0; background: var(--surface-color); border:1px solid var(--border-color); border-radius:10px; padding:8px 10px; display:grid; grid-template-columns:repeat(8,18px); gap:8px; box-shadow:0 4px 12px rgba(0,0,0,0.12); z-index:1000; }

.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  outline: 1px solid rgba(0,0,0,0.1);
  transition: transform 0.15s ease;
}

.theme-dot:hover { transform: scale(1.1); }
.theme-dot.active { outline: 2px solid #333; }

/* Responsividade para telas menores */
@media (max-width: 768px) {
  .user-name {
    font-size: 0.9rem;
  }
  
  .user-id-badge, .day-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .logout-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .user-info-container {
    gap: 0.5rem;
  }
  
  .user-name {
    font-size: 0.9rem;
  }
  
  .user-id-badge, .day-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
  }
}

/* Estilos para Configurações do Relatório */
.config-card { border: 1px solid var(--border-color); }

.config-header { background-color: var(--surface-color); border-bottom: 1px solid var(--accent-color); padding: 0.75rem 1rem; }

.config-section {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 1rem;
}

.config-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.config-subtitle {
  color: #666;
  font-weight: 600;
  font-size: 0.875rem;
}

.config-input {
  border: 1px solid #ced4da;
  transition: border-color 0.15s ease-in-out;
}

.config-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(169, 25, 24, 0.1);
}

.btn-action {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  transition: all 0.15s ease-in-out;
  text-align: center;
}

.btn-action.btn-primary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.btn-action.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-action.btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
}

.btn-action.btn-outline-secondary:hover {
  background-color: #6c757d;
  color: white;
}

/* Seção de Produtos */
.products-card { border: 1px solid var(--border-color); }

.products-header { background-color: var(--surface-color); border-bottom: 1px solid var(--accent-color); padding: 0.75rem 1rem; }

.products-count {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

/* Progress Bar Integrado */
.progress-container {
  background-color: var(--surface-color);
  padding: 1rem;
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
}

.progress-label {
  font-weight: 600;
  color: #495057;
}

.progress-stats {
  font-weight: 700;
  color: var(--accent-color);
  font-size: 1.1rem;
}

.progress-stats .target {
  color: #6c757d;
}

.progress-stats .super-target {
  margin-left: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4c51bf;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.progress-stats .super-target.super-target-hit {
  color: #4338ca;
}

.progress {
  border-radius: 12px;
  background-color: var(--surface-color);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  overflow: hidden;
  position: relative;
}

.progress-bar {
  background: linear-gradient(90deg, var(--accent-color), var(--accent2-color));
  border-radius: 12px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.progress-bar.bg-success {
  background: linear-gradient(90deg, #28a745, #20c997) !important;
  animation: celebration 0.8s ease-out;
}

.progress-bar.super-completed {
  background: linear-gradient(90deg, #6366f1, #7c3aed) !important;
}

.progress-bar.bg-warning {
  background: linear-gradient(90deg, #ffc107, #fd7e14) !important;
}

.progress-bar.completed {
  background: linear-gradient(90deg, #28a745, #20c997, #17a2b8) !important;
  animation: celebration 1.5s ease-out, rainbow 3s infinite;
  box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
}

@keyframes celebration {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes rainbow {
  0%, 100% { 
    background: linear-gradient(90deg, #28a745, #20c997, #17a2b8);
  }
  25% { 
    background: linear-gradient(90deg, #20c997, #17a2b8, #6f42c1);
  }
  50% { 
    background: linear-gradient(90deg, #17a2b8, #6f42c1, #e83e8c);
  }
  75% { 
    background: linear-gradient(90deg, #6f42c1, #e83e8c, #fd7e14);
  }
}

.progress-celebration {
  position: relative;
}

.progress-celebration::after {
  content: '🎉';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  animation: bounce 1s ease-out;
  pointer-events: none;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-20px);
  }
  60% {
    transform: translateX(-50%) translateY(-10px);
  }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #ffd700;
  animation: confetti-fall 3s linear infinite;
  z-index: 1000;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti:nth-child(1) { background: #ff6b6b; left: 10%; animation-delay: 0s; }
.confetti:nth-child(2) { background: #4ecdc4; left: 20%; animation-delay: 0.5s; }
.confetti:nth-child(3) { background: #45b7d1; left: 30%; animation-delay: 1s; }
.confetti:nth-child(4) { background: #96ceb4; left: 40%; animation-delay: 1.5s; }
.confetti:nth-child(5) { background: #feca57; left: 50%; animation-delay: 2s; }
.confetti:nth-child(6) { background: #ff9ff3; left: 60%; animation-delay: 2.5s; }
.confetti:nth-child(7) { background: #54a0ff; left: 70%; animation-delay: 0.8s; }
.confetti:nth-child(8) { background: #5f27cd; left: 80%; animation-delay: 1.3s; }
.confetti:nth-child(9) { background: #00d2d3; left: 90%; animation-delay: 1.8s; }

.progress-stats.completed {
  color: #28a745 !important;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 5px rgba(40, 167, 69, 0.3); }
  to { text-shadow: 0 0 15px rgba(40, 167, 69, 0.6); }
}

/* Toast de celebração */
.celebration-toast {
  border: 2px solid #28a745;
  box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
  animation: celebration-pulse 2s ease-in-out infinite;
}

.celebration-icon {
  font-size: 3rem;
  animation: celebration-spin 2s ease-in-out infinite;
}

/* ===== Modal simples de "Meta batida" ===== */
.goal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1055; /* acima dos toasts e próximo aos modals */
  animation: overlayIn 0.35s ease-out;
}
.goal-modal-overlay.closing { animation: overlayOut 0.2s ease-in forwards; }

@keyframes overlayIn { from { opacity: 0 } 50% { opacity: .75 } to { opacity: 1 } }
@keyframes overlayOut { from { opacity: 1 } to { opacity: 0 } }

.goal-modal {
  background: #fff;
  border-radius: 0;
  width: min(92vw, 480px);
  padding: 0 24px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  position: relative;
  transform: translateY(24px);
  opacity: 0;
  animation: modalRise .45s cubic-bezier(.2,.9,.2,1) forwards;
}

/* Cantoneiras (brackets) para um look mais técnico e flat */
.goal-modal::before,
.goal-modal::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid #111;
}
.goal-modal::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.goal-modal::after  { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.goal-modal .corner-bl,
.goal-modal .corner-br { content: ''; position: absolute; width: 24px; height: 24px; border: 2px solid #111; bottom: 10px; }
.goal-modal .corner-bl { left: 10px; border-right: none; border-top: none; }
.goal-modal .corner-br { right: 10px; border-left: none; border-top: none; }

@keyframes modalRise {
  0% { transform: translateY(24px); opacity: 0; }
  60% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.goal-close-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #666;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.goal-close-btn:hover { background: #efefef; color: #111; }

.goal-topbar {
  height: 6px;
  background: var(--accent-color);
  width: 0;
  animation: barGrow .5s .1s ease-out forwards;
}

@keyframes barGrow { from { width: 0 } to { width: 100% } }

.goal-content { text-align: center; }

.goal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  color: var(--accent-color);
  padding: 6px 10px;
  border-radius: 0;
  font-weight: 700;
  margin-bottom: 14px;
}
.goal-badge i { font-size: 1rem; }
.goal-badge span { font-size: 0.9rem; letter-spacing: 0.2px; }

.polaroid {
  background: #fff;
  border-radius: 0;
  padding: 12px 12px 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  /* textura sutil de papel */
  background-image: radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 6px 6px;
  width: 220px;
  margin: 0 auto 16px;
  position: relative;
}

/* Burst (raios) atrás da polaroid, usando conic-gradient */
.polaroid::before {
  content: '';
  position: absolute;
  inset: -18px;
  z-index: -1;
  background: conic-gradient(from 0deg,
    rgba(0,0,0,0.06) 0deg,
    transparent 40deg,
    rgba(0,0,0,0.04) 80deg,
    transparent 120deg,
    rgba(0,0,0,0.05) 160deg,
    transparent 200deg,
    rgba(0,0,0,0.04) 240deg,
    transparent 320deg,
    rgba(0,0,0,0.06) 360deg
  );
  mask: radial-gradient(circle at center, transparent 46%, #000 47%);
  filter: blur(8px);
  opacity: .35;
  animation: burstDrift 12s linear infinite;
}
@keyframes burstDrift { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }

/* Fitas (tapes) nos cantos superiores da polaroid */
.polaroid::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 8px;
  width: 42px;
  height: 10px;
  background: #f5d36a;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.polaroid .tape-right {
  content: '';
  position: absolute;
  top: -10px;
  right: 8px;
  width: 42px;
  height: 10px;
  background: #f5d36a;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.polaroid-photo {
  background: #eaeaea;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.polaroid-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent-color);
  font-weight: 800;
  font-size: 64px;
}
.polaroid-caption {
  margin-top: 8px;
  font-weight: 700;
  color: #111;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: .3px;
}

.goal-stats { margin: 8px 0 2px; }
.chip {
  display: inline-block;
  background: #f1f3f5;
  border: 1px solid #e5e7eb;
  color: #111;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 0;
}

.goal-divider {
  height: 1px;
  background: #eee;
  margin: 14px auto 12px;
  width: 72%;
}

.goal-title {
  margin: 6px 0 2px;
  font-weight: 800;
  color: #111;
}
.goal-subtitle { margin: 0 0 6px; color: #444; }
.goal-congrats { margin: 0; color: #666; font-size: 0.95rem; }

/* (removido botão de share) */

/* Confete minimalista */
.confetti-min {
  position: absolute;
  top: -12px;
  width: 6px;
  height: 10px;
  animation: confFall 1.6s ease-in forwards;
}
@keyframes confFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(75vh) rotate(300deg); opacity: 0; }
}

/* Aparecer com drama: subir + fade com delays escalonados */
.appear-up { opacity: 0; transform: translateY(10px); animation: upIn .5s cubic-bezier(.2,.9,.2,1) forwards; }
.delay-100 { animation-delay: .10s; }
.delay-200 { animation-delay: .20s; }
.delay-300 { animation-delay: .30s; }
.delay-400 { animation-delay: .40s; }
.delay-500 { animation-delay: .50s; }
.delay-600 { animation-delay: .60s; }
.delay-700 { animation-delay: .70s; }

@keyframes upIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: translateY(0) } }

@keyframes celebration-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.5);
  }
}

/* === NOVA ANIMAÇÃO ÉPICA DE CELEBRAÇÃO === */

/* Modal de celebração fullscreen */
.celebration-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: celebration-overlay-fadein 0.5s ease-out;
}

@keyframes celebration-overlay-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

.celebration-modal {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  color: white;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  animation: celebration-modal-entrance 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 500px;
  width: 90%;
}

@keyframes celebration-modal-entrance {
  0% {
    transform: scale(0.3) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.celebration-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: celebration-title-bounce 1s ease-out 0.5s both;
}

@keyframes celebration-title-bounce {
  0% { transform: translateY(-50px); opacity: 0; }
  60% { transform: translateY(10px); }
  100% { transform: translateY(0); opacity: 1; }
}

.celebration-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 1.5rem;
  animation: celebration-emoji-spin 2s ease-in-out infinite;
}

@keyframes celebration-emoji-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-15deg) scale(1.1); }
  50% { transform: rotate(0deg) scale(1.2); }
  75% { transform: rotate(15deg) scale(1.1); }
}

.celebration-message {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  animation: celebration-message-slide 0.8s ease-out 1s both;
}

@keyframes celebration-message-slide {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.celebration-stats {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: celebration-stats-fade 0.8s ease-out 1.3s both;
}

@keyframes celebration-stats-fade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 0.9; transform: translateY(0); }
}

.celebration-button {
  background: linear-gradient(45deg, #28a745, #20c997);
  border: none;
  color: white;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
  animation: celebration-button-pop 0.6s ease-out 1.6s both;
}

@keyframes celebration-button-pop {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.celebration-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
}

/* Confetti melhorado */
.confetti-epic {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
}

.confetti-piece {
  width: 8px;
  height: 8px;
  background: #ffd700;
  position: absolute;
  animation: confetti-epic-fall 3s linear infinite;
}

@keyframes confetti-epic-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(1080deg);
    opacity: 0;
  }
}

/* Fireworks effect */
.firework {
  position: fixed;
  z-index: 10001;
  pointer-events: none;
}

.firework-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #fff 0%, transparent 70%);
  border-radius: 50%;
  animation: firework-explosion 1.5s ease-out forwards;
}

@keyframes firework-explosion {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* Pulso na progress bar */
.progress-celebration {
  animation: celebration-glow 2s ease-in-out infinite;
}

@keyframes celebration-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
  }
  50% {
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.8), 0 0 50px rgba(40, 167, 69, 0.4);
  }
}

/* Estrelas cadentes */
.shooting-star {
  position: fixed;
  z-index: 10002;
  width: 2px;
  height: 2px;
  background: linear-gradient(45deg, #fff, transparent);
  border-radius: 50%;
  animation: shooting-star-move 1.5s linear infinite;
}

@keyframes shooting-star-move {
  0% {
    transform: translateX(-100px) translateY(-100px);
    opacity: 1;
  }
  100% {
    transform: translateX(100vw) translateY(100vh);
    opacity: 0;
  }
}

@keyframes celebration-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(10deg) scale(1.1); }
}

/* Detalhes diários */
#daily-details {
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.daily-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  transition: all 0.2s ease;
}

.daily-item.today {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 2px 4px rgba(169, 25, 24, 0.2);
}

.daily-item.weekend {
  background: #e3f2fd;
  border-color: #bbdefb;
}

.daily-item.today.weekend {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  border-color: #1976d2;
}

.day-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.8;
}

.day-ganhos {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2px 0;
}

.day-date {
  font-size: 0.6rem;
  opacity: 0.7;
}

#toggle-daily-details {
  font-size: 0.8rem;
  padding: 4px 8px;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.5rem;
}

/* Estilos para o histórico */
.history-results-container {
  max-height: 500px;
  overflow-y: auto;
}

.history-report-card { border: 1px solid var(--border-color); border-radius: 0.375rem; margin-bottom: 1rem; background: var(--surface-color); transition: all 0.15s ease; }

.history-report-card:hover { border-color: var(--accent-color); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }

.history-report-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e5e5e5;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem 0.375rem 0 0;
}

.history-report-title {
  font-weight: 600;
  margin: 0;
  color: #333;
  font-size: 1rem;
}

.history-report-body {
  padding: 1rem;
}

.history-report-textarea {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background-color: #f8f9fa;
  resize: vertical;
  min-height: 200px;
}

.history-report-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.history-btn-copy, .history-btn-whatsapp {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.history-btn-copy {
  background-color: #6c757d;
  color: white;
  border: 1px solid #6c757d;
}

.history-btn-copy:hover {
  background-color: #5a6268;
  color: white;
}

.history-btn-whatsapp {
  background-color: #25d366;
  color: white;
  border: 1px solid #25d366;
}

.history-btn-whatsapp:hover {
  background-color: #1aa952;
  color: white;
}

/* Estilos para o editor de estrutura */
.structure-editor {
  max-height: 500px;
  overflow-y: auto;
}

.struct-group {
  border: 1px solid #dee2e6;
}

.struct-group .card-header {
  background-color: #f8f9fa !important;
  border-bottom: 1px solid #dee2e6;
}

.sg-items {
  min-height: 50px;
}

.sg-item {
  padding: 0.5rem;
  border: 1px solid #f0f0f0;
  border-radius: 0.25rem;
  background-color: #fafafa;
}

.sg-item:hover {
  background-color: #f0f0f0;
}

/* Indicador de salvamento melhorado */
.save-indicator {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.save-indicator:not(:empty) {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: 1px solid rgba(169, 25, 24, 0.2);
}

/* Responsividade */
@media (max-width: 768px) {
  .btn-action {
    min-height: 70px;
    padding: 0.8rem;
  }
  
  .btn-action i {
    font-size: 1.3rem;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* Estilos para cards de produtos em linha */
.product-item {
  transition: all 0.15s ease;
}

.product-card-inline {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  padding: 0.75rem;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.product-card-inline:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(169, 25, 24, 0.1);
}

.product-info {
  flex: 1;
  min-width: 0;
  margin-right: 1rem;
}

.product-name {
  font-weight: 600;
  color: #333;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-controls-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-control {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  padding: 0;
  border: 1px solid #dee2e6;
  transition: all 0.15s ease;
  font-size: 0.875rem;
}

.btn-control:hover {
  border-color: var(--accent-color);
  background-color: var(--accent-color);
  color: white;
}

.product-value-inline {
  text-align: center;
  font-weight: 600;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  width: 60px;
  height: 32px;
  transition: all 0.15s ease;
  font-size: 0.875rem;
}

.product-value-inline:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(169, 25, 24, 0.1);
}

/* Responsividade para cards de produtos */
@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .btn-action {
    min-height: 80px;
    padding: 1rem;
  }
  
  .btn-action i {
    font-size: 1.5rem;
  }
  
  .btn-title {
    font-size: 1rem;
  }
  
  .config-input {
    height: auto;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .product-card-inline {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    gap: 0.75rem;
    text-align: center;
  }
  
  .product-info {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  .product-controls-inline {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .product-controls-inline {
    gap: 0.4rem;
  }
  
  .btn-control {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  
  .product-value-inline {
    width: 50px;
    height: 28px;
    font-size: 0.75rem;
  }
}

.accent-color {
  color: var(--accent-color);
}

/* Garantir que modais fechem corretamente */
body.modal-open {
  overflow: hidden;
}

body:not(.modal-open) .modal-backdrop {
  display: none !important;
}

/* Produtos mais compactos */
.product-card {
  border: 1px solid #dee2e6;
  transition: border-color 0.2s ease;
}

.product-card:hover {
  border-color: var(--primary-color);
}

.product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  min-width: 0;
  word-wrap: break-word;
}

.product-value {
  border: 1px solid #ced4da;
  font-weight: 600;
}

.product-value:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(169, 25, 24, 0.25);
}

/* Botões com cor personalizada */
.btn-outline-danger {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-danger:hover { background-color: var(--accent-color); border-color: var(--accent-color); }

/* Indicadores visuais */
.save-indicator {
  color: var(--primary-color);
  font-weight: 600;
}

/* Headers e títulos com destaque */
.card-header { background-color: var(--surface-color); border-bottom: 2px solid var(--accent-color); }

.btn-primary { background-color: var(--accent-color); border-color: var(--accent-color); color: var(--on-accent-color); }

.btn-primary:hover { background-color: var(--accent-hover); border-color: var(--accent-hover); }

.btn-primary:focus { box-shadow: 0 0 0 0.2rem var(--accent-light); }

/* Melhorar aparência dos inputs */
.form-control:focus { border-color: var(--accent-color); box-shadow: 0 0 0 0.2rem var(--accent-light); }

/* Loading indicator */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Botão com loading */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Responsividade */
@media (max-width: 768px) {
  .product-name {
    font-size: 0.8rem;
  }
  
  .product-value {
    width: 50px !important;
  }
  
  .btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
  }
}

/* Destaque para elementos importantes */
.account-info {
  color: var(--primary-color);
  font-weight: 600;
}

.navbar-brand {
  color: var(--primary-color) !important;
  font-weight: 700;
}

/* Melhorar visibilidade de checkboxes */
.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(169, 25, 24, 0.25);
}

/* Global improvements - align with theme tokens defined above */
/* Keep gray scale fixed, map primaries to theme variables */
:root { --light-gray: #f8f8f8; --medium-gray: #d0d0d0; --dark-gray: #666666; --error-bg: #fef5f5; }

body { background: var(--bg-color); min-height: 100vh; color: var(--on-bg-color); }

/* Custom card styling */
.card {
    border: 1px solid var(--medium-gray);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.card-header {
    border-radius: 4px 4px 0 0 !important;
    border: none;
    font-weight: 600;
    background-color: var(--primary-color) !important;
    color: white !important;
}

.card-header.bg-info {
    background-color: var(--dark-gray) !important;
}

.card-header.bg-warning {
    background-color: var(--accent-color) !important;
    color: white !important;
}

.card-header.bg-success {
    background-color: var(--primary-color) !important;
}

/* Estilos para produtos */
#products-grid .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#products-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.product-value {
    font-weight: bold;
    font-size: 1.1em;
}

.remove-product {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.remove-product:hover {
    opacity: 1;
}

/* Estilos para os dados do PipeRun */
.alert-info .border {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    transition: background-color 0.3s ease;
}

.alert-info .border:hover {
    background-color: #e9ecef !important;
}

.alert-warning {
    border-left: 4px solid var(--accent-color);
}

/* Melhorias nos botões */
.btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-success { background-color: var(--accent-color); border-color: var(--accent-color); color: var(--on-accent-color); }

.btn-success:hover { background-color: var(--accent-hover); border-color: var(--accent-hover); }

.btn-outline-danger:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Input groups melhorados */
.input-group .btn {
    z-index: 2;
}

.input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(29, 29, 27, 0.25);
}

.card-header.bg-secondary {
    background-color: var(--dark-gray) !important;
}

/* Group styling for Bootstrap */
.group {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.group:hover {
    border-color: var(--dark-gray);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--medium-gray);
}

.group-title {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
}

/* Item row styling */
.item {
  display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.5rem;
  background: var(--surface-color);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.item:hover { background: var(--light-gray); }

.item input[type="text"] {
    flex: 1;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    background: white;
}

/* Counter styling */
.counter {
  display: flex;
    align-items: center;
    gap: 0.5rem;
  background: var(--surface-color);
  border-radius: 4px;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
}

.counter button {
    width: 32px;
    height: 32px;
    border-radius: 4px;
  background: var(--light-gray);
  border: 1px solid var(--border-color);
  color: var(--on-surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.counter button:hover { background: var(--accent-color); color: var(--on-accent-color); border-color: var(--accent-color); }

.counter .value {
    min-width: 48px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--primary-color);
}

.counter input.value {
    height: 32px;
    border-radius: 4px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
    width: 64px;
    text-align: center;
    padding: 0;
    font-weight: 500;
}

/* Remove item button */
.item .remove-item {
    height: 32px;
    border-radius: 4px;
    background: white;
    border: 1px solid var(--medium-gray);
    color: var(--accent-color);
    padding: 0 0.5rem;
    transition: all 0.2s ease;
}

.item .remove-item:hover {
    background: var(--error-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Responsive grid for groups */
#groups-wrapper .col-lg-6 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Button enhancements */
.btn {
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    border-width: 1px;
}

.btn:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary { background-color: var(--accent-color) !important; border-color: var(--accent-color) !important; color: var(--on-accent-color) !important; }

.btn-primary:hover { background-color: var(--accent-hover) !important; border-color: var(--accent-hover) !important; }

.btn-success {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.btn-success:hover {
    background-color: var(--dark-gray) !important;
    border-color: var(--dark-gray) !important;
}

.btn-outline-primary { color: var(--accent-color) !important; border-color: var(--accent-color) !important; }

.btn-outline-primary:hover { background-color: var(--accent-color) !important; border-color: var(--accent-color) !important; color: var(--on-accent-color) !important; }

.btn-outline-secondary {
    color: var(--dark-gray) !important;
    border-color: var(--medium-gray) !important;
}

.btn-outline-secondary:hover {
    background-color: var(--dark-gray) !important;
    border-color: var(--dark-gray) !important;
    color: white !important;
}

.btn-outline-info { color: var(--accent-color) !important; border-color: var(--accent-color) !important; }

.btn-outline-info:hover { background-color: var(--accent-color) !important; border-color: var(--accent-color) !important; color: var(--on-accent-color) !important; }

.btn-secondary {
    background-color: var(--dark-gray) !important;
    border-color: var(--dark-gray) !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Modal improvements */
.modal-content {
  border: 1px solid var(--border-color);
    border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid var(--medium-gray);
    border-radius: 4px 4px 0 0 !important;
}

.modal-footer {
    border-top: 1px solid var(--medium-gray);
    border-radius: 0 0 4px 4px;
}

/* Form improvements */
.form-control {
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(29, 29, 27, 0.25);
}

/* Report output styling */
#report-output {
    font-family: 'Courier New', monospace;
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    min-height: 300px;
    line-height: 1.6;
}

/* Navbar improvements */
.navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar-dark.bg-primary { background-color: var(--surface-color) !important; }
.navbar-dark.bg-primary .navbar-brand, .navbar-dark.bg-primary .navbar-text, .navbar-dark.bg-primary .nav-link { color: var(--on-surface-color) !important; }

/* Login card centering and styling */
#login-view {
    margin-top: 2rem;
}

/* Accordion improvements */
.accordion-button {
    border-radius: 4px !important;
    font-weight: 500;
}

.accordion-button:not(.collapsed) { background-color: var(--accent-color); color: var(--on-accent-color); }

/* Alert improvements */
.alert {
    border: 1px solid;
    border-radius: 4px;
    border-left: 3px solid;
}

.alert-danger {
    border-left-color: var(--accent-color);
    background-color: var(--error-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.alert-info {
    border-left-color: var(--primary-color);
    background-color: var(--light-gray);
    border-color: var(--medium-gray);
    color: var(--primary-color);
}

/* Structure editor specific styles */
.structure-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.structure-editor .card {
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
}

.sg-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.sg-item .item {
    margin: 0;
    background: white;
}

/* Checkbox styling */
.check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.check-row:hover {
    background: var(--light-gray);
    border-color: var(--dark-gray);
}

.check-row input {
    margin: 0;
    accent-color: var(--primary-color);
}

.check-row label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.group, .card {
    animation: fadeIn 0.3s ease-out;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--medium-gray);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(241, 241, 241, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid var(--medium-gray);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary-color);
}

.loading-text {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Button loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive improvements specific to color scheme */
@media (max-width: 768px) {
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        background: white;
        border: 1px solid var(--medium-gray);
    }
    
    .counter {
        justify-self: center;
    }
}

/* Editor de Estrutura - Produtos */
.products-table {
  margin-bottom: 0;
  border: 1px solid #e0e0e0;
}

.products-table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
}

.products-table td {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
}

.product-row {
  transition: all 0.2s ease;
}

.product-row:hover {
  background-color: #f8f9fa;
}

.product-row.drag-over {
  background-color: rgba(169, 25, 24, 0.1);
  border-top: 2px solid var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
}

.drag-handle {
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.position-number .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.product-name-input {
  border: 1px solid transparent;
  background-color: transparent;
  transition: all 0.2s ease;
  font-weight: 500;
  padding: 0.375rem 0.5rem;
}

.product-name-input:focus {
  border-color: var(--accent-color);
  background-color: white;
  box-shadow: 0 0 0 0.2rem rgba(169, 25, 24, 0.15);
}

.remove-product {
  border: none;
  background: transparent;
  color: #dc3545;
  transition: all 0.2s ease;
  padding: 0.25rem 0.5rem;
}

.remove-product:hover {
  background-color: #dc3545;
  color: white;
  border-radius: 4px;
}

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

/* Drag and drop visual states */
.product-row[draggable="true"]:hover .drag-handle {
  color: var(--accent-color);
}

.product-row[style*="opacity: 0.5"] {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Sistema de Notificações */
.toast-container {
  z-index: 9999 !important;
}

.custom-toast { min-width:300px; border:none; border-left:4px solid var(--toast-border-color, var(--accent-color)); box-shadow:0 4px 12px rgba(0,0,0,0.15); animation: slideInRight 0.3s ease-out; }

.custom-toast.toast-success {
  --toast-border-color: #28a745;
  background-color: #f8fff9;
}

.custom-toast.toast-info {
  --toast-border-color: #17a2b8;
  background-color: #f3fcfd;
}

.custom-toast.toast-warning {
  --toast-border-color: #ffc107;
  background-color: #fffef0;
}

.custom-toast.toast-error {
  --toast-border-color: #dc3545;
  background-color: #fdf2f2;
}

.custom-toast .toast-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1rem 0.5rem 1rem;
}

.custom-toast .toast-body {
  padding: 0.5rem 1rem 0.75rem 1rem;
  font-size: 0.9rem;
  color: #333;
}

.toast-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

.toast-icon.success {
  color: #28a745;
}

.toast-icon.info {
  color: #17a2b8;
}

.toast-icon.warning {
  color: #ffc107;
}

.toast-icon.error {
  color: #dc3545;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Animações de botões */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Status badge para informações da semana */
.status-badge {
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: rgba(13, 110, 253, 0.1);
  border-radius: 0.375rem;
  border-left: 3px solid #0d6efd;
}

.status-badge small {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Melhorias para progress section */
.progress-section {
  transition: all 0.3s ease;
}

.progress-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Period info styling */
.period-info {
  color: #495057;
  font-size: 0.9rem;
}

.period-label { font-weight: 600; margin-right: 0.25rem; color: var(--on-surface-color); opacity: 0.8; }

.period-badge { display:inline-block; background: var(--surface-color); border: 1px solid var(--border-color); color: var(--on-surface-color); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.period-badge-super { background: rgba(99, 102, 241, 0.16); border-color: rgba(99, 102, 241, 0.4); color: #4338ca; }

.period-sep {
  margin: 0 6px;
  color: #adb5bd;
}

.motivation-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #495057;
}

.motivation-done {
  color: #2f9e44;
  font-weight: 600;
}

/* remove icon bullets for a cleaner look */

/* unify remaining display with period badge style */
.period-badge + .period-badge {
  margin-left: 6px;
}

/* Estilos para o Modal de Histórico Semanal */
.weekly-history-list {
  max-height: 400px;
  overflow-y: auto;
}

/* Tabela do histórico semanal */
#weekly-history-table {
  margin-bottom: 0;
}

#weekly-history-table thead th {
  background-color: var(--surface-color);
  font-weight: 600;
  font-size: 0.875rem;
  color: #495057;
  padding: 1rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

#weekly-history-table tbody tr { transition: all 0.2s ease; border-bottom: 1px solid var(--border-color); }

#weekly-history-table tbody tr:hover {
  background-color: var(--surface-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#weekly-history-table tbody tr.current-week {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-lighter));
  border-left: 4px solid var(--accent-color);
}

#weekly-history-table tbody tr.current-week:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-lighter));
  filter: brightness(0.98);
}

#weekly-history-table tbody tr.completed-week {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.08), rgba(40, 167, 69, 0.03));
  border-left: 4px solid #28a745;
}

#weekly-history-table tbody tr.completed-week:hover {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.12), rgba(40, 167, 69, 0.05));
}

#weekly-history-table tbody tr.super-week {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08));
  border-left: 4px solid #4c51bf;
}

#weekly-history-table tbody tr.super-week:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(79, 70, 229, 0.12));
}

#weekly-history-table tbody td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f3f4;
}

/* Período */
.period-cell {
  font-weight: 500;
  color: #495057;
}

.period-dates {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 2px;
}

.current-week-badge {
  background: linear-gradient(135deg, var(--accent-color), var(--accent2-color));
  color: white;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

/* Meta */
.meta-cell {
  font-weight: 600;
  color: #6c757d;
  font-size: 1rem;
}

.meta-cell .meta-target {
  font-size: 0.85rem;
  line-height: 1.2;
}

.meta-cell .meta-target + .meta-target {
  margin-top: 0.25rem;
}

.meta-cell .meta-target.base.hit {
  color: #28a745;
}

.meta-cell .meta-target.super {
  color: #4c51bf;
  font-weight: 600;
}

.meta-cell .meta-target.super.hit {
  color: #4338ca;
}

/* Resultado */
.result-cell {
  font-weight: 700;
  font-size: 1.1rem;
}

.result-cell.success {
  color: #28a745;
}

.result-cell.partial {
  color: #ffc107;
}

.result-cell.miss {
  color: #dc3545;
}

.result-cell.super {
  color: #4338ca;
}

.result-cell.super .trophy-icon {
  color: #6366f1;
}

/* Performance (Progress Bar) */
.performance-cell {
  width: 150px;
}

.performance-progress {
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.performance-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.performance-progress-bar.success {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.performance-progress-bar.partial {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.performance-progress-bar.miss {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.performance-progress-bar.super {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
}

.performance-percentage {
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  text-align: center;
}

/* Status Badge */
.status-badge {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 1.5rem;
  font-weight: 600;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.completed {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
  border-color: #c3e6cb;
  box-shadow: 0 2px 4px rgba(21, 87, 36, 0.1);
}

.status-badge.in-progress {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
  border-color: #ffeaa7;
  box-shadow: 0 2px 4px rgba(133, 100, 4, 0.1);
}

.status-badge.not-achieved {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  border-color: #f5c6cb;
  box-shadow: 0 2px 4px rgba(114, 28, 36, 0.1);
}

.status-badge.super-completed {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #3730a3;
  border-color: #c7d2fe;
  box-shadow: 0 2px 6px rgba(55, 48, 163, 0.15);
}

/* Trophy icon for completed weeks */
.trophy-icon {
  color: #ffd700;
  margin-right: 0.25rem;
  font-size: 1rem;
}

/* Empty state */
.weekly-history-empty {
  padding: 3rem 1rem;
}

.weekly-history-empty i {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #weekly-history-table {
    font-size: 0.85rem;
  }
  
  #weekly-history-table tbody td {
    padding: 0.75rem 0.5rem;
  }
  
  .performance-cell {
    width: 120px;
  }
  
  .current-week-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
}

/* Animação de spin para ícones */
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =====================
   Pre-celebration progress
   ===================== */
.preprog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: grid;
  place-items: center;
  z-index: 2000;
  animation: overlayIn .18s ease-out;
}
.preprog-overlay.closing { animation: overlayOut .22s ease-in forwards; }

.preprog-box {
  background: #0f1115;
  color: #e6e8ee;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  padding: 20px 22px;
  width: min(520px, 86vw);
  transform: translateY(6px);
  animation: modalRise .22s ease-out forwards;
}
.preprog-label {
  font-size: 14px;
  letter-spacing: .02em;
  opacity: .85;
  margin-bottom: 10px;
}
.preprog-bar {
  --accent: var(--accent-color, #f0b90b);
  position: relative;
  height: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.15));
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
}
.preprog-fill {
  height: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 84%, #fff 0%), var(--accent));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.2);
  transition: width 220ms cubic-bezier(.22,.61,.36,1);
  position: relative;
}
.preprog-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  mix-blend-mode: screen;
  transform: translateX(-100%);
  animation: sheen 1.6s ease-in-out infinite;
}
.preprog-percent {
  margin-top: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  opacity: .8;
}

@keyframes sheen {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

/* Super Goal Modal */
.super-goal-overlay {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(5px);
}

.super-goal-modal {
  position: relative;
  z-index: 10; /* Above fireworks */
  background: linear-gradient(160deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 2px solid #FFD700;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.25), inset 0 0 20px rgba(255, 215, 0, 0.05);
  color: #fff;
}

.super-goal-modal::before,
.super-goal-modal::after,
.super-goal-modal .corner-bl,
.super-goal-modal .corner-br {
  border-color: #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.super-goal-modal .goal-close-btn {
  color: rgba(255,255,255,0.5);
  z-index: 20; /* Ensure it's clickable */
}
.super-goal-modal .goal-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.super-badge {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #FFD700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.super-chip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 215, 0, 0.5);
  color: #FFD700;
}

.super-title {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
  color: #FFD700; /* Solid Gold Color */
  text-shadow: 
    0 2px 0 #B8860B,
    0 0 15px rgba(255, 215, 0, 0.6);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  animation: superTitlePulse 2s ease-in-out infinite;
}

@keyframes superTitlePulse {
  0%, 100% { transform: scale(1); filter: brightness(100%); }
  50% { transform: scale(1.05); filter: brightness(120%); }
}

.super-goal-modal .goal-subtitle {
  color: #ffffff !important;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.super-goal-modal .goal-congrats {
  color: #e0e0e0 !important;
  font-size: 0.95rem;
  margin-top: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.super-goal-modal .polaroid {
  transform: rotate(-3deg) scale(1.02);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  margin-bottom: 1rem;
}

.super-goal-modal .polaroid:hover {
  transform: rotate(0deg) scale(1.1);
  z-index: 10;
}

.fireworks-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1; /* Behind the modal */
}

.super-meta-header {
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.super-meta-text {
  font-size: 3.5rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  background: linear-gradient(
    to bottom,
    #FFD700 0%,
    #FFF8DC 20%,
    #DAA520 40%,
    #FFD700 60%,
    #FFF8DC 80%,
    #DAA520 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #B8860B);
  animation: superMetaPulse 2s ease-in-out infinite, superMetaShine 3s linear infinite;
  background-size: 200% auto;
  letter-spacing: -2px;
}

@keyframes superMetaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes superMetaShine {
  to { background-position: 200% center; }
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

/* Detalhes do histórico */
.history-details-row:hover {
    background-color: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.current-week-badge {
    font-size: 0.65rem;
    background-color: var(--accent-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
