/* ==========================================================================
   NEXUX HUB — PAINEL ADMINISTRATIVO & GESTÃO SAAS
   Design System Oficial Dark & Gold (Espacial Luxo)
   Layout 100% Responsivo: Desktop Fixo | Mobile/Tablet Drawer & Bottom Bar
   ========================================================================== */

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

:root {
  /* 1. Cores de Superfície & Fundo Preto Absoluto Espacial */
  --admin-bg: #06080E;
  --admin-bg-darker: #030508;
  --admin-sidebar-bg: #040711;
  --admin-topbar-bg: rgba(6, 8, 14, 0.92);
  --admin-card-bg: #0B1220;
  --admin-card-surface: #0D1527;
  --admin-card-hover: #10192C;
  --admin-card-elevated: #131E35;
  
  /* 2. Bordas com Baixa Opacidade Dourada / Glassmorphism */
  --admin-border: rgba(216, 180, 90, 0.15);
  --admin-border-subtle: rgba(216, 180, 90, 0.08);
  --admin-border-gold: rgba(216, 180, 90, 0.35);
  --admin-border-gold-strong: rgba(240, 217, 140, 0.55);
  --admin-border-focus: #E5B54F;

  /* 3. Paleta Ouro Metálico Oficial Nexux */
  --gold-light: #f0d98c;
  --gold-primary: #E5B54F;
  --gold-medium: #D49E35;
  --gold-deep: #B88222;
  --gold-bronze: #946800;
  --gold-glow: rgba(216, 180, 90, 0.35);
  --gold-glow-soft: rgba(240, 217, 140, 0.18);
  --gold-glow-intense: rgba(229, 181, 79, 0.6);

  /* 4. Gradientes Oficiais */
  --grad-gold-metallic: linear-gradient(135deg, #E5B54F 0%, #D49E35 50%, #B88222 100%);
  --grad-gold-light: linear-gradient(135deg, #fff2be 0%, #f0d98c 50%, #d8b45a 100%);
  --grad-gold-card: linear-gradient(180deg, rgba(13, 21, 39, 0.95) 0%, rgba(11, 18, 32, 0.98) 100%);
  --grad-dark-glass: linear-gradient(135deg, rgba(216, 180, 90, 0.08) 0%, rgba(11, 18, 32, 0.85) 100%);

  /* 5. Paleta Azul Elétrico / 3D Metálico Oficial NEXUX & Tecnologia */
  --blue-neon-light: #00F0FF;
  --blue-neon-bright: #00D5FF;
  --blue-electric-primary: #0072FF;
  --blue-electric-deep: #0038A8;
  --blue-electric-dark: #002277;
  --grad-blue-3d: linear-gradient(180deg, #00F0FF 0%, #0072FF 50%, #002277 100%);
  --grad-gold-3d: linear-gradient(180deg, #FFE885 0%, #E5A910 50%, #7A4B00 100%);
  --blue-glow: rgba(0, 114, 255, 0.35);
  --blue-glass: rgba(0, 114, 255, 0.15);
  --blue-border: rgba(0, 114, 255, 0.4);

  --neon-cyan: #0072FF;
  --neon-cyan-soft: rgba(0, 114, 255, 0.15);
  --neon-magenta: #f72585;
  --neon-purple: #7209b7;
  --grad-nexus: linear-gradient(135deg, #00F0FF 0%, #0072FF 50%, #7209b7 100%);

  /* 6. Cores Semânticas de Status */
  --status-active-bg: rgba(16, 185, 129, 0.15);
  --status-active-text: #34d399;
  --status-active-border: rgba(16, 185, 129, 0.35);

  --status-trial-bg: rgba(216, 180, 90, 0.15);
  --status-trial-text: #f0d98c;
  --status-trial-border: rgba(216, 180, 90, 0.35);

  --status-expired-bg: rgba(239, 68, 68, 0.15);
  --status-expired-text: #f87171;
  --status-expired-border: rgba(239, 68, 68, 0.35);

  --status-inactive-bg: rgba(148, 163, 184, 0.1);
  --status-inactive-text: #94a3b8;
  --status-inactive-border: rgba(148, 163, 184, 0.2);

  /* 7. Tipografia */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-main: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  --text-gold: #f0d98c;

  /* 8. Dimensões */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 70px;
  --topbar-height-mobile: 60px;
  --bottom-nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE GLOBAL
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--admin-bg);
}

body {
  font-family: var(--font-body);
  background-color: var(--admin-bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Canvas de Fundo de Partículas & Rede Dourada */
#nexus-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* Glow Orbs Orbitais de Fundo */
.bg-glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
  will-change: transform;
}

.orb-1 {
  top: -5%;
  left: 5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(216, 180, 90, 0.12) 0%, transparent 70%);
}

.orb-2 {
  top: 35%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(184, 134, 11, 0.10) 0%, transparent 70%);
}

.orb-3 {
  bottom: 5%;
  left: 15%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.06) 0%, transparent 70%);
}

/* ==========================================================================
   TELA DE LOGIN (ACESSO RESTRITO)
   ========================================================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, #0d1527 0%, #06080E 100%);
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--admin-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--admin-border-gold);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.25rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(216, 180, 90, 0.18), inset 0 1px 0 rgba(240, 217, 140, 0.25);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-gold-metallic);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.4;
}

/* ==========================================================================
   ESTRUTURA PRINCIPAL DO LAYOUT (DESKTOP PADRÃO)
   ========================================================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Sidebar Fixa Desktop */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
  background: rgba(4, 7, 17, 0.7);
}

