/* ============================================================
   evoChat Painel - CSS portado do legado evo-painel (main.css +
   estilos de Sidebar/Header/Login/VerifyEmail). Fidelidade 1:1.
   ============================================================ */

:root {
  /* Cores base do tema claro */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;

  /* Cores de status (fixas) */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;

  /* Accent Colors (Default Indigo) */
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  /* Sidebar settings */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-hover: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-light: #64748b;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[x-cloak] { display: none !important; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s;
  font-size: 14px;
}

.scroll-container {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 2rem;
}

#app {
  height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
.btn-secondary { background-color: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background-color: var(--bg-hover); }
.btn-success { background-color: var(--success-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 700; border-radius: 9999px; }
.badge-success { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-info { background-color: rgba(99, 102, 241, 0.15); color: var(--primary-color); }

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s;
  font-family: inherit;
}

select.input {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
}

[data-theme="dark"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.page-header {
  margin-bottom: 2rem;
  padding-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  gap: 1rem;
  width: 100%;
}

.header-main { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.header-title-row { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; margin: 0; line-height: 1.2; }
.page-header p, .page-header .text-muted { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--text-secondary); }
.header-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.25rem; }
.section-header { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }

.users-page, .departments-page, .units-page, .reports-page, .dashboard-page {
  height: 100%;
  overflow-y: auto;
  padding-right: 0.5rem;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

.input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.text-muted { color: var(--text-secondary); }
.text-small { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-light { color: #94a3b8; }

.spinner { border: 3px solid var(--bg-secondary); border-top-color: var(--primary-color); border-radius: 50%; width: 24px; height: 24px; animation: spin 0.8s linear infinite; }
.spinner-sm { border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: white; border-radius: 50%; width: 16px; height: 16px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-enter-active, .fade-leave-active { transition: opacity 0.3s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ============================================================
   LAYOUT (MainLayout.vue)
   ============================================================ */
.main-layout {
  display: flex;
  height: 100vh;
  background-color: var(--bg-secondary);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
}

.content-wrapper.collapsed-margin { margin-left: var(--sidebar-collapsed-width); }
.content-wrapper.no-margin { margin-left: 0; }

.main-content {
  zoom: 0.85;
  flex: 1;
  padding: 2.35rem;
  overflow-y: auto;
  width: 100%;
  height: calc(100% / 0.85);
}

.main-content.no-padding { padding: 0; }

@media (max-width: 768px) {
  .content-wrapper, .content-wrapper.collapsed-margin { margin-left: 0; }
}

/* ============================================================
   SIDEBAR (Sidebar.vue)
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-right: 1px solid var(--bg-primary);
  margin-right: -1px;
  position: relative;
  z-index: 10;
}

.logo-container { display: flex; align-items: center; gap: 0.75rem; overflow: hidden; }
.logo-img { height: 32px; width: 32px; object-fit: contain; flex-shrink: 0; }
.brand-info { display: flex; flex-direction: column; justify-content: center; }
.logo-text { font-size: 1.125rem; line-height: 1.1; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.version-text { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }

.toggle-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  border-right: 1px solid var(--bg-primary);
  margin-right: -1px;
}

.toggle-container:hover { background-color: var(--bg-hover); }

.toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toggle-btn:hover { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.toggle-text { font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.sidebar.collapsed .toggle-container { padding-left: 1.25rem; justify-content: flex-start; }

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  padding-left: 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-item:hover { background-color: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background-color: var(--primary-color); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2); }
.nav-icon { flex-shrink: 0; width: 22px; display: flex; justify-content: center; }
.nav-text { font-size: 0.875rem; }
.sidebar.collapsed .nav-item { justify-content: flex-start; padding-left: 1.25rem; }
.sidebar.collapsed .nav-icon { margin: 0; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
}

/* ============================================================
   HEADER (Header.vue)
   ============================================================ */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
}

.header-content { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.header-left { display: flex; align-items: center; }
.company-info { display: flex; align-items: center; gap: 1rem; }
.title-block { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.company-logo { height: 32px; width: auto; object-fit: contain; }
.page-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }

.ws-health-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}

.ws-health-badge.status-ok { color: #059669; background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.35); }
.ws-health-badge.status-warning { color: #b45309; background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.35); }
.ws-health-badge.status-critical { color: #b91c1c; background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.35); }
.ws-health-badge.status-offline { color: #6b7280; background: rgba(107, 114, 128, 0.12); border-color: rgba(107, 114, 128, 0.35); }

.header-right { display: flex; align-items: center; gap: 1.25rem; }
.user-info-header { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.2; }
.user-name-header { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.user-email-header { font-size: 0.75rem; }

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.theme-toggle:hover { background: var(--bg-hover); }
.user-menu-container { position: relative; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  border: 2px solid transparent;
}

.avatar:hover, .avatar.active { box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--primary-color); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  padding: 0.5rem;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: slideIn 0.2s ease-out;
}

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

.dropdown-header { padding: 0.75rem 1rem; display: flex; flex-direction: column; max-width: 100%; overflow: hidden; }
.user-full-name { font-weight: 700; font-size: 0.875rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 0.5rem 0; }
.dropdown-section { padding: 0.5rem 1rem; }
.dropdown-section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); font-weight: 700; margin-bottom: 0.5rem; }
.theme-controls { display: flex; flex-direction: column; gap: 0.75rem; }

.theme-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.theme-mode-toggle:hover { background: var(--bg-hover); }
.color-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; }

.color-dot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.color-dot:hover { transform: scale(1.15); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-align: left;
}

.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.logout { color: var(--danger-color); }
.dropdown-item.logout:hover { background: rgba(239, 68, 68, 0.1); }

/* ============================================================
   LOGIN (LoginView.vue)
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background-image: url('https://webpresto.com.br/images/evochat/bg_login.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.login-sidebar {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 2.5rem 3.5rem;
  position: relative;
  z-index: 2;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.login-card { width: 100%; display: flex; flex-direction: column; gap: 1.5rem; }
.login-header { text-align: center; margin-bottom: 0.5rem; }
.login-logo { height: 80px; width: auto; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3)); }
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.75rem; }
.form-group label { font-size: 0.9rem; font-weight: 600; color: #f8fafc; letter-spacing: 0.025em; }

.dark-input { background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); color: white; padding: 0.875rem 1.25rem; font-size: 1rem; }
.dark-input::placeholder { color: rgba(255, 255, 255, 0.6); }
.dark-input:focus { background: rgba(255, 255, 255, 0.05); border-color: #0C668A; box-shadow: 0 0 0 4px rgba(12, 102, 138, 0.2); }

.btn-block {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1rem;
  background-color: #0C668A;
  border: none;
  box-shadow: 0 4px 15px rgba(12, 102, 138, 0.3);
  font-family: 'Space Grotesk', sans-serif;
}

.btn-block:hover { background-color: #09546d; }

.password-input-wrapper { position: relative; display: flex; align-items: center; }
.password-toggle {
  position: absolute;
  right: 1.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s;
}
.password-toggle:hover { color: white; }

.forgot-password-container { text-align: right; margin-top: -0.5rem; }
.forgot-password-link { color: #94a3b8; font-size: 0.8rem; text-decoration: none; transition: color 0.2s; }
.forgot-password-link:hover { color: white; }

.error-message {
  padding: 1rem;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.login-footer { margin-top: 2rem; text-align: center; opacity: 0.7; }

.forgot-header { margin-bottom: 0.5rem; }
.forgot-title { font-size: 1.25rem; font-weight: 700; color: #f8fafc; margin: 0 0 0.5rem 0; }
.forgot-subtitle { font-size: 0.85rem; color: #94a3b8; margin: 0; line-height: 1.5; }
.forgot-subtitle strong { color: #cbd5e1; }
.code-input { letter-spacing: 0.5em; font-size: 1.25rem; text-align: center; }
.back-link-container { text-align: center; margin-top: 0.25rem; }
.back-link { color: #94a3b8; font-size: 0.82rem; text-decoration: none; transition: color 0.2s; }
.back-link:hover { color: white; }
.success-container { text-align: center; padding: 1.5rem 0; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.success-icon { font-size: 2.5rem; }

@media (max-width: 640px) {
  .login-sidebar { max-width: 100%; padding: 2.5rem 1.5rem; background: rgba(15, 23, 42, 0.9); }
  .login-logo { height: 60px; }
}

/* ============================================================
   VERIFY EMAIL (VerifyEmailView.vue)
   ============================================================ */
.verify-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary, #0f172a);
  padding: 1rem;
}

.verify-card {
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.verify-logo { text-align: center; margin-bottom: 2rem; }
.verify-logo .logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.verify-form h2, .verify-state h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  margin: 0 0 0.4rem;
  text-align: center;
}

.subtitle { font-size: 0.9rem; color: var(--text-secondary, #94a3b8); text-align: center; margin-bottom: 1.5rem; }
.verify-state { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1rem 0; text-align: center; }
.verify-state p { color: var(--text-secondary, #94a3b8); font-size: 0.9rem; }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary, #94a3b8); margin-bottom: 0.4rem; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 0.9rem;
  background: var(--bg-tertiary, #0f172a);
  border: 1px solid var(--border-color, #334155);
  border-radius: 8px;
  color: var(--text-primary, #f1f5f9);
  font-size: 0.95rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.input-wrap input:focus { outline: none; border-color: #6366f1; }

.toggle-eye {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #94a3b8);
  padding: 0;
  display: flex;
  align-items: center;
}

.verify-card .btn-primary {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}
.verify-card .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.verify-card .btn-secondary {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--bg-tertiary, #0f172a);
  border: 1px solid var(--border-color, #334155);
  color: var(--text-primary, #f1f5f9);
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.verify-card .btn-secondary:hover { border-color: #6366f1; }
.spin { animation: spin 1s linear infinite; }

/* ===== Fase 2: Configuracoes / Unidades / Departamentos ===== */
.settings-content { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-card { padding: 2rem; }
.settings-card h2 { font-size: 1.25rem; font-weight: 600; margin: 0; }
.mb-1-5 { margin-bottom: 1.5rem; }

.textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
}
.help-text { margin-top: 0.35rem; }
.checkbox-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox { width: 1rem; height: 1rem; }
.time-inputs { display: flex; gap: 1rem; flex-wrap: wrap; }
.time-inputs .form-group { flex: 1; min-width: 140px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.success-message {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1rem;
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981; font-weight: 600;
  border-radius: var(--radius-md);
}
.actions { display: flex; justify-content: flex-end; gap: 0.75rem; }

.empty-state { padding: 3rem 2rem; text-align: center; }
.empty-state h3 { margin: 0 0 0.5rem; }
.table-container { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; }
.data-table tbody tr:hover { background-color: var(--bg-hover); }
.text-right { text-align: right !important; }
.unit-sigla { font-weight: 700; color: var(--primary-color); }
.unit-info { display: flex; flex-direction: column; }
.unit-name { font-weight: 600; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.alert-error { padding: 0.85rem 1rem; background-color: rgba(239,68,68,0.12); color: #ef4444; border-radius: var(--radius-md); margin-bottom: 1rem; }

/* ----------------------------- Fase 3.1: Conversas ----------------------------- */
.badge-neutral { background-color: rgba(148, 163, 184, 0.18); color: var(--text-secondary); }
.input-sm { padding: 0.4rem 0.6rem; font-size: 0.85rem; }

.conversations-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 220px);
  min-height: 420px;
  overflow: hidden;
  padding: 0;
}

.conv-list-pane {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.conv-filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}
.conv-filters .input { flex: 1; }

.conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.conv-item {
  display: block;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
}
.conv-item:hover { background-color: var(--bg-hover); }
.conv-item.active { background-color: var(--bg-hover); border-left: 3px solid var(--primary-color); }
.conv-item-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.conv-item-id { font-weight: 600; font-size: 0.9rem; }
.conv-item-meta { display: flex; justify-content: space-between; margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-secondary); }
.conv-empty { padding: 1.5rem 0.85rem; color: var(--text-secondary); font-size: 0.9rem; text-align: center; }

.conv-thread-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.thread-placeholder { align-items: center; justify-content: center; }

.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.thread-title { font-size: 1rem; margin: 0; }

.thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.msg {
  max-width: 70%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  position: relative;
}
.msg-entrada { align-self: flex-start; background-color: var(--bg-secondary); border: 1px solid var(--border-color); }
.msg-saida { align-self: flex-end; background-color: var(--primary-color); color: #fff; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.msg-time { display: block; margin-top: 0.25rem; font-size: 0.7rem; opacity: 0.75; text-align: right; }
.thread-empty-state, .thread-placeholder p { text-align: center; padding: 2rem; }

/* ----------------------------- Fase 3.2: Relatorios ----------------------------- */
.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.filter-group { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-group label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.filter-actions { justify-content: flex-end; }

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
}
.summary-value { font-size: 1.75rem; font-weight: 700; color: var(--primary-color); }
.summary-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

@media (max-width: 720px) {
  .report-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ----------------------------- Fase 3.3: WhatsApp ----------------------------- */
.alert-info {
  padding: 0.9rem 1.1rem;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.data-table code { font-family: monospace; font-size: 0.82rem; color: var(--text-primary); }

/* ----------------------------- Fase 3.4: Envio ----------------------------- */
.thread-compose {
  display: flex;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
}
.thread-compose .input { flex: 1; }
.compose-error { margin: 0 1.25rem 0.5rem; }

/* ----------------------------- Fase 4.1: Dashboard ----------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.dashboard-block { padding: 1.25rem; }
.dashboard-block-wide { grid-column: 1 / -1; }
.dashboard-block-title { font-size: 0.95rem; margin: 0 0 1rem; color: var(--text-primary); }

.bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.bar-label { width: 120px; font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 10px; background-color: var(--bg-secondary); border-radius: 9999px; overflow: hidden; }
.bar-fill { height: 100%; background-color: var(--primary-color); border-radius: 9999px; }
.bar-value { width: 36px; text-align: right; font-size: 0.82rem; font-weight: 600; }

.peak-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 0.5rem; }
.peak-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.peak-bar { width: 100%; min-height: 2px; background-color: var(--primary-color); border-radius: 3px 3px 0 0; }
.peak-hour { font-size: 0.6rem; color: var(--text-light); margin-top: 0.25rem; }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ----------------------------- Fase 4.3: Sandbox ----------------------------- */
.mt-1-5 { margin-top: 1.5rem; }

/* ----------------------------- Embedded Signup ----------------------------- */
.embedded-signup-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.embedded-signup-row p { margin: 0.25rem 0 0; }
#embedded-signup-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
#embedded-signup-status:empty { display: none; }
