:root {
  /* Paleta Corporativa Oficial MonkeyGru Suite: Dark & Amber */
  --bg-main: #09090b;
  --bg-card: #18181b;
  --bg-card-hover: #222226;
  --bg-subtle: #27272a;
  --border-subtle: #27272a;
  --border-light: #3f3f46;
  --border-focus: #f59e0b;
  
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  
  --brand-primary: #f59e0b;
  --brand-hover: #fbbf24;
  --brand-dark: #d97706;
  --brand-gradient: linear-gradient(135deg, #fbbf24, #d97706);
  --brand-shadow: 0 4px 18px rgba(245, 158, 11, 0.28);
  --brand-glow: 0 0 25px rgba(245, 158, 11, 0.2);

  --accent-primary: #f59e0b;
  --accent-primary-hover: #fbbf24;
  --accent-secondary: #d97706;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.28);
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.28);
  
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.28);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-hover: 0 16px 36px -10px rgba(245, 158, 11, 0.15);

  --transition-fast: 0.18s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(at 15% 15%, rgba(245, 158, 11, 0.05) 0px, transparent 55%),
    radial-gradient(at 85% 85%, rgba(217, 119, 6, 0.04) 0px, transparent 55%);
  background-attachment: fixed;
}

/* Utilitários */
.hidden { display: none !important; }
.font-mono { font-family: var(--font-mono); }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.90rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #09090b;
  box-shadow: var(--brand-shadow);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.38);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: var(--danger-bg);
  color: #f87171;
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 6px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.74rem;
  border-radius: 4px;
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.25s ease-out;
  transition: all 0.2s ease;
}

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

.toast-success { border-color: var(--success); }
.toast-warning { border-color: var(--warning); }
.toast-error { border-color: var(--danger); }
.toast-info { border-color: var(--brand-primary); }

/* ================================================= */
/* TELA DE AUTENTICAÇÃO / LOGIN CORPORATIVO OFICIAL  */
/* ================================================= */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-gradient);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.brand-hero {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand-gradient);
  color: #09090b;
  font-weight: 900;
  font-size: 1.5rem;
  box-shadow: var(--brand-shadow);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.brand-title span {
  color: var(--brand-primary);
  font-weight: 800;
}

.brand-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.form-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 4px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.input-group input,
.form-select,
.form-textarea {
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  width: 100%;
}

.input-group input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrapper input {
  padding-right: 42px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
}

.link-forgot {
  font-size: 0.80rem;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.link-forgot:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.badge-2fa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  padding: 4px 10px;
  border-radius: 9999px;
  width: fit-content;
  margin-bottom: 6px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-group input {
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* ================================================= */
/* PORTAL PRINCIPAL & CABEÇALHO OFICIAL              */
/* ================================================= */
.portal-header {
  background: rgba(9, 9, 11, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-container {
  max-w: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: #09090b;
  font-weight: 900;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-suite-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.brand-suite-title strong {
  color: var(--brand-primary);
}

.brand-suite-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.user-role-badge.role-master {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.25));
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.portal-main {
  max-w: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  min-height: calc(100vh - 140px);
}

.portal-welcome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.greeting-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.greeting-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================= */
/* DASHBOARD DO ADMIN_MASTER (SUITE GOVERNANCE)      */
/* ================================================= */
.admin-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  overflow-x: auto;
}

.admin-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card);
}

.admin-tab-btn.active {
  background: var(--bg-card);
  color: var(--brand-primary);
  border-color: var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* KPIs Consolidados */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-primary);
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.metric-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Tabelas Administrativas */
.admin-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.table-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.table-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-search-input {
  max-width: 240px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.custom-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Cards de Produtos Oficiais da Suite */
.products-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.product-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}

.product-admin-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.product-admin-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.product-admin-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-admin-info h3 {
  font-size: 1.10rem;
  font-weight: 800;
  color: #ffffff;
}

.product-admin-info p {
  font-size: 0.80rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.product-admin-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.product-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
}

.product-meta-row strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* ================================================= */
/* CARDS DE CLIENTE / ESTABELECIMENTOS LICENCIADOS   */
/* ================================================= */
.establishments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.est-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}

.est-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.est-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.est-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--brand-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.est-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.est-info {
  flex: 1;
  min-width: 0;
}

.est-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.est-commercial {
  font-size: 0.80rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.est-locations-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.est-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.est-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.products-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 12px;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.product-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.badge-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.badge-active {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #34d399;
}

.badge-trial {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #fbbf24;
}

.badge-suspended {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: #f87171;
}

/* Modais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-dialog {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.modal-subtitle {
  font-size: 0.80rem;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #ffffff;
}

.portal-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* Loading Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.90rem;
}

/* ========================================================================= */
/* MÓDULO CRM GLOBAL — DESIGN SYSTEM OFICIAL (DARK & AMBER / SLATE)          */
/* ========================================================================= */

.crm-subnav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.crm-subnav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.crm-subnav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.crm-subnav-btn.active {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.crm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  background: rgba(24, 24, 27, 0.6);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.crm-filter-bar .search-input {
  flex: 1;
  min-width: 220px;
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 0.85rem;
}

.crm-filter-bar select {
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-main);
  font-size: 0.85rem;
}

.crm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-vip {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-regular {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-new {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-highticket {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-inactive {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Status de Leads */
.badge-lead-new { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-lead-contacted { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-lead-in_progress { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-lead-converted { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-lead-discarded { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Status da Fila WhatsApp */
.badge-wa-pending { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.badge-wa-opened { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); font-weight: 800; }
.badge-wa-sent { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-wa-failed { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-wa-cancelled { background: rgba(71, 85, 105, 0.2); color: #64748b; border: 1px solid rgba(71, 85, 105, 0.3); }

/* Grid de Segmentos */
.segment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.segment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segment-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.segment-card.selected {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.05);
}

/* Cashback Pill */
.cashback-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.82rem;
}

.cashback-available {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.cashback-locked {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Detalhe do Cliente */
.customer-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .customer-detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-section {
  background: rgba(9, 9, 11, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.detail-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.detail-prop-row:last-child {
  border-bottom: none;
}

.detail-prop-label {
  color: var(--text-muted);
}

.detail-prop-val {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

.status-callout-opened {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #fde68a;
  line-height: 1.5;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .crm-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .crm-subnav {
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