/* Botão Fechar Sidebar Mobile (Oculto no Desktop) */
.sidebar-close-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ff6b6b;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Botão Hambúrguer Topbar Mobile (Oculto no Desktop) */
.mobile-menu-toggle-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.mobile-menu-toggle-btn:hover,
.mobile-menu-toggle-btn:active {
  background: rgba(216, 180, 90, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

/* Backdrop Escuro Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.sidebar-nav {
  flex-grow: 1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  position: relative;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(216, 180, 90, 0.06);
  color: #ffffff;
  border-color: rgba(216, 180, 90, 0.15);
}

.nav-item.active {
  background: rgba(216, 180, 90, 0.12);
  color: var(--gold-light);
  border-color: var(--admin-border-gold);
  font-weight: 700;
  box-shadow: 0 0 20px rgba(216, 180, 90, 0.15), inset 0 1px 0 rgba(240, 217, 140, 0.2);
}

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

.nav-badge-count {
  margin-left: auto;
  background: var(--gold-primary);
  color: #06080E;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  line-height: 1;
  box-shadow: 0 0 10px rgba(229, 181, 79, 0.4);
}

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  background: rgba(4, 7, 17, 0.7);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.25rem;
  transition: var(--transition);
}

.sidebar-user-card:hover {
  background: rgba(216, 180, 90, 0.06);
  border-color: var(--admin-border-gold);
}

/* Área de Conteúdo Principal (Desktop: com margem esquerda) */
.admin-main-wrapper {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  transition: margin-left 0.25s ease, width 0.25s ease;
  position: relative;
  z-index: 1;
}

/* Topbar Sticky */
.admin-topbar {
  height: var(--topbar-height);
  background: var(--admin-topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--admin-border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.topbar-logo-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.header-logo-wordmark {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
  user-select: none;
}

@media (min-width: 769px) {
  .header-logo-wordmark {
    height: 32px;
  }
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-root {
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.breadcrumb-separator {
  color: var(--text-dark);
  font-size: 0.75rem;
}

.breadcrumb-current {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* User Profile & Dropdown */
.user-profile-dropdown {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.user-profile-btn:hover {
  background: rgba(216, 180, 90, 0.08);
  border-color: var(--admin-border-gold);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-gold-metallic);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #06080E;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(229, 181, 79, 0.4);
}

.dropdown-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-profile-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(216, 180, 90, 0.15);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

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

.dropdown-header {
  padding: 0.6rem 0.85rem;
}

.dropdown-divider {
  height: 1px;
  background: var(--admin-border);
  margin: 0.35rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: rgba(216, 180, 90, 0.08);
  color: var(--gold-light);
}

.dropdown-item.text-danger {
  color: #f87171;
}

.dropdown-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ff6b6b;
}

/* ==========================================================================
   ENQUADRAMENTO DAS TELAS & CONTEÚDO PRINCIPAL (DESKTOP)
   ========================================================================== */

.admin-content {
  padding: 2rem 2.5rem;
  flex-grow: 1;
  min-width: 0;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.view-section {
  display: none;
  width: 100%;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease;
  width: 100%;
}

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

/* ==========================================================================
   DASHBOARD — GESTÃO DE VENCIMENTOS (PADRÃO CARDS ORION / PRODUTO)
   ========================================================================== */

.dash-vencimentos-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

/* 1. Cards Compactos & Superfícies no Padrão Oficial */
.dash-card-compact {
  background: var(--admin-card-bg) !important;
  border: 1px solid var(--admin-border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1.15rem 1.4rem !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(240, 217, 140, 0.12) !important;
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.dash-card-compact:hover {
  transform: translateY(-3px) !important;
  background: var(--admin-card-hover) !important;
  border-color: var(--admin-border-gold) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(216, 180, 90, 0.15), inset 0 1px 0 rgba(240, 217, 140, 0.25) !important;
}

/* Variação 1: Card Vencidos */
.dash-card-compact.card-vencidos {
  border-color: rgba(239, 68, 68, 0.35) !important;
  border-left: 4px solid #ef4444 !important;
}

.dash-card-compact.card-vencidos:hover {
  border-color: rgba(239, 68, 68, 0.7) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(239, 68, 68, 0.25) !important;
}

/* Variação 2: Card Vencimentos Hoje */
.dash-card-compact.card-today {
  border-color: rgba(229, 181, 79, 0.35) !important;
  border-left: 4px solid var(--gold-primary) !important;
}

.dash-card-compact.card-today:hover {
  border-color: var(--gold-primary) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(229, 181, 79, 0.25) !important;
}

/* Variação 3: Card Vencimentos em 3 Dias */
.dash-card-compact.card-soon {
  border-color: rgba(212, 158, 53, 0.35) !important;
  border-left: 4px solid var(--gold-medium) !important;
}

.dash-card-compact.card-soon:hover {
  border-color: var(--gold-medium) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 158, 53, 0.25) !important;
}

.dash-expired-left {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.dash-card-text-wrap {
  min-width: 0 !important;
  flex: 1 !important;
  padding-right: 0.75rem !important;
}

.dash-expired-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-compact-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-compact-icon.icon-today {
  background: rgba(229, 181, 79, 0.15);
  border: 1px solid rgba(229, 181, 79, 0.4);
  color: var(--gold-light);
}

.dash-compact-icon.icon-soon {
  background: rgba(212, 158, 53, 0.15);
  border: 1px solid rgba(212, 158, 53, 0.4);
  color: var(--gold-primary);
}

.dash-expired-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dash-expired-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.3px;
}

.dash-expired-title.title-today { color: var(--gold-light); }
.dash-expired-title.title-soon { color: var(--gold-primary); }

.dash-expired-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  line-height: 1.2;
}

.dash-compact-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  line-height: 1.2;
}

.dash-compact-badge.badge-today {
  background: var(--gold-primary);
  color: #06080E;
}

.dash-compact-badge.badge-soon {
  background: var(--gold-medium);
  color: #06080E;
}

.dash-expired-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.dash-expired-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dash-expired-count-large {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  color: #ef4444;
}

.dash-compact-count-large {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
}

.dash-compact-count-large.count-today { color: var(--gold-light); }
.dash-compact-count-large.count-soon { color: var(--gold-primary); }

/* 2. Grid dos 2 Cards de Vencimento */
.dashboard-vencimentos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
}

/* 3. Barra Resumo de Métricas no Rodapé da Dashboard */
.dash-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(240, 217, 140, 0.08);
  width: 100%;
  box-sizing: border-box;
}

.dash-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.dash-summary-item:hover {
  background: rgba(216, 180, 90, 0.06);
}

.dash-summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dash-summary-val {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

.dash-summary-val.text-success { color: #34d399; }
.dash-summary-val.text-cyan { color: var(--gold-light); }
.dash-summary-val.text-magenta { color: var(--gold-primary); }

/* 4. Tela de Drill-Down (Listagem Filtrada Dedicada) */
.dash-drilldown-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  animation: fadeIn 0.25s ease;
}

/* Barra de Topo Compacta em Linha Única */
.drilldown-compact-topbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
}

.drilldown-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.drilldown-back-btn:hover {
  background: rgba(216, 180, 90, 0.1);
  border-color: var(--admin-border-gold);
  color: var(--gold-light);
}

.drilldown-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.drilldown-main-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.drilldown-count-badge {
  background: rgba(216, 180, 90, 0.15);
  border: 1px solid var(--admin-border-gold);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

/* Filtro de Aplicativos em Menu Retrátil (Dropdown) */
.drilldown-dropdown-wrapper {
  position: relative;
  width: 100%;
}

.drilldown-dropdown-trigger {
  width: 100%;
  background: var(--admin-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.drilldown-dropdown-trigger:hover,
.drilldown-dropdown-wrapper.open .drilldown-dropdown-trigger {
  border-color: var(--admin-border-gold);
  background: var(--admin-card-hover);
  color: #ffffff;
}

.drilldown-dropdown-trigger-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.drilldown-dropdown-trigger-left svg {
  color: var(--gold-light);
  flex-shrink: 0;
}

.drilldown-dropdown-count-pill {
  background: rgba(216, 180, 90, 0.15);
  border: 1px solid var(--admin-border-gold);
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}

.drilldown-dropdown-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.drilldown-dropdown-wrapper.open .drilldown-dropdown-chevron {
  transform: rotate(180deg);
}

.drilldown-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border-gold);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 50;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(216, 180, 90, 0.15);
  max-height: 280px;
  overflow-y: auto;
  animation: fadeIn 0.15s ease;
}

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

.drilldown-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
}

.drilldown-dropdown-item:hover {
  background: rgba(216, 180, 90, 0.08);
  color: var(--gold-light);
}

.drilldown-dropdown-item.active {
  background: rgba(216, 180, 90, 0.15);
  color: var(--gold-light);
  font-weight: 700;
}

.drilldown-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.drilldown-item-badge {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.drilldown-dropdown-item.active .drilldown-item-badge {
  background: var(--gold-primary);
  color: #06080E;
  font-weight: 800;
}

/* Barra de Busca Compacta */
.drilldown-search-container {
  position: relative;
  width: 100%;
}

.drilldown-search-container svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-light);
}

.drilldown-search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  background: var(--admin-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.82rem;
  transition: var(--transition);
  outline: none;
}

.drilldown-search-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(229, 181, 79, 0.2);
}

.drilldown-search-input::placeholder {
  color: var(--text-dark);
}

/* Lista de Cards de Clientes Enxutos (2 Linhas / Foco Operacional) */
.drilldown-client-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.drilldown-client-card {
  background: var(--admin-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  width: 100%;
  box-sizing: border-box;
}

.drilldown-client-card:hover {
  background: var(--admin-card-hover);
  border-color: var(--admin-border-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(216, 180, 90, 0.12);
}

/* Linha Superior: Nome do Cliente + Badge App | Preço */
.drilldown-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.drilldown-card-client-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.drilldown-client-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.drilldown-client-card:hover .drilldown-client-name {
  color: var(--gold-light);
}

.drilldown-price-tag {
  color: var(--gold-light);
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

/* Linha Inferior: Data Vencimento | Ações Rápidas */
.drilldown-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.drilldown-due-date-text {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drilldown-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.drilldown-btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  cursor: pointer;
  transition: var(--transition);
}

.drilldown-btn-wa:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.drilldown-btn-renew {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--grad-gold-metallic);
  color: #06080E;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(229, 181, 79, 0.3);
}

.drilldown-btn-renew:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 15px rgba(229, 181, 79, 0.5);
  transform: translateY(-1px);
}

/* ==========================================================================
   TABELAS, PAINÉIS & FILTROS
   ========================================================================== */

.table-panel {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(240, 217, 140, 0.1);
  box-sizing: border-box;
}

.table-toolbar {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(11, 18, 32, 0.6);
  width: 100%;
  box-sizing: border-box;
}

.search-box {
  position: relative;
  min-width: 280px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gold-light);
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: rgba(4, 7, 17, 0.6);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px rgba(229, 181, 79, 0.25);
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-select {
  padding: 0.65rem 1rem;
  background: rgba(4, 7, 17, 0.6);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  transition: var(--transition);
  cursor: pointer;
}

.admin-select:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(229, 181, 79, 0.25);
}

/* Tabela Estilizada */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 1rem 1.25rem;
  background: rgba(4, 7, 17, 0.7);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 1.1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--admin-border-subtle);
  transition: background 0.15s ease;
  vertical-align: middle;
}

