:root {
  --violet-50: #f5f3ff;
  --violet-100: #ede9fe;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
}

* {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
}

body {
  background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
  min-height: 100vh;
}

/* Scrollbar custom */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f5f3ff; }
::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #8b5cf6; }

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-out; }

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(139,92,246,0.6); }
  70% { box-shadow: 0 0 0 12px rgba(139,92,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
}
.pulse-ring { animation: pulse-ring 2s infinite; }

/* Card "calm" */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(139,92,246,0.04), 0 4px 16px rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.08);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
}
.btn-primary {
  background: #7c3aed;
  color: white;
}
.btn-primary:hover { background: #6d28d9; }
.btn-primary:disabled { background: #c4b5fd; cursor: not-allowed; }
.btn-secondary {
  background: #ede9fe;
  color: #6d28d9;
}
.btn-secondary:hover { background: #ddd6fe; }
.btn-ghost {
  background: transparent;
  color: #6d28d9;
}
.btn-ghost:hover { background: #ede9fe; }
.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}
.btn-danger:hover { background: #fecaca; }

/* Input */
.input, .select, .textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  background: white;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.textarea { min-height: 100px; resize: vertical; }

/* Priority pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pill-p1 { background: #fecaca; color: #991b1b; }
.pill-p2 { background: #fed7aa; color: #9a3412; }
.pill-p3 { background: #d1fae5; color: #065f46; }
.pill-pending { background: #fef3c7; color: #92400e; }
.pill-bought { background: #d1fae5; color: #065f46; }
.pill-partial { background: #dbeafe; color: #1e40af; }

/* Nav */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 10px;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-item:hover { background: #f5f3ff; color: #6d28d9; }
.nav-item.active { background: linear-gradient(90deg, #7c3aed 0%, #8b5cf6 100%); color: white; }
.nav-item.active i { color: white; }

/* Loading */
.spinner {
  border: 3px solid #ede9fe;
  border-top: 3px solid #8b5cf6;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}
@keyframes spin { 0%{ transform: rotate(0); } 100%{ transform: rotate(360deg); } }

/* Progress */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #ede9fe;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
  transition: width 0.5s ease;
}

/* Mobile nav — default: hidden. Shown ONLY on mobile when .open */
.sidebar-mobile {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 50;
  display: none;
}
.sidebar-mobile > .sidebar-inner {
  background: white;
  width: 80%;
  max-width: 280px;
  height: 100%;
  padding: 1rem;
  overflow-y: auto;
}
@media (max-width: 768px) {
  .sidebar-mobile.open { display: block; }
}

/* Tooltip helper (info ao lado de DUM/DPP) */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  cursor: help;
}
.tooltip-wrap .tooltip-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1px solid #c4b5fd;
}
.tooltip-wrap .tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  width: 240px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  text-align: left;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
.tooltip-wrap .tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}
.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus-within .tooltip-bubble,
.tooltip-wrap.active .tooltip-bubble {
  opacity: 1;
  pointer-events: auto;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}
.empty-state i {
  font-size: 3rem;
  color: #c4b5fd;
  margin-bottom: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: #1f2937;
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 100;
  animation: fadeIn 0.2s;
  max-width: 400px;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #7c3aed; }

/* Week circle */
.week-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 30px rgba(124,58,237,0.3);
}

/* Mood emoji */
.mood-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 1.3rem;
}
.mood-btn:hover { background: #f3f4f6; }
.mood-btn.selected { border-color: #8b5cf6; background: #ede9fe; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s;
}
.modal {
  background: white;
  border-radius: 16px;
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-lg { max-width: 800px; }

/* Violet logo */
.violet-logo {
  background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Utility */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #ede9fe;
  margin-bottom: 1rem;
  overflow-x: auto;
}
.tab {
  padding: 0.625rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab:hover { color: #6d28d9; }
.tab.active { color: #6d28d9; border-bottom-color: #7c3aed; }

/* Checkbox customizado */
.custom-check {
  width: 22px;
  height: 22px;
  border: 2px solid #c4b5fd;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.custom-check.checked {
  background: #7c3aed;
  border-color: #7c3aed;
  color: white;
}
