:root {
  /* Brand Colors - MyTrends Premium Style */
  --primary: #6366f1; /* Indigo vibrante */
  --primary-rgb: 99, 102, 241;
  --primary-light: #818cf8;
  --secondary: #ec4899; /* Pink vibrante para contraste */
  --accent: #10b981; /* Esmeralda para sucessos/ações */
  --wpp: #25D366;
  --wpp-dark: #128C7E;
  
  /* Kanban Phase Colors */
  --phase-new: #a5b4fc;
  --phase-qual: #c084fc;
  --phase-prop: #fbbf24;
  --phase-closed: #34d399;

  /* UI Colors */
  --bg-app: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --white: #ffffff;
  
  /* Effects - Premium Glassmorphism */
  --glass: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --radius: 24px;
  
  /* Spacing */
  --header-h: 72px;
  --nav-h: 80px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
#app-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  letter-spacing: -1px;
}

.logo .accent {
  color: var(--secondary);
  opacity: 0.9;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-icon {
  background: var(--white);
  border: 1px solid var(--glass-border);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.6rem;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-light);
}

.btn-icon:active {
  transform: translateY(0);
}

.btn-premium {
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 15px -3px rgba(var(--primary-rgb), 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-premium:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(var(--primary-rgb), 0.35);
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.btn-premium:active {
  transform: translateY(0) scale(1);
}

.btn-premium:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-control-premium {
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--glass-border);
  border-radius: 18px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  outline: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-main);
}

.form-control-premium:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 5px rgba(var(--primary-rgb), 0.1);
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  border-color: var(--glass-border);
  box-shadow: 0 8px 12px rgba(0,0,0,0.04);
  transform: translateY(-2px);
}

/* Main Content Area */
#app-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  padding-bottom: calc(var(--nav-h) + 1.25rem);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--glass-border);
  z-index: 1000;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -10px 25px rgba(0,0,0,0.03);
}

.bottom-nav.mobile-scroll {
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  gap: 0;
}

.bottom-nav.mobile-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.bottom-nav.mobile-scroll .nav-item {
  flex: 0 0 calc(100% / 4.5); /* Show 4.5 items to hint at scroll */
  min-width: 80px;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 0;
}

.nav-item .icon {
  font-size: 1.6rem;
  font-style: normal;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: grayscale(0.5) opacity(0.7);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .icon {
  transform: translateY(-6px) scale(1.2);
  filter: grayscale(0) opacity(1);
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.5s;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(46, 125, 50, 0.1);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.rotating {
  animation: spin 1s linear infinite;
}
.card {
  background: var(--bg-card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: rgba(var(--primary-rgb), 0.2);
}

/* WhatsApp Turbo Enhancements */
.kanban-column {
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.kanban-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.kanban-card.dragging {
  cursor: grabbing;
  transform: rotate(2deg) scale(1.05);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 2000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sidebar-drawer.open {
  right: 0;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid #efefef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

@media (max-width: 600px) {
  .sidebar-drawer {
    width: 100%;
    right: -100%;
  }
}

.badge-wpp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #25D36620;
  color: #128C7E;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Profile Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(var(--header-h) - 10px);
  right: 1.5rem;
  background: white;
  min-width: 180px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-header {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.5rem;
}

.dropdown-header span {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.dropdown-header small {
  font-size: 0.75rem;
  color: #64748b;
}

.dropdown-item {
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: var(--primary);
}

.dropdown-item.danger {
  color: #ef4444;
}

.dropdown-item.danger:hover {
  background: #fef2f2;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Drawer (Menu Lateral) - Premium Purple Style */
.drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100%;
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  z-index: 2000;
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 15px 0 50px rgba(0,0,0,0.2);
  color: white;
}

.drawer.open {
  left: 0;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1999;
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.drawer-overlay.open {
  display: block;
}

.drawer-header {
  padding: 2.5rem 1.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: white;
  font-size: 1.4rem;
}

.drawer-logo img {
  filter: brightness(0) invert(1); /* Logo branca no fundo roxo */
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.drawer-section {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s;
  cursor: pointer;
}

.drawer-nav-item i {
  font-size: 1.5rem;
  font-style: normal;
  width: 24px;
  text-align: center;
}

.drawer-nav-item:hover, .drawer-nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-weight: 700;
}

.drawer-nav-item.active {
  background: rgba(255, 255, 255, 0.2);
  border-left: 5px solid white;
}

.drawer-footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
}

.btn-logout-drawer {
  margin-top: 1rem;
  width: 100%;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s;
}

.btn-logout-drawer:hover {
  background: rgba(239, 68, 68, 0.4);
  color: white;
}

/* Mobile Specific Tweaks */
@media (max-width: 768px) {
  #menu-toggle {
    display: flex !important;
  }
  
  #app-header {
    padding: 0 1rem;
  }
  
  .logo span {
    font-size: 1.1rem;
  }
  
  /* Form controls and buttons for touch */
  .btn-premium, .form-control-premium, .btn-primary, .form-control {
    min-height: 48px;
  }
  
  .card {
     padding: 1.25rem;
     border-radius: 20px;
  }
  
  /* Hide bottom nav label if crowded? No, we have the drawer now */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