.admin-table tbody tr:hover td {
  background: rgba(216, 180, 90, 0.04);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.table-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

/* ==========================================================================
   METRICS GRIDS & CHARTS (ENQUADRAMENTO)
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
  width: 100%;
}

.metric-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(240, 217, 140, 0.1);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--admin-border-gold);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 20px rgba(216, 180, 90, 0.12);
}

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

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

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

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

.chart-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(240, 217, 140, 0.1);
  width: 100%;
  box-sizing: border-box;
}

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

.chart-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.chart-canvas-wrap {
  height: 240px;
  position: relative;
  width: 100%;
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR (MOBILE APP / OFICIAL NEXUX)
   ========================================================================== */

.admin-bottom-nav {
  display: none; /* Oculto no Desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(4, 7, 17, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--admin-border);
  align-items: center;
  justify-content: space-around;
  padding: 0 0.25rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 1000;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
}

.admin-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  padding: 0.4rem 0.2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 0;
}

.admin-bottom-nav .nav-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.admin-bottom-nav .nav-icon-wrapper svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-muted);
  transition: all 0.2s ease;
}

.admin-bottom-nav .nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1;
  font-size: 0.68rem;
}

.admin-bottom-nav .nav-item.active {
  color: var(--gold-light);
  font-weight: 700;
  background: rgba(216, 180, 90, 0.08);
}

.admin-bottom-nav .nav-item.active .nav-icon-wrapper svg {
  stroke: var(--gold-primary);
  transform: translateY(-2px);
  filter: drop-shadow(0 0 6px rgba(229, 181, 79, 0.5));
}

.admin-bottom-nav .nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--gold-primary);
}

.mobile-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  padding: 0.1rem 0.35rem;
  font-size: 0.6rem;
  min-width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-primary);
  color: #06080E;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(229, 181, 79, 0.5);
  border-radius: 999px;
}

/* ==========================================================================
   RESPONSIVIDADE: MOBILE & TABLET (DRAWER DESLIZANTE + LARGURA TOTAL 100%)
   ========================================================================== */

@media (max-width: 1024px) {
  /* 1. Sidebar NUNCA fica fixa ao lado do conteúdo no mobile/tablet */
  .admin-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #040711 !important;
    border-right: 1px solid var(--admin-border) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Quando o drawer for aberto via botão hambúrguer */
  .admin-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar-header {
    display: flex !important;
    padding: 0 1.25rem !important;
    height: var(--topbar-height-mobile) !important;
    justify-content: space-between !important;
    border-bottom: 1px solid var(--admin-border) !important;
  }

  .sidebar-close-btn {
    display: flex !important;
  }

  .sidebar-nav {
    padding: 1.25rem 1rem !important;
    align-items: stretch !important;
  }

  .admin-sidebar .nav-item {
    width: 100% !important;
    height: auto !important;
    padding: 0.85rem 1rem !important;
    justify-content: flex-start !important;
    border-radius: var(--radius-md) !important;
  }

  .admin-sidebar .nav-item span:not(.nav-badge-count) {
    display: inline-block !important;
    font-size: 0.9rem !important;
  }

  .admin-sidebar .nav-badge-count {
    position: static !important;
    margin-left: auto !important;
    padding: 0.18rem 0.55rem !important;
    font-size: 0.7rem !important;
  }

  .sidebar-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 1.25rem 1rem !important;
    align-items: stretch !important;
  }

  .sidebar-footer .adm-btn {
    width: 100% !important;
    height: auto !important;
    padding: 0.75rem 1rem !important;
    justify-content: flex-start !important;
  }

  .sidebar-footer .adm-btn span {
    display: inline-block !important;
  }

  /* 2. Main Wrapper Ocupa 100% da Largura da Tela no Mobile/Tablet */
  .admin-main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding-bottom: 0 !important;
  }

  /* Topbar Compacta no Mobile */
  .admin-topbar {
    height: var(--topbar-height-mobile) !important;
    padding: 0 1rem !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 90 !important;
    background: rgba(6, 8, 14, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    width: 100% !important;
  }

  .mobile-menu-toggle-btn {
    display: flex !important;
  }

  .topbar-logo-brand {
    display: flex !important;
  }

  .page-breadcrumb {
    display: none !important;
  }

  .user-info-text {
    display: none !important;
  }

  .user-profile-btn {
    padding: 0.25rem 0.5rem 0.25rem 0.25rem !important;
  }

  /* 3. Bottom Navigation Bar Visível no Rodapé */
  .admin-bottom-nav {
    display: flex !important;
  }

  /* 4. Enquadramento de Conteúdo em 100% no Mobile */
  .admin-content {
    padding: 1rem 1rem 5.5rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  .dash-vencimentos-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .dashboard-vencimentos-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 1rem !important;
  }

  .dash-summary-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
    gap: 0.75rem !important;
    margin-bottom: 1.5rem !important;
  }

  .metric-card {
    padding: 1rem !important;
    width: 100% !important;
  }

  .metric-value {
    font-size: 1.4rem !important;
  }

  .charts-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 1rem !important;
  }

  .chart-card {
    padding: 1rem !important;
    width: 100% !important;
  }

  .chart-canvas-wrap {
    height: 200px !important;
  }

  .table-panel {
    border-radius: var(--radius-md) !important;
    width: 100% !important;
  }

  .table-toolbar {
    padding: 1rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .table-toolbar > div {
    width: 100% !important;
  }

  .search-box {
    min-width: 100% !important;
    width: 100% !important;
  }

  .filters-group {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .filters-group .admin-select {
    width: 100% !important;
  }

  .dash-drilldown-container {
    width: 100% !important;
    max-width: 100% !important;
  }

  .drilldown-compact-topbar {
    width: 100% !important;
  }

  .drilldown-dropdown-wrapper {
    width: 100% !important;
  }

  .drilldown-search-container {
    width: 100% !important;
  }

  .drilldown-client-card {
    width: 100% !important;
  }

  .clients-apps-tabs-wrapper {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
}

/* 5. CELULAR PEQUENO (<= 480px) */
@media (max-width: 480px) {
  .dash-card-compact {
    padding: 0.95rem 1.1rem !important;
    gap: 0.75rem !important;
  }

  .dash-expired-title {
    font-size: 1.05rem !important;
  }

  .dash-expired-subtitle {
    font-size: 0.78rem !important;
    max-width: 80% !important;
  }

  .dash-expired-count-large,
  .dash-compact-count-large {
    font-size: 1.4rem !important;
  }

  .dash-summary-bar {
    grid-template-columns: 1fr 1fr !important;
  }

  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   BANNER FLUTUANTE DE INSTALAÇÃO PWA (PADRÃO COMANDRIX / ORION)
   ========================================================================== */

.nexux-pwa-card {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: var(--admin-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--admin-border-gold);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.15rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(216, 180, 90, 0.2);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.nexux-pwa-card.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nexux-pwa-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.nexux-pwa-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ff6b6b;
}

.nexux-pwa-content {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding-right: 1.5rem;
}

.nexux-pwa-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(216, 180, 90, 0.3);
  border: 1px solid var(--admin-border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040711;
}

.nexux-pwa-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nexux-pwa-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nexux-pwa-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  line-height: 1.2;
}

.nexux-pwa-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nexux-pwa-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nexux-pwa-btn-install {
  flex: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--grad-gold-metallic);
  color: #06080E;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(216, 180, 90, 0.3);
}

.nexux-pwa-btn-install:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(216, 180, 90, 0.5);
  transform: translateY(-1px);
}

