/* ==========================================================================
   PIZZA PRIME CRM (FJT) - DESIGN SYSTEM & CORE STYLES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Cores da Identidade Pizza Prime */
  --primary-red: #80141D;
  --primary-red-dark: #630C13;
  --primary-red-light: #9E1B26;
  --accent-gold: #FFB800;
  --accent-gold-hover: #E5A500;
  --accent-gold-light: rgba(255, 184, 0, 0.15);

  /* Paleta Dark Theme (WhatsApp Web Oficial) */
  --bg-main: #0B141A;
  --bg-sidebar: #111B21;
  --bg-card: #111B21;
  --bg-card-hover: #202C33;
  --bg-header: #202C33;
  --bg-input: #2A3942;
  --border-color: #222D34;
  --border-subtle: rgba(134, 150, 160, 0.15);

  /* Cores de Mensagens WhatsApp Web */
  --msg-customer-bg: #202C33;
  --msg-customer-text: #E9EDEF;
  --msg-bot-bg: #1A2830;
  --msg-bot-text: #E9EDEF;
  --msg-bot-border: rgba(255, 184, 0, 0.3);
  --msg-agent-bg: #005C4B;
  --msg-agent-text: #E9EDEF;
  --msg-system-bg: #182229;
  --msg-meta-text: #8696A0;
  --msg-check-blue: #53BDEB;

  /* Status e Badges */
  --status-bot: #A855F7;
  --status-pending: #EF4444;
  --status-human: #00A884;
  --status-online: #00A884;
  --status-offline: #8696A0;

  /* Tipografia WhatsApp Oficial */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text-primary: #E9EDEF;
  --text-secondary: #8696A0;
  --text-muted: #667781;
  --text-gold: #FFD15C;

  /* Efeitos e Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--border-color) var(--bg-sidebar);
}

/* App Container Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background-color: var(--bg-main);
  overflow: hidden;
}

/* Top Navbar */
.app-header {
  height: 60px;
  background: linear-gradient(90deg, var(--bg-header) 0%, #2B0A10 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  padding: 4px 8px;
  border-radius: var(--radius-md);
}

.brand-section:hover {
  transform: scale(1.02);
  opacity: 0.92;
}

.brand-section:active {
  transform: scale(0.98);
}

.brand-logo {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  transition: filter 0.2s ease;
}

.brand-section:hover .brand-logo {
  filter: drop-shadow(0 0 8px rgba(255, 184, 0, 0.4));
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  background-color: var(--primary-red);
  color: var(--accent-gold);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-gold);
  letter-spacing: 0.5px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-gold);
  color: #FFFFFF;
}

.nav-btn.active {
  background: var(--primary-red);
  border-color: var(--accent-gold);
  color: #FFFFFF;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--primary-red);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
}

.user-role {
  font-size: 0.68rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}

/* Main Content Area */
.main-view {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Modal e Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease-out;
}

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

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

/* Scrollbars Estilizadas */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