.nexux-pwa-btn-dismiss {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nexux-pwa-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--admin-border-gold);
}

@media (max-width: 480px) {
  .nexux-pwa-card {
    bottom: 12px;
    width: calc(100% - 20px);
    padding: 1rem 1rem 0.95rem;
  }

  .nexux-pwa-content {
    gap: 0.75rem;
  }

  .nexux-pwa-icon-wrap {
    width: 42px;
    height: 42px;
  }

  .nexux-pwa-title {
    font-size: 0.95rem;
  }

  .nexux-pwa-desc {
    font-size: 0.75rem;
  }

  .nexux-pwa-actions {
    flex-direction: column-reverse;
    gap: 0.4rem;
  }

  .nexux-pwa-btn-install,
  .nexux-pwa-btn-dismiss {
    width: 100%;
    padding: 0.6rem;
  }
}

/* ==========================================================================
   MODAL: DETALHES DO CLIENTE (DESIGN SYSTEM OFICIAL & FULLSCREEN MOBILE)
   ========================================================================== */

.client-details-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 5, 8, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.client-details-overlay.open {
  opacity: 1;
  visibility: visible;
}

.client-details-box {
  background: #0B1220 !important;
  border: 1px solid rgba(229, 181, 79, 0.25) !important;
  border-radius: var(--radius-xl) !important;
  width: 100% !important;
  max-width: 580px !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 1.5rem !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(216, 180, 90, 0.15) !important;
  transform: scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto !important;
}

.client-details-overlay.open .client-details-box {
  transform: scale(1);
}

/* Topo do Modal */
.client-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.client-details-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.client-details-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.client-details-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.client-details-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ff6b6b;
}

/* Corpo do Modal */
.client-details-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Grid Limpo de Informações */
.client-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: #06080E;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.client-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.client-info-label {
  font-size: 0.72rem;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.client-info-val {
  font-size: 0.88rem;
  color: #ffffff;
  word-break: break-word;
}

.client-info-val.whitespace-nowrap {
  white-space: nowrap;
}

.client-phone-link {
  color: #34d399;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.client-phone-link:hover {
  color: #6ee7b7;
  text-decoration: underline;
}

/* Histórico de Atividades & Pagamentos */
.client-history-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.client-history-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.2px;
}

/* Rodapé: Grid Ergonômico de 4 Ações Rápidas */
.client-details-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.client-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.client-action-btn.btn-wa {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.client-action-btn.btn-wa:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.client-action-btn.btn-renew {
  background: var(--grad-gold-metallic);
  border: none;
  color: #06080E;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(229, 181, 79, 0.3);
}

.client-action-btn.btn-renew:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 15px rgba(229, 181, 79, 0.5);
  transform: translateY(-1px);
}

.client-action-btn.btn-suspend {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.client-action-btn.btn-suspend:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ffffff;
}

.client-action-btn.btn-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.client-action-btn.btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: var(--admin-border-gold);
}

/* Responsividade Mobile: 100% Fullscreen sem sobras */
@media (max-width: 768px) {
  .client-details-overlay {
    padding: 0 !important;
    background: #06080E !important;
  }

  .client-details-box {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    background: #06080E !important;
    padding: 1.25rem !important;
    box-shadow: none !important;
  }

  .client-info-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   LEADS / SOLICITAÇÕES — LAYOUT HÍBRIDO (TABELA DESKTOP VS CARDS MOBILE)
   ========================================================================== */

.leads-desktop-table-wrapper {
  display: block;
  width: 100%;
}

.leads-mobile-list {
  display: none;
  width: 100%;
}

@media (max-width: 768px) {
  .leads-desktop-table-wrapper {
    display: none !important;
  }

  .leads-mobile-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }
}

/* Card de Pedido no Mobile */
.lead-mobile-card {
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
}

.lead-mobile-card:hover,
.lead-mobile-card:active {
  border-color: rgba(229, 181, 79, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(229, 181, 79, 0.12);
}

.lead-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.lead-card-requester {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.lead-card-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lead-card-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.lead-card-app-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.lead-card-business {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.lead-card-status-wrap {
  flex-shrink: 0;
}

.lead-card-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.lead-card-info-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lead-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-card-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #25d366;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lead-card-btn-wa:hover {
  background: rgba(37, 211, 102, 0.22);
}

.lead-card-btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: var(--grad-gold-metallic);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lead-card-btn-approve:hover {
  filter: brightness(1.1);
}

.lead-card-btn-reject {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lead-card-btn-reject:hover {
  background: rgba(239, 68, 68, 0.2);
}

.lead-card-processed-label {
  font-size: 0.75rem;
  color: var(--text-dark);
  font-style: italic;
}

/* Modal Lead Details / Fullscreen Mobile */
.lead-details-overlay {
  padding: 1.5rem;
}

.lead-details-box {
  max-width: 580px;
  width: 100%;
  border-radius: var(--radius-xl);
  background: #0B1220;
  border: 1px solid rgba(229, 181, 79, 0.25);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(229, 181, 79, 0.1);
}

@media (max-width: 768px) {
  .lead-details-overlay {
    padding: 0 !important;
    background: #06080E !important;
  }

  .lead-details-box {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow-y: auto !important;
    background: #06080E !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   CLIENTES — LAYOUT HÍBRIDO (TABELA DESKTOP VS CARDS MOBILE)
   ========================================================================== */

.clients-desktop-table-wrapper {
  display: block;
  width: 100%;
}

.clients-mobile-list {
  display: none;
  width: 100%;
}

@media (max-width: 768px) {
  .clients-desktop-table-wrapper {
    display: none !important;
  }

  .clients-mobile-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }
}

/* Card de Cliente no Mobile */
.client-mobile-card {
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
}

.client-mobile-card:hover,
.client-mobile-card:active {
  border-color: rgba(229, 181, 79, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(229, 181, 79, 0.12);
}

.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.client-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.client-card-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.client-card-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: color 0.15s ease;
}

.client-mobile-card:hover .client-card-name {
  color: var(--gold-light);
}

.client-card-app-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.client-card-business {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.client-card-status-wrap {
  flex-shrink: 0;
}

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.client-card-due-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.client-card-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.client-card-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #25d366;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.client-card-btn-wa:hover {
  background: rgba(37, 211, 102, 0.22);
}

.client-card-btn-renew {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: var(--grad-gold-metallic);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.client-card-btn-renew:hover {
  filter: brightness(1.1);
}

/* ==========================================================================
   CATÁLOGO DE APPS & TELA DE CADASTRO/EDIÇÃO POR ABAS (FULLSCREEN)
   ========================================================================== */

/* 1. Catálogo de Aplicativos (Cards Compactos e Diretos ao Ponto) */
#apps-crud-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  width: 100% !important;
}

.app-compact-card {
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 0.9rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  width: 100%;
}

.app-compact-card:hover {
  border-color: rgba(229, 181, 79, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(229, 181, 79, 0.1);
}

.app-compact-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.app-compact-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 114, 255, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 114, 255, 0.25);
  flex-shrink: 0;
}

.app-compact-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.app-compact-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-compact-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-compact-clients-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.app-compact-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.app-compact-price {
  color: var(--gold-light);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.app-compact-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.6rem;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.app-compact-edit-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(229, 181, 79, 0.4);
  color: #ffffff;
}

/* 2. Tela de Cadastro/Edição de App (Abas Fullscreen) */
.app-form-overlay {
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(8px);
}

.app-form-drawer {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  background: #06080E !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 100 !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

.app-form-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #0B1220;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  gap: 0.75rem;
}

.app-form-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.app-form-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(229, 181, 79, 0.4);
  color: #ffffff;
}

.app-form-header-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .app-form-header-title {
    font-size: 1.1rem;
  }
}

.app-form-save-btn {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0.4rem 0.85rem !important;
  border-radius: 0.75rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.app-form-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: #070B14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.app-form-tabs-bar::-webkit-scrollbar {
  height: 3px;
}

.app-form-tabs-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

.app-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.app-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.app-tab-btn.active {
  color: #ffffff;
  background: rgba(229, 181, 79, 0.12);
  border-color: rgba(229, 181, 79, 0.35);
  box-shadow: 0 0 10px rgba(229, 181, 79, 0.1);
}

.app-form-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: #06080E;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-tab-pane {
  display: none;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.15s ease;
}

.app-tab-pane.active {
  display: flex;
}

.app-form-input-card {
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

@media (max-width: 768px) {
  .app-form-header-bar {
    padding: 0.75rem 1rem;
  }

  .app-form-tabs-bar {
    padding: 0.5rem 1rem;
  }

  .app-form-content-area {
    padding: 1rem;
  }
}

/* ==========================================================================
   MÓDULO FINANCEIRO COMPLETO (FLUXO DE CAIXA, RESUMO & LANÇAMENTOS)
   ========================================================================== */

/* 1. Header e Navegação de Abas Principais Centralizadas */
.fin-top-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.fin-title-block {
  text-align: center;
  margin-bottom: 0.15rem;
}

.fin-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.fin-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0 0;
}

.fin-main-tabs-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.fin-main-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  padding: 0.25rem;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fin-tab-pill {
  padding: 0.45rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  letter-spacing: 0.04em;
}

.fin-tab-pill:hover {
  color: #ffffff;
}

.fin-tab-pill.active {
  color: #06080E;
  background: linear-gradient(135deg, #FFE885 0%, #E5B54F 50%, #C89116 100%);
  box-shadow: 0 2px 10px rgba(229, 181, 79, 0.3);
}

/* 2. Filtro Temporal Secundário (Segmented Control Centralizado) */
.fin-period-control-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.fin-period-control {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.65rem;
  padding: 0.2rem;
  max-width: 320px;
  width: 100%;
  justify-content: space-around;
}

.fin-period-btn {
  flex: 1;
  text-align: center;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fin-period-btn:hover {
  color: #ffffff;
}

.fin-period-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 700;
}

/* 3. Card de Resumo Financeiro (Display Superior) */
.fin-summary-card {
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.fin-summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(229, 181, 79, 0.6), transparent);
}

.fin-summary-top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 1rem;
}

.fin-nav-navigator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto;
}

.fin-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fin-nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(229, 181, 79, 0.35);
}

.fin-nav-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  min-width: 140px;
  text-align: center;
}

.fin-add-circle-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE885 0%, #E5B54F 50%, #C89116 100%);
  color: #06080E;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(229, 181, 79, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
  flex-shrink: 0;
}

.fin-add-circle-btn:hover {
  transform: translateY(-50%) scale(1.06);
  filter: brightness(1.1);
}

.fin-add-circle-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* 4. Medidor Circular Central (Donut Chart Expandido & Harmônico) */
.fin-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0 1.25rem 0;
  position: relative;
}

.fin-gauge-svg-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fin-gauge-center-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  max-width: 170px;
  pointer-events: none;
}

.fin-gauge-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.fin-gauge-val {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #34d399;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.15);
}

.fin-gauge-sub {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  font-weight: 600;
  color: #94a3b8;
}

/* 5. Grid de Métricas Inferiores (OBRIGATÓRIO 3 COLUNAS LADO A LADO) */
.fin-metrics-grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.45rem !important;
  padding-top: 1rem !important;
  margin-top: 0.5rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.fin-metric-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 0.5rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
  min-width: 0;
}

.fin-metric-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fin-metric-amount {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.fin-metric-count {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 6. Listagem de Lançamentos Enxuta */
.fin-entries-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.fin-search-bar {
  flex: 1;
  min-width: 180px;
  position: relative;
  display: flex;
  align-items: center;
}

.fin-search-bar input {
  width: 100%;
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  font-size: 0.82rem;
  color: #ffffff;
  outline: none;
  transition: border-color 0.15s ease;
}

.fin-search-bar input:focus {
  border-color: rgba(229, 181, 79, 0.45);
}

.fin-search-bar svg {
  position: absolute;
  left: 0.75rem;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.fin-entries-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.fin-date-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.fin-date-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fin-entry-card {
  background: #0B1220;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.fin-entry-card:hover {
  border-color: rgba(229, 181, 79, 0.45);
  background: #0e172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.fin-entry-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.fin-entry-line-1 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.fin-entry-time {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.fin-entry-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.15s ease;
}

.fin-entry-title:hover {
  color: var(--gold-light);
}

.fin-entry-line-2 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fin-entry-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.08rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
}

.fin-entry-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.55rem;
  border-radius: 0.5rem;
  background: rgba(0, 114, 255, 0.12);
  color: #00F0FF;
  border: 1px solid rgba(0, 114, 255, 0.3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.fin-entry-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.fin-entry-amount-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.fin-entry-amount {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.1;
}

.fin-entry-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.fin-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fin-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.fin-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

/* 7. Modal de Detalhes do Lançamento */
.fin-details-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 0.5rem;
}

.fin-details-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.fin-details-val {
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 600;
  text-align: right;
}

/* Modais de Categorias */
.fin-category-tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.fin-color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fin-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

/* Botão Gerenciar Categorias (Pill Roxo/Azul Metálico) */
.fin-manage-cat-pill-btn {
  background: rgba(0, 114, 255, 0.15);
  color: #00F0FF;
  border: 1px solid rgba(0, 114, 255, 0.4);
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.fin-manage-cat-pill-btn:hover {
  background: rgba(0, 114, 255, 0.3);
  color: #ffffff;
  border-color: #00F0FF;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

/* Gaveta de Gerenciamento Inline de Categorias */
.fin-inline-cat-drawer {
  background: #070C15;
  border: 1px solid rgba(0, 114, 255, 0.3);
  border-radius: 0.85rem;
  padding: 0.85rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  animation: finFadeIn 0.2s ease-out;
}

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

.fin-inline-cat-add-row {
  display: flex;
  gap: 0.5rem;
}

.fin-inline-cat-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 140px;
  overflow-y: auto;
  padding: 0.2rem 0;
}

.fin-inline-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fin-inline-cat-tag-del {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 0.8rem;
  line-height: 1;
}

.fin-inline-cat-tag-del:hover {
  opacity: 1;
  color: #ef4444;
}

.fin-inline-cat-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.15s ease;
}

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

/* Pills de Seleção de Período de Assinatura */
.fin-period-pill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.fin-period-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-radius: 0.75rem;
  padding: 0.6rem 0.35rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.fin-period-pill:hover {
  background: rgba(0, 114, 255, 0.1);
  color: #ffffff;
  border-color: rgba(0, 114, 255, 0.3);
}

.fin-period-pill.active {
  background: rgba(0, 114, 255, 0.2) !important;
  border-color: #0072FF !important;
  color: #00F0FF !important;
  box-shadow: 0 0 10px rgba(0, 114, 255, 0.35) !important;
}

#client-create-modal .admin-modal-box,
#fin-entry-modal .admin-modal-box,
#fin-fixed-modal .admin-modal-box,
#fin-daily-modal .admin-modal-box,
#fin-details-modal .admin-modal-box {
  background: #0B1220;
  border: 1px solid rgba(229, 181, 79, 0.25);
  border-radius: 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
  .fin-summary-card {
    padding: 1rem 0.85rem;
  }

  .fin-gauge-svg-wrap {
    width: 200px;
    height: 200px;
  }

  .fin-gauge-val {
    font-size: 1.5rem;
  }

  /* Modais 100% Fullscreen e Sólidos no Mobile */
  #client-create-modal.open,
  #user-create-modal.open,
  #fin-entry-modal.open,
  #fin-fixed-modal.open,
  #fin-daily-modal.open,
  #fin-details-modal.open {
    padding: 0 !important;
    background: #06080E !important;
  }

  #client-create-modal .admin-modal-box,
  #user-create-modal .admin-modal-box,
  #fin-entry-modal .admin-modal-box,
  #fin-fixed-modal .admin-modal-box,
  #fin-daily-modal .admin-modal-box,
  #fin-details-modal .admin-modal-box {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    background: #06080E !important;
    padding: 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  #client-create-modal .admin-modal-header,
  #user-create-modal .admin-modal-header,
  #fin-entry-modal .admin-modal-header,
  #fin-fixed-modal .admin-modal-header,
  #fin-daily-modal .admin-modal-header,
  #fin-details-modal .admin-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
    flex-shrink: 0;
  }

  #client-create-modal .admin-modal-body,
  #user-create-modal .admin-modal-body,
  #fin-entry-modal .admin-modal-body,
  #fin-fixed-modal .admin-modal-body,
  #fin-daily-modal .admin-modal-body,
  #fin-details-modal .admin-modal-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
  }

  #client-create-modal .admin-modal-footer,
  #user-create-modal .admin-modal-footer,
  #fin-entry-modal .admin-modal-footer,
  #fin-fixed-modal .admin-modal-footer,
  #fin-daily-modal .admin-modal-footer,
  #fin-details-modal .admin-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.85rem;
    margin-top: auto;
    flex-shrink: 0;
  }
}

/* ==========================================================================
   PAINEL ADMINISTRATIVO (GESTÃO DE USUÁRIOS & INSTÂNCIAS WHATSAPP)
   ========================================================================== */

.user-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.user-page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.user-page-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(229, 181, 79, 0.12);
  color: var(--gold-light);
  border: 1px solid rgba(229, 181, 79, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0 0;
}

.user-btn-create {
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #FFE885 0%, #E5B54F 50%, #C89116 100%);
  color: #06080E;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(229, 181, 79, 0.3);
  transition: all 0.2s ease;
}

.user-btn-create:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.user-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .user-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .user-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.user-metric-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.user-metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-metric-icon.icon-cyan {
  background: rgba(0, 213, 255, 0.12);
  color: #00D5FF;
  border: 1px solid rgba(0, 213, 255, 0.25);
}

.user-metric-icon.icon-gold {
  background: rgba(229, 181, 79, 0.12);
  color: #E5B54F;
  border: 1px solid rgba(229, 181, 79, 0.25);
}

.user-metric-icon.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.user-metric-icon.icon-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.user-metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-metric-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-top: 0.15rem;
}

/* Badges de Perfil de Acesso */
.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.role-admin-main {
  background: rgba(229, 181, 79, 0.15);
  color: #f0d98c;
  border: 1px solid rgba(229, 181, 79, 0.4);
}

.role-admin-sec {
  background: rgba(0, 114, 255, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(0, 114, 255, 0.35);
}

.role-operator {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Badges de Provedor WhatsApp */
.whatsapp-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

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

.provider-uazapi {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.provider-waha {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Lista Mobile de Usuários */
.users-mobile-list {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
}

@media (max-width: 768px) {
  .users-mobile-list {
    display: flex;
  }
}

.user-mobile-card {
  background: #0B1220;
  border: 1px solid rgba(229, 181, 79, 0.18);
  border-radius: 1.15rem;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.user-mobile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.user-mobile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 114, 255, 0.3), rgba(229, 181, 79, 0.3));
  border: 1px solid rgba(229, 181, 79, 0.4);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-mobile-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  font-size: 0.78rem;
}

.user-mobile-actions {
  display: flex;
  gap: 0.5rem;
}

